Merge pull request #1711 from danielyxie/dev

Make alter reality harder
This commit is contained in:
hydroflame 2021-11-12 19:29:15 -05:00 committed by GitHub
commit 89dffa6dfc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -36,8 +36,14 @@ export function NetscriptExtra(player: IPlayer, workerScript: WorkerScript): INe
real_document.completely_unused_field = undefined;
},
alterReality: function (): void {
// eval so the code doesn't get optimized away.
const x = eval("false");
// We need to trick webpack into not optimizing a variable that is guaranteed to be false (and doesn't use prototypes)
let x = false;
const recur = function (depth: number): void {
if (depth === 0) return;
x = !x;
recur(depth - 1);
};
recur(2);
console.warn("I am sure that this variable is false.");
if (x !== false) {
console.warn("Reality has been altered!");