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
Fix tdz checks in transform-block-scoping plugin #9498
Conversation
return "outside"; | ||
} else if (executionStatus === "after") { | ||
return "inside"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that "inside" and "outside" were swapped? To me "inside" means "inside the temporal dead zone", so "the lexical declaration is after the reference".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah looking at the code it seems that "inside" was meant as "inside valid Zone". It is easier to understand for me now after swapping.
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/11147/ |
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10057/ |
8ab5b38
to
4b893c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is some crazy logic to figure out the execution status, but I think I kind of got i partially.
I looked through the tests and all the cases make sense to me.
Just left some nits.
return "outside"; | ||
} else if (executionStatus === "after") { | ||
return "inside"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah looking at the code it seems that "inside" was meant as "inside valid Zone". It is easier to understand for me now after swapping.
Is this relevant to #7933? |
That issue isn't fixed by this PR. |
- Use jest's expect.toThrow/expect.not.toThrow - Add input/output tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✔️
(I swear I reviewed this PR as if I wasn't the author; it's so old that I didn't remember about a single line of the code I wrote 😂)
The first two commits in this PR are at #9492; I suggest reviewing that PR first.