in Rhino, can I enumerate the list of available Java packages? How?

craigwhale

New Member
I tried doing this:\[code\]var r = {};for (p in Packages) { if (Packages.hasOwnProperty(p)) { r[p] = p.toString(); }}\[/code\]...But I got an error: \[quote\] TypeError: Invalid iterator value ... at line xx \[/quote\]The line indicated in the error message is the one with \[code\]for (p in Packages) { ... } \[/code\]Also, \[code\]var r = { "Packages" : typeof Packages, "Packages.length" : typeof Packages.length, "Packages.java" : typeof Packages.java, "Packages.surelyThisIsNotDefined" : typeof Packages.surelyThisIsNotDefined};\[/code\]results in: \[code\]{ "Packages": "object", "Packages.length": "object", "Packages.java": "object", "Packages.surelyThisIsNotDefined": "object"}\[/code\]...which is no help at all.
 
Back
Top