testDirectProxyKeys3.js (271B)
1 load(libdir + "asserts.js"); 2 3 // Throw a TypeError if the trap does not return an object 4 5 var handler = { ownKeys: () => undefined }; 6 for (let p of [new Proxy({}, handler), Proxy.revocable({}, handler).proxy]) 7 assertThrowsInstanceOf(() => Object.keys(p), TypeError);