Clone JSTypeExpression during PolymerPass to avoid sharing types among nodes
Tested that this fixes some crashes seen when moving the Polymer pass before module & goog.scope rewriting, but I'm not sure how to add a unit test for it.
@@ -219,7 +219,7 @@ final class PolymerPassStaticUtils {
static JSTypeExpression getTypeFromProperty(
MemberDefinition property, AbstractCompiler compiler) {
if (property.info != null && property.info.hasType()) {
- return property.info.getType();
+ return property.info.getType().copy();
}
Node typeValue;
