diff --git a/ReflectLite.ts b/ReflectLite.ts index 81f71e8..d1f0d0f 100644 --- a/ReflectLite.ts +++ b/ReflectLite.ts @@ -571,16 +571,8 @@ namespace Reflect { }; } - function functionThis() { - try { return Function("return this;")(); } catch (_) { } - } - - function indirectEvalThis() { - try { return (void 0, eval)("(function() { return this; })()"); } catch (_) { } - } - - function sloppyModeThis() { - return functionThis() || indirectEvalThis(); + function sloppyModeThis(): never { + throw new ReferenceError("globalThis could not be found. Please polyfill globalThis before loading this module."); } }) (function (exporter, root) {