We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2c686fd commit 233d4f8Copy full SHA for 233d4f8
src/node.js
@@ -159,8 +159,17 @@
159
startup.globalVariables = function() {
160
global.process = process;
161
global.global = global;
162
- global.GLOBAL = global;
163
- global.root = global;
+
+ // Deprecate GLOBAL and root
164
+ const holders = {GLOBAL: global, root: global};
165
+ ['GLOBAL', 'root'].forEach(function (name) {
166
+ const access = NativeModule.require('util').deprecate(function(val) {
167
+ if (val) holders[name] = val;
168
+ return holders[name];
169
+ }, "'" + name + "' is deprecated, use 'global'");
170
+ Object.defineProperty(global, name, {get: access, set: access});
171
+ });
172
173
global.Buffer = NativeModule.require('buffer').Buffer;
174
process.domain = null;
175
process._exiting = false;
0 commit comments