Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Proxy/ownKeys/trap-is-undefined.js

raw
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 ---*/
10
11 var target = {
12 foo: 1,
13 bar: 2
14 };
15 var p = new Proxy(target, {});
16
17 var keys = Object.keys(p);
18
19 assert.sameValue(keys[0], "foo");
20 assert.sameValue(keys[1], "bar");
21
22 assert.sameValue(keys.length, 2);