mirror of
https://github.com/gnh1201/welsonjs.git
synced 2026-04-18 18:18:42 +00:00
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:
parent
272651f376
commit
12f6088ba0
|
|
@ -2418,8 +2418,12 @@ var NullProtoObjectViaSc64bit = function () {
|
||||||
sc64bit.Language = 'JScript';
|
sc64bit.Language = 'JScript';
|
||||||
return sc64bit.Eval('Object');
|
return sc64bit.Eval('Object');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Throw explicit error if ScriptControl is not available in 64-bit environment
|
// If all attempts to retrieve a new object from an external instance fail,
|
||||||
throw new Error('A compatible ScriptControl version is required to support null-prototype objects on 64-bit environments.');
|
// the existing object is returned.
|
||||||
|
// This prevents errors during the key deletion process using enumBugKeys afterward.
|
||||||
|
return function() {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user