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

Fix "Cannot read properties of undefined" regression #15031

Merged
merged 1 commit into from Oct 10, 2022

Conversation

farewell-zy
Copy link
Contributor

@farewell-zy farewell-zy commented Oct 10, 2022

Patch: 'end or start' of undefined

@babel-bot
Copy link
Collaborator

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

Copy link
Member

@liuxingbaoyu liuxingbaoyu left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -951,8 +951,8 @@ class Printer {
const comment = comments[i];

if (hasLoc && "loc" in comment && !this._printedComments.has(comment)) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe judge comment.loc != null directly here?

@nicolo-ribaudo
Copy link
Member

What is a test that shows the crash?

@liuxingbaoyu
Copy link
Member

This should be the case when loc is set to undefined in the plugin. Let me add a test.

@liuxingbaoyu
Copy link
Member

This is in the main branch, I can't push, merge it first?

@nicolo-ribaudo nicolo-ribaudo changed the title 'end or start' of undefined Fix "Cannot read properties of undefined" regression Oct 10, 2022
@nicolo-ribaudo nicolo-ribaudo merged commit 2bbc722 into babel:main Oct 10, 2022
@jtoar
Copy link

jtoar commented Oct 10, 2022

Thanks! We were seeing this in CI here if it helps: https://github.com/redwoodjs/redwood/actions/runs/3220457113/jobs/5267202329#step:12:81

@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 Jan 10, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
i: regression 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.

None yet

5 participants