Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Correctly print parens around in in for heads#16630

Merged
nicolo-ribaudo merged 1 commit into
babel:mainfrom
nicolo-ribaudo:for-in-parens
Jul 11, 2024
Merged

Correctly print parens around in in for heads#16630
nicolo-ribaudo merged 1 commit into
babel:mainfrom
nicolo-ribaudo:for-in-parens

Conversation

@nicolo-ribaudo

Copy link
Copy Markdown
Member
Q                       A
Fixed Issues? Fixes #16628
Patch: Bug Fix? y
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

I really wanted to use using, but we would need an assumption to avoid the try/catch when we know it's not necessary.

@nicolo-ribaudo nicolo-ribaudo added PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: generator labels Jul 11, 2024
@babel-bot

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57311

inForStatementInit: boolean = false;
enterForStatementInit(val: boolean) {
const old = this.inForStatementInit;
if (old === val) return () => {};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe return undefined and then use exit?.() on the caller?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Isn't it better to use consistent types, rather than having polymorphic functions? It's trivial for an engine to optimise an empty function call.

@kungfooman

Copy link
Copy Markdown

Interesting PR! I wanted to test it, but link from @babel-bot fails with:

Could not load Babel build #57311: Error sending request to CircleCI: undefined

@nicolo-ribaudo

Copy link
Copy Markdown
Member Author

CircleCI has been working weirdly in the past few days, thanks for noticing the problem -- I'll see if it something that we need to fix :)

@nicolo-ribaudo nicolo-ribaudo merged commit 71282ad into babel:main Jul 11, 2024
@nicolo-ribaudo nicolo-ribaudo deleted the for-in-parens branch July 11, 2024 14:21
@liuxingbaoyu

Copy link
Copy Markdown
Member

It seems that the CircleCI API no longer allows cross-domain.
I will take a look at it.

@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 11, 2024
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: generator PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing parenthesis in initializer of for loop

5 participants