private static void appendNativeObject(final NativeObject obj, final StringBuilder sb, final int level) { if (level == 0) { // For whatever reason, when a native object is printed at the // root level Firefox puts brackets outside it. This is not the // case when a native object is printed as part of an array or // inside another object. sb.append("("); } sb.append("{"); if (level < 3) { final Object[] ids = obj.getIds(); if (ids != null && ids.length > 0) { boolean needsSeparator = false; for (Object key : ids) { if (needsSeparator) { sb.append(", "); } sb.append(key); sb.append(":"); appendValue(obj.get(key), sb, level + 1); needsSeparator = true; } } } sb.append("}"); if (level == 0) { sb.append(")"); } }
attaributes_ = Boolean.TRUE.equals(options.get("attributes")); attributeOldValue_ = Boolean.TRUE.equals(options.get("attributeOldValue")); childList_ = Boolean.TRUE.equals(options.get("childList")); characterData_ = Boolean.TRUE.equals(options.get("characterData")); characterDataOldValue_ = Boolean.TRUE.equals(options.get("characterDataOldValue")); subtree_ = Boolean.TRUE.equals(options.get("subtree")); attributeFilter_ = (NativeArray) options.get("attributeFilter");
private static void appendNativeObject(final NativeObject obj, final StringBuilder sb, final int level) { if (level == 0) { // For whatever reason, when a native object is printed at the // root level Firefox puts brackets outside it. This is not the // case when a native object is printed as part of an array or // inside another object. sb.append('('); } sb.append('{'); if (level < 3) { final Object[] ids = obj.getIds(); if (ids != null && ids.length > 0) { boolean needsSeparator = false; for (Object key : ids) { if (needsSeparator) { sb.append(", "); } sb.append(key); sb.append(':'); appendValue(obj.get(key), sb, level + 1); needsSeparator = true; } } } sb.append('}'); if (level == 0) { sb.append(')'); } }
attaributes_ = Boolean.TRUE.equals(options.get("attributes")); attributeOldValue_ = Boolean.TRUE.equals(options.get("attributeOldValue")); characterData_ = Boolean.TRUE.equals(options.get("characterData")); characterDataOldValue_ = Boolean.TRUE.equals(options.get("characterDataOldValue")); subtree_ = Boolean.TRUE.equals(options.get("subtree")); attributeFilter_ = (NativeArray) options.get("attributeFilter"); final boolean childList = Boolean.TRUE.equals(options.get("childList"));
final Object obj = ((NativeObject) types).get("type", (NativeObject) types); if ("character".equals(obj)) { breakIterator_ = BreakIterator.getCharacterInstance(locale);
final Object obj = ((NativeObject) types).get("type", (NativeObject) types); if ("character".equals(obj)) { breakIterator_ = BreakIterator.getCharacterInstance(locale);
private static Promise create(final Scriptable thisObj, final Object[] args, final PromiseState state) { // fulfilled promises are returned if (args.length != 0 && args[0] instanceof Promise && state == PromiseState.FULFILLED) { return (Promise) args[0]; } final Promise promise; if (args.length > 0) { final Object arg = args[0]; if (arg instanceof NativeObject) { final NativeObject nativeObject = (NativeObject) arg; promise = new Promise(nativeObject.get("then", nativeObject)); } else { promise = new Promise(); promise.value_ = arg; promise.state_ = state; } } else { promise = new Promise(); promise.value_ = Undefined.instance; promise.state_ = state; } promise.setParentScope(thisObj.getParentScope()); promise.setPrototype(getWindow(thisObj).getPrototype(promise.getClass())); return promise; }
if (arg instanceof NativeObject) { final NativeObject nativeObject = (NativeObject) arg; final Object thenFunction = nativeObject.get("then", nativeObject); if (thenFunction != NOT_FOUND) { promise = new Promise(thenFunction);