How do I create a JavaScript string object in Java?

I thought I might be able to do something like this

ScriptableObject str = new NativeString("foo");

but the NativeString class is not available outside the
org.mozilla.javascript.rhino package.

The reason I want to do this is I would then like to add some
properties to that String object like so

str.defineProperty("prop", "val", 0);

and then pass the str object into some JavaScript code.

Thanks,
Peter
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to