Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-350268.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-350268.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 350268;
9 var summary = 'new Function with unbalanced braces';
10 var actual = '';
11 var expect = '';
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 var f;
25
26 try
27 {
28 expect = 'SyntaxError';
29 actual = 'No Error';
30 f = new Function("}");
31 }
32 catch(ex)
33 {
34 actual = ex.name;
35 }
36 reportCompare(expect, actual, summary + ": }");
37
38 try
39 {
40 expect = 'SyntaxError';
41 actual = 'No Error';
42 f = new Function("}}}}}");
43 }
44 catch(ex)
45 {
46 actual = ex.name;
47 }
48 reportCompare(expect, actual, summary + ": }}}}}");
49
50 try
51 {
52 expect = 'SyntaxError';
53 actual = 'No Error';
54 f = new Function("alert(6); } alert(5);");
55 }
56 catch(ex)
57 {
58 actual = ex.name;
59 }
60 reportCompare(expect, actual, summary + ": alert(6); } alert(5);");
61
62 try
63 {
64 expect = 'SyntaxError';
65 actual = 'No Error';
66 f = new Function("} {");
67 }
68 catch(ex)
69 {
70 actual = ex.name;
71 }
72 reportCompare(expect, actual, summary + ": } {");
73
74 exitFunc ('test');
75 }