diff options
Diffstat (limited to 'js/src/jit-test/tests/class/super-this-env.js')
-rw-r--r-- | js/src/jit-test/tests/class/super-this-env.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/class/super-this-env.js b/js/src/jit-test/tests/class/super-this-env.js new file mode 100644 index 0000000000..9faca9b745 --- /dev/null +++ b/js/src/jit-test/tests/class/super-this-env.js @@ -0,0 +1,34 @@ +for (let forceFullParse of [true, false]) { + assertEq(Object.prototype.toString, evaluate(`{ + class C extends Object { + f() { + let x = "toString"; + return () => super[x]; + } + } + + (new C).f()() + }`, { forceFullParse })); + + assertEq(Object.prototype.toString, evaluate(`{ + class C extends Object { + f() { + let x = "toString"; + return () => eval("super[x]"); + } + } + + (new C).f()() + }`, { forceFullParse })); + + assertEq(Object.prototype.toString, evaluate(`{ + class C extends Object { + f() { + let x = "toString"; + return () => eval("() => super[x]"); + } + } + + (new C).f()()() + }`, { forceFullParse })); +} |