public ScriptValue Run(ExecutionContext executionContext) { if (code is BlockStatementNode block) { EvaluateWalker.Walk(block.Body, executionContext); return(ScriptValue.Undefined); } var expressionReference = EvaluateWalker.Walk(code, executionContext); return(executionContext.Realm.Agent.GetValue(expressionReference)); }
public ScriptValue Evaluate(ExecutionContext context) { return(EvaluateWalker.Walk(node.Body, context).Value); }
public ScriptValue Evaluate(ExecutionContext context) { var result = EvaluateWalker.Walk(node.Body, context); return(result.IsValue ? result.Value : ScriptValue.Undefined); }
private static ScriptValue Pow([NotNull] ScriptArguments arg) { //https://tc39.github.io/ecma262/#sec-math.pow return(EvaluateWalker.Exponentiation(arg[0], arg[1], arg.Agent)); }