Handle ScriptControl failures gracefully

Replace the explicit error throw when ScriptControl-based object creation fails with a safe fallback factory that returns an empty object. This prevents runtime errors in 64-bit environments and during subsequent enumBugKeys cleanup by returning a benign constructor instead of throwing.
This commit is contained in:
Namhyeon, Go 2026-04-18 12:20:49 +09:00
parent 272651f376
commit 12f6088ba0

View File

@ -2418,8 +2418,12 @@ var NullProtoObjectViaSc64bit = function () {
sc64bit.Language = 'JScript';
return sc64bit.Eval('Object');
} catch (error) {
// Throw explicit error if ScriptControl is not available in 64-bit environment
throw new Error('A compatible ScriptControl version is required to support null-prototype objects on 64-bit environments.');
// If all attempts to retrieve a new object from an external instance fail,
// the existing object is returned.
// This prevents errors during the key deletion process using enumBugKeys afterward.
return function() {
return {};
}
}
}