Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Proxy/has/call-with.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 `with` variable 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 flags: [noStrict]
14 ---*/
15
16 var _handler, _target, _prop;
17 var target = {};
18 var handler = {
19 has: function(t, prop) {
20 _handler = this;
21 _target = t;
22 _prop = prop;
23
24 return true;
25 }
26 };
27 var p = new Proxy(target, handler);
28
29 with(p) {
30 (attr);
31 }
32
33 assert.sameValue(_handler, handler);
34 assert.sameValue(_target, target);
35 assert.sameValue(_prop, "attr");