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

Treat break inside block inside loop #8914

Merged
merged 2 commits into from Oct 25, 2018

Conversation

thiagoarrais
Copy link
Contributor

@thiagoarrais thiagoarrais commented Oct 22, 2018

Q                       A
Fixed Issues? Fixes #8709
Patch: Bug Fix? 👍
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link --
Any Dependency Changes?
License MIT

Fixes scope for break inside switch statement. The problem was caused by only checking the immediate parent instead of whole ancestor chain.

@thiagoarrais
Copy link
Contributor Author

@nicolo-ribaudo: can you review this, please?

@nicolo-ribaudo nicolo-ribaudo self-assigned this Oct 22, 2018
@nicolo-ribaudo
Copy link
Member

nicolo-ribaudo commented Oct 22, 2018

Can you add a test for a labeled break inside the switch statement which should break the loop?

@babel-bot
Copy link
Collaborator

babel-bot commented Oct 22, 2018

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

@existentialism existentialism added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Oct 25, 2018
@existentialism existentialism merged commit 84e7884 into babel:master Oct 25, 2018
@existentialism
Copy link
Member

@thiagoarrais thanks!

mAAdhaTTah added a commit to valtech-nyc/babel that referenced this pull request Nov 3, 2018
* master: (222 commits)
  Set correct methods name
  Use toPropertyKey in the "decorate" helper
  Allow function types in type params within arrow return types (babel#8954)
  Fix message when plugin of a wrong type is passed (babel#8950)
  rename colliding let bindings with for loop init (babel#8937)
  edge incomplete support for arrow destructuring (babel babel#8349) (babel#8926)
  fix single-arg async arrows when retainLines=true (babel#8868)
  [flow] Explicit inexact objects with `...` (babel#8884)
  Update preset-env data (babel#8898)
  Treat break inside block inside loop (babel#8914)
  fixed "source map" formatting in comment (babel#8878) [skip ci]
  fix typo in contributing guidelines (babel#8901) [skip ci]
  fix: Expression x === 'y' && '' should not evaluate to undefined. (babel#8880)
  fixed an extra word
  Fixes babel#8865 (babel#8866)
  v7.1.4
  v7.1.3
  Bump Babel deps (babel#8770)
  flow-bin@0.82.0 (babel#8832)
  Insertafter jsx fix (babel#8833)
  ...

# Conflicts:
#	packages/babel-parser/src/tokenizer/index.js
#	packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-numeric-literal/options.json
#	packages/babel-parser/test/fixtures/experimental/pipeline-operator/invalid-proposal/options.json
@dewelloper
Copy link

dewelloper commented Mar 11, 2019

but this problem exist on my system and my babel: "@babel/preset-env": "^7.3.4",
https://stackoverflow.com/questions/55109997/what-is-this-code-case-6case-endreturn-context15-stop-babel-react-redux-w

@thiagoarrais
Copy link
Contributor Author

thiagoarrais commented Mar 12, 2019

@dewelloper: I may be able to help you, but I need a repro. Can you come up with a minimal one and open a new issue using the Bug Report template?

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 4, 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
5 participants