Debian Codegraph @

rhino/testsrc/tests/ecma_2/Exceptions/exception-005.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 gTestfile = 'exception-005.js';
7
8 /**
9 * File Name: exception-005
10 * ECMA Section:
11 * Description: Tests for JavaScript Standard Exceptions
12 *
13 * ToObject error.
14 *
15 * Author: [email protected]
16 * Date: 31 August 1998
17 */
18 var SECTION = "exception-005";
19 var VERSION = "js1_4";
20 var TITLE = "Tests for JavaScript Standard Exceptions: ToObjectError";
21
22 startTest();
23 writeHeaderToLog( SECTION + " "+ TITLE);
24
25 ToObject_1();
26
27 test();
28
29 function ToObject_1() {
30 result = "failed: no exception thrown";
31 exception = null;
32
33 try {
34 result = foo["bar"];
35 } catch ( e ) {
36 result = "passed: threw exception",
37 exception = e.toString();
38 } finally {
39 new TestCase(
40 SECTION,
41 "foo[\"bar\"] [ exception is " + exception +" ]",
42 "passed: threw exception",
43 result );
44 }
45 }
46