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

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

Issue 2643003002: [ES6 modules] Introduce ModuleScript model object (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "core/dom/ModuleScript.h"
6
7 namespace blink {
8
9 void ModuleScript::updateStateAfterInstantiation(ScriptValue maybeError) {
domenic 2017/01/19 05:23:59 This method seems redundant. It is only used once
10 DCHECK_EQ(m_instantiationState, InstantiationState::Uninstantiated);
11 m_instantiationState = maybeError.isEmpty() ? InstantiationState::Instantiated
12 : InstantiationState::Errored;
13 m_instantiationError = maybeError;
14 }
15
16 void ModuleScript::propagateUpstreamError(ScriptValue error) {
domenic 2017/01/19 05:23:59 Ideally these would have unit tests. Not sure what
17 DCHECK_EQ(m_instantiationState, InstantiationState::Uninstantiated);
18 m_instantiationState = InstantiationState::Errored;
19 m_instantiationError = error;
20 }
21
22 void ModuleScript::propagateUpstreamSuccess() {
23 DCHECK_EQ(m_instantiationState, InstantiationState::Uninstantiated);
24 m_instantiationState = InstantiationState::Instantiated;
25 }
26
27 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698