Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-256501.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 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 var gTestfile = 'regress-256501.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 256501;
9 var summary = 'Check Recursion';
10 var actual = '';
11 var expect = '';
12
13 printBugNumber(BUGNUMBER);
14 printStatus (summary);
15
16 expect = 'error';
17
18 try
19 {
20 var N = 100*1000;
21 var buffer = new Array(N * 2 + 1);
22 for (var i = 0; i != N; ++i)
23 {
24 buffer[i] = 'do ';
25 buffer[buffer.length - i - 1] = ' while(0);';
26 }
27 buffer[N] = 'printStatus("TEST");';
28
29 // text is do do ... do print("TEST"); while(0); while(0); ... while(0);
30 var text = buffer.join('');
31
32 eval(text);
33 actual = 'no error';
34 }
35 catch(e)
36 {
37 actual = 'error';
38 }
39 reportCompare(expect, actual, summary);