Вопрос

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?

Это было полезно?

Решение

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top