diff --git a/core/src/main/java/org/teavm/backend/javascript/codegen/MinifyingAliasProvider.java b/core/src/main/java/org/teavm/backend/javascript/codegen/MinifyingAliasProvider.java index 32bd6f989..2accfdf91 100644 --- a/core/src/main/java/org/teavm/backend/javascript/codegen/MinifyingAliasProvider.java +++ b/core/src/main/java/org/teavm/backend/javascript/codegen/MinifyingAliasProvider.java @@ -49,7 +49,11 @@ public class MinifyingAliasProvider implements AliasProvider { @Override public String getStaticMethodAlias(MethodReference method) { - return RenderingUtil.indexToId(lastSuffix++, startLetters); + String result; + do { + result = RenderingUtil.indexToId(lastSuffix++, startLetters); + } while (!usedAliases.add(result) || RenderingUtil.KEYWORDS.contains(result)); + return result; } @Override