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..d71b759ebd777327325de223f47fb8d16011f4d4 100644 |
--- a/third_party/WebKit/Source/core/dom/ModuleScript.cpp |
+++ b/third_party/WebKit/Source/core/dom/ModuleScript.cpp |
@@ -6,6 +6,22 @@ |
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 |