Package org.htmlunit.corejs.javascript
Class NativeProxy
java.lang.Object
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.NativeProxy
- All Implemented Interfaces:
Serializable,Callable,ConstProperties,Constructable,DebuggableObject,Scriptable,SymbolScriptable
This class implements the Proxy object.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.KeyComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Scriptableprivate static final Stringprivate static final longprivate ScriptableObjectprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate final StringFields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncall(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslistprivate Objectconstruct(Context cx, Scriptable scope, Object[] args) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtargetprivate static NativeProxyconstructor(Context cx, Scriptable scope, Object[] args) booleandefineOwnProperty(Context cx, Object id, ScriptableObject desc) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-descvoiddelete(int index) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-pvoidsee https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-pvoidsee https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-pget(int index, Scriptable start) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiverget(String name, Scriptable start) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiverget(Symbol key, Scriptable start) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiverReturn the name of the class.(package private) Object[]getIds(boolean getNonEnumerable, boolean getSymbols) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeysprotected ScriptableObjectgetOwnPropertyDescriptor(Context cx, Object id) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-psee https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof(package private) ScriptableObjectprivate CallableGets the value that will be returned by calling the typeof operator on this object.booleanhas(int index, Scriptable start) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-pbooleanhas(String name, Scriptable start) https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-pbooleanhas(Symbol key, Scriptable start) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-pstatic voidinit(Context cx, Scriptable scope, boolean sealed) booleansee https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-isextensiblebooleansee https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-preventextensionsvoidput(int index, Scriptable start, Object value) https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receivervoidput(String name, Scriptable start, Object value) https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receivervoidput(Symbol key, Scriptable start, Object value) https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiverprivate static Objectrevocable(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) voidsetPrototype(Scriptable prototype) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-setprototypeof-vprivate voidsetPrototypeDirect(Scriptable prototype) Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
addLazilyInitializedValue, applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildClassCtor, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, checkValidAttributes, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getBase, getBase, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, putConst, putConstProperty, putImpl, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, size
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
PROXY_TAG
- See Also:
-
TRAP_GET_PROTOTYPE_OF
- See Also:
-
TRAP_SET_PROTOTYPE_OF
- See Also:
-
TRAP_IS_EXTENSIBLE
- See Also:
-
TRAP_PREVENT_EXTENSIONS
- See Also:
-
TRAP_GET_OWN_PROPERTY_DESCRIPTOR
- See Also:
-
TRAP_DEFINE_PROPERTY
- See Also:
-
TRAP_HAS
- See Also:
-
TRAP_GET
- See Also:
-
TRAP_SET
- See Also:
-
TRAP_DELETE_PROPERTY
- See Also:
-
TRAP_OWN_KEYS
- See Also:
-
TRAP_APPLY
- See Also:
-
TRAP_CONSTRUCT
- See Also:
-
targetObj
-
handlerObj
-
typeOf
-
-
Constructor Details
-
NativeProxy
-
-
Method Details
-
init
-
getClassName
Description copied from class:ScriptableObjectReturn the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassNamein interfaceScriptable- Specified by:
getClassNamein classScriptableObject
-
construct
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget- Specified by:
constructin interfaceConstructable- Parameters:
cx- the current Context for this threadscope- an enclosing scope of the caller except when the function is called from a closure.args- the array of arguments- Returns:
- the allocated object
-
has
https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-p- Specified by:
hasin interfaceScriptable- Overrides:
hasin classScriptableObject- Parameters:
name- the name of the propertystart- the object in which the lookup began- Returns:
- true if and only if the property was found in the object
- See Also:
-
has
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-p- Specified by:
hasin interfaceScriptable- Overrides:
hasin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object in which the lookup began- Returns:
- true if and only if the property was found in the object
- See Also:
-
has
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-p- Specified by:
hasin interfaceSymbolScriptable- Overrides:
hasin classScriptableObject
-
getIds
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys- Overrides:
getIdsin classScriptableObject
-
get
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver- Specified by:
getin interfaceScriptable- Overrides:
getin classScriptableObject- Parameters:
name- the name of the propertystart- the object in which the lookup began- Returns:
- the value of the property (may be null), or NOT_FOUND
- See Also:
-
get
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver- Specified by:
getin interfaceScriptable- Overrides:
getin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object in which the lookup began- Returns:
- the value of the property (may be null), or NOT_FOUND
- See Also:
-
get
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver- Specified by:
getin interfaceSymbolScriptable- Overrides:
getin classScriptableObject
-
put
https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver- Specified by:
putin interfaceScriptable- Overrides:
putin classScriptableObject- Parameters:
name- the name of the propertystart- the object whose property is being setvalue- value to set the property to- See Also:
-
put
https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver- Specified by:
putin interfaceScriptable- Overrides:
putin classScriptableObject- Parameters:
index- the numeric index for the propertystart- the object whose property is being setvalue- value to set the property to- See Also:
-
put
https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver- Specified by:
putin interfaceSymbolScriptable- Overrides:
putin classScriptableObject
-
delete
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-p- Specified by:
deletein interfaceScriptable- Overrides:
deletein classScriptableObject- Parameters:
name- the name of the property- See Also:
-
delete
public void delete(int index) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-p- Specified by:
deletein interfaceScriptable- Overrides:
deletein classScriptableObject- Parameters:
index- the numeric index for the property- See Also:
-
delete
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-p- Specified by:
deletein interfaceSymbolScriptable- Overrides:
deletein classScriptableObject
-
getOwnPropertyDescriptor
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p- Overrides:
getOwnPropertyDescriptorin classScriptableObject
-
defineOwnProperty
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc- Overrides:
defineOwnPropertyin classScriptableObject- Parameters:
cx- the current Contextid- the name/index of the propertydesc- the new property descriptor, as described in 8.6.1
-
isExtensible
public boolean isExtensible()see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-isextensible- Overrides:
isExtensiblein classScriptableObject
-
preventExtensions
public boolean preventExtensions()see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-preventextensions- Overrides:
preventExtensionsin classScriptableObject
-
getTypeOf
Description copied from class:ScriptableObjectGets the value that will be returned by calling the typeof operator on this object.- Overrides:
getTypeOfin classScriptableObject- Returns:
- default is "object" unless
ScriptableObject.avoidObjectDetection()istruein which case it returns "undefined"
-
getPrototype
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-getprototypeof- Specified by:
getPrototypein interfaceScriptable- Overrides:
getPrototypein classScriptableObject- Returns:
- the prototype
-
setPrototypeDirect
-
setPrototype
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-setprototypeof-v- Specified by:
setPrototypein interfaceScriptable- Overrides:
setPrototypein classScriptableObject- Parameters:
prototype- the prototype to set
-
call
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist -
constructor
-
revocable
-
getTrap
-
callTrap
-
getTargetThrowIfRevoked
ScriptableObject getTargetThrowIfRevoked()
-