js/src/tests/js1_5/Regress/regress-191633.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/tests/js1_5/Regress/regress-191633.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,73 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +/*
    1.10 + *
    1.11 + * Date:    03 February 2003
    1.12 + * SUMMARY: Testing script with huge number of comments
    1.13 + *
    1.14 + * See http://bugzilla.mozilla.org/show_bug.cgi?id=191633
    1.15 + *
    1.16 + */
    1.17 +//-----------------------------------------------------------------------------
    1.18 +var UBound = 0;
    1.19 +var BUGNUMBER = 191633;
    1.20 +var summary = 'Testing script with huge number of comments';
    1.21 +var status = '';
    1.22 +var statusitems = [];
    1.23 +var actual = '';
    1.24 +var actualvalues = [];
    1.25 +var expect= '';
    1.26 +var expectedvalues = [];
    1.27 +
    1.28 +
    1.29 +status = inSection(1);
    1.30 +actual = false; // initialize to failure
    1.31 +var s = repeat_str("//\n", 40000); // Build a string of 40000 lines of comments
    1.32 +eval(s + "actual = true;");
    1.33 +expect = true;
    1.34 +addThis();
    1.35 +
    1.36 +
    1.37 +
    1.38 +//-----------------------------------------------------------------------------
    1.39 +test();
    1.40 +//-----------------------------------------------------------------------------
    1.41 +
    1.42 +
    1.43 +
    1.44 +function repeat_str(str, repeat_count)
    1.45 +{
    1.46 +  var arr = new Array(repeat_count);
    1.47 +
    1.48 +  while (repeat_count != 0)
    1.49 +    arr[--repeat_count] = str;
    1.50 +
    1.51 +  return str.concat.apply(str, arr);
    1.52 +}
    1.53 +
    1.54 +
    1.55 +function addThis()
    1.56 +{
    1.57 +  statusitems[UBound] = status;
    1.58 +  actualvalues[UBound] = actual;
    1.59 +  expectedvalues[UBound] = expect;
    1.60 +  UBound++;
    1.61 +}
    1.62 +
    1.63 +
    1.64 +function test()
    1.65 +{
    1.66 +  enterFunc('test');
    1.67 +  printBugNumber(BUGNUMBER);
    1.68 +  printStatus(summary);
    1.69 +
    1.70 +  for (var i=0; i<UBound; i++)
    1.71 +  {
    1.72 +    reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
    1.73 +  }
    1.74 +
    1.75 +  exitFunc ('test');
    1.76 +}

mercurial