/** * Deletes the properties with the provided names. * @param scope the scope from which properties have to be removed * @param propertiesToDelete the list of property names */ private static void deleteProperties(final Scriptable scope, final String... propertiesToDelete) { for (final String property : propertiesToDelete) { scope.delete(property); } }
/** * @see net.sourceforge.htmlunit.corejs.javascript.Scriptable#delete(String) */ public void delete(String name) { obj.delete(name); } /**
/** * @see net.sourceforge.htmlunit.corejs.javascript.Scriptable#delete(int) */ public void delete(int index) { obj.delete(index); } /**
/** * Deletes the properties with the provided names. * @param scope the scope from which properties have to be removed * @param propertiesToDelete the list of property names */ private static void deleteProperties(final Scriptable scope, final String... propertiesToDelete) { for (final String property : propertiesToDelete) { scope.delete(property); } }
public void delete(String id) { prototype.delete(id); }
public void delete(int index) { prototype.delete(index); }
/** * Removes the property from an object or its prototype chain. * <p> * Searches for a property with <code>name</code> in obj or * its prototype chain. If it is found, the object's delete * method is called. * @param obj a JavaScript object * @param name a property name * @return true if the property doesn't exist or was successfully removed * @since 1.5R2 */ public static boolean deleteProperty(Scriptable obj, String name) { Scriptable base = getBase(obj, name); if (base == null) return true; base.delete(name); return !base.has(name, obj); }
/** * Removes the property from an object or its prototype chain. * <p> * Searches for a property with <code>index</code> in obj or * its prototype chain. If it is found, the object's delete * method is called. * @param obj a JavaScript object * @param index a property index * @return true if the property doesn't exist or was successfully removed * @since 1.5R2 */ public static boolean deleteProperty(Scriptable obj, int index) { Scriptable base = getBase(obj, index); if (base == null) return true; base.delete(index); return !base.has(index, obj); }