summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-08-21 17:19:41 -0700
committerisaacs <i@izs.me>2013-08-21 17:58:12 -0700
commiteef552774e1c78b113e1b543cb9463cd64ecd5ed (patch)
tree2febee76c7c4b9c4e1a908a85ee1226321440141 /lib
parent7afdba6e0bc3b69c2bf5fdbd59f938ac8f7a64c5 (diff)
downloadandroid-node-v8-eef552774e1c78b113e1b543cb9463cd64ecd5ed.tar.gz
android-node-v8-eef552774e1c78b113e1b543cb9463cd64ecd5ed.tar.bz2
android-node-v8-eef552774e1c78b113e1b543cb9463cd64ecd5ed.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/repl.js4
-rw-r--r--lib/vm.js26
2 files changed, 15 insertions, 15 deletions
diff --git a/lib/repl.js b/lib/repl.js
index cf3322834a..782e79e153 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 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);
};