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(); } }
public Object internalCall( Object functionReference, JSFunction function, Object self, Object... args) { // 13.2.1 try { ExecutionContext fnContext = createFunctionExecutionContext(functionReference, function, self, args); ThreadContextManager.pushContext(fnContext); try { Object value = function.call(fnContext); if (value == null) { return Types.NULL; } return value; } catch (ThrowException e) { throw e; } catch (Throwable e) { throw new ThrowException(fnContext, e); } } finally { ThreadContextManager.popContext(); } }