32 Commits

Author SHA1 Message Date
Babel Bot
b99c4f06d4
chore: update test262 to 70bc32edab22b44db9d671ce505db8842ae200b6 (#13233) 2021-04-29 21:50:43 -04:00
Nicolò Ribaudo
22b0eb038f [ts] Enforce order for the override modifier (#13209)
* [ts] Enforce order for the `override` modifier

* generator

* Add more checks

* Update TS tests
2021-04-28 18:21:31 +02:00
Huáng Jùnliàng
ceaab0bae7 Parse class fields and private methods by default (#13175)
* feat: materialize class features

* chore: move testcases to es2022

* chore: update test fixtures

* chore: remove classPr\w+ from options.json

* chore: remove empty options.json

* update flow test allowlist

* update typescript allowlist
2021-04-28 18:21:31 +02:00
Sosuke Suzuki
7484b51e56 Support TS 4.3 get/set type members (#13089)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-04-28 18:21:31 +02:00
Pig Fang
eac0259ce2 Support TS 4.3 static index signature in classes (#13096) 2021-04-28 18:21:31 +02:00
Babel Bot
fb908fd87e
Update test262 (#13196)
* chore: update test262 to eca69e2c95972a4c5780ef58fe1f1e53e871b9b1

* test262: add mapping for privateIn

* test262: ignored syntax-free features

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2021-04-23 10:40:54 +02:00
Karan Sapolia
b63be942ce
Use native ESM for dev scripts (#12296)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-01-30 18:36:21 +01:00
Sosuke Suzuki
45fdde0ce2
(ts) Throw for abstract methods in a non-abstract class (#12686) 2021-01-27 18:56:55 +01:00
Zen
6c9a481e83
@babel/preset-typescript: fix tsx assigment issue (#12599) 2021-01-10 09:21:39 -06:00
Huáng Jùnliàng
0f866ed9d2
Add a workflow to update test262 tests weekly (#12523)
* chore: draft update parser tests workflow

* Build babel parser

* chore: use Babel bot as git user name

* use babel-bot token

* refactor: use actions/github-script

* rename
2020-12-21 10:04:57 -05:00
Sosuke Suzuki
94d116052f
[ts] Allow modifiers as names of methods with type parameters (#12356) 2020-11-18 15:29:02 +01:00
Huáng Jùnliàng
b564368d6e
refactor: reorder checkLVal parameters (#12346)
* refactor: reorder checkLVal parameters

* update allow list

* Apply suggestions from code review
2020-11-17 09:07:32 -05:00
Huáng Jùnliàng
2782a549e9
Refactor yield await classification (#12230)
* fix: incomplete ParamKind declaration

* refactor: add expression scope handler

* test: update test262 allowlist

* chore: cleanup

* fix: push expression scope for function body

* fix: push new expression scope for initializer and static block

* test: add more test cases

* fix flow error

* refactor: remove unecessary expression scope

* fix: parameter initializer error should not cross expression scope boundary

* chore: cleanup outdated comments

* fix: do not record async arrow error on ParameterDeclaration

* Update packages/babel-parser/src/util/expression-scope.js

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>

* polish: clear ancestry declaration error on validate

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-10-26 11:42:02 -04:00
Brian Ng
d51aa6d761
[ts] Allow optional binding pattern parameters within types/interfaces (#12227) 2020-10-21 08:16:43 -05:00
Huáng Jùnliàng
1964c961ae
chore: update test262 tests (#12204) 2020-10-16 16:55:10 -04:00
Nicolò Ribaudo
3fd963fdc8
[ts] Add support for template interpolations in types (#12131)
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 20:15:42 +02:00
Sosuke Suzuki
a4a14caee7
Throw a syntax error for empty type parameter/argument (#12088) 2020-09-22 08:26:30 -05:00
Sosuke Suzuki
7028a14c7f
fix: throw for constructors with type parameters (#12065)
* Throw a syntax error for a constructor with type parameters

* Modify to match error location with TypeScript

* Update typescript parser tests

Update allowlist.txt
2020-09-17 13:03:33 -04:00
Brian Ng
8a1d7e41f2 Allow unknown/any in TS catch clause param (#11755) 2020-07-29 16:51:48 -04:00
Huáng Jùnliàng
e498bee10f
replace whitelist by allowlist in parser-tests (#11727) 2020-06-17 15:32:46 -04:00
Bogdan Savluk
4108524856
Update prettier to v2 (#11579)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-06-07 22:21:33 +02:00
Justin Ridgewell
bda759ac3d Handle private access chained on an optional chain (#11248)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-05-26 22:18:17 +02:00
Huáng Jùnliàng
dcd23c7949
chore: update test262 (#11590) 2020-05-21 08:20:10 -05:00
Huáng Jùnliàng
2f31ecf85d
fix: allow bigInt in method name and TSLiteralType (#11547)
* refactor: add isLiteralPropertyName to parser utils

* address review comments [skip-ci]

* refactor: keyword is valid identifierName

* fix: allow bigint in TSLiteralType

* update typescript test whitelist
2020-05-14 18:40:52 -04:00
Brian Ng
1a2f67191c
Update flow test whitelist (#11459) 2020-04-21 16:39:40 -05:00
Huáng Jùnliàng
81c5f1f22d
Disallow private name in object elements and TS type elements (#10980)
* 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>
2020-01-11 11:26:10 -05:00
Huáng Jùnliàng
9fec528016 Reduce false negative cases of typescript parser tests (#10979)
* tests: read baesline errors for typescript parsing error

* chore: add error codes

* chore: tune the regex
2020-01-10 22:11:10 +01:00
Nicolò Ribaudo
bfc56ebbab Update Test262, Flow and TS parser tests (#10976)
* Update Test262, Flow and TS parser tests

* Updates
2020-01-10 09:50:11 -05: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
314513374d
chore: update test262 (#10943)
* chore: update test262

* chore: ignore untoggleable features
2019-12-29 21:35:19 -05:00
Nicolò Ribaudo
e74efd2c0a Run parser tests from the official TypeScript parser (#10444) 2019-12-03 01:09:54 +01:00