Debian Codegraph @

rhino/testsrc/tests/lc2/Objects/object-003.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 = 'object-003.js';
7
8 /**
9 File Name: object-003.js
10 Description:
11
12 Getting and Setting Java Object properties by index value.
13
14 @author [email protected]
15 @version 1.00
16 */
17 var SECTION = "LiveConnect Objects";
18 var VERSION = "1_3";
19 var TITLE = "Getting and setting JavaObject properties by index value";
20
21 startTest();
22 writeHeaderToLog( SECTION + " "+ TITLE);
23
24 var vector = new java.util.Vector();
25
26 new TestCase(
27 SECTION,
28 "var vector = new java.util.Vector(); vector.addElement(\"hi\")",
29 void 0,
30 vector.addElement("hi") );
31
32 test();
33
34
35 function EnumerateJavaObject( javaobject ) {
36 var properties = new Array();
37 for ( var p in javaobject ) {
38 properties[properties.length] = new Property( p, javaobject[p] );
39 }
40 return properties;
41 }
42 function Property( name, value ) {
43 this.name = name;
44 this.value = value;
45 }
46