fix residual globals mapping

This commit is contained in:
Renaud Pawlak 2020-06-03 16:43:41 +02:00
parent f1a4036fa8
commit 1b4948e625
3 changed files with 9 additions and 1 deletions

View File

@ -1051,6 +1051,13 @@ public class JSweetContext extends Context {
globalsMapping.put(from, to);
}
/**
* Clear globals mappings.
*/
public void clearGlobalsMappings() {
globalsMapping.clear();;
}
/**
* Returns the TypeScript string for globals mapping.
*/

View File

@ -1052,6 +1052,7 @@ public class JSweetTranspiler implements JSweetOptions {
logger.info("created " + outputFilePath);
} finally {
context.clearHeaders();
context.clearGlobalsMappings();
context.clearFooterStatements();
}

View File

@ -5783,7 +5783,7 @@ public class Java2TypeScriptTranslator extends AbstractTreePrinter {
print(exprStr, expr);
if (checkFirstArrayElement)
print("[0]");
print(").length == " + context.getFunctionalTypeParameterCount(type));
print(").length === " + context.getFunctionalTypeParameterCount(type));
}
} else {
print(exprStr, expr);