public NodeVisitor Get(JSNode node) { if (node == null) { return(null); } var nodeType = node.GetType(); var currentType = nodeType; return(Cache.GetOrCreate( nodeType, () => { while (currentType != null) { NodeVisitor result; if (Methods.TryGetValue(currentType, out result)) { return result; } currentType = currentType.BaseType; } return null; } )); }
public NodeVisitor Get(JSNode node) { if (node == null) { return(null); } var nodeType = node.GetType(); return(Cache.GetOrCreate( nodeType, FindNodeVisitor )); }