Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 | |
| OLD | NEW |