Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
node-lodash
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Debian JavaScript Maintainers
node-lodash
Commits
c84584b6
Commit
c84584b6
authored
5 years ago
by
Yadd
Browse files
Options
Downloads
Patches
Plain Diff
Fix deprecation warning about "root"
Closes: #935845
parent
679bd40d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
debian/patches/series
+1
-0
1 addition, 0 deletions
debian/patches/series
debian/patches/support-globalThis.diff
+73
-0
73 additions, 0 deletions
debian/patches/support-globalThis.diff
with
74 additions
and
0 deletions
debian/patches/series
0 → 100644
+
1
−
0
View file @
c84584b6
support-globalThis.diff
This diff is collapsed.
Click to expand it.
debian/patches/support-globalThis.diff
0 → 100644
+
73
−
0
View file @
c84584b6
Description: Add support for globalThis when detecting global object
Inspired from https://github.com/lodash/lodash/pull/4347/files
Author: Xavier Guimard <yadd@debian.org>
Bug-Debian: https://bugs.debian.org/935845
Forwarded: not-needed
Last-Update: 2020-01-30
--- a/dist/lodash.core.js
+++ b/dist/lodash.core.js
@@ -64,11 +64,14 @@
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
+ /** Detect free variable `globalThis` */
+ const freeGlobalThis = typeof globalThis == 'object' && globalThis !== null && globalThis.Object == Object && globalThis;
+
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
+ var root = freeGlobalThis || freeGlobal || freeSelf || Function('return this')();
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
--- a/dist/lodash.js
+++ b/dist/lodash.js
@@ -418,8 +418,11 @@
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
+ /** Detect free variable `globalThis` */
+ const freeGlobalThis = typeof globalThis == 'object' && globalThis !== null && globalThis.Object == Object && globalThis;
+
/** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
+ var root = freeGlobalThis || freeGlobal || freeSelf || Function('return this')();
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
--- a/lodash-cli/bin/lodash
+++ b/lodash-cli/bin/lodash
@@ -727,9 +727,11 @@
'',
" var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;",
'',
+ " var freeGlobalThis = typeof globalThis == 'object' && globalThis !== null && globalThis.Object == Object && globalThis;",
+ '',
" var freeSelf = typeof self == 'object' && self && self.Object === Object && self;",
'',
- " var root = freeGlobal || freeSelf || Function('return this')();",
+ " var root = freeGlobalThis || freeGlobal || freeSelf || Function('return this')();",
'',
" var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;",
'',
--- a/lodash.js
+++ b/lodash.js
@@ -415,11 +415,14 @@
/** Detect free variable `global` from Node.js. */
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
+ /** Detect free variable `globalThis` */
+ const freeGlobalThis = typeof globalThis == 'object' && globalThis !== null && globalThis.Object == Object && globalThis;
+
/** Detect free variable `self`. */
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
/** Used as a reference to the global object. */
- var root = freeGlobal || freeSelf || Function('return this')();
+ var root = freeGlobalThis || freeGlobal || freeSelf || Function('return this')();
/** Detect free variable `exports`. */
var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment