Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-256617.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-256617.js';
7 //-----------------------------------------------------------------------------
8 // should fail with syntax error. won't run in browser...
9 var BUGNUMBER = 256617;
10 var summary = 'throw statement: eol should not be allowed';
11 var actual = '';
12 var expect = '';
13
14 printBugNumber(BUGNUMBER);
15 printStatus (summary);
16
17 expect = 'syntax error';
18
19 try
20 {
21 eval('throw\n1;');
22 actual = 'throw ignored';
23 }
24 catch(e)
25 {
26 if (e instanceof SyntaxError)
27 {
28 actual = 'syntax error';
29 }
30 else
31 {
32 actual = 'no error';
33 }
34 }
35
36 reportCompare(expect, actual, summary);