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 Scriptable
private static final String
private static final long
private ScriptableObject
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
private final String
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
Fields 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 Object
construct
(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 NativeProxy
constructor
(Context cx, Scriptable scope, Object[] args) boolean
defineOwnProperty
(Context cx, Object id, ScriptableObject desc) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-descvoid
delete
(int index) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-pvoid
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-pvoid
see 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 ScriptableObject
getOwnPropertyDescriptor
(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) ScriptableObject
private Callable
Gets the value that will be returned by calling the typeof operator on this object.boolean
has
(int index, Scriptable start) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-pboolean
has
(String name, Scriptable start) https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-pboolean
has
(Symbol key, Scriptable start) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-pstatic void
init
(Context cx, Scriptable scope, boolean sealed) boolean
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-isextensibleboolean
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-preventextensionsvoid
put
(int index, Scriptable start, Object value) https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receivervoid
put
(String name, Scriptable start, Object value) https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receivervoid
put
(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 Object
revocable
(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) void
setPrototype
(Scriptable prototype) see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-setprototypeof-vprivate void
setPrototypeDirect
(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:ScriptableObject
Return the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassName
in interfaceScriptable
- Specified by:
getClassName
in classScriptableObject
-
construct
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-construct-argumentslist-newtarget- Specified by:
construct
in 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:
has
in interfaceScriptable
- Overrides:
has
in 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:
has
in interfaceScriptable
- Overrides:
has
in 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:
has
in interfaceSymbolScriptable
- Overrides:
has
in classScriptableObject
-
getIds
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys- Overrides:
getIds
in classScriptableObject
-
get
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver- Specified by:
get
in interfaceScriptable
- Overrides:
get
in 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:
get
in interfaceScriptable
- Overrides:
get
in 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:
get
in interfaceSymbolScriptable
- Overrides:
get
in classScriptableObject
-
put
https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-set-p-v-receiver- Specified by:
put
in interfaceScriptable
- Overrides:
put
in 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:
put
in interfaceScriptable
- Overrides:
put
in 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:
put
in interfaceSymbolScriptable
- Overrides:
put
in classScriptableObject
-
delete
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-delete-p- Specified by:
delete
in interfaceScriptable
- Overrides:
delete
in 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:
delete
in interfaceScriptable
- Overrides:
delete
in 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:
delete
in interfaceSymbolScriptable
- Overrides:
delete
in classScriptableObject
-
getOwnPropertyDescriptor
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-getownproperty-p- Overrides:
getOwnPropertyDescriptor
in classScriptableObject
-
defineOwnProperty
see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-defineownproperty-p-desc- Overrides:
defineOwnProperty
in 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:
isExtensible
in classScriptableObject
-
preventExtensions
public boolean preventExtensions()see https://262.ecma-international.org/12.0/#sec-proxy-object-internal-methods-and-internal-slots-preventextensions- Overrides:
preventExtensions
in classScriptableObject
-
getTypeOf
Description copied from class:ScriptableObject
Gets the value that will be returned by calling the typeof operator on this object.- Overrides:
getTypeOf
in classScriptableObject
- Returns:
- default is "object" unless
ScriptableObject.avoidObjectDetection()
istrue
in 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:
getPrototype
in interfaceScriptable
- Overrides:
getPrototype
in 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:
setPrototype
in interfaceScriptable
- Overrides:
setPrototype
in 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()
-