summaryrefslogtreecommitdiff
path: root/lib/vm.js
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-08-22 15:09:24 +0200
committerTrevor Norris <trev.norris@gmail.com>2014-09-16 12:28:47 -0700
commit21e60643b0795fe7b6a46ff29d73df60e6a7c9f5 (patch)
tree9eabb3502881497dcb7766179a5d2ee4647a03bd /lib/vm.js
parent174f7d2820dcb12f1b4b511840416a03cd65b9cf (diff)
downloadandroid-node-v8-21e60643b0795fe7b6a46ff29d73df60e6a7c9f5.tar.gz
android-node-v8-21e60643b0795fe7b6a46ff29d73df60e6a7c9f5.tar.bz2
android-node-v8-21e60643b0795fe7b6a46ff29d73df60e6a7c9f5.zip
lib, src: add vm.runInDebugContext()
Compiles and executes source code in V8's debugger context. Provides a programmatic way to get access to the debug object by executing: var Debug = vm.runInDebugContext('Debug'); Fixes #7886. Reviewed-by: Trevor Norris <trev.norris@gmail.com>
Diffstat (limited to 'lib/vm.js')
-rw-r--r--lib/vm.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/vm.js b/lib/vm.js
index 83b78b874b..7c6c59c0af 100644
--- a/lib/vm.js
+++ b/lib/vm.js
@@ -55,6 +55,10 @@ exports.createContext = function(sandbox) {
return sandbox;
};
+exports.runInDebugContext = function(code) {
+ return binding.runInDebugContext(code);
+};
+
exports.runInContext = function(code, contextifiedSandbox, options) {
var script = new Script(code, options);
return script.runInContext(contextifiedSandbox, options);