Chromium Code Reviews| Index: test/mjsunit/harmony/proxies-prototype-target-stackoverflow.js |
| diff --git a/test/mjsunit/harmony/proxies-prototype-target-stackoverflow.js b/test/mjsunit/harmony/proxies-prototype-target-stackoverflow.js |
| index ba55f6aad9357cfff3b600addb70a02148a415b9..3bed73c6bab77bbb9b39ae588b7d236207f79bf3 100644 |
| --- a/test/mjsunit/harmony/proxies-prototype-target-stackoverflow.js |
| +++ b/test/mjsunit/harmony/proxies-prototype-target-stackoverflow.js |
| @@ -6,20 +6,27 @@ |
| // Test that traps that involve walking the target object's prototype chain |
| // don't overflow the stack when the original proxy is on that chain. |
| - |
| -(function TestGetPrototype() { |
| +function test(fn) { |
| + return () => { |
| + print(fn.name); |
| + fn(); |
| + print(" done"); |
| + } |
|
neis
2016/03/01 13:40:31
Not sure if this was temporary debugging code or n
Camillo Bruni
2016/03/01 19:04:57
is debugging code :)
|
| +} |
| + |
| +test(function TestGetPrototype() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| try { return p.__proto__; } catch(e) { assertInstanceof(e, RangeError); } |
| })(); |
| -(function TestSetPrototype() { |
| +test(function TestSetPrototype() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| try { p.__proto__ = p; } catch(e) { assertInstanceof(e, RangeError); } |
| })(); |
| -(function TestHasProperty() { |
| +test(function TestHasProperty() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| try { |
| @@ -27,19 +34,19 @@ |
| } catch(e) { assertInstanceof(e, RangeError); } |
| })(); |
| -(function TestSet() { |
| +test(function TestSet() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| try { p.foo = 1; } catch(e) { assertInstanceof(e, RangeError); } |
| })(); |
| -(function TestGet() { |
| +test(function TestGet() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| try { return p.foo; } catch(e) { assertInstanceof(e, RangeError); } |
| })(); |
| -(function TestEnumerate() { |
| +test(function TestEnumerate() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| try { for (var x in p) {} } catch(e) { assertInstanceof(e, RangeError); } |
| @@ -48,49 +55,49 @@ |
| // The following traps don't involve the target object's prototype chain; |
| // we test them anyway for completeness. |
| -(function TestIsExtensible() { |
| +test(function TestIsExtensible() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| return Reflect.isExtensible(p); |
| })(); |
| -(function TestPreventExtensions() { |
| +test(function TestPreventExtensions() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| Reflect.preventExtensions(p); |
| })(); |
| -(function TestGetOwnPropertyDescriptor() { |
| +test(function TestGetOwnPropertyDescriptor() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| return Object.getOwnPropertyDescriptor(p, "foo"); |
| })(); |
| -(function TestDeleteProperty() { |
| +test(function TestDeleteProperty() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| delete p.foo; |
| })(); |
| -(function TestDefineProperty() { |
| +test(function TestDefineProperty() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| Object.defineProperty(p, "foo", {value: "bar"}); |
| })(); |
| -(function TestOwnKeys() { |
| +test(function TestOwnKeys() { |
| var p = new Proxy({}, {}); |
| p.__proto__ = p; |
| return Reflect.ownKeys(p); |
| })(); |
| -(function TestCall() { |
| +test(function TestCall() { |
| var p = new Proxy(function() {}, {}); |
| p.__proto__ = p; |
| return p(); |
| })(); |
| -(function TestConstruct() { |
| +test(function TestConstruct() { |
| var p = new Proxy(function() { this.foo = 1; }, {}); |
| p.__proto__ = p; |
| return new p(); |