| 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 // Test that traps that involve walking the target object's prototype chain | 5 // 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. | 6 // don't overflow the stack when the original proxy is on that chain. |
| 9 | 7 |
| 10 (function TestGetPrototype() { | 8 (function TestGetPrototype() { |
| 11 var p = new Proxy({}, {}); | 9 var p = new Proxy({}, {}); |
| 12 p.__proto__ = p; | 10 p.__proto__ = p; |
| 13 try { return p.__proto__; } catch(e) { assertInstanceof(e, RangeError); } | 11 try { return p.__proto__; } catch(e) { assertInstanceof(e, RangeError); } |
| 14 })(); | 12 })(); |
| 15 | 13 |
| 16 (function TestSetPrototype() { | 14 (function TestSetPrototype() { |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 var p = new Proxy(function() {}, {}); | 86 var p = new Proxy(function() {}, {}); |
| 89 p.__proto__ = p; | 87 p.__proto__ = p; |
| 90 return p(); | 88 return p(); |
| 91 })(); | 89 })(); |
| 92 | 90 |
| 93 (function TestConstruct() { | 91 (function TestConstruct() { |
| 94 var p = new Proxy(function() { this.foo = 1; }, {}); | 92 var p = new Proxy(function() { this.foo = 1; }, {}); |
| 95 p.__proto__ = p; | 93 p.__proto__ = p; |
| 96 return new p(); | 94 return new p(); |
| 97 })(); | 95 })(); |
| OLD | NEW |