Fix: Use Vars instead of plain assignments for declaration imports
This commit is contained in:
+1
-6
@@ -222,12 +222,7 @@ class IrModuleToJsTransformer(
|
||||
.forEach { declaration ->
|
||||
val declName = getNameForExternalDeclaration(declaration)
|
||||
importStatements.add(
|
||||
JsExpressionStatement(
|
||||
jsAssignment(
|
||||
declName.makeRef(),
|
||||
JsNameRef(declName, qualifiedReference)
|
||||
)
|
||||
)
|
||||
JsVars(JsVars.JsVar(declName, JsNameRef(declName, qualifiedReference)))
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -105,7 +105,7 @@ private val RESERVED_IDENTIFIERS = setOf(
|
||||
|
||||
"Error", "Object", "Number",
|
||||
|
||||
"Math", "String", "Boolean", "Date", "Array", "RegExp", "JSON",
|
||||
"Math", "String", "Boolean", "Date", "Array", "RegExp", "JSON", "Map",
|
||||
|
||||
// global identifiers usually declared in know environments (node.js, browser, require.js, WebWorkers, etc)
|
||||
"require", "define", "module", "window", "self"
|
||||
|
||||
Reference in New Issue
Block a user