* Permit %%placeholder%% in left-hand-side of a let declaration
* Test that "let" followed by modulo is still treated as an identifier
* More tests for edge-case handling of "let" with placeholders enabled
* refactor: raise AwaitNotInAsyncContext when an AwaitExpression will be parsed
* tweak logic
* early exit when errors are before thrown error position
* fix: always return true in assert.throws callback
See https://nodejs.org/api/assert.html#assert_assert_throws_fn_error_message
* update test fixtures
* fix flow error
* jsx: fix sequence expression at JSXAttributeValue (#8787)
* jsx: fix sequence expression at JSXAttributeValue
* Change logic for detecting unparenthesized expressions
* use parseMaybeAssign instead of custom error handling
Co-authored-by: Daniel Tschinder <daniel@tschinder.de>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* I'm not good at booleans
* Format
* Throw a recoverable error
Co-authored-by: Bruno Macabeus <macabeus@users.noreply.github.com>
Co-authored-by: Daniel Tschinder <daniel@tschinder.de>
* refactor: introduce isPrivateName and getPrivateNameSV
* feat: check recoverable errors on estree-throw
* fix: pass through all params of parseBlockBody
* fix: set bigInt to null when invalid bigInt value is parsed
e.g. 0.1n
* fix: use string literal value in error message
When estree plugin is enabled, stringLiteral#extra.raw is not accessible. Use StringLiteral#value instead.
* refactor: introduce hasPropertyAsPrivateName
* fix: adapt to ChainExpression
* fix: port checkLVal early return for method in object pattern
* fix: throw new a?.() on estree
* fix: early return for __proto__ in accessors
* fix: test record element via isObjectProperty
* fix: pass through isLHS in toAssignable
* refactor: introduce isObjectMethod methods
* fix: disallow all parenthesized pattern except parsing LHS
* fix: forStatement requires LHS
* simplify toAssignable
* add more test cases
* fix: pass through isLHS on object property and assignment expression
* fix: record parenthesized identifier error for LHS
* remove duplicated skipped tests
* fix: do not record errors on ancestry arrow head
* Update packages/babel-parser/src/util/expression-scope.js
Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
* polish: update AwaitNotInAsyncFunction message
* polish: update YieldInParameter error message
* Apply suggestions from code review
Co-authored-by: Brian Ng <bng412@gmail.com>
* update test fixtures
Co-authored-by: Brian Ng <bng412@gmail.com>
* Reland "Fix: check if param is assignable when parsing arrow return type annotation"
This reverts commit 91a7a64b4b0c30ab1fdfbb12f77522afa2285ec4.
* Mark `RestElement` as assignable
* fix(babel-parser) better error message for missing number exponent after 'e'
* fix(babel-parser) requested changes
* msg
Co-authored-by: Brian Ng <bng412@gmail.com>