Guard browser OPFS invalid INI lines helper

This commit is contained in:
2026-06-14 01:03:55 +08:00
parent f1106c4328
commit 7117bdc890
2 changed files with 65 additions and 14 deletions

View File

@@ -4642,6 +4642,17 @@
);
}
function opfsInvalidIniLines(machineId, section, assignment) {
return [
"[EMC]",
`MACHINE = ${machineId}`,
"",
`[${section}]`,
assignment,
"",
];
}
function assertSimConfigStagingPlan(machineRel, plan, expectedWasmDir) {
if (plan.wasmDir !== expectedWasmDir) {
throw new Error(`${machineRel}: browser sim staging root drift`);
@@ -9775,14 +9786,11 @@
interp,
ini,
"browser-invalid-param-file-session",
[
"[EMC]",
"MACHINE = browser-invalid-param-file-session",
"",
"[RS274NGC]",
opfsInvalidIniLines(
"browser-invalid-param-file-session",
"RS274NGC",
"PARAMETER_FILE = ../escape.var",
"",
],
),
/Invalid parameter filename/,
);
@@ -9791,14 +9799,11 @@
interp,
ini,
"browser-invalid-tool-file-session",
[
"[EMC]",
"MACHINE = browser-invalid-tool-file-session",
"",
"[EMCIO]",
opfsInvalidIniLines(
"browser-invalid-tool-file-session",
"EMCIO",
"TOOL_TABLE = nested/tool.tbl",
"",
],
),
/Invalid tool table filename/,
);