((ScriptableObject) ScriptableObject.getProperty(window, "Object")).delete("getOwnPropertySymbols");
/** * Removes prototype properties. * @param window the scope * @param className the class for which properties should be removed * @param properties the properties to remove */ private void removePrototypeProperties(final Window window, final String className, final String[] properties) { final ScriptableObject prototype = (ScriptableObject) ScriptableObject.getClassPrototype(window, className); for (final String property : properties) { prototype.delete(property); } }
((ScriptableObject) ScriptableObject.getProperty(window, "Object")).delete("getOwnPropertySymbols");
/** * Removes prototype properties. * @param window the scope * @param className the class for which properties should be removed * @param properties the properties to remove */ private void removePrototypeProperties(final Window window, final String className, final String[] properties) { final ScriptableObject prototype = (ScriptableObject) ScriptableObject.getClassPrototype(window, className); for (final String property : properties) { prototype.delete(property); } }
/** * Removes prototype properties. * @param window the scope * @param className the class for which properties should be removed * @param properties the properties to remove */ private void removePrototypeProperties(final Window window, final String className, final String[] properties) { final ScriptableObject prototype = (ScriptableObject) ScriptableObject.getClassPrototype(window, className); for (final String property : properties) { prototype.delete(property); } }
/** * Removes prototype properties. * @param scope the scope * @param className the class for which properties should be removed * @param properties the properties to remove */ private static void removePrototypeProperties(final Scriptable scope, final String className, final String... properties) { final ScriptableObject prototype = (ScriptableObject) ScriptableObject.getClassPrototype(scope, className); for (final String property : properties) { prototype.delete(property); } }
/** * Removes prototype properties. * @param scope the scope * @param className the class for which properties should be removed * @param properties the properties to remove */ private static void removePrototypeProperties(final Scriptable scope, final String className, final String... properties) { final ScriptableObject prototype = (ScriptableObject) ScriptableObject.getClassPrototype(scope, className); for (final String property : properties) { prototype.delete(property); } }
@Override ScriptableObject getPropertyDescriptor(Context cx, Scriptable parent) { ScriptableObject desc = super.getPropertyDescriptor(cx, parent); desc.delete("value"); desc.delete("writable"); if (getter != null) desc.defineProperty("get", getter, EMPTY); if (setter != null) desc.defineProperty("set", setter, EMPTY); return desc; } }
@Override public void delete(String name) { int info = findInstanceIdInfo(name); if (info != 0) { // Let the super class to throw exceptions for sealed objects if (!isSealed()) { int attr = (info >>> 16); if ((attr & PERMANENT) == 0) { int id = (info & 0xFFFF); setInstanceIdValue(id, NOT_FOUND); } return; } } if (prototypeValues != null) { int id = prototypeValues.findId(name); if (id != 0) { if (!isSealed()) { prototypeValues.delete(id); } return; } } super.delete(name); }