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

Unified Diff: src/ast/scopeinfo.cc

Issue 2302783002: [modules] Basic support of exports (Closed)
Patch Set: . 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/ast/modules.cc ('k') | src/ast/scopes.h » ('j') | src/contexts.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopeinfo.cc
diff --git a/src/ast/scopeinfo.cc b/src/ast/scopeinfo.cc
index 20a96938c2a93625c2d7b97409c219e518dddabd..e900e6733b84f6cab65aacb4564536daebf6afbd 100644
--- a/src/ast/scopeinfo.cc
+++ b/src/ast/scopeinfo.cc
@@ -419,7 +419,7 @@ String* ScopeInfo::FunctionName() {
ModuleInfo* ScopeInfo::ModuleDescriptorInfo() {
DCHECK(scope_type() == MODULE_SCOPE);
- return static_cast<ModuleInfo*>(get(ModuleInfoEntryIndex()));
+ return ModuleInfo::cast(get(ModuleInfoEntryIndex()));
}
String* ScopeInfo::ParameterName(int var) {
@@ -718,10 +718,25 @@ void ScopeInfo::Print() {
ContextLocalNameEntriesIndex() + ContextLocalCount(), this);
}
+ // XXX never called for module scopes
+
PrintF("}\n");
}
#endif // DEBUG
+Handle<ModuleInfoEntry> ModuleInfoEntry::New(Isolate* isolate,
+ Handle<Object> export_name,
+ Handle<Object> local_name,
+ Handle<Object> import_name,
+ Handle<Object> module_request) {
+ Handle<ModuleInfoEntry> result = isolate->factory()->NewModuleInfoEntry();
+ result->set(kExportNameIndex, *export_name);
+ result->set(kLocalNameIndex, *local_name);
+ result->set(kImportNameIndex, *import_name);
+ result->set(kModuleRequestIndex, *module_request);
+ return result;
+}
+
Handle<ModuleInfo> ModuleInfo::New(Isolate* isolate, ModuleDescriptor* descr) {
// Serialize special exports.
Handle<FixedArray> special_exports =
« no previous file with comments | « src/ast/modules.cc ('k') | src/ast/scopes.h » ('j') | src/contexts.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698