Debian Codegraph @

rhino/testsrc/tests/lc2/JavaToJS/enum-002.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 = 'enum-002.js';
7
8 /**
9 File Name: enum-002.js
10 Section: LiveConnect
11 Description:
12
13 Tests enumeration of a java object. This also does some
14 conversions.
15
16 Regression test for bug:
17
18 http://scopus.mcom.com/bugsplat/show_bug.cgi?id=107638
19
20 Author: [email protected]
21 Date: 12 november 1997
22 */
23 var SECTION = "enum-002";
24 var VERSION = "JS1_3";
25 var TITLE = "The variable statement";
26
27 startTest();
28 writeHeaderToLog( SECTION + " "+ TITLE);
29
30 var v = new java.util.Vector();
31 v.addElement("TRUE");
32
33 for (e = v.elements(), result = new Array(), i = 0 ; e.hasMoreElements();
34 i++ )
35 {
36 result[i] = (new java.lang.Boolean(e.nextElement())).booleanValue();
37 }
38
39 for ( i = 0; i < result.length; i++ ) {
40 new TestCase( SECTION,
41 "test enumeration of a java object: element at " + i,
42 "true",
43 String( result[i] ) );
44 }
45
46 test();
47