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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/dom/ModuleScript.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/dom/ModuleScript.h" 5 #include "core/dom/ModuleScript.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 void ModuleScript::setInstantiationError(v8::Isolate* isolate,
10 v8::Local<v8::Value> error) {
11 DCHECK_EQ(m_instantiationState, ModuleInstantiationState::Uninstantiated);
12 m_instantiationState = ModuleInstantiationState::Errored;
13
14 DCHECK(!error.IsEmpty());
15 m_instantiationError.set(isolate, error);
16 }
17
18 void ModuleScript::setInstantiationSuccess() {
19 DCHECK_EQ(m_instantiationState, ModuleInstantiationState::Uninstantiated);
20 m_instantiationState = ModuleInstantiationState::Instantiated;
21 }
22
9 DEFINE_TRACE(ModuleScript) {} 23 DEFINE_TRACE(ModuleScript) {}
24 DEFINE_TRACE_WRAPPERS(ModuleScript) {
25 visitor->traceWrappers(m_instantiationError);
26 }
10 27
11 } // namespace blink 28 } // namespace blink
OLDNEW
« 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