Pergunta

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?

Foi útil?

Solução

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 em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top