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

Side by Side Diff: third_party/WebKit/Source/core/dom/ScriptModuleResolverImpl.cpp

Issue 2848213002: [ES6 modules] Fix bad assert in HostResolveImportedModule (Closed)
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/ScriptModuleResolverImpl.h" 5 #include "core/dom/ScriptModuleResolverImpl.h"
6 6
7 #include "bindings/core/v8/ScriptModule.h" 7 #include "bindings/core/v8/ScriptModule.h"
8 #include "core/dom/Modulator.h" 8 #include "core/dom/Modulator.h"
9 #include "core/dom/ModuleScript.h" 9 #include "core/dom/ModuleScript.h"
10 10
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 66
67 // Step 5. If resolved module script's instantiation state is "errored", then 67 // Step 5. If resolved module script's instantiation state is "errored", then
68 // throw resolved module script's instantiation error. 68 // throw resolved module script's instantiation error.
69 if (module_script->InstantiationState() == 69 if (module_script->InstantiationState() ==
70 ModuleInstantiationState::kErrored) { 70 ModuleInstantiationState::kErrored) {
71 ScriptValue error = modulator_->GetInstantiationError(module_script); 71 ScriptValue error = modulator_->GetInstantiationError(module_script);
72 exception_state.RethrowV8Exception(error.V8Value()); 72 exception_state.RethrowV8Exception(error.V8Value());
73 return ScriptModule(); 73 return ScriptModule();
74 } 74 }
75 75
76 // Step 6. Assert: resolved module script's instantiation state is 76 // Step 6. Assert: resolved module script's module record is not null.
77 // "instantiated" (and thus its module record is not null).
78 CHECK_EQ(module_script->InstantiationState(),
79 ModuleInstantiationState::kInstantiated);
80 ScriptModule record = module_script->Record(); 77 ScriptModule record = module_script->Record();
81 CHECK(!record.IsNull()); 78 CHECK(!record.IsNull());
82 79
83 // Step 7. Return resolved module script's module record. 80 // Step 7. Return resolved module script's module record.
84 return record; 81 return record;
85 } 82 }
86 83
87 DEFINE_TRACE(ScriptModuleResolverImpl) { 84 DEFINE_TRACE(ScriptModuleResolverImpl) {
88 ScriptModuleResolver::Trace(visitor); 85 ScriptModuleResolver::Trace(visitor);
89 visitor->Trace(record_to_module_script_map_); 86 visitor->Trace(record_to_module_script_map_);
90 visitor->Trace(modulator_); 87 visitor->Trace(modulator_);
91 } 88 }
92 89
93 } // namespace blink 90 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698