GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Avoid unnecessary parens around `async` in `for await` by nicolo-ribaudo · Pull Request #16625 · babel/babel

Conversation

@nicolo-ribaudo

@nicolo-ribaudo nicolo-ribaudo commented Jul 10, 2024

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

The parentheses are only required in the sync case, since for (async of could either start a for (async of => x; y ; z) {} or a for (async of x) {}. With for await there is no ambiguity.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nicolo-ribaudo
Avoid unnecessary parens around async in for await
fb57d86
@nicolo-ribaudo nicolo-ribaudo added PR: Polish 💅 A type of pull request used for our changelog categories pkg: generator labels Jul 10, 2024
@nicolo-ribaudo nicolo-ribaudo added this to the generator: preserveFormat milestone Jul 10, 2024
@babel-bot

babel-bot commented Jul 10, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

liuxingbaoyu
liuxingbaoyu reviewed Jul 10, 2024
View reviewed changes
Comment thread packages/babel-generator/src/node/parentheses.ts Outdated
@@ -479,7 +479,10 @@ export function Identifier(
// some tools (including earlier Babel versions) can't parse
// `for await (async of [])` without them.

@liuxingbaoyu liuxingbaoyu Jul 10, 2024

Copy link
Copy Markdown
Member

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.

Comments here seem no longer needed?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nicolo-ribaudo reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@nicolo-ribaudo nicolo-ribaudo Jul 10, 2024

Copy link
Copy Markdown
Member Author

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.

Good catch! It looks this code was intentional, but the only mentioned tool I could find through issues + git blame was Babel, and the bug in Babel has been fixed long ago.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

liuxingbaoyu reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nicolo-ribaudo
Remove comment
9ebf8d9
liuxingbaoyu
liuxingbaoyu approved these changes Jul 10, 2024
View reviewed changes
JLHwung
JLHwung approved these changes Jul 10, 2024
View reviewed changes
Comment thread packages/babel-generator/src/node/parentheses.ts Resolved

Uh oh!

There was an error while loading. Please reload this page.

@nicolo-ribaudo @JLHwung
Update packages/babel-generator/src/node/parentheses.ts
949d88f
Co-authored-by: Huáng Jùnliàng <[email protected]>
@nicolo-ribaudo
nicolo-ribaudo merged commit 9783c3c into babel:main Jul 11, 2024
@nicolo-ribaudo
nicolo-ribaudo deleted the for-await-async-no-parens branch July 11, 2024 08:14
@davidjbradshaw davidjbradshaw mentioned this pull request Jul 19, 2024
[Snyk] Upgrade @babel/runtime from 7.24.7 to 7.24.8 davidjbradshaw/iframe-resizer#1298
Merged
@richyhoopd richyhoopd mentioned this pull request Aug 1, 2024
[Snyk] Upgrade: , , richyhoopd/Video-App#1187
Open
@Exkaleburx Exkaleburx mentioned this pull request Aug 1, 2024
[Snyk] Upgrade @babel/core from 7.9.0 to 7.24.8 Exkaleburx/plug-and-klay#10
Open
@X-oss-byte X-oss-byte mentioned this pull request Aug 1, 2024
[Snyk] Upgrade @babel/core from 7.11.6 to 7.24.8 X-oss-byte/gatsby-1#800
Open
This was referenced Aug 1, 2024
[Snyk] Upgrade @babel/runtime from 7.19.0 to 7.24.8 DevangPatelUK/BotFramework-WebChat#54
Open
[Snyk] Upgrade @babel/runtime from 7.19.0 to 7.24.8 DevangPatelUK/BotFramework-WebChat#57
Open
[Snyk] Upgrade @babel/runtime from 7.17.2 to 7.24.8 DevangPatelUK/BotFramework-WebChat#61
Open
This was referenced Aug 1, 2024
[Snyk] Upgrade @babel/core from 7.24.7 to 7.24.8 hashim21223445/async#2
Open
[Snyk] Upgrade @babel/eslint-parser from 7.24.7 to 7.24.8 hashim21223445/async#3
Merged
@ashly1111111 ashly1111111 mentioned this pull request Aug 1, 2024
[Snyk] Upgrade: , , , , ashly1111111/node#116
Open
@jamesleesaunders jamesleesaunders mentioned this pull request Aug 1, 2024
[Snyk] Upgrade: , jamesleesaunders/d3-ez#200
Closed
This was referenced Aug 1, 2024
[Snyk] Upgrade: , tiff-es/fewpjs-class-extensions-super-lab-online-web-sp-000#197
Open
[Snyk] Upgrade: , tiff-es/fewpjs-getter-and-setter-methods-dc-web-091619#211
Open
[Snyk] Upgrade: , tiff-es/fewpjs-acting-on-events-dc-web-091619#195
Open
[Snyk] Upgrade: , tiff-es/js-looping-and-iteration-looping-code-along-dc-web-091619#204
Open
[Snyk] Upgrade: , tiff-es/fewpjs-document-onload-dc-web-091619#200
Open
@anbo-de anbo-de mentioned this pull request Aug 2, 2024
[Snyk] Upgrade @babel/core from 7.24.7 to 7.24.8 WDAqua/Qanary#290
Merged
@tiff-es tiff-es mentioned this pull request Aug 2, 2024
[Snyk] Upgrade @babel/preset-env from 7.10.4 to 7.24.8 tiff-es/tiffany-portfolio-responsive#465
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 15, 2024
[Snyk] Upgrade: , , , , body-parser, dotenv, express, mongoose, nodemon rawdaymohamed/Hot-Todo#373
Open
@AKJUS AKJUS mentioned this pull request Sep 16, 2024
[Snyk] Upgrade: , , , , , , , , classnames, docusaurus-lunr-search, react-markdown AKJUS/OpenLineage#26
Open
@bee22193 bee22193 mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , browserify, cssnano, gulp-zip bee22193/mnmlurl#1254
Open
@AnushaSalian AnushaSalian mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , ajv, glob, eslint, minimist, handlebars, jsdom, katex, moment, prettier, winston, yargs, workbox-cli virtual-labs/ph3-lab-mgmt#530
Open
@vinit-aikido vinit-aikido mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , , , , , magic-string, , convert-source-map, source-map, graceful-fs, tslib, chokidar, , terser, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , brotli, core-js-bundle, diff, http-server, jasmine-core, jasmine, jquery, tmp, karma, karma-chrome-launcher, karma-firefox-launcher, karma-jasmine, karma-sourcemap-loader, selenium-webdriver, puppeteer, reflect-metadata, requirejs, rollup, shelljs, systemjs, tsickle, typescript, yargs vinit-aikido/terragoat#58
Open
@Sonic269 Sonic269 mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , , , , , magic-string, , convert-source-map, source-map, graceful-fs, tslib, chokidar, , terser, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , brotli, core-js-bundle, diff, http-server, jasmine-core, jasmine, jquery, tmp, karma, karma-chrome-launcher, karma-firefox-launcher, karma-jasmine, karma-sourcemap-loader, selenium-webdriver, puppeteer, reflect-metadata, requirejs, rollup, shelljs, systemjs, tsickle, typescript, yargs Sonic269/App6#120
Open
@venkatarao-palaparthi venkatarao-palaparthi mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#455
Open
@AKJUS AKJUS mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , , , , , , classnames, docusaurus-lunr-search, react-markdown AKJUS/OpenLineage#28
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , , body-parser, dotenv, express, mongoose, nodemon rawdaymohamed/Hot-Todo#374
Open
@karencapiiro karencapiiro mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , , , , , magic-string, , convert-source-map, source-map, graceful-fs, tslib, chokidar, , terser, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , brotli, core-js-bundle, diff, http-server, jasmine-core, jasmine, jquery, tmp, karma, karma-chrome-launcher, karma-firefox-launcher, karma-jasmine, karma-sourcemap-loader, selenium-webdriver, puppeteer, reflect-metadata, requirejs, rollup, shelljs, systemjs, tsickle, typescript, yargs Rashdamada/terragoat#5
Open
@bee22193 bee22193 mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , , browserify, cssnano, gulp-zip bee22193/mnmlurl#1255
Open
@vinit-aikido vinit-aikido mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , , , , , , , magic-string, , convert-source-map, source-map, graceful-fs, tslib, chokidar, , terser, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , brotli, core-js-bundle, diff, http-server, jasmine-core, jasmine, jquery, tmp, karma, karma-chrome-launcher, karma-firefox-launcher, karma-jasmine, karma-sourcemap-loader, selenium-webdriver, puppeteer, reflect-metadata, requirejs, rollup, shelljs, systemjs, tsickle, typescript, yargs vinit-aikido/terragoat#59
Open
@syofyanzuhad syofyanzuhad mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , , , , , classnames, formik, markdown-to-jsx, typescript syofyanzuhad/profile#134
Open
@AnushaSalian AnushaSalian mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , , , ajv, glob, eslint, minimist, handlebars, jsdom, katex, moment, prettier, winston, yargs, workbox-cli virtual-labs/ph3-lab-mgmt#531
Open
@Sonic269 Sonic269 mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , , , , , , , magic-string, , convert-source-map, source-map, graceful-fs, tslib, chokidar, , terser, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , brotli, core-js-bundle, diff, http-server, jasmine-core, jasmine, jquery, tmp, karma, karma-chrome-launcher, karma-firefox-launcher, karma-jasmine, karma-sourcemap-loader, selenium-webdriver, puppeteer, reflect-metadata, requirejs, rollup, shelljs, systemjs, tsickle, typescript, yargs Sonic269/App6#121
Open
@MrRio MrRio mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , core-js, canvg, fflate, html2canvas parallax/jsPDF#3770
Closed
@AnushaSalian AnushaSalian mentioned this pull request Sep 19, 2024
[Snyk] Upgrade: , , , ajv, glob, eslint, minimist, handlebars, jsdom, katex, moment, prettier, winston, yargs, workbox-cli virtual-labs/ph3-lab-mgmt#532
Open
@venkatarao-palaparthi venkatarao-palaparthi mentioned this pull request Sep 19, 2024
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#456
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 19, 2024
[Snyk] Upgrade: , , , , body-parser, dotenv, express, mongoose, nodemon rawdaymohamed/Hot-Todo#375
Open
@venkatarao-palaparthi venkatarao-palaparthi mentioned this pull request Sep 20, 2024
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#457
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 20, 2024
[Snyk] Upgrade: , , , , body-parser, dotenv, express, mongoose, nodemon rawdaymohamed/Hot-Todo#376
Open
@venkatarao-palaparthi venkatarao-palaparthi mentioned this pull request Sep 21, 2024
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#458
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 21, 2024
[Snyk] Upgrade: , , , , body-parser, dotenv, express, mongoose, nodemon rawdaymohamed/Hot-Todo#377
Open
This was referenced Sep 22, 2024
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#459
Open
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#460
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 23, 2024
[Snyk] Upgrade @babel/node from 7.18.10 to 7.25.0 rawdaymohamed/Hot-Todo#382
Open
@anandgupta193 anandgupta193 mentioned this pull request Sep 24, 2024
[Snyk] Upgrade @babel/node from 7.10.4 to 7.25.0 anandgupta193/sortNsuffle-react#1128
Open
@anandgupta193 anandgupta193 mentioned this pull request Oct 3, 2024
[Snyk] Upgrade @babel/node from 7.10.4 to 7.25.0 anandgupta193/sortNsuffle-react#1136
Open
@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.

Reviewers

@liuxingbaoyu liuxingbaoyu liuxingbaoyu approved these changes
@JLHwung JLHwung JLHwung approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

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

Projects

None yet

Milestone

generator: preserveFormat

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@nicolo-ribaudo @babel-bot @JLHwung @liuxingbaoyu
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.