Debian Codegraph @

rhino/testsrc/tests/ecma_2/Exceptions/statement-006.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 = 'statement-006.js';
7
8 /**
9 File Name: statement-006.js
10 Corresponds To: 12.6.3-9-n.js
11 ECMA Section: 12.6.3 The for...in Statement
12 Description:
13
14 Author: [email protected]
15 Date: 11 september 1997
16 */
17 var SECTION = "statement-006";
18 var VERSION = "JS1_4";
19 var TITLE = "The for..in statement";
20
21 startTest();
22 writeHeaderToLog( SECTION + " "+ TITLE);
23
24 var result = "Failed";
25 var exception = "No exception thrown";
26 var expect = "Passed";
27
28 try {
29 var o = new MyObject();
30 var result = 0;
31 for ( var o in foo) {
32 result += this[o];
33 }
34 } catch ( e ) {
35 result = expect;
36 exception = e.toString();
37 }
38
39 new TestCase(
40 SECTION,
41 "object is not defined" +
42 " (threw " + exception +")",
43 expect,
44 result );
45
46 test();
47
48 function MyObject() {
49 this.value = 2;
50 this[0] = 4;
51 return this;
52 }