| 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 testNonConstructable() { | 5 (function testNonConstructable() { |
| 8 var proxy = new Proxy({},{}); | 6 var proxy = new Proxy({},{}); |
| 9 assertThrows(function(){ new proxy() }, TypeError); | 7 assertThrows(function(){ new 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 testFailingConstructRevoked() { | 13 (function testFailingConstructRevoked() { |
| 16 var pair = Proxy.revocable(Array, {}); | 14 var pair = Proxy.revocable(Array, {}); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 147 |
| 150 var result3 = ReflectConstructRealm1(proxy, []); | 148 var result3 = ReflectConstructRealm1(proxy, []); |
| 151 assertSame(Realm.eval(realm1, 'Array.prototype'), | 149 assertSame(Realm.eval(realm1, 'Array.prototype'), |
| 152 Reflect.getPrototypeOf(result3)); | 150 Reflect.getPrototypeOf(result3)); |
| 153 | 151 |
| 154 var ReflectConstructRealm2 = Realm.eval(realm2, 'Reflect.construct'); | 152 var ReflectConstructRealm2 = Realm.eval(realm2, 'Reflect.construct'); |
| 155 var result4 = ReflectConstructRealm2(proxy, argsRealm1); | 153 var result4 = ReflectConstructRealm2(proxy, argsRealm1); |
| 156 assertSame(Realm.eval(realm2, 'Array.prototype'), | 154 assertSame(Realm.eval(realm2, 'Array.prototype'), |
| 157 Reflect.getPrototypeOf(result4)); | 155 Reflect.getPrototypeOf(result4)); |
| 158 })(); | 156 })(); |
| OLD | NEW |