| Index: Source/core/dom/Microtask.cpp | 
| diff --git a/Source/core/dom/Microtask.cpp b/Source/core/dom/Microtask.cpp | 
| index bbfb00df0df387155ff21d0dc56ec1f724c3547b..642907ef212aa14a11056792afc1c8714ebef508 100644 | 
| --- a/Source/core/dom/Microtask.cpp | 
| +++ b/Source/core/dom/Microtask.cpp | 
| @@ -48,6 +48,10 @@ void Microtask::performCheckpoint() | 
|  | 
| v8::HandleScope handleScope(isolate); | 
| v8::Local<v8::Context> context = isolateData->ensureDomInJSContext(); | 
| +    if (context.IsEmpty()) { | 
| +        // The script execution has been terminated. | 
| +        return; | 
| +    } | 
| v8::Context::Scope scope(context); | 
| v8::V8::RunMicrotasks(isolate); | 
|  | 
|  |