Test case:
```js
var results = []
var observe = function (method, object, ...args) {
results.push({
method: method
, object: object
, args: args
, output: Reflect[method](object, ...args)
})
}
var obj = { get x() {
Object.defineProperty(this, 'x', { value: 2, configurable: false, writable:
false })
observe('getOwnPropertyDescriptor', this, 'x')
return 1
} }
observe('get', obj, 'x')
results[0]
// { method: "getOwnPropertyDescriptor", object: obj, args: [ "x" ], output: {
value: 2, writable: false, enumerable: true, configurable: false } }
// `obj` is observed to have a nonconfigurable, nonwritable property "x" with
value `2`.
results[1] // { method: "get", object: obj, args: [ "x" ], output: 1 }
// Then, `obj.[[Get]]("x") is observed to return `1`.
```
Not sure if it is worrisome. What is sure, the situation could become worse
with fanciful proxies.
―Claude
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss