Skip to content
This repository was archived by the owner on Oct 15, 2020. It is now read-only.

Commit d7b9182

Browse files
obastemurchakrabot
authored andcommitted
deps: update ChakraCore to chakra-core/ChakraCore@50e5667a3f
[1.8>1.9] [MERGE #4583 @rhuanjl] Modules: Fix indirect circular children Merge pull request #4583 from rhuanjl:moduleAgain This re-fixes chakra-core/ChakraCore#4482 Notes: 1. Test case was previously dependent on load order. Load order was changed which made the issue appear to be fixed (and test pass) when it wasn't actually fixed. - Test case revised to trigger issue irrespective of load order. 2. Have to complete all ModuleDeclarationInstantiation before we generate any root functions to ensure this issue can never occur. Conscious the test case may need moving to fit with #4582 Reviewed-By: chakrabot <[email protected]>
1 parent ee274af commit d7b9182

File tree

4 files changed

+20
-12
lines changed

4 files changed

+20
-12
lines changed

Diff for: deps/chakrashim/core/lib/Runtime/Language/SourceTextModuleRecord.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -842,11 +842,6 @@ namespace Js
842842
Assert(childModuleRecord->WasParsed());
843843
childModuleRecord->ModuleDeclarationInstantiation();
844844
});
845-
846-
childrenModuleSet->EachValue([=](SourceTextModuleRecord* childModuleRecord)
847-
{
848-
childModuleRecord->GenerateRootFunction();
849-
});
850845
}
851846

852847
ENTER_SCRIPT_IF(scriptContext, true, false, false, !scriptContext->GetThreadContext()->IsScriptActive(),
@@ -903,6 +898,13 @@ namespace Js
903898
scriptContext->GetDebugContext()->RegisterFunction(this->rootFunction->GetFunctionBody(), nullptr);
904899
}
905900
#endif
901+
if (childrenModuleSet != nullptr)
902+
{
903+
childrenModuleSet->EachValue([=](SourceTextModuleRecord* childModuleRecord)
904+
{
905+
childModuleRecord->GenerateRootFunction();
906+
});
907+
}
906908
}
907909

908910
Var SourceTextModuleRecord::ModuleEvaluation()

Diff for: deps/chakrashim/core/test/es6/module_4482_dep1.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,14 @@
1313
//v) Thing2 would not yet exist = segfault
1414

1515

16-
import Thing1 from './module_4482_dep2.js';
17-
import Thing2 from './module_4482_dep3.js';
16+
import Thing1 from 'module_4482_dep2.js';
17+
import Thing2 from 'module_4482_dep3.js';
1818

1919
export { Thing1, Thing2 };
2020

2121
export default
2222
function main()
23-
{}
23+
{
24+
Thing1();
25+
Thing2();
26+
}

Diff for: deps/chakrashim/core/test/es6/module_4482_dep2.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
//-------------------------------------------------------------------------------------------------------
55

66
//thing1.js
7-
import { Thing2 } from './module_4482_dep1.js';
7+
import { Thing2 } from 'module_4482_dep1.js';
88

99
export default
10-
function Thing1()
10+
function main()
1111
{
1212
Thing2();
1313
}

Diff for: deps/chakrashim/core/test/es6/module_4482_dep3.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
//-------------------------------------------------------------------------------------------------------
55

66

7-
import { Thing1 } from './module_4482_dep1.js';
7+
import { Thing1 } from 'module_4482_dep1.js';
88

99
export default
10-
function Thing2(){}
10+
function main()
11+
{
12+
Thing1();
13+
}

0 commit comments

Comments
 (0)