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

Unified Diff: src/modules.h

Issue 934323004: Teach ModuleDescriptor about basic local exports (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handled review comments, added message tests Created 5 years, 10 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
Index: src/modules.h
diff --git a/src/modules.h b/src/modules.h
index ac04e47c4d76c7d9179b6097d72d410a552ed5e6..b7f5d19abc4c104f14aa2f9dec5760ab5880c700 100644
--- a/src/modules.h
+++ b/src/modules.h
@@ -28,7 +28,8 @@ class ModuleDescriptor : public ZoneObject {
// Add a name to the list of exports. If it already exists, or this descriptor
// is frozen, that's an error.
- void Add(const AstRawString* name, Zone* zone, bool* ok);
+ void AddLocalExport(const AstRawString* export_name,
+ const AstRawString* local_name, Zone* zone, bool* ok);
// Do not allow any further refinements, directly or through unification.
void Freeze() { frozen_ = true; }
@@ -67,10 +68,14 @@ class ModuleDescriptor : public ZoneObject {
class Iterator {
public:
bool done() const { return entry_ == NULL; }
- const AstRawString* name() const {
+ const AstRawString* export_name() const {
DCHECK(!done());
return static_cast<const AstRawString*>(entry_->key);
}
+ const AstRawString* local_name() const {
+ DCHECK(!done());
+ return static_cast<const AstRawString*>(entry_->value);
+ }
void Advance() { entry_ = exports_->Next(entry_); }
private:
« no previous file with comments | « src/messages.js ('k') | src/modules.cc » ('j') | test/message/export-duplicate.out » ('J')

Powered by Google App Engine
This is Rietveld 408576698