tor-browser

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

recover-lambdas-bug1113940.js (907B)


      1 gczeal(14);
      2 
      3 // The object metadata callback can iterate over the stack. Thus during the
      4 // allocation of the lambda we might inspect the stack which is still incomplete
      5 // because the lambda is not yet reconstructed.
      6 //
      7 // enableShellAllocationMetadataBuilder ignores its argument, because we don't
      8 // permit metadata callbacks to run JS any more, so this test may be
      9 // unnecessary. We'll preserve its structure just in case.
     10 enableShellAllocationMetadataBuilder(function() {});
     11 function f() {
     12    (function() {
     13        '' ^ Object
     14    })();
     15 }
     16 x = 0;
     17 for (var j = 0; j < 99; ++j) {
     18    x += f();
     19 }
     20 
     21 try {
     22  x = true;
     23  // Same comment as above.
     24  enableShellAllocationMetadataBuilder(function([x, y, z], ... Debugger) {});
     25  for (var i = 0; i < 10; ++i) {
     26    var f = function() {
     27      function g() {
     28 x++;
     29      }
     30      g();
     31    }
     32    f();
     33  }
     34 } catch (e) {
     35  assertEq(e instanceof TypeError, true);
     36 }