diff options
Diffstat (limited to 'js/src/jit-test/tests/basic/testFunctionStatementAliasLocals.js')
-rw-r--r-- | js/src/jit-test/tests/basic/testFunctionStatementAliasLocals.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/basic/testFunctionStatementAliasLocals.js b/js/src/jit-test/tests/basic/testFunctionStatementAliasLocals.js new file mode 100644 index 000000000..7be49b7f3 --- /dev/null +++ b/js/src/jit-test/tests/basic/testFunctionStatementAliasLocals.js @@ -0,0 +1,16 @@ +function f1(b) { + var w = 3; + if (b) + function w() {} + return w; +} +assertEq(typeof f1(true), "function"); +assertEq(f1(false), 3); + +function f2(b, w) { + if (b) + function w() {} + return w; +} +assertEq(typeof f2(true, 3), "function"); +assertEq(f2(false, 3), 3); |