PageRenderTime 5ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/js/src/jit-test/tests/arguments/strict-nested-assign-shadow-function-name.js

http://github.com/zpao/v8monkey
JavaScript | 33 lines | 25 code | 4 blank | 4 comment | 1 complexity | cd3b2ff106b0cba699a84a0cbd1f2593 MD5 | raw file
 1/*
 2 * Any copyright is dedicated to the Public Domain.
 3 * http://creativecommons.org/licenses/publicdomain/
 4 */
 5load(libdir + 'array-compare.js');
 6
 7var obj = {};
 8
 9function strictNestedAssignShadowFunctionName(p)
10{
11  "use strict";
12  function inner()
13  {
14    function p() { p = 1776; }
15    p();
16  }
17  inner();
18  return arguments;
19}
20
21var a1, a2, a3, a4, a5;
22for (var i = 0; i < 5; i++)
23{
24  a1 = strictNestedAssignShadowFunctionName();
25  a2 = strictNestedAssignShadowFunctionName(99);
26  a3 = strictNestedAssignShadowFunctionName("");
27  a4 = strictNestedAssignShadowFunctionName(obj);
28}
29
30assertEq(arraysEqual(a1, []), true);
31assertEq(arraysEqual(a2, [99]), true);
32assertEq(arraysEqual(a3, [""]), true);
33assertEq(arraysEqual(a4, [obj]), true);