- https://github.com/mozilla/gecko-dev/blob/8bcc214714bd4e1ceea7c2d921abdad0eefe7df9/js/src/builtin/Object.cpp#L418
- https://github.com/mozilla/gecko-dev/blob/8bcc214714bd4e1ceea7c2d921abdad0eefe7df9/js/src/builtin/Object.cpp#L424
- https://github.com/mozilla/gecko-dev/blob/8bcc214714bd4e1ceea7c2d921abdad0eefe7df9/js/src/builtin/Object.cpp#L430
- https://github.com/mozilla/gecko-dev/blob/8bcc214714bd4e1ceea7c2d921abdad0eefe7df9/js/src/builtin/Object.cpp#L466
- Let thisArgument be the this value.
- If thisArgument is null or undefined, then
- Let realm be the Realm of the running execution context.
- Set O to realm.[[globalThis]].
- Else let O be ToObject(thisArgument).
- If IsCallable(Getter) is false, then throw a TypeError exception.
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Let Attributes be the result of calling ObjectCreate(%ObjectPrototype%).
- Call CreateDataProperty(Attributes, "enumerable", true).
- Call CreateDataProperty(Attributes, "configurable", true).
- Call CreateDataProperty(Attributes, "get", Getter).
- Let desc be the result of calling ToPropertyDescriptor(Attributes).
- ReturnIfAbrupt(desc).
- Let success be the result of DefinePropertyOrThrow(O, key, desc).
- ReturnIfAbrupt(success).
- Return undefined.
- Let thisArgument be the this value.
- If thisArgument is null or undefined, then
- Let realm be the Realm of the running execution context.
- Set O to realm.[[globalThis]].
- Else let O be ToObject(thisArgument).
- If IsCallable(Setter) is false, then throw a TypeError exception.
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Let Attributes be the result of calling ObjectCreate(%ObjectPrototype%).
- Call CreateDataProperty(Attributes, "enumerable", true).
- Call CreateDataProperty(Attributes, "configurable", true).
- Call CreateDataProperty(Attributes, "set", Setter).
- Let desc be the result of calling ToPropertyDescriptor(Attributes).
- ReturnIfAbrupt(desc).
- Let success be the result of DefinePropertyOrThrow(O, key, desc).
- ReturnIfAbrupt(success).
- Return undefined.
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Let O be ToObject(this value).
- ReturnIfAbrupt(O).
- Repeat
- Let desc be the result of calling the [[GetOwnProperty]] internal method of O passing key as the argument.
- ReturnIfAbrupt(desc).
- If desc is not undefined, then
- If IsAccessorDescriptor(desc) is true, then return desc.[[Get]].
- Return undefined.
- Let O be the result of calling the [[GetPrototypeOf]] internal method of O with no arguments.
- ReturnIfAbrupt(O).
- If O is null, return undefined.
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Let O be ToObject(this value).
- ReturnIfAbrupt(O).
- Repeat
- Let desc be the result of calling the [[GetOwnProperty]] internal method of O passing key as the argument.
- ReturnIfAbrupt(desc).
- If desc is not undefined, then
- If IsAccessorDescriptor(desc) is true, then return desc.[[Set]].
- Return undefined.
- Let O be the result of calling the [[GetPrototypeOf]] internal method of O with no arguments.
- ReturnIfAbrupt(O).
- If O is null, return undefined.
- https://github.com/WebKit/webkit/blob/cc40e8cb9c9fd8eedf8432a76260e13f0a32bd0e/Source/JavaScriptCore/runtime/ObjectPrototype.cpp#L111
- https://github.com/WebKit/webkit/blob/cc40e8cb9c9fd8eedf8432a76260e13f0a32bd0e/Source/JavaScriptCore/runtime/ObjectPrototype.cpp#L131
- https://github.com/WebKit/webkit/blob/cc40e8cb9c9fd8eedf8432a76260e13f0a32bd0e/Source/JavaScriptCore/runtime/ObjectPrototype.cpp#L151
- https://github.com/WebKit/webkit/blob/cc40e8cb9c9fd8eedf8432a76260e13f0a32bd0e/Source/JavaScriptCore/runtime/ObjectPrototype.cpp#L165
- Let O be ToObject(this value).
- ReturnIfAbrupt(O).
- If IsCallable(Getter) is false, then throw a TypeError exception.
- Let desc be the PropertyDescriptor{[[Get]]: Getter, [[Enumerable]]: true, [[Configurable]]: true}.
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Let success be the result of calling the [[DefineOwnProperty]] internal method of O passing key and desc as arguments.
- ReturnIfAbrupt(success).
- Return undefined.
- Let O be ToObject(this value).
- ReturnIfAbrupt(O).
- If IsCallable(Setter) is false, then throw a TypeError exception.
- Let desc be the PropertyDescriptor{[[Set]]: Setter, [[Enumerable]]: true, [[Configurable]]: true}.
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Let success be the result of calling the [[DefineOwnProperty]] internal method of O passing key and desc as arguments.
- ReturnIfAbrupt(success).
- Return undefined.
- Let O be ToObject(this value).
- ReturnIfAbrupt(O).
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Repeat
- Let desc be the result of calling the [[GetOwnProperty]] internal method of O passing key as the argument.
- ReturnIfAbrupt(desc).
- If desc is not undefined, then
- If IsAccessorDescriptor(desc) is true, then return desc.[[Get]].
- Return undefined.
- Let O be the result of calling the [[GetPrototypeOf]] internal method of O with no arguments.
- ReturnIfAbrupt(O).
- If O is null, return undefined.
- Let O be ToObject(this value).
- ReturnIfAbrupt(O).
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Repeat
- Let desc be the result of calling the [[GetOwnProperty]] internal method of O passing key as the argument.
- ReturnIfAbrupt(desc).
- If desc is not undefined, then
- If IsAccessorDescriptor(desc) is true, then return desc.[[Set]].
- Return undefined.
- Let O be the result of calling the [[GetPrototypeOf]] internal method of O with no arguments.
- ReturnIfAbrupt(O).
- If O is null, return undefined.
- https://github.com/v8/v8/blob/9a0307b0d47cdd3273d3539d6e3e2da1e48d7250/src/v8natives.js#L297
- https://github.com/v8/v8/blob/9a0307b0d47cdd3273d3539d6e3e2da1e48d7250/src/v8natives.js#L323
- https://github.com/v8/v8/blob/9a0307b0d47cdd3273d3539d6e3e2da1e48d7250/src/v8natives.js#L314
- https://github.com/v8/v8/blob/9a0307b0d47cdd3273d3539d6e3e2da1e48d7250/src/v8natives.js#L340
- Let thisArgument be the this value.
- If thisArgument is null or undefined, then
- Let realm be the Realm of the running execution context.
- Set O to realm.[[globalThis]].
- Else let O be ToObject(thisArgument).
- If IsCallable(Getter) is false, then throw a TypeError exception.
- Let desc be the PropertyDescriptor{[[Get]]: Getter, [[Enumerable]]: true, [[Configurable]]: true}.
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Let success be the result of calling the [[DefineOwnProperty]] internal method of O passing key and desc as arguments.
- ReturnIfAbrupt(success).
- Return undefined.
- Let thisArgument be the this value.
- If thisArgument is null or undefined, then
- Let realm be the Realm of the running execution context.
- Set O to realm.[[globalThis]].
- Else let O be ToObject(thisArgument).
- If IsCallable(Setter) is false, then throw a TypeError exception.
- Let desc be the PropertyDescriptor{[[Set]]: Setter, [[Enumerable]]: true, [[Configurable]]: true}.
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Let success be the result of calling the [[DefineOwnProperty]] internal method of O passing key and desc as arguments.
- ReturnIfAbrupt(success).
- Return undefined.
- Let thisArgument be the this value.
- If thisArgument is null or undefined, then
- Let realm be the Realm of the running execution context.
- Set O to realm.[[globalThis]].
- Else let O be ToObject(thisArgument).
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Repeat
- Let desc be the result of calling the [[GetOwnProperty]] internal method of O passing key as the argument.
- ReturnIfAbrupt(desc).
- If desc is not undefined, then
- If IsAccessorDescriptor(desc) is true, then return desc.[[Get]].
- Let O be the result of calling the [[GetPrototypeOf]] internal method of O with no arguments.
- ReturnIfAbrupt(O).
- If O is null, return undefined.
- Let thisArgument be the this value.
- If thisArgument is null or undefined, then
- Let realm be the Realm of the running execution context.
- Set O to realm.[[globalThis]].
- Else let O be ToObject(thisArgument).
- Let key be ToPropertyKey(P).
- ReturnIfAbrupt(key).
- Repeat
- Let desc be the result of calling the [[GetOwnProperty]] internal method of O passing key as the argument.
- ReturnIfAbrupt(desc).
- If desc is not undefined, then 4. If IsAccessorDescriptor(desc) is true, then return desc.[[Set]].
- Let O be the result of calling the [[GetPrototypeOf]] internal method of O with no arguments.
- ReturnIfAbrupt(O).
- If O is null, return undefined.