summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2017-11-24 00:13:44 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2017-11-24 00:13:44 +0100
commit6f724e1563159fb332ed43068649958e99e7be28 (patch)
tree524febbafe51e70e328b4386db174294a5debd31 /src
parent05948d8e4e3fefb757ea8b8aa5160cacd07e0cf4 (diff)
downloadandroid-node-v8-6f724e1563159fb332ed43068649958e99e7be28.tar.gz
android-node-v8-6f724e1563159fb332ed43068649958e99e7be28.tar.bz2
android-node-v8-6f724e1563159fb332ed43068649958e99e7be28.zip
lib,src: remove vm.runInDebugContext()
The V8 API it is based on is deprecated and scheduled for removal later this year. Remove it. PR-URL: https://github.com/nodejs/node/pull/13295 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Jefe Lindstaedt <robert.lindstaedt@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/node_contextify.cc33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/node_contextify.cc b/src/node_contextify.cc
index 420cc77e92..584d2dc6f9 100644
--- a/src/node_contextify.cc
+++ b/src/node_contextify.cc
@@ -22,7 +22,6 @@
#include "node_internals.h"
#include "node_watchdog.h"
#include "base_object-inl.h"
-#include "v8-debug.h"
namespace node {
@@ -30,7 +29,6 @@ using v8::Array;
using v8::ArrayBuffer;
using v8::Boolean;
using v8::Context;
-using v8::Debug;
using v8::EscapableHandleScope;
using v8::External;
using v8::Function;
@@ -218,42 +216,11 @@ class ContextifyContext {
function_template->InstanceTemplate()->SetInternalFieldCount(1);
env->set_script_data_constructor_function(function_template->GetFunction());
- env->SetMethod(target, "runInDebugContext", RunInDebugContext);
env->SetMethod(target, "makeContext", MakeContext);
env->SetMethod(target, "isContext", IsContext);
}
- static void RunInDebugContext(const FunctionCallbackInfo<Value>& args) {
- Local<String> script_source(args[0]->ToString(args.GetIsolate()));
- if (script_source.IsEmpty())
- return; // Exception pending.
- Local<Context> debug_context = Debug::GetDebugContext(args.GetIsolate());
- Environment* env = Environment::GetCurrent(args);
- if (debug_context.IsEmpty()) {
- // Force-load the debug context.
- auto dummy_event_listener = [] (const Debug::EventDetails&) {};
- Debug::SetDebugEventListener(args.GetIsolate(), dummy_event_listener);
- debug_context = Debug::GetDebugContext(args.GetIsolate());
- CHECK(!debug_context.IsEmpty());
- // Ensure that the debug context has an Environment assigned in case
- // a fatal error is raised. The fatal exception handler in node.cc
- // is not equipped to deal with contexts that don't have one and
- // can't easily be taught that due to a deficiency in the V8 API:
- // there is no way for the embedder to tell if the data index is
- // in use.
- const int index = Environment::kContextEmbedderDataIndex;
- debug_context->SetAlignedPointerInEmbedderData(index, env);
- }
-
- Context::Scope context_scope(debug_context);
- MaybeLocal<Script> script = Script::Compile(debug_context, script_source);
- if (script.IsEmpty())
- return; // Exception pending.
- args.GetReturnValue().Set(script.ToLocalChecked()->Run());
- }
-
-
static void MakeContext(const FunctionCallbackInfo<Value>& args) {
Environment* env = Environment::GetCurrent(args);