| 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 --stack-size=100 | 5 // Flags: --stack-size=100 |
| 6 | 6 |
| 7 // Test that traps that involve walking the target object's prototype chain | 7 // Test that traps that involve walking the target object's prototype chain |
| 8 // don't overflow the stack when the original proxy is on that chain. | 8 // don't overflow the stack when the original proxy is on that chain. |
| 9 | 9 |
| 10 (function TestGetPrototype() { | 10 (function TestGetPrototype() { |
| 11 var handler = {}; | 11 var handler = {}; |
| 12 var p = new Proxy({}, handler); | 12 var p = new Proxy({}, handler); |
| 13 handler.__proto__ = p; | 13 handler.__proto__ = p; |
| 14 try { return p.__proto__; } catch(e) { assertInstanceof(e, RangeError); } | 14 try { return p.__proto__; } catch(e) { assertInstanceof(e, RangeError); } |
| 15 })(); | 15 })(); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 handler.__proto__ = p; | 109 handler.__proto__ = p; |
| 110 try { return p(); } catch(e) { assertInstanceof(e, RangeError); } | 110 try { return p(); } catch(e) { assertInstanceof(e, RangeError); } |
| 111 })(); | 111 })(); |
| 112 | 112 |
| 113 (function TestConstruct() { | 113 (function TestConstruct() { |
| 114 var handler = {}; | 114 var handler = {}; |
| 115 var p = new Proxy(function() { this.foo = 1; }, handler); | 115 var p = new Proxy(function() { this.foo = 1; }, handler); |
| 116 handler.__proto__ = p; | 116 handler.__proto__ = p; |
| 117 try { return new p(); } catch(e) { assertInstanceof(e, RangeError); } | 117 try { return new p(); } catch(e) { assertInstanceof(e, RangeError); } |
| 118 })(); | 118 })(); |
| OLD | NEW |