Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 07b967f2b8cf3bf37e093d1e3724b142d50663ad..ad11dcd2044839b1909a06593d0c91607c17ee6f 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -8896,11 +8896,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; |
} |
@@ -9353,7 +9357,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, |