Skip to content

Commit

Permalink
lib: remove variables root and GLOBAL
Browse files Browse the repository at this point in the history
The `root` and `GLOBAL` never be documented.
  • Loading branch information
JacksonTian committed May 30, 2015
1 parent 2c686fd commit 233d4f8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,17 @@
startup.globalVariables = function() {
global.process = process;
global.global = global;
global.GLOBAL = global;
global.root = global;

// Deprecate GLOBAL and root
const holders = {GLOBAL: global, root: global};
['GLOBAL', 'root'].forEach(function (name) {
const access = NativeModule.require('util').deprecate(function(val) {
if (val) holders[name] = val;
return holders[name];
}, "'" + name + "' is deprecated, use 'global'");
Object.defineProperty(global, name, {get: access, set: access});
});

global.Buffer = NativeModule.require('buffer').Buffer;
process.domain = null;
process._exiting = false;
Expand Down

0 comments on commit 233d4f8

Please sign in to comment.