OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --harmony-proxies --harmony-reflect | |
6 | |
7 (function testNonCallable() { | 5 (function testNonCallable() { |
8 var proxy = new Proxy({},{}); | 6 var proxy = new Proxy({},{}); |
9 assertThrows(function(){ proxy() }, TypeError); | 7 assertThrows(function(){ proxy() }, TypeError); |
10 | 8 |
11 var proxy2 = new Proxy(proxy, {}); | 9 var proxy2 = new Proxy(proxy, {}); |
12 assertThrows(function(){ proxy2() }, TypeError); | 10 assertThrows(function(){ proxy2() }, TypeError); |
13 })(); | 11 })(); |
14 | 12 |
15 (function testCallProxyFallbackNoArguments() { | 13 (function testCallProxyFallbackNoArguments() { |
16 var called = false; | 14 var called = false; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 assertThrows(() => { Reflect.apply(proxy_to_proxy, { proxy }, []); }, | 111 assertThrows(() => { Reflect.apply(proxy_to_proxy, { proxy }, []); }, |
114 TypeError); | 112 TypeError); |
115 assertThrows(() => { | 113 assertThrows(() => { |
116 Function.prototype.call.apply(proxy_to_proxy, [null]); | 114 Function.prototype.call.apply(proxy_to_proxy, [null]); |
117 }, TypeError); | 115 }, TypeError); |
118 assertThrows(() => { | 116 assertThrows(() => { |
119 Function.prototype.apply.apply(proxy_to_proxy, [null, []]); | 117 Function.prototype.apply.apply(proxy_to_proxy, [null, []]); |
120 }, TypeError); | 118 }, TypeError); |
121 }); | 119 }); |
122 })(); | 120 })(); |
OLD | NEW |