Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 6accad7747ac917a0d39419ca60c3492b41ae73e..b6a8a52591ecfb150fbec3ed1e376cf5e8ed146d 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -8912,11 +8912,15 @@ bool Debug::SetDebugEventListener(Isolate* isolate, EventCallback that, |
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate); |
ENTER_V8(i_isolate); |
i::HandleScope scope(i_isolate); |
- i::Handle<i::Object> foreign = i_isolate->factory()->undefined_value(); |
- if (that != NULL) { |
- foreign = i_isolate->factory()->NewForeign(FUNCTION_ADDR(that)); |
+ if (that == nullptr) { |
+ i_isolate->debug()->SetDebugDelegate(nullptr, false); |
+ } else { |
+ i::Handle<i::Object> i_data = i_isolate->factory()->undefined_value(); |
+ if (!data.IsEmpty()) i_data = Utils::OpenHandle(*data); |
+ i::NativeDebugDelegate* delegate = |
+ new i::NativeDebugDelegate(i_isolate, that, i_data); |
+ i_isolate->debug()->SetDebugDelegate(delegate, true); |
} |
- i_isolate->debug()->SetEventListener(foreign, Utils::OpenHandle(*data, true)); |
return true; |
} |
@@ -9369,7 +9373,7 @@ void debug::SetDebugDelegate(Isolate* v8_isolate, |
debug::DebugDelegate* delegate) { |
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(v8_isolate); |
ENTER_V8(isolate); |
- isolate->debug()->SetDebugDelegate(delegate); |
+ isolate->debug()->SetDebugDelegate(delegate, false); |
} |
void debug::ResetBlackboxedStateCache(Isolate* v8_isolate, |