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/. */
8
* Date: 10 December 2001
9
* SUMMARY: Regression test for bug 114491
10
* See http://bugzilla.mozilla.org/show_bug.cgi?id=114491
12
* Rhino crashed on this code. It should produce a syntax error, not a crash.
13
* Using the () operator after a function STATEMENT is incorrect syntax.
14
* Rhino correctly caught the error when there was no |if (true)|.
15
* With the |if (true)|, however, Rhino crashed -
18
//-----------------------------------------------------------------------------
20
var BUGNUMBER = 114491;
21
var summary = 'Regression test for bug 114491';
25
var actualvalues = [];
27
var expectedvalues = [];
30
status = inSection(1);
31
actual = 'Program execution did NOT fall into catch-block';
32
expect = 'Program execution fell into into catch-block';
35
var sEval = 'if (true) function f(){}()';
46
//-----------------------------------------------------------------------------
48
//-----------------------------------------------------------------------------
53
statusitems[UBound] = status;
54
actualvalues[UBound] = actual;
55
expectedvalues[UBound] = expect;
63
printBugNumber(BUGNUMBER);
64
printStatus (summary);
66
for (var i = 0; i < UBound; i++)
68
reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);