619 Commits

Author SHA1 Message Date
Babel Bot
e50f6f7eef v7.13.15 2021-04-08 15:40:57 +00:00
Federico Ciardi
42e630e8a2
Allow trailing comma after rest parameter in TSDeclareFunction (#13101)
* fix(ts): allow trailing comma after rest parameter in `TSDeclareFunction`

* Apply code review changes

Co-Authored-By: Nicolò Ribaudo <7000710+nicolo-ribaudo@users.noreply.github.com>
2021-04-06 18:36:17 +02:00
Federico Ciardi
7fe3ebf4db
fix: raise SyntaxError for unparenthesized assert and assign (#13099)
* fix: raise `SyntaxError` for unparenthesized assert and assign

* chore
2021-04-06 16:07:13 +02:00
Bogdan Savluk
a647b9ea6b Convert @babel/core to TypeScript (#12929)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-03-30 19:51:35 +02:00
Huáng Jùnliàng
8efbac4a5d
fix: the LHS in for-of loop should not start with let (#13049)
* fix: the LHS in for-of loop should not start with let

* Update packages/babel-parser/src/parser/statement.js

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

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-03-29 16:54:23 -04:00
Babel Bot
2f8203f190 v7.13.13 2021-03-26 21:09:38 +00:00
Huáng Jùnliàng
0067fd9e02
Disallow await before exponential (#12441)
* refactor: move unary exponential check to parseMaybeUnary

* fix: disallow await before exponential

* add test cases
2021-03-25 11:20:47 -04:00
Federico Ciardi
4f727139ec
fix(ts): Allow parenthesized "assert and assign" (#12933)
Co-authored-by: Nicolò Ribaudo <7000710+nicolo-ribaudo@users.noreply.github.com>
2021-03-22 17:00:03 +01:00
Babel Bot
edb11baabf v7.13.12 2021-03-22 15:36:45 +00:00
Sosuke Suzuki
beb7cf8b24
Sort error keys with ESLint (#13020) 2021-03-18 21:01:57 +01:00
Babel Bot
4b674ea031 v7.13.11 2021-03-15 09:34:23 +00:00
Huáng Jùnliàng
0988c471e9
Parse type imports in TSImportEqualsDeclaration (#12962) 2021-03-14 23:34:49 +01:00
Huáng Jùnliàng
1a05b81387
Support multiple static blocks (#12738) 2021-03-12 23:29:55 +01:00
Babel Bot
d1d404b9a3 v7.13.10 2021-03-08 22:23:36 +00:00
Nicolò Ribaudo
d04842a700
Avoid using CJS globals in internal source files (#12963)
* Lint against CJS globals in modules

* Use `import.meta.url` instead of `__filename` in `src` files

* Prepare fixtures runner for `import.meta.url`

* Use `import.meta.url` instead of `__filename` in `test/index` files

* Remove `__dirname` from remaining test files

dirname

* Avoid using `module` in `src` files

* Avoid using `require` in `src` files

* Avoid using `require` in `test` files

* Update `@types/node`

* Compile dynamic import in `@babel/node`

* Fix windows

* Use `@babel/plugin-proposal-dynamic-import` from npm
2021-03-05 19:55:36 +01:00
Sosuke Suzuki
b416847b61
(ts) Raise syntax error for abstract methods with a body (#12687)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-03-02 11:57:58 +01:00
Babel Bot
2c0e8d0008 v7.13.9 2021-03-01 21:33:11 +00:00
Huáng Jùnliàng
efdca01409
fix: add tokens when tokens: true is passed to parseExpression (#12939) 2021-03-01 14:09:56 -05:00
Sosuke Suzuki
b62fc3d44f
babel-parser(flow): Set this property to null for FunctionTypeAnnotation without parens (#12930)
* Add null property to FunctionTypeAnnotation without parens

* Update tests

* Update tests
2021-03-01 09:15:43 -05:00
Babel Bot
e940b8c4b9 v7.13.4 2021-02-23 10:31:04 +00:00
Nicolò Ribaudo
c30039029a
Don't enable class features by default in estree (#12867)
* Don't enable class features by default in `estree`

* Flow

* Reduce breakage
2021-02-23 11:30:01 +01:00
Nicolò Ribaudo
c827193d9c v7.13.0 2021-02-22 23:35:18 +01:00
Huáng Jùnliàng
03d7911be6
Implement class features in estree (#12370)
Co-authored-by: Kai Cataldo <kai@kaicataldo.com>
2021-02-21 20:12:12 +01:00
Sosuke Suzuki
9c567baa9b
Parse JS Module Blocks proposal (#12469) 2021-02-21 20:08:20 +01:00
Sosuke Suzuki
e4588bed22
Support TypeScript 4.2 abstract constructor signatures (#12628)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-02-21 20:07:55 +01:00
George Zahariev
5b99b8f221
Flow Enums with unknown members support (#12193)
* Flow Enums with unknown members parsing

* Updates after rebase

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-02-21 18:42:23 +01:00
Daniel Sainati
16e9f1c8e5
Support Flow this parameter annotations (#12234) 2021-02-21 17:44:27 +01:00
Nicolò Ribaudo
2f755ef052 v7.12.17 2021-02-18 15:58:43 +01:00
Federico Ciardi
8e9143f06f
fix(ts): parse multiline declarations correctly (#12776)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-02-16 23:51:24 +01:00
Ikko Ashimine
4819ce70e4
refactor: fix typo in error.js (#12808)
postion -> position
2021-02-16 12:35:58 -05:00
Sosuke Suzuki
c22e72eb24
Raise recoverable error for type members with invalid modifiers (#12785) 2021-02-12 17:20:06 +01:00
Babel Bot
dd5c9f958c v7.12.16 2021-02-11 22:36:24 +00:00
Nicolò Ribaudo
c07185207c
[parser] Fix scope handling of Flow declared functions (#12735) 2021-02-10 21:07:14 +01:00
Sosuke Suzuki
f1a327506e
ts: Throw recoverable for duplicates access modifier (#12775)
* Support parsing for duplicates access modifiers

Support parsing for duplicates access modifiers

* Fix lint problems

* Address reviews
2021-02-09 09:59:06 +01:00
Sosuke Suzuki
d242ea04c8
babel-parser(ts): Raise recoverable error for abstract interface (#12771)
* Support parsing abstract interface

* Address review

Address reviews

Address reviews

* Fix types

* Add hasFollowingLineBreak
2021-02-09 09:56:18 +01:00
Nicolò Ribaudo
e735266dee
Avoid importing .json files (#12759)
* Avoid importing `.json` files

* Use ESold in babel.config.json

* Use `import/extensions` eslint plugin
2021-02-05 23:34:36 +01:00
Federico Ciardi
bf523da0b0
fix(ts): include asserts in TSTypePredicate location (#12763) 2021-02-05 20:02:41 +01:00
Federico Ciardi
eccbcca948
[TS] Create TSUnionType or TSIntersectionType when typealias has a leading operator (#12758)
* Create `TSUnionType` or `TSIntersectionType` when typealias has a leading operator

* Apply code review suggestions

* Test `TSIntersectionType`
2021-02-05 20:00:27 +01:00
Babel Bot
b1921d2d9b v7.12.15 2021-02-04 21:27:03 +00:00
Federico Ciardi
d1cf66e8c1
fix(ts): include leading operator in TSUnionType and TSIntersectionType locations (#12757) 2021-02-04 19:24:35 +01:00
Nicolò Ribaudo
dd18d87152 v7.12.14 2021-02-03 15:58:57 +01:00
Federico Ciardi
94ba66c89b
fix(ts): allow abstract methods with export default abstract class (#12748) 2021-02-03 09:48:41 -05:00
Nicolò Ribaudo
d291edbdf1 v7.12.13 2021-02-03 01:59:31 +01:00
Stuart Cook
20664a430e
Permit %%placeholder%% in left-hand-side of a let declaration (#12725)
* 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
2021-02-01 20:00:21 -05:00
Huáng Jùnliàng
ecfe20395b
spec: disable await binding identifier within static block (#12661) 2021-02-01 21:55:43 +01:00
Huáng Jùnliàng
108564fdad
refactor: raise AwaitNotInAsyncContext when an AwaitExpression will be parsed (#12716)
* 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
2021-02-01 10:46:43 -05:00
Nicolò Ribaudo
8cf0a757d5
Recover from "missing semicolon" errors (#12437)
* Recover from "missing semicolon" errors

* Update other tests

* Fix flow

* Fix windows test

* Add back deleted test
2021-02-01 10:08:43 +01:00
Sosuke Suzuki
45fdde0ce2
(ts) Throw for abstract methods in a non-abstract class (#12686) 2021-01-27 18:56:55 +01:00
Federico Ciardi
fbfd1b2aa6
fix(parser): throw error with wrong typescript 'export declare' (#12684) 2021-01-26 22:51:12 -06:00
Sosuke Suzuki
8fcba6eb55
Raise recoverable error for await expressions in sync functions (#12520) 2021-01-24 01:45:27 +01:00