From 21e60643b0795fe7b6a46ff29d73df60e6a7c9f5 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 22 Aug 2014 15:09:24 +0200 Subject: 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 --- lib/vm.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/vm.js') 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); -- cgit v1.2.3