Visit every property in Object.{isSealed, isFrozen} on proxy

RESOLVED DUPLICATE of bug 1120512

Status

()

Core
JavaScript Engine
RESOLVED DUPLICATE of bug 1120512
3 years ago
3 months ago

People

(Reporter: anba, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
TestIntegrityLevel [1] does not stop property traversal when a writable or configurable property was found. 

[1] https://people.mozilla.org/~jorendorff/es6-draft.html#sec-testintegritylevel

Test cases:

Expected: Calls getOwnPropertyDescriptor for both properties
Actual: getOwnPropertyDescriptor only called for the first property


Test Object.isFrozen and configurable property:

  var p = new Proxy(Object.preventExtensions(Object.defineProperties({}, {
    a: {configurable: true},
    b: {configurable: false},
  })), {
    getOwnPropertyDescriptor(t, pk) {
      print(`getOwnPropertyDescriptor: pk=${pk}`);
      return Object.getOwnPropertyDescriptor(t, pk);
    }
  });
  Object.isFrozen(p);


Test Object.isFrozen and writable property:

  var p = new Proxy(Object.preventExtensions(Object.defineProperties({}, {
    a: {writable: true},
    b: {configurable: false},
  })), {
    getOwnPropertyDescriptor(t, pk) {
      print(`getOwnPropertyDescriptor: pk=${pk}`);
      return Object.getOwnPropertyDescriptor(t, pk);
    }
  });
  Object.isFrozen(p);


Test Object.isSealed and configurable property:

  var p = new Proxy(Object.preventExtensions(Object.defineProperties({}, {
    a: {configurable: true},
    b: {configurable: false},
  })), {
    getOwnPropertyDescriptor(t, pk) {
      print(`getOwnPropertyDescriptor: pk=${pk}`);
      return Object.getOwnPropertyDescriptor(t, pk);
    }
  });
  Object.isSealed(p);
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1120512
You need to log in before you can comment on or make changes to this bug.