godotjs / godotjs/javascript

Two issues with Worker demo

未关闭
#12 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug investigation
主要语言
C++
星标
1.1k
派生
80
PR 合并指标
30 天内没有已合并 PR

描述

1) `fib.js` [default export](https://github.com/Geequlim/ECMAScriptDemos/blob/ca86889abfcd5518ed49b8f3eacf9fc4cefd91d4/worker/fib.js#L1) is `fib` function and not a godot class, so every time the file is loaded i get an error message "modules/ECMAScript/ecmascript.cpp:92 - JavaScript Error". Is this how it is supposed to be right now (work in progress)? So for now to avoid this message on every save one should export some empty class inheriting `godot.Object`?

2) This one is less straightforward. When i press "Calculate in Worker" the playing scene just exits without any error ("Calculate in Main Thread" works fine). I tested different things and it seems like there is a stack overflow in worker thread on my machine when [`N`](https://github.com/Geequlim/ECMAScriptDemos/blob/ca86889abfcd5518ed49b8f3eacf9fc4cefd91d4/worker/Control.js#L3) is higher than 26. Even when `fib` is a simple function as `(n) => n < 2 ? n : fib( n - 1 )`. With 26 or lower worker is fine. Any clues what this might be caused by? What is the maximum N on your machine if you use the provided simple function?

贡献指南

打开贡献指南

调研方向

先在 worker 演示中复现这两份报告,然后阅读 worker/fib.js 和 worker/Control.js,尤其要查看 default export 以及 worker 计算所使用的 N 值。当重复出现的 JavaScript 错误和 worker 触发的场景退出都得到解释和修正,并且 Calculate in Main Thread 和 Calculate in Worker 路径仍按预期运行时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript
领域
game-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。