trap-is-undefined.js (595B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 /*--- 4 esid: sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys 5 description: > 6 [[OwnPropertyKeys]] ( ) 7 8 6. If trap is undefined, then Return target.[[OwnPropertyKeys]]() 9 features: [Proxy] 10 ---*/ 11 12 var target = { 13 foo: 1, 14 bar: 2 15 }; 16 var p = new Proxy(target, {}); 17 18 var keys = Object.getOwnPropertyNames(p); 19 20 assert.sameValue(keys[0], "foo"); 21 assert.sameValue(keys[1], "bar"); 22 23 assert.sameValue(keys.length, 2); 24 25 reportCompare(0, 0);