Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Proxy/ownKeys/trap-is-not-callable.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 Trap is not callable.
7 info: |
8 [[OwnPropertyKeys]] ( )
9
10 5. Let trap be ? GetMethod(handler, "ownKeys").
11 ...
12
13 #sec-getmethod
14 7.3.9 GetMethod (O, P)
15
16 4. If IsCallable(func) is false, throw a TypeError exception.
17 ---*/
18
19 var p = new Proxy({
20 attr: 1
21 }, {
22 ownKeys: {}
23 });
24
25 assert.throws(TypeError, function() {
26 Object.keys(p);
27 });