From eef552774e1c78b113e1b543cb9463cd64ecd5ed Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 21 Aug 2013 17:19:41 -0700 Subject: vm: Put back display_errors flag This is an important part of the repl use-case. TODO: The arg parsing in vm.runIn*Context() is rather wonky. It would be good to move more of that into the Script class, and/or an options object. --- lib/vm.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'lib/vm.js') diff --git a/lib/vm.js b/lib/vm.js index 5dd1ddea70..c71bb81add 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); }; -- cgit v1.2.3