Source:
private void processExternSymbols() { Set<String> noTransitiveProvides = Collections.emptySet(); LinkedHashSet<String> visitedNamespaces = new LinkedHashSet<>(); LinkedHashSet<String> visitedClassLikes = new LinkedHashSet<>(); List<TypedVar> externSymbols = new ArrayList<>(); Set<String> externSymbolNames = new TreeSet<>(); for (TypedVar symbol : compiler.getTopScope().getAllSymbols()) { CompilerInput symbolInput = compiler.getInput(new InputId(symbol.getInputName())); if (symbolInput == null || !symbolInput.isExtern() || symbol.getType() == null) { continue; } if (isPlatformExtern(symbolInput.getName())) { continue; } if (symbol.getName().contains(".prototype")) continue; if (symbol.getType().isUnknownType()) continue; externSymbols.add(symbol); externSymbolNames.add(symbol.getName()); } Set<String> shadowedSymbols = getShadowedProvides(externSymbolNames); for (TypedVar symbol : externSymbols) { String parentPath = getNamespace(symbol.getName()); boolean isDefault = isDefaultExport(symbol); String emitName = symbol.getName() + (needsAlias(shadowedSymbols, symbol.getName(), symbol) ? Constants.SYMBOL_ALIAS_POSTFIX : ""); if (visitedNamespaces.contains(parentPath)) { if (isDefault && isClassLike(symbol.getType())) visitedClassLikes.add(symbol.getName()); continue; } if (isStaticFieldOrMethod(symbol.getType()) && visitedClassLikes.contains(parentPath)) continue; if (visitedClassLikes.contains(getNamespace(parentPath))) continue; declareNamespace(isDefault ? parentPath : symbol.getName(), symbol, emitName, isDefault, noTransitiveProvides, true); if (!isDefault && isLikelyNamespace(symbol.getType())) visitedNamespaces.add(symbol.getName()); if (isDefault && isClassLike(symbol.getType())) visitedClassLikes.add(symbol.getName()); } }

Target:
private void processExternSymbols() { Set<String> noTransitiveProvides = Collections.emptySet(); Set<String> visitedNamespaces = new TreeSet<>(); Set<String> visitedClassLikes = new TreeSet<>(); List<TypedVar> externSymbols = new ArrayList<>(); TreeSet<String> externSymbolNames = new TreeSet<>(); for (TypedVar symbol : compiler.getTopScope().getAllSymbols()) { CompilerInput symbolInput = compiler.getInput(new InputId(symbol.getInputName())); if (symbolInput == null || !symbolInput.isExtern() || symbol.getType() == null) { continue; } if (isPlatformExtern(symbolInput.getName())) { continue; } if (symbol.getName().contains(".prototype")) continue; if (symbol.getType().isUnknownType()) continue; externSymbols.add(symbol); externSymbolNames.add(symbol.getName()); } Set<String> shadowedSymbols = getShadowedProvides(externSymbolNames); for (TypedVar symbol : externSymbols) { String parentPath = getNamespace(symbol.getName()); boolean isDefault = isDefaultExport(symbol); String emitName = symbol.getName(); if (needsAlias(shadowedSymbols, symbol.getName(), symbol)) { emitName += Constants.SYMBOL_ALIAS_POSTFIX; } if (visitedNamespaces.contains(parentPath)) { if (isDefault && isClassLike(symbol.getType())) visitedClassLikes.add(symbol.getName()); continue; } if (isStaticFieldOrMethod(symbol.getType()) && visitedClassLikes.contains(parentPath)) continue; if (visitedClassLikes.contains(getNamespace(parentPath))) continue; declareNamespace(isDefault ? parentPath : symbol.getName(), symbol, emitName, isDefault, noTransitiveProvides, true); if (!isDefault && isLikelyNamespace(symbol.getType())) visitedNamespaces.add(symbol.getName()); if (isDefault && isClassLike(symbol.getType())) visitedClassLikes.add(symbol.getName()); } }