1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/basic/builtinLocals.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,35 @@ 1.4 + 1.5 +/* Resolve 'arguments' and the name of the function itself in the presence of such local variables. */ 1.6 + 1.7 +function f() { 1.8 + return typeof arguments; 1.9 + function arguments() { 1.10 + return 7; 1.11 + } 1.12 +} 1.13 +assertEq(f(), "function"); 1.14 + 1.15 +function g() { 1.16 + var arguments = 0; 1.17 + return typeof arguments; 1.18 +} 1.19 +assertEq(g(), "number"); 1.20 + 1.21 +function h() { 1.22 + return typeof h; 1.23 + function h() { 1.24 + return 7; 1.25 + } 1.26 +} 1.27 +assertEq(h(), "function"); 1.28 + 1.29 +function i() { 1.30 + return typeof i; 1.31 + var i; 1.32 +} 1.33 +assertEq(i(), "undefined"); 1.34 + 1.35 +function j() { 1.36 + return typeof j; 1.37 +} 1.38 +assertEq(j(), "function");