Debian Codegraph @

rhino/testsrc/tests/e4x/XML/regress-324422-1.js

raw symbols SCIP
1 /* -*- Mode: java; tab-width:8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 gTestfile = 'regress-324422-1.js';
8
9 var summary = "Do not crash creating XML object with long initialiser";
10
11 var BUGNUMBER = 324422;
12 var actual = 'No Crash';
13 var expect = 'No Crash';
14
15 printBugNumber(BUGNUMBER);
16 START(summary);
17
18 if (typeof document == 'undefined')
19 {
20 printStatus ("Expect possible out of memory error");
21 expectExitCode(0);
22 expectExitCode(5);
23 }
24 var str = '<fu>x</fu>';
25
26 for (var icount = 0; icount < 20; icount++)
27 {
28 str = str + str;
29 }
30
31 printStatus(str.length);
32
33 try
34 {
35 var x = new XML('<root>' + str + '</root>');
36 }
37 catch(ex)
38 {
39 expect = 'InternalError: script stack space quota is exhausted';
40 actual = ex + '';
41 print('Caught ' + ex);
42 }
43
44 TEST(1, expect, actual);
45
46 END();