Esempio n. 1
0
        public static bool HasLambdasWithClosedVariables(StatementSyntax statement)
        {
            var checker = new LambdaChecker();

            statement.Accept(checker);
            return(checker.hasLambdasWithClosedVariables);
        }
Esempio n. 2
0
        public JsStatement TransformLoop(JsStatement loop)
        {
            if (loopNode.GetContainingType().Name.StartsWith("YieldEnumerator$") || loopNode.GetContainingType().Name.StartsWith("Async$"))
            {
                return(loop);
            }
            if (!LambdaChecker.HasLambdasWithClosedVariables(body))
            {
                return(loop);
            }

            var result = (JsStatement)loop.Accept(this);

            return(result);
        }