Skip to content

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!

for (let i = 0; i < len; i++) {
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

@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.

5 participants