| 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 | |
| 6 | |
| 7 var global = this; | 5 var global = this; |
| 8 | 6 |
| 9 var funs = { | 7 var funs = { |
| 10 Object: [ Object ], | 8 Object: [ Object ], |
| 11 Function: [ Function ], | 9 Function: [ Function ], |
| 12 Array: [ Array ], | 10 Array: [ Array ], |
| 13 String: [ String ], | 11 String: [ String ], |
| 14 Boolean: [ Boolean ], | 12 Boolean: [ Boolean ], |
| 15 Number: [ Number ], | 13 Number: [ Number ], |
| 16 Date: [ Date ], | 14 Date: [ Date ], |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 assertTag("Function", new Proxy(() => 42, {get() {return 666}})); | 150 assertTag("Function", new Proxy(() => 42, {get() {return 666}})); |
| 153 | 151 |
| 154 revocable = Proxy.revocable([], {}); | 152 revocable = Proxy.revocable([], {}); |
| 155 revocable.revoke(); | 153 revocable.revoke(); |
| 156 assertThrows(() => Object.prototype.toString.call(revocable.proxy), TypeError); | 154 assertThrows(() => Object.prototype.toString.call(revocable.proxy), TypeError); |
| 157 | 155 |
| 158 handler = {}; | 156 handler = {}; |
| 159 revocable = Proxy.revocable([], handler); | 157 revocable = Proxy.revocable([], handler); |
| 160 handler.get = () => revocable.revoke(); | 158 handler.get = () => revocable.revoke(); |
| 161 assertThrows(() => Object.prototype.toString.call(revocable.proxy), TypeError); | 159 assertThrows(() => Object.prototype.toString.call(revocable.proxy), TypeError); |
| OLD | NEW |