Skip to content

Conversation

@obastemur
Copy link
Collaborator

No description provided.

@obastemur obastemur requested a review from boingoing January 18, 2018 18:44
@obastemur
Copy link
Collaborator Author

Fixes #4570 . Test cases will follow. /cc @rhuanjl @fatcerberus

@obastemur
Copy link
Collaborator Author

@rhuanjl would you like to contribute your test cases? Please let me know the commit hash

bool contains = this->parentModuleList->Contains(parentRecord);
if (!contains)

if (!this->parentModuleList->Contains(parentRecord))
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My branch wasn't updated hence there was an assert(!contains) here. That's why the change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The assert was wrong - I have removed that.


In reply to: 162434163 [](ancestors = 162434163)

@obastemur
Copy link
Collaborator Author

Prior to adding more test cases, I will introduce WScript.RegisterModuleSource(path, source). So we won't end-up having bunch of moduleXXX1.js files under test folder.

@akroshg
Copy link
Contributor

akroshg commented Jan 18, 2018

that would be great!


In reply to: 358745237 [](ancestors = 358745237)

@rhuanjl
Copy link
Collaborator

rhuanjl commented Jan 18, 2018

The test case I had is here:
rhuanjl@6b050fd

Though I note that this issue would be covered by currently disabled test bug_issue_3257.js

@obastemur
Copy link
Collaborator Author

Though I note that this issue would be covered by currently disabled test bug_issue_3257.js

It would do that to some extend. I saw there are other issues need attention prior to enable it. See #4575

obastemur and others added 3 commits January 18, 2018 15:06
…names.

Note - test coverage is actually already provided by more bug issue 3257
But that test is currently disabled
@obastemur
Copy link
Collaborator Author

Also opened #4577 to track WScript.RegisterModuleSource(path, source) separately.

@obastemur
Copy link
Collaborator Author

@akroshg @boingoing please review

@rhuanjl
Copy link
Collaborator

rhuanjl commented Jan 18, 2018

This seems to work for most cases now.

The following seemingly related example (i.e. a circular re-entrant import) still crashes but I think it crashes with or without this fix - taking module0 out of the folder removes the crash so this is probably an error in ch's specifier normalising or something and not a CC error (a few printfs show that this case is somehow generating 5 module records):

//test.js
WScript.LoadScriptFile("module0/module0.js","module");
//module0/module0.js
import "module1.js";
import "module2.js";
//module1.js
import "module2.js";
//module2.js
import "module0/module0.js";

@obastemur
Copy link
Collaborator Author

Yep there are more to come. Things to do on both ch and CC side. Thanks for the test cases and all the effort @rhuanjl !

Copy link
Contributor

@boingoing boingoing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks for fixing these! 👍

@obastemur
Copy link
Collaborator Author

@akroshg @rhuanjl @boingoing Thanks for the reviews!

@chakrabot chakrabot merged commit 348ef31 into chakra-core:release/1.8 Jan 19, 2018
chakrabot pushed a commit that referenced this pull request Jan 19, 2018
Merge pull request #4574 from obastemur:fix_reent
chakrabot pushed a commit that referenced this pull request Jan 19, 2018
…rting

Merge pull request #4574 from obastemur:fix_reent
chakrabot pushed a commit that referenced this pull request Jan 19, 2018
…t module importing

Merge pull request #4574 from obastemur:fix_reent
@fatcerberus
Copy link
Contributor

@obastemur This fix has resurfaced #4482 in miniSphere. :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants