diff --git a/js/js.tests/test/org/jetbrains/k2js/test/rhino/RhinoUtils.java b/js/js.tests/test/org/jetbrains/k2js/test/rhino/RhinoUtils.java index 6287ff58b45..9ded7daf6fb 100644 --- a/js/js.tests/test/org/jetbrains/k2js/test/rhino/RhinoUtils.java +++ b/js/js.tests/test/org/jetbrains/k2js/test/rhino/RhinoUtils.java @@ -164,12 +164,17 @@ public final class RhinoUtils { versionToScope.put(version, parentScope); } else { - // reset declared modules NativeObject kotlin = (NativeObject) parentScope.get("Kotlin"); + assert kotlin != null; NativeObject modules = (NativeObject) kotlin.get("modules"); + assert modules != null; + String stdlibModuleName = "kotlin_lib_compiled"; + NativeObject stdlibModule = (NativeObject) modules.get(stdlibModuleName); - modules.setAttributes("JS_TESTS", 0); - modules.remove("JS_TESTS"); + NativeObject newModules = new NativeObject(); + newModules.put(stdlibModuleName, newModules, stdlibModule); + + kotlin.put("modules", kotlin, newModules); } return parentScope; }