参考所有分组,完成尽量多的内容:结论为 native 守住 OPFS 选项不透传

This commit is contained in:
cnc
2026-06-04 05:27:46 +08:00
parent 2223e6d601
commit 81c7b061a8

View File

@@ -209,7 +209,21 @@ grep -F 'fiveaxisKinematicsType: options.fiveaxisKinematicsType' web/src/wasm-co
grep -F 'fiveaxis_kinematics_type: options.fiveaxis_kinematics_type' web/src/wasm-core.js >/dev/null
grep -F 'xyzbcTrt: options.xyzbcTrt' web/src/wasm-core.js >/dev/null
grep -F 'globalThis.createCncSimModule' web/src/wasm-core.js >/dev/null
grep -F 'createModule(moduleOptions)' web/src/wasm-core.js >/dev/null
grep -F 'const hasOpfsOptions = Object.prototype.hasOwnProperty.call(moduleOptions, "opfs");' web/src/wasm-core.js >/dev/null
grep -F 'const emscriptenModuleOptions = hasOpfsOptions' web/src/wasm-core.js >/dev/null
grep -F '? (({ opfs: _opfs, ...rest }) => rest)(moduleOptions)' web/src/wasm-core.js >/dev/null
grep -F 'const module = hasOpfsOptions ? await createModule(emscriptenModuleOptions) : await createModule(moduleOptions);' web/src/wasm-core.js >/dev/null
grep -F 'const opfs = installOpfsWorkspace(module, moduleOptions);' web/src/wasm-core.js >/dev/null
if ! awk '
index($0, "const hasOpfsOptions = Object.prototype.hasOwnProperty.call(moduleOptions, \"opfs\");") { has_line = NR }
index($0, "const emscriptenModuleOptions = hasOpfsOptions") { stripped_line = NR }
index($0, "await createModule(emscriptenModuleOptions)") { create_line = NR }
index($0, "const opfs = installOpfsWorkspace(module, moduleOptions);") { opfs_line = NR }
END { exit !(has_line && stripped_line && create_line && opfs_line && has_line < stripped_line && stripped_line < create_line && create_line < opfs_line) }
' web/src/wasm-core.js; then
echo "wasm-core must strip OPFS options before creating the Emscripten module and install OPFS from the original options" >&2
exit 1
fi
grep -F 'async parseFile(path, dialect = "linuxcnc", options = {})' web/src/wasm-core.js >/dev/null
grep -F 'async parseWithParameterFile(program, parameterPath, dialect = "linuxcnc", options = {})' web/src/wasm-core.js >/dev/null
grep -F 'async parseFileWithParameterFile(path, parameterPath, dialect = "linuxcnc", options = {})' web/src/wasm-core.js >/dev/null