tor-browser

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

regress-300079.js (1209B)


      1 /* -*- 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 = 300079;
      8 var summary = "precompiled functions should inherit from current window's Function.prototype";
      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  if (typeof clone == 'undefined') {
     23    expect = 'SKIPPED';
     24    actual = 'SKIPPED';
     25  }
     26  else {
     27    expect = 'PASSED';
     28 
     29    f = evaluate("(function () { return a * a; })", {envChainObject: {a: 3}});
     30    gc();
     31    try {
     32      a_squared = f(2);
     33      if (a_squared != 9)
     34        throw "Unexpected return from g: a_squared == " + a_squared;
     35      actual = "PASSED";
     36    } catch (e) {
     37      actual = "FAILED: " + e;
     38    }
     39  }
     40 
     41  reportCompare(expect, actual, summary);
     42 }