tor-browser

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

bug1671563-strict.js (388B)


      1 // A `var` is `undefined` on entering a function body in strict mode too.
      2 
      3 "use strict";
      4 
      5 load(libdir + "asserts.js");
      6 
      7 function f(a = class C{}) {
      8  var x;
      9  return x;
     10 }
     11 assertEq(f(), undefined);
     12 
     13 function* g1(a = class C {}) {
     14  var x;
     15  assertEq(x, undefined);
     16 }
     17 g1().next();
     18 
     19 function* g2(a = class C {}) {
     20  x;
     21  let x;
     22 }
     23 assertThrowsInstanceOf(() => g2().next(), ReferenceError);