Closed Bug 1062340 Opened 8 years ago Closed 7 years ago

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

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1120512

People

(Reporter: anba, Unassigned)

References

Details

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
Closed: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1120512
You need to log in before you can comment on or make changes to this bug.