Pregunta

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?

¿Fue útil?

Solución

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).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top