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

Unified Diff: src/ast/modules.cc

Issue 2328283002: Revert of [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.h ('k') | src/ast/scopeinfo.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/modules.cc
diff --git a/src/ast/modules.cc b/src/ast/modules.cc
index 6d8f35f39048057944beb600d472ec64e296053f..f0cb18bc627be13d3fd251231f98dbf6b136431c 100644
--- a/src/ast/modules.cc
+++ b/src/ast/modules.cc
@@ -87,28 +87,27 @@
} // namespace
-Handle<ModuleInfoEntry> ModuleDescriptor::Entry::Serialize(
- Isolate* isolate) const {
- return ModuleInfoEntry::New(isolate,
- ToStringOrUndefined(isolate, export_name),
- ToStringOrUndefined(isolate, local_name),
- ToStringOrUndefined(isolate, import_name),
- ToStringOrUndefined(isolate, module_request));
+Handle<FixedArray> ModuleDescriptor::Entry::Serialize(Isolate* isolate) const {
+ Handle<FixedArray> result = isolate->factory()->NewFixedArray(4);
+ result->set(0, *ToStringOrUndefined(isolate, export_name));
+ result->set(1, *ToStringOrUndefined(isolate, local_name));
+ result->set(2, *ToStringOrUndefined(isolate, import_name));
+ result->set(3, *ToStringOrUndefined(isolate, module_request));
+ return result;
}
ModuleDescriptor::Entry* ModuleDescriptor::Entry::Deserialize(
- Isolate* isolate, AstValueFactory* avfactory,
- Handle<ModuleInfoEntry> entry) {
- Entry* result = new (avfactory->zone()) Entry(Scanner::Location::invalid());
- result->export_name = FromStringOrUndefined(
- isolate, avfactory, handle(entry->export_name(), isolate));
- result->local_name = FromStringOrUndefined(
- isolate, avfactory, handle(entry->local_name(), isolate));
- result->import_name = FromStringOrUndefined(
- isolate, avfactory, handle(entry->import_name(), isolate));
- result->module_request = FromStringOrUndefined(
- isolate, avfactory, handle(entry->module_request(), isolate));
- return result;
+ Isolate* isolate, AstValueFactory* avfactory, Handle<FixedArray> data) {
+ Entry* entry = new (avfactory->zone()) Entry(Scanner::Location::invalid());
+ entry->export_name =
+ FromStringOrUndefined(isolate, avfactory, handle(data->get(0), isolate));
+ entry->local_name =
+ FromStringOrUndefined(isolate, avfactory, handle(data->get(1), isolate));
+ entry->import_name =
+ FromStringOrUndefined(isolate, avfactory, handle(data->get(2), isolate));
+ entry->module_request =
+ FromStringOrUndefined(isolate, avfactory, handle(data->get(3), isolate));
+ return entry;
}
void ModuleDescriptor::MakeIndirectExportsExplicit(Zone* zone) {
« no previous file with comments | « src/ast/modules.h ('k') | src/ast/scopeinfo.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698