Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Proxy/has/call-in.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 es6id: 9.5.7
5 description: >
6 A `in` check trigger trap.call(handler, target, P);
7 info: |
8 [[HasProperty]] (P)
9
10 ...
11 9. Let booleanTrapResult be ToBoolean(Call(trap, handler, «target, P»)).
12 ...
13 ---*/
14
15 var _handler, _target, _prop;
16 var target = {};
17 var handler = {
18 has: function(t, prop) {
19 _handler = this;
20 _target = t;
21 _prop = prop;
22
23 return prop in t;
24 }
25 };
26 var p = new Proxy(target, handler);
27
28 "attr" in p;
29
30 assert.sameValue(_handler, handler, "handler is context");
31 assert.sameValue(_target, target, "target is the first parameter");
32 assert.sameValue(_prop, "attr", "given prop is the second paramter");