views:

222

answers:

1

Hi there, to execute JavaScript in Rhino one has to create an execution context for the script. The constructor of the Context class uses the JavaScript compliance level VERSION_DEFAULT.

protected Context(ContextFactory factory) {
    if(factory == null) {
        throw new IllegalArgumentException("factory == null");
    }
    this.factory = factory;
    **setLanguageVersion(VERSION_DEFAULT);**
    optimizationLevel = codegenClass != null ? 0 : -1;
    maximumInterpreterStackDepth = Integer.MAX_VALUE;
}

As I cannot find a mapping of VERSION_DEFAULT to any of the actual VERSION_XXX constants in the API, I'm wondering which JavaScript compliance level VERSION_DEFAULT is. The release note of Rhino 1.7R1 (*ttps://developer.mozilla.org/en/New_in_Rhino_1.7R1) states that one has to specify the JavaScript version explicitly, but it does not mention which version is used when Context.setLanguageVersion() is omitted.

A: 
jamie mccrindle