Ejemplo n.º 1
0
 public Completion ExecuteExpressionStatement(ExpressionStatement expressionStatement)
 {
     var exprRef = _engine.EvaluateExpression(expressionStatement.Expression);
     return new Completion(Completion.Normal, _engine.GetValue(exprRef), null);
 }
Ejemplo n.º 2
0
        private void EmitExpressionStatement(ExpressionStatement s)
        {
            using (var ec = new ExpressionContext(this, OperatorInfo.Body))
            {
                if (s.Expression is CallExpression)
                {
                    var call = s.Expression as CallExpression;
                    if (call.Callee is FunctionExpression)
                    {
                        // group around function expression (function(){}());
                        ec.BeginGroup();
                    }
                }

                Emit(s.Expression);
            }

            Write(";");
        }