Debian Codegraph @

js/src/tests/test262/built-ins/Proxy/apply/call-result.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 esid: sec-proxy-object-internal-methods-and-internal-slots-call-thisargument-argumentslist
5 description: >
6 Return the result from the trap method.
7 info: |
8 [[Call]] (thisArgument, argumentsList)
9
10 9. Return Call(trap, handler, «target, thisArgument, argArray»).
11 features: [Proxy]
12 ---*/
13
14 var result = {};
15 var p = new Proxy(function() {
16 throw new Test262Error('target should not be called');
17 }, {
18 apply: function(t, c, args) {
19 return result;
20 },
21 });
22
23 assert.sameValue(p.call(), result);
24
25 reportCompare(0, 0);