tzagallo@apple.com | c73b58b | 2019-04-09 07:54:18 +0000 | [diff] [blame] | 1 | //@ if $jitTests then runDefault("--useLLInt=0") else skip end |
| 2 | |
| 3 | const o = {}; |
| 4 | const handler = { |
| 5 | get(target, prop, receiver) { |
| 6 | o.__proto__ = receiver; |
| 7 | }, |
| 8 | has(target, prop) { |
| 9 | o.__proto__ = undefined; |
| 10 | return 1; |
| 11 | } |
| 12 | }; |
| 13 | |
| 14 | const p = new Proxy({}, handler); |
| 15 | handler.__proto__ = p; |
| 16 | try { |
| 17 | with (p) { |
| 18 | a = 0 |
| 19 | } |
| 20 | throw new Error("Should throw RangeError"); |
| 21 | } catch (error) { |
| 22 | if (error.message !== "Maximum call stack size exceeded.") |
| 23 | throw new Error("Expected stack overflow, but got: " + error); |
| 24 | } |