我正在开发一个交叉构建的 ScalaJs 项目,并使用 utest 编写了 ScalaJs 测试。它最初工作正常,测试用例确实编译并给出了结果,但现在我突然收到下面提到的错误。请告诉我可能出了什么问题以及如何纠正。
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
org.mozilla.javascript.JavaScriptException: scala.scalajs.runtime.UndefinedBehaviorError: An undefined behavior was detected: undefined is not an instance of java.lang.String (Lorg_scalajs_testinterface_internal_BridgeBase.sjsir#143)
at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1018)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:815)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:394)
at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3102)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
at org.scalajs.jsenv.rhino.RhinoJSEnv$$anonfun$org$scalajs$jsenv$rhino$RhinoJSEnv$$setupCom$2$$anonfun$4.apply(RhinoJSEnv.scala:341)
at org.scalajs.jsenv.rhino.RhinoJSEnv$$anonfun$org$scalajs$jsenv$rhino$RhinoJSEnv$$setupCom$2$$anonfun$4.apply(RhinoJSEnv.scala:341)
at org.scalajs.jsenv.rhino.RhinoJSEnv.loop$1(RhinoJSEnv.scala:406)
at org.scalajs.jsenv.rhino.RhinoJSEnv.org$scalajs$jsenv$rhino$RhinoJSEnv$$comEventLoop(RhinoJSEnv.scala:412)
at org.scalajs.jsenv.rhino.RhinoJSEnv$$anonfun$org$scalajs$jsenv$rhino$RhinoJSEnv$$internalRunJS$5.apply(RhinoJSEnv.scala:216)
at org.scalajs.jsenv.rhino.RhinoJSEnv$$anonfun$org$scalajs$jsenv$rhino$RhinoJSEnv$$internalRunJS$5.apply(RhinoJSEnv.scala:215)
at scala.Option.foreach(Option.scala:236)
at org.scalajs.jsenv.rhino.RhinoJSEnv.org$scalajs$jsenv$rhino$RhinoJSEnv$$internalRunJS(RhinoJSEnv.scala:215)
at org.scalajs.jsenv.rhino.RhinoJSEnv$AsyncRunner$$anon$1.run(RhinoJSEnv.scala:116)
org.scalajs.jsenv.ComJSEnv$ComClosedException: JSCom has been closed
at org.scalajs.jsenv.rhino.RhinoJSEnv$ComRunner.receive(RhinoJSEnv.scala:164)
at org.scalajs.testadapter.ComUtils$.receiveResponse(ComUtils.scala:42)
at org.scalajs.testadapter.ComUtils$.receiveLoop(ComUtils.scala:21)
at org.scalajs.testadapter.ComUtils$.receiveLoop(ComUtils.scala:16)
at org.scalajs.testadapter.ScalaJSTask.execute(ScalaJSTask.scala:61)
at sbt.TestRunner.runTest$1(TestFramework.scala:76)
at sbt.TestRunner.run(TestFramework.scala:85)
at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202)
at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202)
at sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:185)
at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202)
at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202)
at sbt.TestFunction.apply(TestFramework.scala:207)
at sbt.Tests$$anonfun$9.apply(Tests.scala:216)
at sbt.Tests$$anonfun$9.apply(Tests.scala:216)
at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44)
at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44)
at sbt.std.Transform$$anon$4.work(System.scala:63)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:228)
at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17)
at sbt.Execute.work(Execute.scala:237)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:228)
at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159)
at sbt.CompletionService$$anon$2.call(CompletionService.scala:28)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[error] Could not run test com.knoldus.DashboardClientTest: org.scalajs.jsenv.ComJSEnv$ComClosedException: JSCom has been closed