コード例 #1
0
ファイル: ProgramFactory.cs プロジェクト: RomanHuryk/RandomJS
 internal ReturnStatement GenReturnStatement(IScope scope, Expression expr = null)
 {
     expr = expr ?? GenExpression(scope, 0);
     if (!(expr is Literal))
     {
         expr = new NonEmptyExpression(expr, GenLiteral(scope));
     }
     return(new ReturnStatement(scope, expr, _depthProtection));
 }
コード例 #2
0
ファイル: ProgramFactory.cs プロジェクト: tevador/RandomJS
        internal Expression GenSafeReturnExpression(IScope scope)
        {
            var expr = GenExpression(scope, 0, ExpressionType.VariableExpression | ExpressionType.Literal);

            if (!(expr is Literal))
            {
                expr = new NonEmptyExpression(expr, GenLiteral(scope));
            }
            return(expr);
        }