Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

don't throw if no sandbox options

  • Loading branch information...
commit 769cbbbac55637feb47a08e8e5739fa2bf4dd77a 1 parent 9a50a6a
@cadorn cadorn authored
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/loader.js
View
7 lib/loader.js
@@ -23,6 +23,8 @@ exports.getReport = LOADER.require.getReport;
exports.sandbox = function(sandboxIdentifier, loadedCallback, sandboxOptions)
{
+ sandboxOptions = sandboxOptions || {};
+
var options = {},
key;
@@ -90,7 +92,10 @@ exports.sandbox = function(sandboxIdentifier, loadedCallback, sandboxOptions)
options.onInitModule = function(moduleInterface, moduleObj, pkg)
{
- sandboxOptions.onInitModule(moduleInterface, moduleObj);
+ if (sandboxOptions.onInitModule)
+ {
+ sandboxOptions.onInitModule(moduleInterface, moduleObj);
+ }
// @see http://nodejs.org/docs/latest/api/globals.html
Please sign in to comment.
Something went wrong with that request. Please try again.