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 114493
10
* See http://bugzilla.mozilla.org/show_bug.cgi?id=114493
12
* Rhino crashed on this code. It should produce a syntax error, not a crash.
13
* Note that "3"[5] === undefined, and Rhino correctly gave an error if you
14
* tried to use the call operator on |undefined|:
17
* js: TypeError: undefined is not a function.
19
* However, Rhino CRASHED if you tried to do "3"[5]().
21
* Rhino would NOT crash if you tried "3"[0]() or "3"[5]. Only array indices
22
* that were out of bounds, followed by the call operator, would crash.
25
//-----------------------------------------------------------------------------
27
var BUGNUMBER = 114493;
28
var summary = 'Regression test for bug 114493';
32
var actualvalues = [];
34
var expectedvalues = [];
38
status = inSection(1);
39
actual = 'Program execution did NOT fall into catch-block';
40
expect = 'Program execution fell into into catch-block';
54
//-----------------------------------------------------------------------------
56
//-----------------------------------------------------------------------------
61
statusitems[UBound] = status;
62
actualvalues[UBound] = actual;
63
expectedvalues[UBound] = expect;
71
printBugNumber(BUGNUMBER);
72
printStatus (summary);
74
for (var i = 0; i < UBound; i++)
76
reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);