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); }
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; }