Skip to content

Commit 85d168f

Browse files
committedDec 13, 2023
Remove dynamic execution from lite-mode
1 parent 893db5d commit 85d168f

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed
 

‎ReflectLite.ts

+2-10
Original file line numberDiff line numberDiff line change
@@ -571,16 +571,8 @@ namespace Reflect {
571571
};
572572
}
573573

574-
function functionThis() {
575-
try { return Function("return this;")(); } catch (_) { }
576-
}
577-
578-
function indirectEvalThis() {
579-
try { return (void 0, eval)("(function() { return this; })()"); } catch (_) { }
580-
}
581-
582-
function sloppyModeThis() {
583-
return functionThis() || indirectEvalThis();
574+
function sloppyModeThis(): never {
575+
throw new ReferenceError("globalThis could not be found. Please polyfill globalThis before loading this module.");
584576
}
585577
})
586578
(function (exporter, root) {

0 commit comments

Comments
 (0)
Please sign in to comment.