Ranando King (2018-01-15T15:41:50.000Z)
kingmph at gmail.com (2018-01-16T15:50:19.639Z)
---------- Forwarded message ---------- From: Ranando King <kingmph at gmail.com> Date: Mon, Jan 15, 2018 at 12:34 AM Subject: Re: An idea to extend the functionality of Proxy objects. To: Isiah Meadows <isiahmeadows at gmail.com> I'm only including the altered verbiage for each internal method. The altered invariants would be as follows, with changes in red, with a black background for removed bits. Sorry if this looks too much like a redacted government document. The point of these changes is to remove any references to "the target" in favor of "the target as described by the essential internal methods, superseded by the corresponding methods of a [[ProxyHandler]] should one exist". Definitions: - The *target* of an internal method is the object upon which the internal method is called. - A target is *non-extensible* if it has been observed to return false from its [[IsExtensible]] internal method, or true from its [[PreventExtensions]] internal method. - A *non-existent* property is a property that does not exist as an own property on a non-extensible target. - All references to *[SameValue](https://tc39.github.io/ecma262/#sec-samevalue)* are according to the definition of the [SameValue](https://tc39.github.io/ecma262/#sec-samevalue) algorithm. - Each reference to an essential internal method is presumed to refer to the corresponding trap on the [[ProxyHandler]] object should both the object and the trap exist. [[GetPrototypeOf]] ( ) - If [[IsExtensible]] returns false, and [[GetPrototypeOf]] returns a value v, then any future calls to [[GetPrototypeOf]] should return the [SameValue](https://tc39.github.io/ecma262/#sec-samevalue) as v. [[SetPrototypeOf]] (V) - If [[IsExtensible]] returns false, [[SetPrototypeOf]] must return false, unless V is the [SameValue](https://tc39.github.io/ecma262/#sec-samevalue) as the target's observed [[GetPrototypeOf]] value. [[PreventExtensions]] ( ) - If [[PreventExtensions]] returns true, all future calls to [[IsExtensible]] on the target must return false and the target is now considered non-extensible. [[GetOwnProperty]] (P) - If [[IsExtensible]] returns false and P is non-existent, then all future calls to [[GetOwnProperty]] (P) on the target must describe P as non-existent (i.e. [[GetOwnProperty]] (P) must return undefined). [[DefineOwnProperty]] (P, Desc) - [[DefineOwnProperty]] must return false if [[GetOwnProperty]] (P) has previously been observed as a non-configurable own property of the target, unless either: - [[DefineOwnProperty]] (P, Desc) must return false if [[IsExtensible]] returns false and P is a non-existent own property. That is, if [[IsExtensible]] returns false, [[DefineOwnProperty]] (P, Desc) cannot be used to create new properties. [[HasProperty]] ( P ) - If [[GetOwnProperty]] (P) was previously observed as a non-configurable data or accessor own property of the target, [[HasProperty]] must return true. [[Get]] (P, Receiver) - If [[GetOwnProperty]] (P) was previously observed as a non-configurable, non-writable own data property of the target with value v, then [[Get]] must return the [SameValue](https://tc39.github.io/ecma262/#sec-samevalue). - If [[GetOwnProperty]] (P) was previously observed as a non-configurable own accessor property of the target, and the [[Get]] attribute of P is undefined, the [[Get]] operation must return undefined. [[Set]] ( P, V, Receiver) - If [[GetOwnProperty]] (P) was previously observed as a non-configurable, non-writable own data property of the target, then [[Set]] must return false unless V is the [SameValue](https://tc39.github.io/ecma262/#sec-samevalue) as P's [[Value]] attribute. - If [[GetOwnProperty]] (P) was previously observed as a non-configurable own accessor property of the target, and the [[Set]] attribute of P is undefined, the [[Set]] operation must return false. [[Delete]] ( P ) - If [[GetOwnProperty]] (P) was previously observed to be a non-configurable own data or accessor property of the target, [[Delete]] must return false. [[OwnPropertyKeys]] ( ) - If [[IsExtensible]] returns false, the returned [List](https://tc39.github.io/ecma262/#sec-list-and-record-specification-type) must contain only the keys of all own properties of the object that are observable using [[GetOwnProperty]].