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));
        }
Exemple #2
0
        public ScriptValue Evaluate(ExecutionContext context)
        {
            var result = EvaluateWalker.Walk(node.Body, context);

            return(result.IsValue ? result.Value : ScriptValue.Undefined);
        }
Exemple #3
0
 public ScriptValue Evaluate(ExecutionContext context)
 {
     return(EvaluateWalker.Walk(node.Body, context).Value);
 }