Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有时候脚本刚运行出现红字,但不影响脚本判断和点击。这个问题可以忽视吗。 #298

Open
momijifox opened this issue Jan 11, 2025 · 3 comments
Labels
Accepted 🌱 受理 Maintainer may be busy resolving or fixing the labeled issues Bug 🐞 故障 Confirmed bugs or reports that are very likely to be bugs

Comments

@momijifox
Copy link

momijifox commented Jan 11, 2025

//V: 开始运行 [$cwd/test.js].
//E: null cannot be cast to non-null type org.mozilla.javascript.BaseFunction
// java.lang.NullPointerException: null cannot be cast to non-null type org.mozilla.javascript.BaseFunction
// at org.autojs.autojs.runtime.ScriptRuntime.js_object_observe_lite_min_delegate$lambda$8(ScriptRuntime.kt:420)
// at org.autojs.autojs.runtime.ScriptRuntime.$r8$lambda$kNdsxHEjPv4uuSao7pi2qSgmX2U(Unknown Source:0)
// at org.autojs.autojs.runtime.ScriptRuntime$$ExternalSyntheticLambda38.invoke(D8$$SyntheticClass:0)
// at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
// at org.autojs.autojs.runtime.ScriptRuntime.getJs_object_observe_lite_min(ScriptRuntime.kt:420)
// at org.autojs.autojs.runtime.ScriptRuntime.initEpilogue(ScriptRuntime.kt:486)
// at org.autojs.autojs.engine.RhinoJavaScriptEngine.init$lambda$11(RhinoJavaScriptEngine.kt:134)
// at org.autojs.autojs.engine.RhinoJavaScriptEngine.$r8$lambda$WwBVg_MTp1nxsGcaa3kTXE7_UQE(Unknown Source:0)
// at org.autojs.autojs.engine.RhinoJavaScriptEngine$$ExternalSyntheticLambda2.invoke(D8$$SyntheticClass:0)
// at org.autojs.autojs.util.RhinoUtils.withTimeConsuming(RhinoUtils.kt:748)
// at org.autojs.autojs.engine.RhinoJavaScriptEngine.init(RhinoJavaScriptEngine.kt:133)
// at org.autojs.autojs.engine.LoopBasedJavaScriptEngine.init(LoopBasedJavaScriptEngine.java:116)
// at org.autojs.autojs.execution.RunnableScriptExecution.prepare(RunnableScriptExecution.java:64)
// at org.autojs.autojs.execution.RunnableScriptExecution.execute(RunnableScriptExecution.java:38)
// at org.autojs.autojs.execution.RunnableScriptExecution.execute(RunnableScriptExecution.java:33)
// at org.autojs.autojs.execution.RunnableScriptExecution.run(RunnableScriptExecution.java:27)
// at java.lang.Thread.run(Thread.java:764)

@SuperMonster003
Copy link
Owner

这个问题看起来是 ScriptRuntime 没能正常加载 "object-observe-lite.min.js" 这个文件, 它是一个内部使用的内置模块.
这个模块专属于 ui 模块某些功能的 (如加载 xml 布局), 当脚本中不涉及上述功能时, 很可能不会引发相关问题.
但从整体上来看, 这是不应该出现的.
我试着修改一下内置模块的加载方式, 让这些内部模块由 Rhino 内置的 require 方法加载, 下一版本 (v6.6.2) 发布后, 如果依然出现上述问题 (或类似问题), 可以继续反馈.
此类问题通常比较隐蔽, 难以发现, 非常感谢你的本次反馈. ^_^

@SuperMonster003 SuperMonster003 added Accepted 🌱 受理 Maintainer may be busy resolving or fixing the labeled issues Bug 🐞 故障 Confirmed bugs or reports that are very likely to be bugs labels Jan 12, 2025
@momijifox

This comment was marked as duplicate.

@momijifox

This comment was marked as duplicate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted 🌱 受理 Maintainer may be busy resolving or fixing the labeled issues Bug 🐞 故障 Confirmed bugs or reports that are very likely to be bugs
Projects
None yet
Development

No branches or pull requests

2 participants