tor-browser

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

regress-191668.js (1499B)


      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 *
      8 * Date:    03 February 2003
      9 * SUMMARY: Testing script containing <!- at internal buffer boundary.
     10 * JS parser must look for HTML comment-opener <!--, but mustn't disallow <!-
     11 *
     12 * See http://bugzilla.mozilla.org/show_bug.cgi?id=191668
     13 *
     14 */
     15 //-----------------------------------------------------------------------------
     16 var UBound = 0;
     17 var BUGNUMBER = 191668;
     18 var summary = 'Testing script containing <!- at internal buffer boundary';
     19 var status = '';
     20 var statusitems = [];
     21 var actual = '';
     22 var actualvalues = [];
     23 var expect= '';
     24 var expectedvalues = [];
     25 
     26 var N = 512;
     27 var j = 0;
     28 var str = 'if (0<!-0) ++j;';
     29 
     30 for (var i=0; i!=N; ++i)
     31 {
     32  eval(str);
     33  str = ' ' + str;
     34 }
     35 
     36 status = inSection(1);
     37 actual = j;
     38 expect = N;
     39 addThis();
     40 
     41 
     42 
     43 //-----------------------------------------------------------------------------
     44 test();
     45 //-----------------------------------------------------------------------------
     46 
     47 
     48 
     49 function addThis()
     50 {
     51  statusitems[UBound] = status;
     52  actualvalues[UBound] = actual;
     53  expectedvalues[UBound] = expect;
     54  UBound++;
     55 }
     56 
     57 
     58 function test()
     59 {
     60  printBugNumber(BUGNUMBER);
     61  printStatus(summary);
     62 
     63  for (var i=0; i<UBound; i++)
     64  {
     65    reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
     66  }
     67 }