Skip to content

Commit 344342c

Browse files
committed
[MERGE chakra-core#1433 @Yongqu] MSFT 8152328 module initialization assert when one of the dependent was parsed earlier.
Merge pull request chakra-core#1433 from Yongqu:bugfix Dependent module record notify the parent module that is is ready during DeclarationInitialization. We should count the number of unfinished dependent module as those that are not done with DeclarationInitialization not Parse. The test will be ported to core after we fix up ch test harness.
2 parents cd0cb8b + 75506fe commit 344342c

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

lib/Runtime/Language/SourceTextModuleRecord.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace Js
3939
isRootModule(false),
4040
hadNotifyHostReady(false),
4141
localExportSlots(nullptr),
42-
numUnParsedChildrenModule(0),
42+
numUnInitializedChildrenModule(0),
4343
moduleId(InvalidModuleIndex),
4444
localSlotCount(InvalidSlotCount),
4545
localExportCount(0)
@@ -197,7 +197,7 @@ namespace Js
197197
{
198198
HRESULT hr = NO_ERROR;
199199

200-
if (numUnParsedChildrenModule == 0)
200+
if (numUnInitializedChildrenModule == 0)
201201
{
202202
NotifyParentsAsNeeded();
203203

@@ -239,11 +239,11 @@ namespace Js
239239
}
240240
else
241241
{
242-
if (numUnParsedChildrenModule == 0)
242+
if (numUnInitializedChildrenModule == 0)
243243
{
244244
return NOERROR; // this is only in case of recursive module reference. Let the higher stack frame handle this module.
245245
}
246-
numUnParsedChildrenModule--;
246+
numUnInitializedChildrenModule--;
247247

248248
hr = PrepareForModuleDeclarationInitialization();
249249
}
@@ -577,9 +577,9 @@ namespace Js
577577
moduleRecord->parentModuleList = RecyclerNew(recycler, ModuleRecordList, recycler);
578578
}
579579
moduleRecord->parentModuleList->Add(this);
580-
if (!moduleRecord->WasParsed())
580+
if (!moduleRecord->WasDeclarationInitialized())
581581
{
582-
numUnParsedChildrenModule++;
582+
numUnInitializedChildrenModule++;
583583
}
584584
}
585585
return false;

lib/Runtime/Language/SourceTextModuleRecord.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ namespace Js
126126
LocalExportMap* localExportMapByExportName; // from propertyId to index map: for bytecode gen.
127127
LocalExportMap* localExportMapByLocalName; // from propertyId to index map: for bytecode gen.
128128
LocalExportIndexList* localExportIndexList; // from index to propertyId: for typehandler.
129-
uint numUnParsedChildrenModule;
129+
uint numUnInitializedChildrenModule;
130130
ExportedNames* exportedNames;
131131
ResolvedExportMap* resolvedExportMap;
132132

0 commit comments

Comments
 (0)