public void Execute(JSFunctionMetadata funcMetadata) { if (funcMetadata.IsAnalyzed) return; if (!funcMetadata.Scope.IsEvalFunction) return; //This is not the body in an eval() _currFuncMetadata = funcMetadata; _implicitReturn = _currFuncMetadata.Scope.GetOrAddSymbol("_implicit_eval_return"); _implicitReturn.SymbolType = JSSymbol.SymbolTypes.HiddenLocal; _currBlock = null; _currStatementIndex = -1; _currExpressionStatement = null; VisitNode(_currFuncMetadata.FunctionIR.Statement); _currFuncMetadata.FunctionIR.Statement.Statements.Add( new ReturnStatement( new ReadIdentifierExpression(_implicitReturn) ) ); }
public override void Visit(ExpressionStatement node) { var stackState = _localVars.GetTemporaryStackState(); base.Visit(node); _localVars.PopTemporariesAfter(stackState); }
public override void Visit(ExpressionStatement node) { VisitNode(node.Expression); Visit((Statement)node); }
public override void Visit(ExpressionStatement node) { PushLocation(node); VisitNode(node.Expression); AsVoid(); PopLocation(); }
public override void Visit(ExpressionStatement node) { Debug.Assert(_currExpressionStatement == null, "Invalid situation"); _currExpressionStatement = node; VisitNode(node.Expression); _currExpressionStatement = null; }