mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 10:27: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');
|
var xml = new ActiveXObject('Microsoft.XMLDOM');
|
||||||
} catch(e) {}
|
} 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. */
|
/** Use a single "load" function. */
|
||||||
var load = (!amd && typeof require == 'function')
|
var load = (!amd && typeof require == 'function')
|
||||||
? require
|
? require
|
||||||
|
|||||||
Reference in New Issue
Block a user