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

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

Issue 2555653002: [WIP Prototype] ES6 https://html.spec.whatwg.org/#fetch-a-single-module-script implementation (Closed)
Patch Set: rebased Created 3 years, 9 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/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

Powered by Google App Engine
This is Rietveld 408576698