tor-browser

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

toSource-infinite-recursion.js (697B)


      1 // |reftest| skip-if(!Error.prototype.toSource)
      2 
      3 /*
      4 * Any copyright is dedicated to the Public Domain.
      5 * http://creativecommons.org/licenses/publicdomain/
      6 */
      7 
      8 //-----------------------------------------------------------------------------
      9 var BUGNUMBER = 650574;
     10 var summary = 'Check for too-deep stack when converting a value to source';
     11 
     12 print(BUGNUMBER + ": " + summary);
     13 
     14 /**************
     15 * BEGIN TEST *
     16 **************/
     17 
     18 var e = Error('');
     19 e.fileName = e;
     20 assertEq(e.toSource(), `(new Error("", {}, 18))`);
     21 
     22 /******************************************************************************/
     23 
     24 if (typeof reportCompare === "function")
     25  reportCompare(true, true);
     26 
     27 print("All tests passed!");