Skip to content

Commit 96b7faf

Browse files
committed
Fix JS compilation
1 parent 87e0e22 commit 96b7faf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

utbot-js/src/main/kotlin/framework/codegen/model/constructor/tree/JsCgStatementConstructor.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class JsCgStatementConstructor(context: CgContext) :
9595
isMutable = isMutableVar
9696
}
9797

98-
updateVariableScope(declaration.variable, model)
98+
rememberVariableForModel(declaration.variable, model)
9999

100100
return Either.left(declaration)
101101
}
@@ -275,7 +275,7 @@ class JsCgStatementConstructor(context: CgContext) :
275275

276276
override fun declareVariable(type: ClassId, name: String): CgVariable =
277277
CgVariable(name, type).also {
278-
updateVariableScope(it)
278+
rememberVariableForModel(it)
279279
}
280280

281281
// TODO SEVERE: think about these 2 functions

utbot-js/src/main/kotlin/framework/codegen/model/constructor/tree/JsCgVariableConstructor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class JsCgVariableConstructor(ctx: CgContext) : CgVariableConstructor(ctx) {
102102
): Pair<CgVariable, CgDeclaration> {
103103
val declaration = CgDeclaration(variableType, baseVariableName.toVarName(), initializer.resolve())
104104
val variable = declaration.variable
105-
updateVariableScope(variable)
105+
rememberVariableForModel(variable)
106106
return variable to declaration
107107
}
108108

0 commit comments

Comments
 (0)