Skip to content

Commit

Permalink
Merge pull request #5 from benoneal/patch-2
Browse files Browse the repository at this point in the history
Sandbox inherits from global
  • Loading branch information
Matt Walters committed May 21, 2015
2 parents 4f6e340 + 3b3f1e9 commit e78561c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.js
Expand Up @@ -5,7 +5,7 @@ var fs = require('fs'),
vm = require('vm'),
extend = require('util')._extend;

module.exports = function (module, mocks, globals) {
module.exports = function (module, mocks) {

mocks = mocks || {};

Expand Down Expand Up @@ -33,14 +33,13 @@ module.exports = function (module, mocks, globals) {
return require(file);
}
},
console: console,
exports: exports,
module: {
exports: exports
}
};

if (!!globals) { extend(sandbox, globals); }
extend(sandbox, global);

var filepath = resolve(module, caller);

Expand Down

0 comments on commit e78561c

Please sign in to comment.