Commit 97840ebf authored by Per Bothner's avatar Per Bothner

* AbstractScriptEngineFactory.java (addLocation): New method.

Fixes GitLab issue #71 "[javax.script] No bindings are created
in ScriptEngine's engine scope?".
parent 5bfffd4c
Pipeline #129798986 failed with stage
in 5 minutes and 43 seconds
......@@ -180,6 +180,15 @@ public abstract class AbstractScriptEngineFactory implements ScriptEngineFactory
return super.newLocation(name, property);
}
@Override
public NamedLocation addLocation(Symbol name, Object property, Location loc) {
if (ebindings instanceof KawaScriptBindings)
return ((KawaScriptBindings) ebindings).environment
.addLocation(name, property, loc);
else
return super.addLocation(name, property, loc);
}
public NamedLocation lookupDirect (Symbol name, Object property, int hash) {
NamedLocation loc = super.lookupDirect(name, property, hash);
if (loc != null && loc.isBound())
......
2020-03-25 Per Bothner <per@bothner.com>
* KawaScriptEngine.java: Give name to created Environment.
* AbstractScriptEngineFactory.java (addLocation): New method.
Fixes GitLab issue #71 "[javax.script] No bindings are created
in ScriptEngine's engine scope?".
* KawaScriptEngine.java (createBindings): Give name to new Environment.
2020-03-24 Per Bothner <per@bothner.com>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment