tor-browser

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

regress-452498-082.js (1444B)


      1 /* -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 //-----------------------------------------------------------------------------
      7 var BUGNUMBER = 452498;
      8 var summary = 'TM: upvar2 regression tests';
      9 var actual = '';
     10 var expect = '';
     11 
     12 
     13 //-----------------------------------------------------------------------------
     14 test();
     15 //-----------------------------------------------------------------------------
     16 
     17 function test()
     18 {
     19  printBugNumber(BUGNUMBER);
     20  printStatus (summary);
     21 
     22 // ------- Comment #82 From Gary Kwong [:nth10sd]
     23 
     24 // =====
     25 
     26  (function(){function  x(){} {let x = [] }});
     27 
     28 // =====
     29 
     30  var f = new Function("new function x(){ return x |= function(){} } ([], function(){})");
     31  "" + f;
     32 
     33 // =====
     34 
     35  function g(code)
     36  {
     37    var f = new Function(code);
     38    f();
     39  }
     40  g("for (var x = 0; x < 3; ++x)(new (function(){})());");
     41 
     42 // =====
     43  try
     44  {
     45    eval(
     46      'for(let [\n' +
     47      'function  x () { M:if([1,,])  }\n'
     48      );
     49  }
     50  catch(ex)
     51  {
     52  }
     53 
     54 // =====
     55 
     56  try
     57  {
     58    function foo(code)
     59    {
     60      var c;
     61      eval("const c, x5 = c;");
     62    }
     63    foo();
     64  }
     65  catch(ex)
     66  {
     67  }
     68 
     69 // =====
     70 
     71  var f = new Function("[] = [( '' )()];");
     72  "" + f;
     73 
     74 // =====
     75 
     76  reportCompare(expect, actual, summary);
     77 }