| Index: src/debug.cc | 
| diff --git a/src/debug.cc b/src/debug.cc | 
| index 0af63f61fdcd63ea3731250c6726d6bf9da46fed..25c600ad8da7523a3e87e3825412b2c80eaa86b5 100644 | 
| --- a/src/debug.cc | 
| +++ b/src/debug.cc | 
| @@ -813,6 +813,9 @@ void Debug::Unload() { | 
| // 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>(); | 
|  |