* Add "<" parser tests
* No {jsx,flow,typescript} plugin
* Type parameter
* Valid JS Code
* Add: better parser error when using jsx
Address #11499
* Add: babel parser test
Test parser with no plugins and when jsx is given with a js expression
* Add: no flow but with typescript test
* Add: type paramter test with no plugins (no flow)
* Add: unclosed jsx element test
* Forbid async arrow functions after binary operator.
This commit makes Babel throw an error when parsing
code like "3 + async() => 2".
* Make atPossibleAsync more accurate
* Change atPossibleAsync to atPossibleAsyncArrow
Add an extra test to atPossibleAsync and refactor it to
atPossibleAsyncArrow. This also fixes a bug in the Typescript plugin,
so a new test has been added.
* Add test for async arrow after unary operator
* Added support for record and tuple syntax.
This commit adds support for both the hash #{} and bar {||}
syntaxes to babel-parser, as well as adds the supporting
babel-plugin-syntax-record-and-tuple plugin to enable support
for the syntax. Does not include any transform for records and
tuples.
* typo
* added check to ensure recordAndTuple in babel-parser
* switched to syntaxType option instead of explicit entries for each record and tuple type
* switched to using recordAndTupleSyntaxType for generator options instead of adding to node
* added tests for generator option recordAndTupleSyntaxType
* added test for record and tuple bar syntax with flow typings
* added tests for invalid/missing recordAndTuple syntaxType parser option
* fixed flowcheck errors
* fix merge with class privates in tokenizer
* Update packages/babel-parser/src/types.js
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* improved recordAndTuple generator error message, added tests for invalid,missing options
* updated error messages for invalid parser syntaxType option
* updated error message
* added better error messages for when the recordAndTuple syntaxType is doesn't match the syntax used
* updated record and tuple support to use new error message templates
* added recordAndTuple to missing plugin helpers
* Fix linting
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Fixes issue 10989 where the only the identifier in a member expression that is the value of an object property would be parsed. Removing checkExpressionErrors in parseExprSubscripts results in the subscript also being parsed.
* refactor: replace refShorthandDefaultPos by refExpressionErrors
* fix: duplicate __proto__ keys should be allowed in patterns
* docs: add comments for ExpressionErrors.doubleProto [ci-skip]
* test: add more test for coverage
* fix: disallow private name in object member and TS type elements
* chore: update test262 whitelist
* chore: make flow happy
* Update packages/babel-parser/src/parser/expression.js
Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* chore: update test fixtures
* Update packages/babel-parser/src/parser/expression.js
Co-Authored-By: Brian Ng <bng412@gmail.com>
* chore: update test fixtures
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
* Add error recovery support to @babel/parser
* Update @babel/parser tests to always recover from errors
* Update this.raise usage in @babel/parser:
- expression.js
- lval.js
- statement.js
- estree.js
- flow.js
- jsx/index.js
- tokenizer/index.js
* Update @babel/parser fixtures with recovered errors
* Fix tests out of @babel/parser
* Do not use try/catch for control flow
* Update invalid fixtures
* Do not report invalid lhs in toAssignable
* Do not validate function id multiple times
* Dedupe reserved await errors
* Remove duplicate errors about strict reserved bindings
* Remove duplicated error about yield/await inside params
* Don't error twice for methods in object patterns
* Don't report invalid super() twice
* Remove dup error about reserved param for expr arrows
* Remove double escapes in migrated tests
* Dedupe errors about invalid escapes in identifiers
* Remove duplicated error about decorated constructor
* Remove duplicated error about spread in flow class
* Don't throw for invalid super usage
* Don't fail for object decorators with stage 2
* Fix flow inexact type errors
* Fix flow
* Fix errors about escapes in keywords (ref: #10455)
* Update after rebase
* Fix todo
* Remove duplicated error when using += for defaults
* Remove unnecessary throw
* Nit: use ??
* 🐛 fixed missing errors on assignment pattern in object expression
* ♻️ remove a non-needed comment
* 🐛 missed adding comma in the test input
* 🐛 fixed the failing valid-property-initializer test
* Allow duplicate __proto__ keys in patterns, simple case (#6705)
* Update test262 whitelist
* Rename checkDuplicatedProto's parameter and adjust type
* Store first __proto__ redefinition's position