-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: patch lodash to not use Function calls
- Loading branch information
1 parent
10fb856
commit 7bc2016
Showing
4 changed files
with
81 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,7 +131,8 @@ | |
}, | ||
"pnpm": { | ||
"patchedDependencies": { | ||
"[email protected]": "patches/[email protected]" | ||
"[email protected]": "patches/[email protected]", | ||
"[email protected]": "patches/[email protected]" | ||
} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/_root.js b/_root.js | ||
index 281f81280ec9ea137b644ba60b9f5c6ccede4f88..ceb914c0fa8db7d7064d2a6b79f065ec59c826e9 100644 | ||
--- a/_root.js | ||
+++ b/_root.js | ||
@@ -3,7 +3,22 @@ import freeGlobal from './_freeGlobal.js'; | ||
/** Detect free variable `self`. */ | ||
var freeSelf = typeof self == 'object' && self && self.Object === Object && self; | ||
|
||
+// From https://mathiasbynens.be/notes/globalthis#robust-polyfill | ||
+var root = freeGlobal || freeSelf || null; | ||
+if (root == null) { | ||
+ (function() { | ||
+ if (typeof globalThis === 'object') return; | ||
+ Object.defineProperty(Object.prototype, '__magic__', { | ||
+ get: function() { | ||
+ return this; | ||
+ }, | ||
+ configurable: true | ||
+ }); | ||
+ root = __magic__; | ||
+ delete Object.prototype.__magic__; | ||
+ })(); | ||
+} | ||
+ | ||
/** Used as a reference to the global object. */ | ||
-var root = freeGlobal || freeSelf || Function('return this')(); | ||
|
||
export default root; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.