/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. */
  5. load(libdir + 'array-compare.js');
  6. var obj = {};
  7. function strictNestedAssignShadowFunctionCall(p)
  8. {
  9. "use strict";
  10. function inner()
  11. {
  12. function p() { }
  13. p = 1776;
  14. }
  15. inner();
  16. return arguments;
  17. }
  18. var a1, a2, a3, a4;
  19. for (var i = 0; i < 5; i++)
  20. {
  21. a1 = strictNestedAssignShadowFunctionCall();
  22. a2 = strictNestedAssignShadowFunctionCall(99);
  23. a3 = strictNestedAssignShadowFunctionCall("");
  24. a4 = strictNestedAssignShadowFunctionCall(obj);
  25. }
  26. assertEq(arraysEqual(a1, []), true);
  27. assertEq(arraysEqual(a2, [99]), true);
  28. assertEq(arraysEqual(a3, [""]), true);
  29. assertEq(arraysEqual(a4, [obj]), true);