Esempio n. 1
0
        private bool IsValidTarget(Node node)
        {
            if (node == null || node is ConstantExpression || node is NameExpression)
            {
                return(true);
            }

            var expr = node as Expression;

            if (expr != null && _expressions.ContainsKey(expr))
            {
                return(true);
            }

            var walker = new DetectSideEffectsWalker();

            node.Walk(walker);
            return(!walker.HasSideEffects);
        }
Esempio n. 2
0
        private bool IsValidTarget(Node node) {
            if (node == null || node is ConstantExpression || node is NameExpression) {
                return true;
            }

            var expr = node as Expression;
            if (expr != null && _expressions.ContainsKey(expr)) {
                return true;
            }

            var walker = new DetectSideEffectsWalker();
            node.Walk(walker);
            return !walker.HasSideEffects;
        }