| 233 | NashornExecution ex = new NashornExecution(this, next.first, next.second, b, en); |
| 234 | ex.setTernSupport(ternSupport); |
| 235 | |
| 236 | return ex; |
| 237 | }, (x) -> x); |
| 238 | |
| 239 | |
| 240 | NashornExecution fork(NashornExecution from, Map<String, Object> parameters) { |
| 241 | ScriptEngine se = factory.getScriptEngine("-scripting", "--language=es6"); |
| 242 | ScriptContext context = se.getContext(); |
| 243 | |
| 244 | Bindings dest = from.context.getBindings(ScriptContext.GLOBAL_SCOPE); |
| 245 | Bindings source = from.context.getBindings(ScriptContext.GLOBAL_SCOPE); |
| 246 | |
| 247 | dest.entrySet().forEach(e -> source.put(e.getKey(), e.getValue())); |
| 248 | |
| 249 | context.setAttribute("_", from.box, ScriptContext.ENGINE_SCOPE); |
| 250 | from.box.find(Boxes.root, from.box.both()).findFirst().ifPresent(x -> context.setAttribute("__", x, ScriptContext.ENGINE_SCOPE)); |
| 251 | |
| 252 | NashornExecution ex = new NashornExecution(this, from.box, from.property, context, se); |