diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/warp/function-var-environment-inlined.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/warp/function-var-environment-inlined.js b/js/src/jit-test/tests/warp/function-var-environment-inlined.js new file mode 100644 index 0000000000..f3b9c9b3b7 --- /dev/null +++ b/js/src/jit-test/tests/warp/function-var-environment-inlined.js @@ -0,0 +1,15 @@ +function defaultValue() { return 3; } + +function testCallee(p = defaultValue()) { + var q = p + 1; + return () => q + p; +} +function test() { + var res = 0; + for (var i = 0; i < 2000; i++) { + res += testCallee()(); + res += testCallee(1)(); + } + assertEq(res, 20000); +} +test(); |