Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(496)

Unified Diff: third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp

Issue 2886593002: [ES6 modules] ModuleTreeLinker::Instantiate shouldn't proceed on invalid context (Closed)
Patch Set: hasvalidcontxt Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp
index baceb7eedd23f10e52a9ea52e7ffd19e0cf300e0..fec4cbeb6764eb3d0477452a0b82dfb205d38850 100644
--- a/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp
+++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinker.cpp
@@ -376,6 +376,13 @@ void ModuleTreeLinker::Instantiate() {
// https://html.spec.whatwg.org/multipage/webappapis.html#internal-module-script-graph-fetching-procedure
+ // [nospec] Abort the steps if the browsing context is discarded.
+ if (!modulator_->HasValidContext()) {
+ descendants_module_script_ = nullptr;
+ AdvanceState(State::kFinished);
+ return;
+ }
+
// Step 5. Let instantiationStatus be null.
// Note: The |error| variable corresponds to spec variable
// "instantiationStatus". If |error| is empty, it indicates successful
« no previous file with comments | « third_party/WebKit/Source/core/dom/ModulatorImpl.cpp ('k') | third_party/WebKit/Source/core/testing/DummyModulator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698