Huáng Jùnliàng
e8dac621de
chore: specify package type ( #10849 )
2020-01-09 21:40:15 -05:00
jack
5f807ae45b
Enable optional chaining by default in @babel/parser ( #10817 )
2020-01-10 03:09:39 +01:00
Oleksandr Fediashov
c3388ea42f
Enable nullish coalescing by default in @babel/parser ( #10819 )
...
* move files, remove hasPlugin() & expectPlugin()
* restore permissions
2020-01-10 02:52:53 +01:00
Abdul Ali
5b907e9bb7
[parser] enable dynamic import by default ( #10843 )
...
* [parser] enable dynamic import by default
* chore: add back babel-core api test
2020-01-10 02:28:52 +01:00
Nicolò Ribaudo
771c730fda
[parser] Disallow duplicate and undeclared private names ( #10456 )
...
* [parser] Add private names tracking to Scope
- Disallow duplicate private names
- Disallow undeclared private names
* Update tests
* Test all possible duplications
* Test undeclared private names
* Better error message for top-level private names
* Fix flow
* Update test262 whitelist
* Update fixtures
* Update flow whitelist
* Remove old output.json
* Move ClassScopeHandler to a separate class
* Make the code readable
2020-01-10 02:22:05 +01:00
Huáng Jùnliàng
8fd532db39
LiteralPropertyName should allow BigIntLiteral ( #10955 )
...
* fix: property name should allow BigIntLiteral
* test: add non decimal test case
* add bigintIndex to whitelist
2020-01-07 10:23:50 -05:00
Huáng Jùnliàng
455d782ef0
test: add invalid-lone-import test ( #10950 )
...
* test: add lone import test
* polish: raise recoverable error
2020-01-03 23:08:59 +01:00
Huáng Jùnliàng
a28353703f
fix: check await when parsing AsyncArrowBindingIdentifier ( #10953 )
2020-01-03 23:08:28 +01:00
Huáng Jùnliàng
467667af88
When reading a new string, U+2028/2029 should correctly set th… ( #10944 )
...
* test: add test on template
* fix: update lineStart when string contains U+2028/U+2029
2020-01-03 23:07:54 +01:00
Huáng Jùnliàng
6ee8c97e6a
Fix: TopLevelAwait should respect await identifiers defined in… ( #10947 )
2020-01-03 23:07:11 +01:00
Huáng Jùnliàng
26eb891870
fix: Class Field Initializer should not allow await expression as immediate child ( #10946 )
...
* fix: scope.inAsync should exclude reference in class property initializers
* chore: add test on await in computed class property
* fix flow error :(
2019-12-31 09:36:03 -05:00
Huáng Jùnliàng
0238244268
refactor: remove unecessary checkYieldAwaitInDefaultParams ( #10936 )
2019-12-30 16:12:09 -05:00
Huáng Jùnliàng
2f3f77926d
refactor: remove unused invalidTemplateEscapePosition tokenizer state ( #10935 )
...
* refactor: remove unused invalidTemplateEscapePosition tokenizer state
* fix flow error
2019-12-30 16:11:56 -05:00
Huáng Jùnliàng
30449fe05d
Refactor parseSubscript ( #10937 )
...
* refactor: unify optionalMemberExpression generation
* test: add optional calls invalid typecasts
* fix: do not parse async arrow when call is optional
* test: update test fixtures
2019-12-30 16:11:39 -05:00
Huáng Jùnliàng
86245a83a2
TSTypeCastExpression should not be inside call parameters ( #10939 )
2019-12-30 16:10:19 -05:00
Huáng Jùnliàng
197a8da04d
Remove unused parser methods ( #10942 )
...
* chore: remove unused isStrictBody
* chore: remove unused eatRelational
2019-12-30 16:09:50 -05:00
Huáng Jùnliàng
a18166d2a9
refactor: remove inClassProperty parser state ( #10906 )
2019-12-24 11:43:39 +01:00
Barthélémy Ledoux
f651f22f96
fix: lost leading comment after named import ( #10901 )
...
* create test for 10892
* update expected output
* fixed #10892
* add colon to restart build
* remove colon as it makes tests fail
2019-12-22 10:22:28 +01:00
Nicolò Ribaudo
12da0941c8
v7.7.7
2019-12-19 01:33:19 +01:00
Nicolò Ribaudo
0b3f883ed1
Properly serialize non-json values in parser tests ( #10858 )
2019-12-12 10:22:17 +01:00
Kai Cataldo
7b54a94389
@babel/eslint-parser: fix ImportExpression node to match ESTree spec ( #10828 )
...
* @babel/eslint-parser: fix ImportExpression node to match ESTree spec
* Update caller name for @babel/core.parseSync
* Move logic into estree plugin
* Add estree plugin tests
* Fix Flow error
* Fix flow
* Remove extra properties on ImportExpression node
* Incorporate review feedback
2019-12-11 11:13:57 +01:00
Nicolò Ribaudo
5156d3ea06
Restore @babel/parser tests ( #10854 )
...
* Make parser tests work again
* Update failing fixtures
* Fix serialization of BigInt
* Fix
2019-12-11 11:09:13 +01:00
Bowei Han
20e43ad103
validate parentheses in the left-hand side of assignment expressions ( #10576 )
...
* invalid left-hand assignments based on parenthesis
* validate against nested ParenthesizedExpressions
2019-12-09 20:29:02 -05:00
Kai Cataldo
fb100eee41
@babel/eslint-parser: fix BigIntLiteral node to match ESTree spec ( #10827 )
...
* @babel/eslint-parser: fix BigIntLiteral node to match ESTree spec
* Move token conversion to @babel/eslint-parser
* Add estree plugin tests
* Update test helpers to handle BigInt serializing
* Update Literal union type to include BigIntLiteral
* Add FlowIgnore comment for BigInt
2019-12-08 02:59:18 +01:00
Nicolò Ribaudo
d04508e510
v7.7.5
2019-12-06 14:12:41 +01:00
Huáng Jùnliàng
c6e966cac9
[parser] Use scope flags to check arguments ( #10801 )
...
* chore: add test case
Co-authored-by: Jens Maier<jens@elberet.de>
* use scope flags to check arguments
2019-12-05 08:23:53 +01:00
Alex Lewis
bb6cc61979
fix(optional chaining): Optional delete returns true with nullish base ( #10806 )
...
Per issue 10805, the return value when using delete on a nullish base is
currently undefined. The correct return type should be true.
2019-12-04 12:56:25 +01:00
YeonJuan
d18afbd7c3
Allow tuple rest trailing comma ( #10800 )
2019-12-03 18:32:36 +01:00
Nicolò Ribaudo
5440ae1cae
Correctly disambiguate / after async fuctions ( #10475 )
...
* Correctly disambiguate / after async fuctions
2019-12-02 22:41:39 +01:00
Nicolò Ribaudo
75767d87cb
v7.7.4
2019-11-23 00:05:58 +01:00
George Zahariev
01d6d6dd3b
Flow enums: fix enum body location ( #10737 )
2019-11-19 22:46:08 -06:00
Brian Ng
a502d88043
Fix some incorrect typeof parsing in flow ( #10657 )
2019-11-18 19:22:27 +01:00
gr
10213655bc
[parser] Allow optional async methods ( #10582 )
...
* Add parsePostMemberNameModifiers to aync method
* Add test
2019-11-18 19:18:36 +01:00
Huáng Jùnliàng
cfd26fdbf2
register ImportEqualsSpecifier to scope ( #10710 )
...
Co-authored-by: <jaejoon.choi>
2019-11-18 13:04:34 -05:00
Kai Cataldo
a6d134804a
Unify build step for ESLint packages ( #10723 )
2019-11-16 10:15:15 +01:00
Huáng Jùnliàng
d413a3078c
Add asserts this [is type] parsing support ( #10677 )
2019-11-11 16:36:10 -06:00
Sakibul Mowla
4cb5e0a013
Allow TypeScript type assertions in array destructuring ( #10592 )
...
* Add test
* Add fix
* Fix test, destructure with as assertion
* Add angle-bracket assertion case
* Use isBinding to make typeCastToParameter decision
2019-11-11 22:38:13 +01:00
Nicolò Ribaudo
e315d65a7a
v7.7.3
2019-11-08 23:45:00 +03:00
Nicolò Ribaudo
0287c0f02f
Don't recover from "adjacent jsx elements" parser error ( #10682 )
2019-11-08 23:23:04 +03:00
Nicolò Ribaudo
35f4d12763
v7.7.2
2019-11-07 02:20:52 +03:00
Nicolò Ribaudo
9082e68d6f
Parse arrows with params annotations in conditional expressions ( #10669 )
2019-11-07 02:18:36 +03:00
Leonid Shevtsov
2cd5ad0c80
fix typo: identifer -> identifier ( #10647 )
2019-11-06 09:13:08 +01:00
Nicolò Ribaudo
97faa83953
v7.7.0
2019-11-05 11:27:14 +01:00
Nicolò Ribaudo
e9c1bce50f
Add support for TS declare modifier on fields ( #10545 )
...
* [parser] Add support for TS declare modifier on fields (#10484 )
* [parser] Add support for TS declare modifier on fields
* Use Object.create(null)
* Comment
* Add support for TS declare types to types and generator (#10544 )
* Transform TypeScript "declare" fields (#10546 )
* Transform TypeScript "declare" fields
* Remove multiple spaces
* declareFields -> allowDeclareFields
* Update after rebase
2019-11-05 10:56:57 +01:00
Nicolò Ribaudo
87feda7c2a
@babel/parser error recovery ( #10363 )
...
* 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 ??
2019-11-05 10:15:00 +01:00
Nicolò Ribaudo
d023e105b7
[TS] Parse calls with type args in optional chains ( #10631 )
...
* [TS] Parse calls with type args in optional chains
* Test output
2019-11-04 13:25:15 -05:00
George Zahariev
ec3345bb57
Flow enums parsing ( #10344 )
...
* Flow enums parsing
* Parse exporting enums
* Enums parsing remove lookahead, other improvements
* Enums: add EnumBody and EnumMember aliases, change boolean members to use BooleaLiteral value
* Fix enum member init flow type, now that boolean members have a BooleanLiteral value
* Flow enums: use contextual utils, change members length checks to use logic operators, remove reserved word logic modification
* Flow enums: remove unnecessary code in generator, fix error message
2019-10-29 22:55:12 +01:00
Vivek Nayyar
4b3a19ea9f
fixed missing errors on assignment pattern in object expression ( #10607 )
...
* 🐛 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
2019-10-29 22:32:02 +01:00
Nicolò Ribaudo
143d159982
Create parser plugin "topLevelAwait" ( #10449 )
...
* Create parser plugin "topLevelAwait"
* Update test262 whitelist
* Update ts typings
* Fix "sourceType: unambiguous" with TLA
* Ambiguous tokens after await
* Update await %x(0)
* typo [skip ci]
* Typo [skip ci]
Co-Authored-By: Brian Ng <bng412@gmail.com>
2019-10-29 22:18:39 +01:00
Georgii Dolzhykov
63f9a3c946
rename assertsModifier to asserts ( #10613 )
...
see https://github.com/babel/babel/pull/10543#issuecomment-547571501
2019-10-29 16:25:42 -04:00