diff --git a/lib/sandboxed_module.js b/lib/sandboxed_module.js index 6bf483c..ed53ac8 100644 --- a/lib/sandboxed_module.js +++ b/lib/sandboxed_module.js @@ -68,6 +68,7 @@ SandboxedModule.prototype._init = function(moduleId, trace, options) { var module = new Module(this.filename, parent); module.filename = this.filename; + module.paths = parent.paths; this.module = module; @@ -118,6 +119,8 @@ SandboxedModule.prototype._getGlobals = function() { globals[optionsGlobalsKey] = this._options.globals[optionsGlobalsKey]; } + globals.global = globals.GLOBAL = globals.root = globals; + return globals; }; diff --git a/package.json b/package.json index 767cf90..50a24ca 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "testing" ], "license": "MIT", - "version": "2.0.3", + "version": "2.0.5", "repository": "felixge/node-sandboxed-module", "main": "./lib/sandboxed_module", "files": [