tor-browser

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

testFunctionStatementAliasLocals.js (379B)


      1 function f1(b) {
      2    var w = 3;
      3    if (b)
      4        function w() {}
      5    return w;
      6 }
      7 assertEq(typeof f1(true), "function");
      8 assertEq(f1(false), 3);
      9 
     10 function f2(b, w) {
     11    // Annex B doesn't apply to functions in blocks with the same name as a
     12    // parameter.
     13    if (b)
     14        function w() {}
     15    return w;
     16 }
     17 assertEq(typeof f2(true, 3), "number");
     18 assertEq(f2(false, 3), 3);