Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Proxy/getOwnPropertyDescriptor/call-parameters.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.5
5 description: >
6 Trap is called with hander context and parameters are target and P
7 info: |
8 [[GetOwnProperty]] (P)
9
10 ...
11 9. Let trapResultObj be Call(trap, handler, «target, P»).
12 ...
13 ---*/
14
15 var _target, _handler, _prop;
16 var target = {
17 attr: 1
18 };
19 var handler = {
20 getOwnPropertyDescriptor: function(t, prop) {
21 _target = t;
22 _handler = this;
23 _prop = prop;
24
25 return Object.getOwnPropertyDescriptor(t);
26 }
27 };
28 var p = new Proxy(target, handler);
29
30 Object.getOwnPropertyDescriptor(p, "attr");
31
32 assert.sameValue(_handler, handler);
33 assert.sameValue(_target, target);
34 assert.sameValue(_prop, "attr");