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

Unified Diff: src/api.cc

Issue 2355033002: [modules] Add a requested_modules field to Module (Closed)
Patch Set: Handle review 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 | « no previous file | src/factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index 8ae8fbb8117a9abba36fa2ab02f41f499a1814af..b352226b716ce2b54793b8b8f1bf68b2dac20fe2 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -2048,19 +2048,16 @@ MaybeLocal<Module> ScriptCompiler::CompileModule(Isolate* isolate,
if (!maybe.ToLocal(&unbound)) return MaybeLocal<Module>();
i::Handle<i::SharedFunctionInfo> shared = Utils::OpenHandle(*unbound);
- i::Handle<i::FixedArray> regular_exports =
- i::handle(shared->scope_info()->ModuleDescriptorInfo()->regular_exports(),
- i_isolate);
- int regular_exports_length = regular_exports->length();
-
- i::Handle<i::Module> module =
- i_isolate->factory()->NewModule(shared, regular_exports_length);
+ i::Handle<i::Module> module = i_isolate->factory()->NewModule(shared);
// TODO(neis): This will create multiple cells for the same local variable if
// exported under multiple names, which is wrong but cannot be observed at the
// moment. This will be fixed by doing the full-fledged linking here once we
// get there.
- for (int i = 0; i < regular_exports_length; ++i) {
+ i::Handle<i::FixedArray> regular_exports =
+ i::handle(shared->scope_info()->ModuleDescriptorInfo()->regular_exports(),
+ i_isolate);
+ for (int i = 0, length = regular_exports->length(); i < length; ++i) {
i::Handle<i::ModuleInfoEntry> entry =
i::handle(i::ModuleInfoEntry::cast(regular_exports->get(i)), i_isolate);
DCHECK(entry->import_name()->IsUndefined(i_isolate));
« no previous file with comments | « no previous file | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698