Skip to content

Commit 7eca76d

Browse files
committed
Respond to PR feedback
1 parent 6a6ba18 commit 7eca76d

File tree

2 files changed

+14
-11
lines changed

2 files changed

+14
-11
lines changed

lib/Runtime/Language/SourceTextModuleRecord.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ namespace Js
367367
{
368368
OUTPUT_TRACE_DEBUGONLY(Js::ModulePhase, _u("OnChildModuleReady(%s)\n"), this->GetSpecifierSz(), childModule->GetSpecifierSz());
369369
HRESULT hr = NOERROR;
370-
if (childException != nullptr || this->errorObject != nullptr)
370+
if (childException != nullptr)
371371
{
372372
// propagate the error up as needed.
373373
if (this->errorObject == nullptr)
@@ -836,7 +836,7 @@ namespace Js
836836
OUTPUT_TRACE_DEBUGONLY(Js::ModulePhase, _u("ModuleDeclarationInstantiation(%s)\n"), this->GetSpecifierSz());
837837
ScriptContext* scriptContext = GetScriptContext();
838838

839-
if (this->WasDeclarationInitialized())
839+
if (this->WasDeclarationInitialized() || this->errorObject != nullptr)
840840
{
841841
return false;
842842
}

test/es6module/bug_OS17830745.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,16 @@
1111
// not parsed. That put module3 into error state, we should skip instantiating
1212
// module3.
1313

14-
WScript.RegisterModuleSource('module0_e0565b64-3435-42c1-ad1f-6376fb7af915.js', `
15-
console.log('fail');`);
16-
WScript.RegisterModuleSource('module3_65eb7cb0-2a92-4a34-a368-2cfc1d6a3768.js', `import {
17-
default as module3_localbinding_0,
18-
default as module3_localbinding_1
19-
} from 'module0_e0565b64-3435-42c1-ad1f-6376fb7af915.js';
20-
export { } from 'module2_894411c7-94ec-4069-b8e1-10ab0d881f6e.js';
21-
console.log('fail');`);
22-
WScript.LoadScriptFile('module3_65eb7cb0-2a92-4a34-a368-2cfc1d6a3768.js', 'module');
14+
WScript.RegisterModuleSource('module0.js', `
15+
console.log('fail');
16+
`);
17+
18+
WScript.RegisterModuleSource('module3.js', `
19+
import { default as _default } from 'module0.js';
20+
export { } from 'module2.js';
21+
console.log('fail');
22+
`);
23+
24+
WScript.LoadScriptFile('module3.js', 'module');
25+
2326
console.log('pass');

0 commit comments

Comments
 (0)