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

Unified Diff: src/objects.h

Issue 2362153003: [modules] Support star exports. (Closed)
Patch Set: Address comments. Created 4 years, 3 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
« no previous file with comments | « src/messages.h ('k') | src/objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index ca3c8f89b7c5bbac73d62cd5e3c597b1f41c258b..b846e509a2b62890fedb59fe39bbc514dc435e79 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -7962,11 +7962,22 @@ class Module : public Struct {
static Handle<Object> LoadImport(Handle<Module> module, Handle<String> name,
int module_request);
+ // The [must_resolve] argument indicates whether or not an exception should be
+ // thrown if the module does not provide an export named [name].
+ //
+ // If [must_resolve] is true, a null result indicates an exception. If
+ // [must_resolve] is false, a null result does not necessarily indicate an
+ // exception, but there may be one pending.
+ //
+ // Currently, an exception is always thrown in the case of a cycle and in the
+ // case of conflicting star exports. TODO(neis): Make that spec-compliant.
+ static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport(Handle<Module> module,
+ Handle<String> name,
+ bool must_resolve);
static MUST_USE_RESULT MaybeHandle<Cell> ResolveImport(Handle<Module> module,
Handle<String> name,
- int module_request);
- static MUST_USE_RESULT MaybeHandle<Cell> ResolveExport(Handle<Module> module,
- Handle<String> name);
+ int module_request,
+ bool must_resolve);
static const int kCodeOffset = HeapObject::kHeaderSize;
static const int kExportsOffset = kCodeOffset + kPointerSize;
@@ -7978,6 +7989,10 @@ class Module : public Struct {
private:
enum { kEvaluatedBit };
+ // Helper for ResolveExport.
+ static MUST_USE_RESULT MaybeHandle<Cell> ResolveExportUsingStarExports(
+ Handle<Module> module, Handle<String> name, bool must_resolve);
+
DISALLOW_IMPLICIT_CONSTRUCTORS(Module);
};
« no previous file with comments | « src/messages.h ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698