10 普通与特异(Exotic)对象的行为 (Ordinary and Exotic Objects Behaviours)
10.1 普通对象的内部方法与内部槽 (Ordinary Object Internal Methods and Internal Slots)
所有普通对象都有名为 [[Prototype]] 的内部槽。该内部槽的值要么是 null 要么是一个对象,用于实现继承。假设一个名为 P 的属性在普通对象O 上缺失,但存在于其 [[Prototype]] 对象上。如果 P 指向 [[Prototype]] 对象上的数据属性,则 O 在“取值”访问(get access)时继承它,使其表现得仿佛 P 是 O 的一个属性。如果 P 指向 [[Prototype]] 对象上的可写数据属性,在 O 上对 P 进行“设值”访问(set access)会在 O 上创建一个名为 P 的新数据属性。如果 P 指向 [[Prototype]] 对象上的不可写数据属性,在 O 上对 P 的设值访问会失败。如果 P 指向 [[Prototype]] 对象上的访问器属性(accessor property),则该访问器在 O 上同时被继承用于 get 与 set 访问。
每个普通对象内部方法委派给一个同名的抽象操作。如果该抽象操作依赖另一个内部方法,那么会在 O 上调用该内部方法,而不是直接调用同名的抽象操作。这些语义确保当普通对象的内部方法应用到特异(exotic)对象时,被重写的内部方法能够被调用。
10.1.1[[GetPrototypeOf]] ( )
The [[GetPrototypeOf]] internal method of 一个普通对象O takes no arguments and returns 一个正常完成,包含一个 Object 或 null. It performs the following steps when called:
The abstract operation OrdinaryGetPrototypeOf takes argument O (an Object) and returns an Object or null. It performs the following steps when called:
返回 O.[[Prototype]]。
10.1.2[[SetPrototypeOf]] ( V )
The [[SetPrototypeOf]] internal method of 一个普通对象O takes argument V (an Object or null) and returns 一个正常完成,包含一个 Boolean. It performs the following steps when called:
The abstract operation OrdinarySetPrototypeOf takes arguments O (an Object) and V (an Object or null) and returns a Boolean. It performs the following steps when called:
The abstract operation OrdinaryPreventExtensions takes argument O (an Object) and returns true. It performs the following steps when called:
将 O.[[Extensible]] 设为 false。
返回 true。
10.1.5[[GetOwnProperty]] ( P )
The [[GetOwnProperty]] internal method of 一个普通对象O takes argument P (a property key) and returns 一个正常完成,包含一个 Property Descriptor 或 undefined. It performs the following steps when called:
The abstract operation OrdinaryGetOwnProperty takes arguments O (an Object) and P (a property key) and returns a Property Descriptor or undefined. It performs the following steps when called:
The [[DefineOwnProperty]] internal method of 一个普通对象O takes arguments P (a property key) and Desc (a Property Descriptor) and returns 一个正常完成(包含 Boolean)或一个抛出完成. It performs the following steps when called:
The abstract operation OrdinaryDefineOwnProperty takes arguments O (an Object), P (a property key), and Desc (a Property Descriptor) and returns either a normal completion containing a Boolean or a throw completion. It performs the following steps when called:
10.1.6.2 IsCompatiblePropertyDescriptor ( Extensible, Desc, Current )
The abstract operation IsCompatiblePropertyDescriptor takes arguments Extensible (a Boolean), Desc (a Property Descriptor), and Current (a Property Descriptor or undefined) and returns a Boolean. It performs the following steps when called:
10.1.6.3 ValidateAndApplyPropertyDescriptor ( O, P, extensible, Desc, current )
The abstract operation ValidateAndApplyPropertyDescriptor takes arguments O (an Object or undefined), P (a property key), extensible (a Boolean), Desc (a Property Descriptor), and current (a Property Descriptor or undefined) and returns a Boolean. 当且仅当 Desc 可以在指定 extensibility 与当前属性 current 的条件下,作为某对象的属性(维护 不变式)被应用时,返回 true。当应用可行且 O 不为 undefined 时,会对名为 P 的属性执行(必要时创建)。 It performs the following steps when called:
用一个数据属性替换对象 O 上名为 P 的属性,其 [[Configurable]]、[[Enumerable]] 分别设为 configurable、enumerable,其 [[Value]]、[[Writable]] 特性若 Desc 含该字段则取其值,否则取该特性的 默认值。
否则,
对 Desc 的每个字段,将对象 O 上名为 P 的属性对应特性设为该字段的值。
返回 true。
10.1.7[[HasProperty]] ( P )
The [[HasProperty]] internal method of 一个普通对象O takes argument P (a property key) and returns 一个正常完成(包含 Boolean)或一个抛出完成. It performs the following steps when called:
The abstract operation OrdinaryHasProperty takes arguments O (an Object) and P (a property key) and returns either a normal completion containing a Boolean or a throw completion. It performs the following steps when called:
令 hasOwn 为 ? O.[[GetOwnProperty]](P)。
若 hasOwn 不为 undefined,返回 true。
令 parent 为 ? O.[[GetPrototypeOf]]()。
若 parent 不为 null,则
返回 ? parent.[[HasProperty]](P)。
返回 false。
10.1.8[[Get]] ( P, Receiver )
The [[Get]] internal method of 一个普通对象O takes arguments P (a property key) and Receiver (an ECMAScript language value) and returns 一个正常完成(包含 ECMAScript 语言值)或一个抛出完成. It performs the following steps when called:
The abstract operation OrdinaryGet takes arguments O (an Object), P (a property key), and Receiver (an ECMAScript language value) and returns either a normal completion containing an ECMAScript language value or a throw completion. It performs the following steps when called:
The [[Set]] internal method of 一个普通对象O takes arguments P (a property key), V (an ECMAScript language value), and Receiver (an ECMAScript language value) and returns 一个正常完成(包含 Boolean)或一个抛出完成. It performs the following steps when called:
The abstract operation OrdinarySet takes arguments O (an Object), P (a property key), V (an ECMAScript language value), and Receiver (an ECMAScript language value) and returns either a normal completion containing a Boolean or a throw completion. It performs the following steps when called:
10.1.9.2 OrdinarySetWithOwnDescriptor ( O, P, V, Receiver, ownDesc )
The abstract operation OrdinarySetWithOwnDescriptor takes arguments O (an Object), P (a property key), V (an ECMAScript language value), Receiver (an ECMAScript language value), and ownDesc (a Property Descriptor or undefined) and returns either a normal completion containing a Boolean or a throw completion. It performs the following steps when called:
The [[Delete]] internal method of 一个普通对象O takes argument P (a property key) and returns 一个正常完成(包含 Boolean)或一个抛出完成. It performs the following steps when called:
The abstract operation OrdinaryDelete takes arguments O (an Object) and P (a property key) and returns either a normal completion containing a Boolean or a throw completion. It performs the following steps when called:
令 desc 为 ? O.[[GetOwnProperty]](P)。
若 desc 为 undefined,返回 true。
若 desc.[[Configurable]] 为 true,则
从 O 中移除名为 P 的自身属性。
返回 true。
返回 false。
10.1.11[[OwnPropertyKeys]] ( )
The [[OwnPropertyKeys]] internal method of 一个普通对象O takes no arguments and returns 一个正常完成,包含一个属性键List. It performs the following steps when called:
The abstract operation OrdinaryOwnPropertyKeys takes argument O (an Object) and returns a List of property keys. It performs the following steps when called:
10.1.12 OrdinaryObjectCreate ( proto [ , additionalInternalSlotsList ] )
The abstract operation OrdinaryObjectCreate takes argument proto (an Object or null) and optional argument additionalInternalSlotsList (a List of names of internal slots) and returns an Object. 用于指定在运行时创建新的普通对象。additionalInternalSlotsList 包含必须定义为该对象一部分的额外内部槽名称(除 [[Prototype]] 与 [[Extensible]] 之外)。若未提供 additionalInternalSlotsList,则使用一个新的空 List。 It performs the following steps when called:
The abstract operation OrdinaryCreateFromConstructor takes arguments constructor (a function object) and intrinsicDefaultProto (a String) and optional argument internalSlotsList (a List of names of internal slots) and returns either a normal completion containing an Object or a throw completion. 它创建一个普通对象,其 [[Prototype]] 值取自构造函数的 "prototype" 属性(若存在)。否则使用由 intrinsicDefaultProto 命名的内在对象作为 [[Prototype]]。internalSlotsList 包含需要定义的额外内部槽名称。若未提供 internalSlotsList,则使用新的空 List。 It performs the following steps when called:
The abstract operation GetPrototypeFromConstructor takes arguments constructor (a function object) and intrinsicDefaultProto (a String) and returns either a normal completion containing an Object or a throw completion. 决定与特定构造函数对应之对象应使用的 [[Prototype]] 值。该值若构造函数具有 "prototype" 属性则从中取得,否则使用由 intrinsicDefaultProto 命名的内在对象作为 [[Prototype]]。 It performs the following steps when called:
The abstract operation RequireInternalSlot takes arguments O (an ECMAScript language value) and internalSlot (an internal slot name) and returns either a normal completion containing unused or a throw completion. 除非 O 是一个 Object 且拥有给定内部槽,否则抛出异常。 It performs the following steps when called:
定义在函数形式参数与函数体内 this 引用如何解释。lexical 表示 this 引用词法包围函数的 this 值。strict 表示使用调用该函数时提供的 this 值而不加修改。global 表示 undefined 或 null 的 this 值被解释为对全局对象的引用,其它 this 值会先传入 ToObject。
[[Strict]]
a Boolean
若该函数为严格函数则为 true,若为非严格函数则为 false。
[[HomeObject]]
an Object
若函数使用 super,此槽为其 super 属性查找起始的对象(通过该对象的 [[GetPrototypeOf]])。
The [[Call]] internal method of 一个 ECMAScript 函数对象F takes arguments thisArgument (an ECMAScript language value) and argumentsList (a List of ECMAScript language values) and returns 一个正常完成(包含 ECMAScript 语言值)或一个抛出完成. It performs the following steps when called:
The abstract operation PrepareForOrdinaryCall takes arguments F (an ECMAScript function object) and newTarget (an Object or undefined) and returns an execution context. It performs the following steps when called:
The abstract operation OrdinaryCallBindThis takes arguments F (an ECMAScript function object), calleeContext (an execution context), and thisArgument (an ECMAScript language value) and returns unused. It performs the following steps when called:
The syntax-directed operation 运行时语义:EvaluateBody takes arguments functionObject (an ECMAScript function object) and argumentsList (a List of ECMAScript language values) and returns a return completion or a throw completion. It is defined piecewise over the following productions:
The abstract operation OrdinaryCallEvaluateBody takes arguments F (an ECMAScript function object) and argumentsList (a List of ECMAScript language values) and returns a return completion or a throw completion. It performs the following steps when called:
Return ? EvaluateBody of F.[[ECMAScriptCode]] with arguments F and argumentsList.
10.2.2[[Construct]] ( argumentsList, newTarget )
The [[Construct]] internal method of 一个 ECMAScript 函数对象F takes arguments argumentsList (a List of ECMAScript language values) and newTarget (a constructor) and returns 一个正常完成(包含 Object)或一个抛出完成. It performs the following steps when called:
The abstract operation OrdinaryFunctionCreate takes arguments functionPrototype (an Object), sourceText (a sequence of Unicode code points), ParameterList (a Parse Node), Body (a Parse Node), thisMode (lexical-this or non-lexical-this), env (an Environment Record), and privateEnv (a PrivateEnvironment Record or null) and returns an ECMAScript function object. 用于在运行时创建一个具有默认 [[Call]] 内部方法且无 [[Construct]] 内部方法(但后续可通过诸如 MakeConstructor 的操作增加)的新函数。sourceText 是待创建函数语法定义的源文本。 It performs the following steps when called:
The abstract operation AddRestrictedFunctionProperties takes arguments F (a function object) and realm (a Realm Record) and returns unused. It performs the following steps when called:
The abstract operation MakeConstructor takes argument F (an ECMAScript function object or a built-in function object) and optional arguments writablePrototype (a Boolean) and prototype (an Object) and returns unused. 将 F 转换为构造器。 It performs the following steps when called:
The abstract operation MakeClassConstructor takes argument F (an ECMAScript function object) and returns unused. It performs the following steps when called:
断言:F.[[IsClassConstructor]] 为 false。
将 F.[[IsClassConstructor]] 设为 true。
返回 unused。
10.2.7 MakeMethod ( F, homeObject )
The abstract operation MakeMethod takes arguments F (an ECMAScript function object) and homeObject (an Object) and returns unused. 将 F 配置为一个方法。 It performs the following steps when called:
The abstract operation DefineMethodProperty takes arguments homeObject (an Object), key (a property key or Private Name), closure (a function object), and enumerable (a Boolean) and returns either a normal completion containing either a PrivateElement or unused, or an abrupt completion. It performs the following steps when called:
The abstract operation SetFunctionName takes arguments F (a function object) and name (a property key or Private Name) and optional argument prefix (a String) and returns unused. 为 F 添加一个 "name" 属性。 It performs the following steps when called:
The abstract operation SetFunctionLength takes arguments F (a function object) and length (a non-negative integer or +∞) and returns unused. 为 F 添加一个 "length" 属性。 It performs the following steps when called:
The abstract operation FunctionDeclarationInstantiation takes arguments func (an ECMAScript function object) and argumentsList (a List of ECMAScript language values) and returns either a normal completion containing unused or a throw completion. func 是为其建立执行上下文的函数对象。
Note
当为求值一个 ECMAScript 函数建立执行上下文时,会创建一个新的 Function Environment Record,并在其中实例化每个形式参数的绑定。函数体内的每个声明也会被实例化。若函数形式参数不包含任何默认值初始化器,则函数体声明与参数在同一个 Environment Record 中实例化。若存在默认值参数初始化器,则为函数体声明创建第二个 Environment Record。形式参数与函数在 FunctionDeclarationInstantiation 过程中被初始化。所有其它绑定在函数体求值期间初始化。
The [[Call]] internal method of 内置函数对象F takes arguments thisArgument (an ECMAScript language value) and argumentsList (a List of ECMAScript language values) and returns 返回一个包含 ECMAScript 语言值的正常完成或一个抛出完成. It performs the following steps when called:
The [[Construct]] internal method of 内置函数对象F(当该方法存在时) takes arguments argumentsList (a List of ECMAScript language values) and newTarget (a constructor) and returns 返回一个包含 Object 的正常完成或一个抛出完成. It performs the following steps when called:
The abstract operation BuiltinCallOrConstruct takes arguments F (a built-in function object), thisArgument (an ECMAScript language value or uninitialized), argumentsList (a List of ECMAScript language values), and newTarget (a constructor or undefined) and returns 返回一个包含 ECMAScript 语言值的正常完成或一个抛出完成. It performs the following steps when called:
令 result 为 对 F 的求值 且符合其规范描述的完成记录结果。若 thisArgument 为 uninitialized,则 this 值未初始化;否则由 thisArgument 提供 this 值。argumentsList 提供具名参数。newTarget 提供 NewTarget 值。
The abstract operation CreateBuiltinFunction takes arguments behaviour (an Abstract Closure, a set of algorithm steps, or some other definition of a function's behaviour provided in this specification), length (a non-negative integer or +∞), name (a property key or a Private Name), and additionalInternalSlotsList (a List of names of internal slots) and optional arguments realm (a Realm Record), prototype (an Object or null), and prefix (a String) and returns 一个内置函数对象. additionalInternalSlotsList 含必须作为该对象一部分定义的额外内部槽名称。此操作创建一个内置函数对象。 It performs the following steps when called:
The [[Call]] internal method of 绑定函数特异对象F takes arguments thisArgument (an ECMAScript language value) and argumentsList (a List of ECMAScript language values) and returns 返回一个包含 ECMAScript 语言值的正常完成或一个抛出完成. It performs the following steps when called:
The [[Construct]] internal method of 绑定函数特异对象F takes arguments argumentsList (a List of ECMAScript language values) and newTarget (a constructor) and returns 返回一个包含 Object 的正常完成或一个抛出完成. It performs the following steps when called:
The abstract operation BoundFunctionCreate takes arguments targetFunction (a function object), boundThis (an ECMAScript language value), and boundArgs (a List of ECMAScript language values) and returns 返回一个包含 function object 的正常完成或一个抛出完成. 用于指定创建新的绑定函数特异对象。 It performs the following steps when called:
The [[DefineOwnProperty]] internal method of 数组特异对象A takes arguments P (a property key) and Desc (a Property Descriptor) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The abstract operation ArrayCreate takes argument length (a non-negative integer) and optional argument proto (an Object) and returns 返回一个包含数组特异对象的正常完成或一个抛出完成. 用于指定创建新的 Array。 It performs the following steps when called:
The abstract operation ArraySpeciesCreate takes arguments originalArray (an Object) and length (a non-negative integer) and returns 返回一个包含 Object 的正常完成或一个抛出完成. 用于指定通过由 originalArray 派生的构造函数创建新的 Array 或相似对象;不强制该构造函数返回 Array。 It performs the following steps when called:
The abstract operation ArraySetLength takes arguments A (an Array) and Desc (a Property Descriptor) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[GetOwnProperty]] internal method of 字符串特异对象S takes argument P (a property key) and returns 返回一个包含 Property Descriptor 或 undefined 的正常完成. It performs the following steps when called:
The [[DefineOwnProperty]] internal method of 字符串特异对象S takes arguments P (a property key) and Desc (a Property Descriptor) and returns 返回一个包含 Boolean 的正常完成. It performs the following steps when called:
The abstract operation StringCreate takes arguments value (a String) and prototype (an Object) and returns 一个字符串特异对象. 用于指定创建新的字符串特异对象。 It performs the following steps when called:
令 S 为 MakeBasicObject(« [[Prototype]], [[Extensible]], [[StringData]] »)。
The abstract operation StringGetOwnProperty takes arguments S (an Object that has a [[StringData]] internal slot) and P (a property key) and returns 一个 Property Descriptor 或 undefined. It performs the following steps when called:
The [[GetOwnProperty]] internal method of arguments 特异对象args takes argument P (a property key) and returns 返回包含 Property Descriptor 或 undefined 的正常完成. It performs the following steps when called:
The [[DefineOwnProperty]] internal method of arguments 特异对象args takes arguments P (a property key) and Desc (a Property Descriptor) and returns 返回包含 Boolean 的正常完成. It performs the following steps when called:
The [[Get]] internal method of arguments 特异对象args takes arguments P (a property key) and Receiver (an ECMAScript language value) and returns 返回一个包含 ECMAScript 语言值的正常完成或一个抛出完成. It performs the following steps when called:
The [[Set]] internal method of arguments 特异对象args takes arguments P (a property key), V (an ECMAScript language value), and Receiver (an ECMAScript language value) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[Delete]] internal method of arguments 特异对象args takes argument P (a property key) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The abstract operation CreateUnmappedArgumentsObject takes argument argumentsList (a List of ECMAScript language values) and returns 一个普通对象. It performs the following steps when called:
The abstract operation CreateMappedArgumentsObject takes arguments func (an Object), formals (a Parse Node), argumentsList (a List of ECMAScript language values), and env (an Environment Record) and returns 一个 arguments 特异对象. It performs the following steps when called:
The abstract operation MakeArgGetter takes arguments name (a String) and env (an Environment Record) and returns 一个函数对象. 创建一个内置函数对象,执行时返回 env 中对 name 的绑定值。 It performs the following steps when called:
The abstract operation MakeArgSetter takes arguments name (a String) and env (an Environment Record) and returns 一个函数对象. 创建一个内置函数对象,执行时设置 env 中 name 的绑定值。 It performs the following steps when called:
令 setterClosure 为一个带参数 (value) 的新 Abstract Closure,捕获 name 与 env,调用时执行:
The [[PreventExtensions]] internal method of TypedArrayO takes no arguments and returns 返回一个包含 Boolean 的正常完成. It performs the following steps when called:
注:6.1.7.3 中的可扩展性不变式不允许在 O 仍可能获得(或失去后再获得)属性时返回 true;当底层缓冲区重分配且涉及整数索引属性时可能发生该情况。
The [[GetOwnProperty]] internal method of TypedArrayO takes argument P (a property key) and returns 返回包含 Property Descriptor 或 undefined 的正常完成. It performs the following steps when called:
The [[HasProperty]] internal method of TypedArrayO takes argument P (a property key) and returns 返回包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[DefineOwnProperty]] internal method of TypedArrayO takes arguments P (a property key) and Desc (a Property Descriptor) and returns 返回包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[Get]] internal method of TypedArrayO takes arguments P (a property key) and Receiver (an ECMAScript language value) and returns 返回包含 ECMAScript 语言值的正常完成或一个抛出完成. It performs the following steps when called:
The [[Set]] internal method of TypedArrayO takes arguments P (a property key), V (an ECMAScript language value), and Receiver (an ECMAScript language value) and returns 返回包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[Delete]] internal method of TypedArrayO takes argument P (a property key) and returns 返回包含 Boolean 的正常完成. It performs the following steps when called:
10.4.5.10 MakeTypedArrayWithBufferWitnessRecord ( obj, order )
The abstract operation MakeTypedArrayWithBufferWitnessRecord takes arguments obj (a TypedArray) and order (seq-cst or unordered) and returns 一个 TypedArray With Buffer Witness Record. It performs the following steps when called:
The abstract operation TypedArrayCreate takes argument prototype (an Object) and returns 一个 TypedArray. 用于指定创建新的 TypedArray。 It performs the following steps when called:
The abstract operation TypedArrayByteLength takes argument taRecord (a TypedArray With Buffer Witness Record) and returns 一个非负整数. It performs the following steps when called:
The abstract operation TypedArrayLength takes argument taRecord (a TypedArray With Buffer Witness Record) and returns 一个非负整数. It performs the following steps when called:
The abstract operation IsTypedArrayOutOfBounds takes argument taRecord (a TypedArray With Buffer Witness Record) and returns 一个 Boolean. 检查任一数值属性是否引用了底层缓冲区边界外的索引。 It performs the following steps when called:
The abstract operation IsValidIntegerIndex takes arguments O (a TypedArray) and index (a Number) and returns 一个 Boolean. It performs the following steps when called:
The abstract operation TypedArrayGetElement takes arguments O (a TypedArray) and index (a Number) and returns a Number, a BigInt, 或 undefined. It performs the following steps when called:
10.4.5.18 TypedArraySetElement ( O, index, value )
The abstract operation TypedArraySetElement takes arguments O (a TypedArray), index (a Number), and value (an ECMAScript language value) and returns 返回包含 unused 的正常完成或一个抛出完成. It performs the following steps when called:
The abstract operation IsArrayBufferViewOutOfBounds takes argument O (a TypedArray or a DataView) and returns 一个 Boolean. 检查 TypedArray 的数值属性或 DataView 方法是否可能引用底层数据块范围之外的值;为上游规范提供便利。 It performs the following steps when called:
The [[GetPrototypeOf]] internal method of 模块命名空间特异对象 takes no arguments and returns 返回一个包含 null 的正常完成. It performs the following steps when called:
返回 null。
10.4.6.2[[SetPrototypeOf]] ( V )
The [[SetPrototypeOf]] internal method of 模块命名空间特异对象O takes argument V (an Object or null) and returns 返回一个包含 Boolean 的正常完成. It performs the following steps when called:
The [[IsExtensible]] internal method of 模块命名空间特异对象 takes no arguments and returns 返回一个包含 false 的正常完成. It performs the following steps when called:
返回 false。
10.4.6.4[[PreventExtensions]] ( )
The [[PreventExtensions]] internal method of 模块命名空间特异对象 takes no arguments and returns 返回一个包含 true 的正常完成. It performs the following steps when called:
返回 true。
10.4.6.5[[GetOwnProperty]] ( P )
The [[GetOwnProperty]] internal method of 模块命名空间特异对象O takes argument P (a property key) and returns 返回一个包含 Property Descriptor 或 undefined 的正常完成,或一个抛出完成. It performs the following steps when called:
The [[DefineOwnProperty]] internal method of 模块命名空间特异对象O takes arguments P (a property key) and Desc (a Property Descriptor) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[HasProperty]] internal method of 模块命名空间特异对象O takes argument P (a property key) and returns 返回一个包含 Boolean 的正常完成. It performs the following steps when called:
The [[Get]] internal method of 模块命名空间特异对象O takes arguments P (a property key) and Receiver (an ECMAScript language value) and returns 返回一个包含 ECMAScript 语言值的正常完成或一个抛出完成. It performs the following steps when called:
The [[Set]] internal method of 模块命名空间特异对象 takes arguments P (a property key), V (an ECMAScript language value), and Receiver (an ECMAScript language value) and returns 返回一个包含 false 的正常完成. It performs the following steps when called:
返回 false。
10.4.6.10[[Delete]] ( P )
The [[Delete]] internal method of 模块命名空间特异对象O takes argument P (a property key) and returns 返回一个包含 Boolean 的正常完成. It performs the following steps when called:
The abstract operation ModuleNamespaceCreate takes arguments module (a Module Record) and exports (a List of Strings) and returns 一个模块命名空间特异对象. 用于指定创建新的模块命名空间特异对象。 It performs the following steps when called:
The [[SetPrototypeOf]] internal method of 不可变原型特异对象O takes argument V (an Object or null) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The abstract operation SetImmutablePrototype takes arguments O (an Object) and V (an Object or null) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[GetPrototypeOf]] internal method of Proxy 特异对象O takes no arguments and returns 返回一个包含 Object 或 null 的正常完成,或一个抛出完成. It performs the following steps when called:
The [[SetPrototypeOf]] internal method of Proxy 特异对象O takes argument V (an Object or null) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[IsExtensible]] internal method of Proxy 特异对象O takes no arguments and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[PreventExtensions]] internal method of Proxy 特异对象O takes no arguments and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[GetOwnProperty]] internal method of Proxy 特异对象O takes argument P (a property key) and returns 返回一个包含 Property Descriptor 或 undefined 的正常完成,或一个抛出完成. It performs the following steps when called:
The [[DefineOwnProperty]] internal method of Proxy 特异对象O takes arguments P (a property key) and Desc (a Property Descriptor) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[HasProperty]] internal method of Proxy 特异对象O takes argument P (a property key) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[Get]] internal method of Proxy 特异对象O takes arguments P (a property key) and Receiver (an ECMAScript language value) and returns 返回一个包含 ECMAScript 语言值的正常完成或一个抛出完成. It performs the following steps when called:
The [[Set]] internal method of Proxy 特异对象O takes arguments P (a property key), V (an ECMAScript language value), and Receiver (an ECMAScript language value) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[Delete]] internal method of Proxy 特异对象O takes argument P (a property key) and returns 返回一个包含 Boolean 的正常完成或一个抛出完成. It performs the following steps when called:
The [[OwnPropertyKeys]] internal method of Proxy 特异对象O takes no arguments and returns 返回一个包含属性键列表的正常完成或一个抛出完成. It performs the following steps when called:
The [[Call]] internal method of Proxy 特异对象O takes arguments thisArgument (an ECMAScript language value) and argumentsList (a List of ECMAScript language values) and returns 返回一个包含 ECMAScript 语言值的正常完成或一个抛出完成. It performs the following steps when called:
The [[Construct]] internal method of Proxy 特异对象O takes arguments argumentsList (a List of ECMAScript language values) and newTarget (a constructor) and returns 返回一个包含 Object 的正常完成或一个抛出完成. It performs the following steps when called:
The abstract operation ValidateNonRevokedProxy takes argument proxy (a Proxy exotic object) and returns 返回一个包含 unused 的正常完成或一个抛出完成. 若 proxy 已被撤销则抛出 TypeError 异常。 It performs the following steps when called:
若 proxy.[[ProxyTarget]] 为 null,抛出 TypeError 异常。
断言:proxy.[[ProxyHandler]] 不为 null。
返回 unused。
10.5.15 ProxyCreate ( target, handler )
The abstract operation ProxyCreate takes arguments target (an ECMAScript language value) and handler (an ECMAScript language value) and returns 返回一个包含 Proxy 特异对象的正常完成或一个抛出完成. 用于指定创建新的 Proxy 对象。 It performs the following steps when called: