tor-browser

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

regress-429739.js (1020B)


      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 = 429739;
      8 var summary = 'Do not assert: OBJ_GET_CLASS(cx, obj)->flags & JSCLASS_HAS_PRIVATE';
      9 
     10 //-----------------------------------------------------------------------------
     11 test();
     12 //-----------------------------------------------------------------------------
     13 
     14 function test()
     15 {
     16  printBugNumber(BUGNUMBER);
     17  printStatus (summary);
     18 
     19  var actual;
     20  try
     21  {
     22    var o = { __noSuchMethod__: Function }; 
     23    actual = (new o.y) + '';
     24    throw new Error("didn't throw, produced a value");
     25  }
     26  catch(ex)
     27  {
     28    actual = ex;
     29  }
     30 
     31  reportCompare("TypeError", actual.name, "bad error name");
     32  reportCompare(true, /is not a constructor/.test(actual), summary);
     33 }