diff --git a/lib/repl.js b/lib/repl.js index cf3322834a7..782e79e1538 100644 --- a/lib/repl.js +++ b/lib/repl.js @@ -113,9 +113,9 @@ function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) { var err, result; try { if (self.useGlobal) { - result = vm.runInThisContext(code, file); + result = vm.runInThisContext(code, file, 0, false); } else { - result = vm.runInContext(code, context, file); + result = vm.runInContext(code, context, file, 0, false); } } catch (e) { err = e; diff --git a/lib/vm.js b/lib/vm.js index 5dd1ddea709..c71bb81add2 100644 --- a/lib/vm.js +++ b/lib/vm.js @@ -30,15 +30,15 @@ var util = require('util'); // - makeContext(sandbox) // From this we build the entire documented API. -Script.prototype.runInNewContext = function(initSandbox, timeout) { +Script.prototype.runInNewContext = function(initSandbox, timeout, disp) { var context = exports.createContext(initSandbox); - return this.runInContext(context, timeout); + return this.runInContext(context, timeout, disp); }; exports.Script = Script; -exports.createScript = function(code, filename) { - return new Script(code, filename); +exports.createScript = function(code, filename, disp) { + return new Script(code, filename, disp); }; exports.createContext = function(initSandbox) { @@ -51,17 +51,17 @@ exports.createContext = function(initSandbox) { return initSandbox; }; -exports.runInContext = function(code, sandbox, filename, timeout) { - var script = exports.createScript(code, filename); - return script.runInContext(sandbox, timeout); +exports.runInContext = function(code, sandbox, filename, timeout, disp) { + var script = exports.createScript(code, filename, disp); + return script.runInContext(sandbox, timeout, disp); }; -exports.runInNewContext = function(code, sandbox, filename, timeout) { - var script = exports.createScript(code, filename); - return script.runInNewContext(sandbox, timeout); +exports.runInNewContext = function(code, sandbox, filename, timeout, disp) { + var script = exports.createScript(code, filename, disp); + return script.runInNewContext(sandbox, timeout, disp); }; -exports.runInThisContext = function(code, filename, timeout) { - var script = exports.createScript(code, filename); - return script.runInThisContext(timeout); +exports.runInThisContext = function(code, filename, timeout, disp) { + var script = exports.createScript(code, filename, disp); + return script.runInThisContext(timeout, disp); }; diff --git a/src/node_contextify.cc b/src/node_contextify.cc index 002cffe1468..b2b73240a15 100644 --- a/src/node_contextify.cc +++ b/src/node_contextify.cc @@ -329,6 +329,7 @@ class ContextifyScript : ObjectWrap { contextify_script->Wrap(args.Holder()); Local code = args[0]->ToString(); Local filename = GetFilenameArg(args, 1); + bool display_exception = GetDisplayArg(args, 2); Local context = Context::GetCurrent(); Context::Scope context_scope(context); @@ -338,7 +339,8 @@ class ContextifyScript : ObjectWrap { Local