|
22 | 22 | #include "node_internals.h" |
23 | 23 | #include "node_watchdog.h" |
24 | 24 | #include "base_object-inl.h" |
25 | | -#include "v8-debug.h" |
26 | 25 |
|
27 | 26 | namespace node { |
28 | 27 |
|
29 | 28 | using v8::Array; |
30 | 29 | using v8::ArrayBuffer; |
31 | 30 | using v8::Boolean; |
32 | 31 | using v8::Context; |
33 | | -using v8::Debug; |
34 | 32 | using v8::EscapableHandleScope; |
35 | 33 | using v8::External; |
36 | 34 | using v8::Function; |
@@ -218,42 +216,11 @@ class ContextifyContext { |
218 | 216 | function_template->InstanceTemplate()->SetInternalFieldCount(1); |
219 | 217 | env->set_script_data_constructor_function(function_template->GetFunction()); |
220 | 218 |
|
221 | | - env->SetMethod(target, "runInDebugContext", RunInDebugContext); |
222 | 219 | env->SetMethod(target, "makeContext", MakeContext); |
223 | 220 | env->SetMethod(target, "isContext", IsContext); |
224 | 221 | } |
225 | 222 |
|
226 | 223 |
|
227 | | - static void RunInDebugContext(const FunctionCallbackInfo<Value>& args) { |
228 | | - Local<String> script_source(args[0]->ToString(args.GetIsolate())); |
229 | | - if (script_source.IsEmpty()) |
230 | | - return; // Exception pending. |
231 | | - Local<Context> debug_context = Debug::GetDebugContext(args.GetIsolate()); |
232 | | - Environment* env = Environment::GetCurrent(args); |
233 | | - if (debug_context.IsEmpty()) { |
234 | | - // Force-load the debug context. |
235 | | - auto dummy_event_listener = [] (const Debug::EventDetails&) {}; |
236 | | - Debug::SetDebugEventListener(args.GetIsolate(), dummy_event_listener); |
237 | | - debug_context = Debug::GetDebugContext(args.GetIsolate()); |
238 | | - CHECK(!debug_context.IsEmpty()); |
239 | | - // Ensure that the debug context has an Environment assigned in case |
240 | | - // a fatal error is raised. The fatal exception handler in node.cc |
241 | | - // is not equipped to deal with contexts that don't have one and |
242 | | - // can't easily be taught that due to a deficiency in the V8 API: |
243 | | - // there is no way for the embedder to tell if the data index is |
244 | | - // in use. |
245 | | - const int index = Environment::kContextEmbedderDataIndex; |
246 | | - debug_context->SetAlignedPointerInEmbedderData(index, env); |
247 | | - } |
248 | | - |
249 | | - Context::Scope context_scope(debug_context); |
250 | | - MaybeLocal<Script> script = Script::Compile(debug_context, script_source); |
251 | | - if (script.IsEmpty()) |
252 | | - return; // Exception pending. |
253 | | - args.GetReturnValue().Set(script.ToLocalChecked()->Run()); |
254 | | - } |
255 | | - |
256 | | - |
257 | 224 | static void MakeContext(const FunctionCallbackInfo<Value>& args) { |
258 | 225 | Environment* env = Environment::GetCurrent(args); |
259 | 226 |
|
|
0 commit comments