diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-03 09:52:00 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-03 11:37:40 -0800 |
commit | 45fbcbb71b991335d84069b45bbcff3961c1ba15 (patch) | |
tree | 8da416d2f2e4faa66e2403301dc2d1fa50b2bcff /scalajslib | |
parent | bfd64f104a283b70ad57a66c8ac7d4dc3bda9e6f (diff) | |
download | mill-45fbcbb71b991335d84069b45bbcff3961c1ba15.tar.gz mill-45fbcbb71b991335d84069b45bbcff3961c1ba15.tar.bz2 mill-45fbcbb71b991335d84069b45bbcff3961c1ba15.zip |
fix scalalib tests
Diffstat (limited to 'scalajslib')
-rw-r--r-- | scalajslib/src/mill/scalajslib/ScalaJSBridge.scala | 5 | ||||
-rw-r--r-- | scalajslib/test/src/mill/scalajslib/HelloJSWorldTests.scala | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/scalajslib/src/mill/scalajslib/ScalaJSBridge.scala b/scalajslib/src/mill/scalajslib/ScalaJSBridge.scala index 6b471164..8152d3d1 100644 --- a/scalajslib/src/mill/scalajslib/ScalaJSBridge.scala +++ b/scalajslib/src/mill/scalajslib/ScalaJSBridge.scala @@ -20,7 +20,10 @@ class ScalaJSWorker { scalaInstanceCache match { case Some((sig, bridge)) if sig == classloaderSig => bridge case _ => - val cl = new URLClassLoader(toolsClasspath.map(_.toIO.toURI.toURL).toArray) + val cl = new URLClassLoader( + toolsClasspath.map(_.toIO.toURI.toURL).toArray, + getClass.getClassLoader + ) val bridge = cl .loadClass("mill.scalajslib.bridge.ScalaJSBridge") .getDeclaredConstructor() diff --git a/scalajslib/test/src/mill/scalajslib/HelloJSWorldTests.scala b/scalajslib/test/src/mill/scalajslib/HelloJSWorldTests.scala index 18fbc269..12102666 100644 --- a/scalajslib/test/src/mill/scalajslib/HelloJSWorldTests.scala +++ b/scalajslib/test/src/mill/scalajslib/HelloJSWorldTests.scala @@ -17,7 +17,7 @@ import scala.collection.JavaConverters._ object HelloJSWorldTests extends TestSuite { - val workspacePath = TestEvaluator.getOutPathStatic() + val workspacePath = TestUtil.getOutPathStatic() / "hello-js-world" trait HelloJSWorldModule extends ScalaJSModule with PublishModule { override def millSourcePath = workspacePath @@ -89,10 +89,11 @@ object HelloJSWorldTests extends TestSuite { } def runJS(path: Path): String = { - val engineManager = new ScriptEngineManager + val engineManager = new ScriptEngineManager(null) val engine = engineManager.getEngineByName("nashorn") val console = new Console - engine.getBindings(ScriptContext.ENGINE_SCOPE).put("console", console) + val bindings = engine.getBindings(ScriptContext.ENGINE_SCOPE) + bindings.put("console", console) engine.eval(new FileReader(path.toIO)) console.out.toString } |