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
refactor: reorder checkLVal parameters #12346
Conversation
// true | ||
// > obj.__proto__ | ||
// null | ||
const key = `_${expr.name}`; |
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.
Implement checkClashes
with Set
so we don't have to deal with old V8 bug.
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/32768/ |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
return; | ||
default: | ||
super.checkLVal(expr, bindingType, checkClashes, contextDescription); | ||
super.checkLVal(expr, contextDescription, ...args); |
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.
Passing through all the rest parameters here causes typescript-parser tests failed: https://travis-ci.com/github/babel/babel/jobs/433402908#L842
Ironically this is a bug fix, let's see one of the failing tests
It should fail but TS compiler is so loose that it allows such cases, just to be thrown later by TS type checking diagnostics. I will add them to the allowlist
.
2e86bfc
to
e830de5
Compare
const let = 1
whentypescript
plugin is enabled (bug)This PR aims to simplify
checkLVal
usage and tweaked storage ofcheckClashes
a bit. It unintentionally fixed a parser bug.While working on this PR, I find a bug of estree plugin:
This PR does not fix this bug. It should have been caught by the
estree-throws
parser tests,babel/packages/babel-parser/test/helpers/runFixtureTests.js
Line 86 in 5bbad89
but then I realize
estree-throws
will eventually become noop as we are now testing parser on error recovery mode. I will address that in another PR.