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

Unified Diff: third_party/WebKit/Source/core/dom/ModuleScript.cpp

Issue 2782403002: [ES6 modules] Implement #concept-module-script-instantiation-error (Closed)
Patch Set: rebased Created 3 years, 8 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
« no previous file with comments | « third_party/WebKit/Source/core/dom/ModuleScript.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ModuleScript.cpp
diff --git a/third_party/WebKit/Source/core/dom/ModuleScript.cpp b/third_party/WebKit/Source/core/dom/ModuleScript.cpp
index 0ab530f2e7bf380eb06370d210bd3475a855d34e..2f9e74d601011094dc6b9ff8faaf5b50b0321c69 100644
--- a/third_party/WebKit/Source/core/dom/ModuleScript.cpp
+++ b/third_party/WebKit/Source/core/dom/ModuleScript.cpp
@@ -6,6 +6,23 @@
namespace blink {
+void ModuleScript::setInstantiationError(v8::Isolate* isolate,
+ v8::Local<v8::Value> error) {
+ DCHECK_EQ(m_instantiationState, ModuleInstantiationState::Uninstantiated);
+ m_instantiationState = ModuleInstantiationState::Errored;
+
+ DCHECK(!error.IsEmpty());
+ m_instantiationError.set(isolate, error);
+}
+
+void ModuleScript::setInstantiationSuccess() {
+ DCHECK_EQ(m_instantiationState, ModuleInstantiationState::Uninstantiated);
+ m_instantiationState = ModuleInstantiationState::Instantiated;
+}
+
DEFINE_TRACE(ModuleScript) {}
+DEFINE_TRACE_WRAPPERS(ModuleScript) {
+ visitor->traceWrappers(m_instantiationError);
+}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/dom/ModuleScript.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698