Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BuildGlobalNamespace will not create duplicate Refs
Previously it was up to the caller of scanNewNodes() to avoid passing BuildGlobalNamespace nodes that might already have references. This has led to exceptions being thrown because multiple references were created for the same Node. This change makes BuildGlobalNamespace and the Name class it depends on smart enough to avoid creation of additional Refs for the same Node even when scanNewNodes() is passed AST nodes that already have Refs. Effectively this means that code modifying the AST can safely pass any Nodes they think may need reconsideration to the scanNewNodes() method and rely on BuildGlobalNamespace to do the right thing. On the other hand, I've added several checks to restrict changing a Ref's Node. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=233448314
- Loading branch information