You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 29, 2026. It is now read-only.
描述
将作品上传到 小码王、稽木世界 时,报错 “加载作品文件失败。”
bug在哪
经过排查,发现是旧版 scratch-parser 的bug导致的。
这会导致
"\\b"变成"\",导致作品加载失败。受该bug影响的 scratch-parser 版本
v4.3.5 ~ v5.1.0
修复该bug的 scratch-parser 版本
v5.1.1
Pull Request
scratchfoundation/scratch-parser#62
BeetJSON为何触发该bug
列表
BeetJSON⚠️internal⛔.CONST.encode_ascii_control_char.value包含\b。怎么避免触发该bug
项目内的
\后面不能紧跟着b或u0008。解决方案
更改 v1.2.0 版本的代码,将该列表的所有项去掉开头的
\,例如\b改成b。当自制积木
BeetJSON⚠️internal⛔.stringify.string字符串化 ASCII 控制符的时候,在BeetJSON⚠️internal⛔.CONST.encode_ascii_control_char.value的值的前面连接\,以此保证上述更改不影响结果。计划发布 v1.2.2 版本。
本文不使用AI,排查bug的过程不使用AI。