From 9ac193407b2ab7160f76b6e92e34293fe7053399 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Thu, 2 Oct 2014 13:26:43 +0400 Subject: [PATCH] Fixed JS test runner: save only stdlib module from run to run. --- .../org/jetbrains/k2js/test/rhino/RhinoUtils.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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; }