mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 07:47:49 +00:00
Poison the free variable root in Node.js.
This commit is contained in:
@@ -189,6 +189,15 @@
|
||||
var xml = new ActiveXObject('Microsoft.XMLDOM');
|
||||
} catch(e) {}
|
||||
|
||||
/** Poison the free variable `root` in Node.js */
|
||||
try {
|
||||
Object.defineProperty(global.root, 'root', {
|
||||
'configurable': true,
|
||||
'enumerable': false,
|
||||
'get': function() { throw new ReferenceError; }
|
||||
});
|
||||
} catch(e) {}
|
||||
|
||||
/** Use a single "load" function. */
|
||||
var load = (!amd && typeof require == 'function')
|
||||
? require
|
||||
|
||||
Reference in New Issue
Block a user