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

Side by Side Diff: third_party/WebKit/Source/bindings/core/v8/ScriptModule.h

Issue 2798533002: [ES6 modules] ScriptModule::compile() exceptions are handled via isolate's MessageListener (Closed)
Patch Set: rebase 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 | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp » ('j') | 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 #ifndef ScriptModule_h 5 #ifndef ScriptModule_h
6 #define ScriptModule_h 6 #define ScriptModule_h
7 7
8 #include "bindings/core/v8/ScriptState.h" 8 #include "bindings/core/v8/ScriptState.h"
9 #include "bindings/core/v8/SharedPersistent.h" 9 #include "bindings/core/v8/SharedPersistent.h"
10 #include "core/CoreExport.h" 10 #include "core/CoreExport.h"
(...skipping 19 matching lines...) Expand all
30 const String& fileName); 30 const String& fileName);
31 31
32 ScriptModule() {} 32 ScriptModule() {}
33 ScriptModule(const ScriptModule& module) : m_module(module.m_module) {} 33 ScriptModule(const ScriptModule& module) : m_module(module.m_module) {}
34 ~ScriptModule(); 34 ~ScriptModule();
35 35
36 // Returns exception, if any. 36 // Returns exception, if any.
37 ScriptValue instantiate(ScriptState*); 37 ScriptValue instantiate(ScriptState*);
38 void evaluate(ScriptState*); 38 void evaluate(ScriptState*);
39 39
40 bool isNull() const { return m_module->isEmpty(); } 40 bool isNull() const { return !m_module || m_module->isEmpty(); }
41 41
42 private: 42 private:
43 ScriptModule(v8::Isolate*, v8::Local<v8::Module>); 43 ScriptModule(v8::Isolate*, v8::Local<v8::Module>);
44 44
45 static v8::MaybeLocal<v8::Module> resolveModuleCallback( 45 static v8::MaybeLocal<v8::Module> resolveModuleCallback(
46 v8::Local<v8::Context>, 46 v8::Local<v8::Context>,
47 v8::Local<v8::String> specifier, 47 v8::Local<v8::String> specifier,
48 v8::Local<v8::Module> referrer); 48 v8::Local<v8::Module> referrer);
49 49
50 RefPtr<SharedPersistent<v8::Module>> m_module; 50 RefPtr<SharedPersistent<v8::Module>> m_module;
51 }; 51 };
52 52
53 } // namespace blink 53 } // namespace blink
54 54
55 #endif // ScriptModule_h 55 #endif // ScriptModule_h
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698