Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/built-ins/Proxy/preventExtensions/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.4
5 description: >
6 Trap is called with handler on its context and target as the first
7 parameter.
8 info: |
9 [[PreventExtensions]] ( )
10
11 ...
12 8. Let booleanTrapResult be ToBoolean(Call(trap, handler, «target»)).
13 ...
14 ---*/
15
16 var _target, _handler;
17 var target = {};
18 var handler = {
19 preventExtensions: function(t) {
20 _handler = this;
21 _target = t;
22
23 return Object.preventExtensions(target);
24 }
25 };
26 var p = new Proxy(target, handler);
27
28 Object.preventExtensions(p);
29
30 assert.sameValue(_handler, handler);
31 assert.sameValue(_target, target);