Guard browser OPFS custom session load options

This commit is contained in:
2026-06-14 02:13:05 +08:00
parent 55541fae26
commit 3c5945f42f
2 changed files with 82 additions and 14 deletions

View File

@@ -4614,6 +4614,22 @@
].join("\n");
}
function opfsCustomSessionLoadOptions(
iniSdk,
iniWasmPath,
parameterWasmPath,
toolTableWasmPath,
filenameOverrides = {},
) {
return {
iniSdk,
iniWasmPath,
...filenameOverrides,
parameterWasmPath,
toolTableWasmPath,
};
}
async function verifyOpfsSavedText(label, loadActualText, expectedLines) {
verifyExpectedOutput(label, await loadActualText(), expectedLines.join("\n"));
}
@@ -9540,12 +9556,12 @@
const loadedIniFileSession = await loadMachineSessionFromOpfs(
interp,
iniFileMachineId,
{
iniSdk: ini,
iniWasmPath: iniFileIniWasmPath,
parameterWasmPath: iniFileParameterWasmPath,
toolTableWasmPath: iniFileToolTableWasmPath,
},
opfsCustomSessionLoadOptions(
ini,
iniFileIniWasmPath,
iniFileParameterWasmPath,
iniFileToolTableWasmPath,
),
);
assertOpfsSessionStaging(
"opfs_load_ini_named_session_staging",
@@ -9668,14 +9684,16 @@
const loadedIniOverrideSession = await loadMachineSessionFromOpfs(
interp,
iniOverrideMachineId,
{
iniSdk: ini,
iniWasmPath: iniOverrideIniWasmPath,
parameterFilename: explicitParameterFilename,
parameterWasmPath: explicitParameterWasmPath,
toolTableFilename: explicitToolTableFilename,
toolTableWasmPath: explicitToolTableWasmPath,
},
opfsCustomSessionLoadOptions(
ini,
iniOverrideIniWasmPath,
explicitParameterWasmPath,
explicitToolTableWasmPath,
{
parameterFilename: explicitParameterFilename,
toolTableFilename: explicitToolTableFilename,
},
),
);
assertOpfsSessionStaging(
"opfs_load_explicit_session_staging",