tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

strict-nested-assign-shadow-function-call.js (729B)


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