JS: collect label definitions, not some of their usages
This commit is contained in:
@@ -106,9 +106,9 @@ fun collectDefinedNames(scope: JsNode): Set<JsName> {
|
||||
super.visitExpressionStatement(x)
|
||||
}
|
||||
|
||||
override fun visitBreak(x: JsBreak) {
|
||||
x.label?.name?.let { names += it }
|
||||
super.visitBreak(x)
|
||||
override fun visitLabel(x: JsLabel) {
|
||||
x.name?.let { names += it }
|
||||
super.visitLabel(x)
|
||||
}
|
||||
|
||||
override fun visitCatch(x: JsCatch) {
|
||||
@@ -141,9 +141,9 @@ fun collectDefinedNamesInAllScopes(scope: JsNode): Set<JsName> {
|
||||
x.name?.let { names += it }
|
||||
}
|
||||
|
||||
override fun visitBreak(x: JsBreak) {
|
||||
x.label?.name?.let { names += it }
|
||||
super.visitBreak(x)
|
||||
override fun visitLabel(x: JsLabel) {
|
||||
x.name?.let { names += it }
|
||||
super.visitLabel(x)
|
||||
}
|
||||
|
||||
override fun visitCatch(x: JsCatch) {
|
||||
|
||||
@@ -337,6 +337,7 @@ public final class Translation {
|
||||
|
||||
JsProgramFragment fragment = staticContext.getFragment();
|
||||
for (String tag : staticContext.getInlineFunctionTags()) {
|
||||
assert !inlineFunctionTagMap.containsKey(tag) : "Duplicate inline function tag found: '" + tag + "'";
|
||||
inlineFunctionTagMap.put(tag, unit);
|
||||
}
|
||||
NormalizeImportTagsKt.normalizeImportTags(fragment);
|
||||
@@ -349,6 +350,7 @@ public final class Translation {
|
||||
byte[] headerData = ((TranslationUnit.BinaryAst) unit).getHeader();
|
||||
JsAstProtoBuf.Header h = JsAstProtoBuf.Header.parseFrom(CodedInputStream.newInstance(headerData));
|
||||
for (String tag : h.getInlineFunctionTagsList()) {
|
||||
assert !inlineFunctionTagMap.containsKey(tag) : "Duplicate inline function tag found: '" + tag + "'";
|
||||
inlineFunctionTagMap.put(tag, unit);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user