Index: src/factory.cc |
diff --git a/src/factory.cc b/src/factory.cc |
index 39b4b1f1ac494d073ab07be3a4923b983e49a88f..564f821c42875dd1e14e68d0344678b1fe9f8dc0 100644 |
--- a/src/factory.cc |
+++ b/src/factory.cc |
@@ -1817,6 +1817,10 @@ Handle<Module> Factory::NewModule(Handle<SharedFunctionInfo> code) { |
isolate()); |
Handle<ObjectHashTable> exports = |
ObjectHashTable::New(isolate(), module_info->RegularExportCount()); |
+ Handle<FixedArray> regular_exports = |
+ NewFixedArray(module_info->RegularExportCount()); |
+ Handle<FixedArray> regular_imports = |
+ NewFixedArray(module_info->regular_imports()->length()); |
int requested_modules_length = module_info->module_requests()->length(); |
Handle<FixedArray> requested_modules = |
requested_modules_length > 0 ? NewFixedArray(requested_modules_length) |
@@ -1825,6 +1829,8 @@ Handle<Module> Factory::NewModule(Handle<SharedFunctionInfo> code) { |
Handle<Module> module = Handle<Module>::cast(NewStruct(MODULE_TYPE)); |
module->set_code(*code); |
module->set_exports(*exports); |
+ module->set_regular_exports(*regular_exports); |
+ module->set_regular_imports(*regular_imports); |
module->set_hash(isolate()->GenerateIdentityHash(Smi::kMaxValue)); |
module->set_module_namespace(isolate()->heap()->undefined_value()); |
module->set_requested_modules(*requested_modules); |