blob: 448691930040672cd09cdc002707b433753ed117 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
load(libdir + "asserts.js");
/*
* Throw a TypeError if the trap skips an existing own enumerable property on a
* non-extensible object
*/
var target = {};
Object.defineProperty(target, 'foo', {
enumerable: true,
configurable: true
});
Object.preventExtensions(target);
var handler = { ownKeys: () => [] };
for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy])
assertThrowsInstanceOf(() => Object.keys(p), TypeError);
|