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

Bail on sharing comments with siblings if key is a string #5007

Merged
merged 2 commits into from
Dec 16, 2016

Conversation

existentialism
Copy link
Member

@existentialism existentialism commented Dec 15, 2016

Q A
Patch: Bug Fix? Y
Major: Breaking Change? N
Minor: New Feature? N
Deprecations? N
Spec Compliancy? N
Tests Added/Pass? Y/Y
Fixed Tickets Fixes #4995
License MIT
Doc PR
Dependency Changes

@@ -0,0 +1,4 @@
myLabel: //woops
for (let a of {}) {
Copy link
Member

Choose a reason for hiding this comment

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

{} isn't valid anyway so it should be anything else like b

Copy link
Member

@hzoo hzoo Dec 15, 2016

Choose a reason for hiding this comment

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

If we wanted to test validity then could make an exec.js test, but yeah this is just b/c of the comment

@hzoo hzoo added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Dec 15, 2016
@hzoo hzoo added this to the Next Patch milestone Dec 15, 2016
@codecov-io
Copy link

codecov-io commented Dec 15, 2016

Current coverage is 89.10% (diff: 100%)

No coverage report found for master at e06faa9.

Powered by Codecov. Last update e06faa9...dca9352

@@ -5,6 +5,9 @@
*/

export function shareCommentsWithSiblings() {
// NOTE: this assumes numbered keys
if (typeof this.key === "string") return;
Copy link
Member

Choose a reason for hiding this comment

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

I wonder what value does the key get in a LabeledStatement... or does the sharing happen from the ForOfStatement side? That would be bad 😆

Copy link
Member

@hzoo hzoo Dec 16, 2016

Choose a reason for hiding this comment

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

the key is basically the position in Program or a BlockStatement via an integer but if it's part of another node it's just the property name of the key (so for for-of it's like left, right, body). For a LabeledStatement its an integer too.

@hzoo hzoo merged commit 196cdd4 into babel:master Dec 16, 2016
panagosg7 pushed a commit to panagosg7/babel that referenced this pull request Jan 17, 2017
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 6, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 6, 2019
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 PR: Bug Fix 🐛 A type of pull request used for our changelog categories
Projects
None yet
4 participants