Index: src/debug.cc |
diff --git a/src/debug.cc b/src/debug.cc |
index b4421d6df8f2ffa51ce10a8f35d7b955bf4b3a99..80f993b82b29ecceee5c98e7a50644b9e75feec1 100644 |
--- a/src/debug.cc |
+++ b/src/debug.cc |
@@ -807,15 +807,15 @@ bool Debug::Load() { |
void Debug::Unload() { |
ClearAllBreakPoints(); |
+ // Match unmatched PromiseHandlePrologue calls. |
+ while (thread_local_.promise_on_stack_) PromiseHandleEpilogue(); |
+ |
// Return debugger is not loaded. |
if (!IsLoaded()) return; |
// Clear the script cache. |
DestroyScriptCache(); |
- // Match unmatched PromiseHandlePrologue calls. |
- while (thread_local_.promise_on_stack_) PromiseHandleEpilogue(); |
- |
// Clear debugger context global handle. |
GlobalHandles::Destroy(Handle<Object>::cast(debug_context_).location()); |
debug_context_ = Handle<Context>(); |