Question

I'd like to use the NativeJSON class from a Rhino shell script. The only things I can find about how to use it on the Web are from Java.

// Load the configuration file
load(arguments[0]);

// Extract the configuration for the target environment
print(NativeJSON.stringify(environments[arguments[1]]));

Any clue how I'd get at it from a Rhino shell script?

Was it helpful?

Solution

The NativeJSON class is an implementation of the JSON object from ECMAScript 5, so you shouldn't need to do anything special. You can access it by calling JSON.stringify(object) or JSON.parse(jsonString).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top