Debian Codegraph @

js/src/tests/test262/built-ins/Proxy/has/trap-is-not-callable-realm.js

raw
1 // Copyright (C) 2016 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-hasproperty-p
5 description: >
6 Throws if trap is not callable (honoring the Realm of the current execution
7 context)
8 info: |
9 [[HasProperty]] (P)
10
11 ...
12 6. Let trap be GetMethod(handler, "has").
13 ...
14 7.3.9 GetMethod (O, P)
15 ...
16 2. Let func be GetV(O, P).
17 5. If IsCallable(func) is false, throw a TypeError exception.
18 ...
19 features: [cross-realm, Proxy]
20 ---*/
21
22 var OProxy = $262.createRealm().global.Proxy;
23 var p = new OProxy({}, {
24 has: {}
25 });
26
27 assert.throws(TypeError, function() {
28 "attr" in p;
29 });
30
31 reportCompare(0, 0);