public Object eval(JSProgram eval, boolean direct) { try { ExecutionContext evalContext = createEvalExecutionContext(eval, direct); ThreadContextManager.pushContext(evalContext); Completion result = eval.execute(evalContext); return result.value; } finally { ThreadContextManager.popContext(); } }
public Completion execute(JSProgram program) { try { ThreadContextManager.pushContext(this); setStrict(program.isStrict()); this.fileName = program.getFileName(); performDeclarationBindingInstantiation(program); try { return program.execute(this); } catch (ThrowException e) { throw e; } catch (Throwable t) { throw new ThrowException(this, t); } } finally { ThreadContextManager.popContext(); } }