PageRenderTime 22ms CodeModel.GetById 11ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 1ms

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

http://github.com/zpao/v8monkey
JavaScript | 33 lines | 25 code | 4 blank | 4 comment | 1 complexity | 29a7e5b8ba80a8a80eb936c10b2025e2 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 strictNestedAssignShadowFunctionCall(p)
10{
11  "use strict";
12  function inner()
13  {
14    function p() { }
15    p = 1776;
16  }
17  inner();
18  return arguments;
19}
20
21var a1, a2, a3, a4;
22for (var i = 0; i < 5; i++)
23{
24  a1 = strictNestedAssignShadowFunctionCall();
25  a2 = strictNestedAssignShadowFunctionCall(99);
26  a3 = strictNestedAssignShadowFunctionCall("");
27  a4 = strictNestedAssignShadowFunctionCall(obj);
28}
29
30assertEq(arraysEqual(a1, []), true);
31assertEq(arraysEqual(a2, [99]), true);
32assertEq(arraysEqual(a3, [""]), true);
33assertEq(arraysEqual(a4, [obj]), true);