tor-browser

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

regress-83532-002.js (1186B)


      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 * Date: 01 June 2001
      8 *
      9 * SUMMARY: Testing that we don't crash on switch case -1...
     10 * See http://bugzilla.mozilla.org/show_bug.cgi?id=83532
     11 *
     12 */
     13 //-----------------------------------------------------------------------------
     14 var BUGNUMBER = 83532;
     15 var summary = "Testing that we don't crash on switch case -1";
     16 var sToEval = '';
     17 
     18 //-----------------------------------------------------------------------------
     19 test();
     20 //-----------------------------------------------------------------------------
     21 
     22 function test()
     23 {
     24  printBugNumber(BUGNUMBER);
     25  printStatus (summary);
     26 
     27  // Just testing that we don't crash on these -
     28  sToEval += 'function f () {switch(1) {case -1:}};';
     29  sToEval += 'function g(){switch(1){case (-1):}};';
     30  sToEval += 'var h = function() {switch(1) {case -1:}};'
     31    sToEval += 'f();';
     32  sToEval += 'g();';
     33  sToEval += 'h();';
     34  eval(sToEval);
     35 
     36  reportCompare('No Crash', 'No Crash', '');
     37 }