@Override public int getLength() { return (int) array.getLength(); }
/** @deprecated Use {@link #getLength()} instead. */ public long jsGet_length() { return getLength(); }
/** * Replacement of {@link NativeArray#toArray()}. */ private static Object[] toArray(final NativeArray narray) { final long longLen = narray.getLength(); if (longLen > Integer.MAX_VALUE) { throw new IllegalStateException(); } final int len = (int) longLen; final Object[] arr = new Object[len]; for (int i = 0; i < len; i++) { arr[i] = ScriptableObject.getProperty(narray, i); } return arr; }
/** * Replacement of {@link NativeArray#toArray()}. */ private static Object[] toArray(final NativeArray narray) { final long longLen = narray.getLength(); if (longLen > Integer.MAX_VALUE) { throw new IllegalStateException(); } final int len = (int) longLen; final Object[] arr = new Object[len]; for (int i = 0; i < len; i++) { arr[i] = ScriptableObject.getProperty(narray, i); } return arr; }
static long getLengthProperty(Context cx, Scriptable obj) { // These will both give numeric lengths within Uint32 range. if (obj instanceof NativeString) { return ((NativeString)obj).getLength(); } else if (obj instanceof NativeArray) { return ((NativeArray)obj).getLength(); } return ScriptRuntime.toUint32( ScriptRuntime.getObjectProp(obj, "length", cx)); }
Locale locale = new Locale("en", "US"); if (locales instanceof NativeArray) { if (((NativeArray) locales).getLength() != 0) { locale = new Locale(((NativeArray) locales).get(0).toString());
Locale locale = new Locale("en", "US"); if (locales instanceof NativeArray) { if (((NativeArray) locales).getLength() != 0) { locale = new Locale(((NativeArray) locales).get(0).toString());
final int length = (int) array.getLength(); returnPromise.all_ = new Promise[length]; for (int i = 0; i < length; i++) {
private static Promise all(final boolean race, final Scriptable thisObj, final Object[] args) { final Window window = getWindow(thisObj); final Promise returnPromise = new Promise(window); if (args.length == 0) { returnPromise.all_ = new Promise[0]; } else if (args[0] instanceof NativeArray) { final NativeArray array = (NativeArray) args[0]; final int length = (int) array.getLength(); returnPromise.all_ = new Promise[length]; for (int i = 0; i < length; i++) { final Object o = array.get(i); if (o instanceof Promise) { returnPromise.all_[i] = (Promise) o; if (returnPromise.all_[i].dependentPromises_ == null) { returnPromise.all_[i].dependentPromises_ = new ArrayList<Promise>(2); } returnPromise.all_[i].dependentPromises_.add(returnPromise); } else { returnPromise.all_[i] = create(thisObj, new Object[] {o}, PromiseState.FULFILLED); } } } // TODO handle the other cases returnPromise.race_ = race; returnPromise.settleAll(window); return returnPromise; }
h.put((int)h.getLength(), h, source);
for (int i = 0; i < array.getLength(); i++) { final Object value = ScriptableObject.getProperty(array, i); if (Undefined.instance != value
for (int i = 0; i < array.getLength(); i++) { final Object entryObject = array.get(i); if (entryObject instanceof NativeArray) {
for (int i = 0; i < array.getLength(); i++) { final Object entryObject = array.get(i); if (entryObject instanceof NativeArray) {
long length = array.getLength(); Class<?> arrayType = type.getComponentType(); Object Result = Array.newInstance(arrayType, (int)length);
if (args[0] instanceof NativeArray) { final NativeArray array = (NativeArray) args[0]; locales = new String[(int) array.getLength()]; for (int i = 0; i < locales.length; i++) { locales[i] = Context.toString(array.get(i));
if (args[0] instanceof NativeArray) { final NativeArray array = (NativeArray) args[0]; locales = new String[(int) array.getLength()]; for (int i = 0; i < locales.length; i++) { locales[i] = Context.toString(array.get(i));
for (int i = 0; i < array.getLength(); i++) { add(ScriptableObject.getProperty(array, i));