| throw new Error("Bad assertion!") |
| // This test makes sure that when wrapper() is called with the closure created in foo() as |this| |
| // that we to_this the |this| that is a closure before the arrow function captures its value. |
| // This crashes if there is a bug in debug builds. |
| function capture() { return wrapper; } |
| // This should not defineProperty on a JSLexicalEnvironment! That's a huge bug. |
| Object.defineProperty(this, "foo", { |
| assert(!("bar" in this)); |
| assert(this === globalThis); |
| function capture() { return wrapper; } |
| // This should not defineProperty on a JSLexicalEnvironment! That's a huge bug. |
| Object.defineProperty(this, "foo", { |