new [[HasProperty]] invariant for non-extensible objects

Oriol _ oriol-bugzilla at
Sun Mar 5 14:46:45 UTC 2017

Yes, but the point is that if the property is removed, then [[HasProperty]] will return false, and thus the invariant can't be enforced, because an exotic object might behave like if the property was deleted under the hood.

Since you say the invariant is enforced for exotic proxy objects, you may prefer a counterexample for these:

var target = Object.preventExtensions({foo: "bar"});
var p = new Proxy(target, {
  has: (target, prop) => !Reflect.deleteProperty(target, prop)

// Object is non-extensible
Object.isExtensible(p); // false

// foo is an observable own property
!!Object.getOwnPropertyDescriptor(p, "foo"); // true

// [[HasProperty]] returns false
"foo" in p; // false

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list