src/jdk/nashorn/internal/objects/NativeString.java
Print this page
*** 37,46 ****
--- 37,47 ----
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
+ import java.util.Set;
import jdk.internal.dynalink.CallSiteDescriptor;
import jdk.internal.dynalink.linker.GuardedInvocation;
import jdk.internal.dynalink.linker.LinkRequest;
import jdk.nashorn.internal.lookup.MethodHandleFactory.LookupException;
import jdk.nashorn.internal.objects.annotations.Attribute;
*** 389,411 ****
}
/**
* return a List of own keys associated with the object.
* @param all True if to include non-enumerable keys.
* @return Array of keys.
*/
@Override
! public String[] getOwnKeys(final boolean all) {
final List<Object> keys = new ArrayList<>();
// add string index keys
for (int i = 0; i < value.length(); i++) {
keys.add(JSType.toString(i));
}
// add super class properties
! keys.addAll(Arrays.asList(super.getOwnKeys(all)));
return keys.toArray(new String[keys.size()]);
}
/**
* ECMA 15.5.3 String.length
--- 390,414 ----
}
/**
* return a List of own keys associated with the object.
* @param all True if to include non-enumerable keys.
+ * @param nonEnumerable set of non-enumerable properties seen already.Used
+ * to filter out shadowed, but enumerable properties from proto children.
* @return Array of keys.
*/
@Override
! protected String[] getOwnKeys(final boolean all, final Set<String> nonEnumerable) {
final List<Object> keys = new ArrayList<>();
// add string index keys
for (int i = 0; i < value.length(); i++) {
keys.add(JSType.toString(i));
}
// add super class properties
! keys.addAll(Arrays.asList(super.getOwnKeys(all, nonEnumerable)));
return keys.toArray(new String[keys.size()]);
}
/**
* ECMA 15.5.3 String.length