Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Fix bad module nesting when module closure throws global error #1644

Merged
merged 2 commits into from
Aug 24, 2021

Conversation

Krinkle
Copy link
Member

@Krinkle Krinkle commented Aug 2, 2021

Fixes #1478.

@Krinkle Krinkle marked this pull request as draft August 2, 2021 23:06
@Krinkle Krinkle marked this pull request as ready for review August 2, 2021 23:14
// we teardown internal state to ensure correct module nesting.
// Ref https://github.com/qunitjs/qunit/issues/1478.
moduleStack.pop();
config.currentModule = module.parentModule || prevModule;
Copy link
Member Author

Choose a reason for hiding this comment

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

Same as before, we only restore currentModule if the module in question is a scoped module. If it is a linear module, then we assign current and leave it as-is. I hope the new structure makes this more obvious. In the old code, this was done a bit strangely.

@Krinkle Krinkle requested a review from gibson042 August 6, 2021 01:07
This asserts the undesirable status quo, where the stack is left
in a bad state if the module closure encounters a global error while
test suites are still being loaded.

Ref qunitjs#1478.
@Krinkle Krinkle merged commit e457e29 into qunitjs:main Aug 24, 2021
@Krinkle Krinkle deleted the fix-module-state branch August 24, 2021 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Error in modules's nested executeNow call forces subsequent modules to become children
1 participant