michael@0: michael@0: /* Resolve 'arguments' and the name of the function itself in the presence of such local variables. */ michael@0: michael@0: function f() { michael@0: return typeof arguments; michael@0: function arguments() { michael@0: return 7; michael@0: } michael@0: } michael@0: assertEq(f(), "function"); michael@0: michael@0: function g() { michael@0: var arguments = 0; michael@0: return typeof arguments; michael@0: } michael@0: assertEq(g(), "number"); michael@0: michael@0: function h() { michael@0: return typeof h; michael@0: function h() { michael@0: return 7; michael@0: } michael@0: } michael@0: assertEq(h(), "function"); michael@0: michael@0: function i() { michael@0: return typeof i; michael@0: var i; michael@0: } michael@0: assertEq(i(), "undefined"); michael@0: michael@0: function j() { michael@0: return typeof j; michael@0: } michael@0: assertEq(j(), "function");