MISC: Protect against reassigning certain globals (#972)

This commit is contained in:
Snarling
2023-12-16 05:03:52 -05:00
committed by GitHub
parent da1b8533e0
commit 97d679bdac
6 changed files with 15 additions and 4 deletions
+9
View File
@@ -0,0 +1,9 @@
// This file is imported for side effects only.
/* Prevent inadvertantly redefining certain window properties,
which are known to cause unrecoverable game errors when redefined.
The player is able to redefine these properties as writable if desired. */
Object.defineProperties(window, {
Number: { writable: false },
Object: { writable: false },
String: { writable: false },
});