775 Commits

Author SHA1 Message Date
Chris Garrett
3f3ce5f668 Add the decoratorsAutoAccessors parser plugin (#13681)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2022-01-16 14:14:19 +01:00
Babel Bot
bc0d1ef860 v7.16.8 2022-01-10 21:11:46 +00:00
Sosuke Suzuki
69246b6212
[babel 8] fix properties name for function-like TS nodes (#13709)
* Align AST

* Add tests for parser

* Generator

* Add babel-types support

* Address review

* Address review
2022-01-10 17:35:03 +01:00
Babel Bot
23e884048a v7.16.7 2021-12-31 00:13:43 +00:00
Nicolò Ribaudo
d1cabf6bc8
[babel 8] Add "exports" to every package (#14013) 2021-12-29 16:29:10 +01:00
Huáng Jùnliàng
ad17fe1cce
fix: check preceding line break before exclamation (#14049) 2021-12-16 15:50:15 -05:00
Babel Bot
5687ade5e7 v7.16.6 2021-12-14 23:32:57 +00:00
Huáng Jùnliàng
7794201940
fix: handle tokens for invalid template element (#14055) 2021-12-14 17:54:09 -05:00
Babel Bot
7b7ab94066 v7.16.5 2021-12-13 22:12:58 +00:00
Huáng Jùnliàng
39080492f4
maintain estree string literal shape when cloned (#14039) 2021-12-09 17:58:25 -05:00
Huáng Jùnliàng
94af0e5c62
Improve template tokenizing (#13919)
* add benchmarks

* refactor: tokenize template as middle + tail

* perf: avoid push tc.brace

* refactor: overwrite skipSpace in jsx plugin

* transform tl.templateMiddle/Tail

* refactor: simplify JSX context tracking

* fix flow error

* refactor: move JSX context to context.js

* fix: ensure comment stack is correctly handled

* rename createPositionFromPosition

* rename token type and methods

* add tokenIsTemplate

* refactor: merge babel 7 logic in babel7CompatTokens

* fix flow error
2021-12-06 16:43:46 -05:00
Nicolò Ribaudo
2d989a983d
Run tests in a native Node.js ESM environment (#13966) 2021-12-03 15:32:58 +01:00
J. S. Choi
f4236f43a1
Extend hasPlugin to accept plugin-configuration array pairs (#13982)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-12-02 23:17:51 +01:00
Nicolò Ribaudo
ad1798ed48
Only bundle the release build, and don't import src in tests (#13978)
* Only bundle the release build, and don't import `src` in tests

* Use file extension to signal skipping

* Remove unnecessary config change

* Fix imports
2021-11-24 10:08:53 -05:00
Nicolò Ribaudo
75996cb62b
Use full import specifier path in tests (#13938) 2021-11-24 11:43:18 +01:00
Huáng Jùnliàng
a470f7b479
Recover from shorthand assign exprs (#13968)
* refactor: avoid duplicate property access

* refactor: tweak parseMember

* polish: recover from shorthand assign in exprs
2021-11-19 10:22:29 -05:00
Huáng Jùnliàng
d30308fe8e
fix: update UnexpectedPrivateField error message (#13975) 2021-11-17 18:54:23 +01:00
Babel Bot
99774ee9fa v7.16.4 2021-11-16 22:37:47 +00:00
Sosuke Suzuki
87fc2e76d7
Add assertions to ExportNamedDeclaration without from (#13957) 2021-11-16 11:53:28 +01:00
Francisco Ryan Tolmasky I
966387d263
Always expose expressionValue in DirectiveLiteral nodes (#13960)
* fix(babel-parser): Move storage of expressionValue in DirectiveLiteral to main parser so it is accessible to others.

Closes #13953.

Reviewed by @tolmasky.

* Add results from running `OVERWRITE=true yarn jest babel-parser`.

Reviewed by @tolmasky.
2021-11-13 20:46:16 -05:00
Huáng Jùnliàng
54c539ecc1
Refactor bindingProperty parsing (#13929)
* refactor: inline parseMaybePrivateName

* correct test case

* perf: fast exit in checkExpressionErrors

* refactor: add parseBindingProperty

* fix: private property with variance

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

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

* chore: update testcase

* refactor: remove refExpressionErrors for record/tuple

They are always non-ambiguous.

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-11-12 10:11:46 -05:00
Sneh Khatri
135ab837bc
Throw on duplicate __proto__ props followed by assignment (#13951) 2021-11-12 14:45:56 +01:00
Babel Bot
3b6f061e18 v7.16.3 2021-11-09 21:44:15 +00:00
Sneh Khatri
a6a526968d
fix: incorrect await rejection following arrow function in parameters (fixes #13872) (#13928)
* fix: incorrect await rejection following arrow func in params

* expressionScope.exit() shifted to end

* test added for yield
2021-11-05 15:41:31 -04:00
Huáng Jùnliàng
7250d2562b
Simplifiy tracking of valid JSX positions (#13891)
Remove `state.inPropertyName` and simplifies `state.canStartJSXElement` tracking
2021-11-04 17:12:42 +01:00
Huáng Jùnliàng
1fa759f989
refactor: extract tt.lt and tt.gt from tt.relation (#13892) 2021-11-01 21:15:42 -04:00
Babel Bot
68fad796b1 v7.16.2 2021-11-01 21:47:31 +00:00
Sosuke Suzuki
cba7f9e503
Add missing assertions type (#13905) 2021-11-01 08:43:39 -04:00
Nicolò Ribaudo
45308f3cba v7.16.0 2021-10-30 01:26:04 +02:00
Sosuke Suzuki
d5ba355867
Support TypeScript 4.5 type-only import/export specifiers (#13802) 2021-10-29 01:23:23 +02:00
Huáng Jùnliàng
872086a9a0
feat: support startColumn option (#13887) 2021-10-29 01:20:32 +02:00
Nicolò Ribaudo
718c6cb7de
Handle .mts and .cts files in @babel/preset-typescript (#13838) 2021-10-29 01:13:37 +02:00
J. S. Choi
ad59a2c618
Caret topic (pipe operator) (#13749)
* parser: Add caret as topic reference (tests)

* parser: Add caret as topic reference (implement)

* generator: Avoid reconstructing validTopicTokenSet

* babel-parser: Remove redundant throws in expression.js

* Minimize diff

* Update error message

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-10-28 16:04:55 -04:00
Sosuke Suzuki
ddc45a5a50
Enable class static blocks by default (#13713)
* Remove classStaticBlock plugin

* Update tests

* Remove class static blocks from proposalPlugins

* Update tests

* Remove classStaticBlock from mapping for test262

* chore: update babel-types

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2021-10-28 14:39:04 -04:00
Nicolò Ribaudo
fb7ddf4d38
[ts] Support private methods overloads (#13876)
* [parser] Allow private methods overloads when parsing TS

* Add transform tests

* Fix estree

* Fix flow
2021-10-26 07:29:20 +02:00
Nicolò Ribaudo
c7ddb1ae93
Use workspace:^ to specify @babel/ dependencies (#13772)
* Enforce `workspace:^` to specify `@babel/` dependencies

* `yarn constraints --fix`

* Update lockfile
2021-10-25 07:22:08 +02:00
Nicolò Ribaudo
62b2c5ebb9
Regenerate parser fixtures (#13882) 2021-10-24 18:12:10 +02:00
Mickey Rose
b5907ef967
remove executable permission from files that shouldn't have it (#13873) 2021-10-23 14:18:30 +02:00
Babel Bot
c4b13725aa v7.15.8 2021-10-06 20:45:15 +00:00
Nicolò Ribaudo
64f14b05fa
Collect comments around parentheses in expressions (#13803)
Co-authored-by: Brian Ng <bng412@gmail.com>
2021-10-05 20:15:24 +02:00
Huáng Jùnliàng
178d43ff17
Tokenize keywords-like identifier as new tokens (#13769)
* refactor: add more identifier token helpers

* refactor: explode tt.name into multiple tokens

* fix: disallow escape in interface keyword

* refactor: simplify isMaybeDefaultImport

* review comments

* refactor: avoid string comparison
2021-09-23 10:54:44 -04:00
Nicolò Ribaudo
2e2d202694
[babel 8] Materialize ESTree's classFeatures option (#13752)
* [babel 8] Enable ESTree classFeatures by default in @babel/parser

* Fix `visitorKeys`

* Update tests
2021-09-22 15:28:10 -04:00
Babel Bot
8d0294edf8 v7.15.7 2021-09-17 22:54:10 +00:00
Huáng Jùnliàng
d2076a531f
Store token type as number (#13768)
* refactor: abstract token metadata access

* refactor: move token-specific update context logic

* refactor: centralize token definitions

* refactor: abstract token type creation

* refactor: use number as token storage

* build: replace tt.* as number

* fix flow errors

* fix: build on Node 12

* Update packages/babel-parser/src/tokenizer/types.js

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

* refactor: rename token types exports to tt

* update unit test

* test: update Babel 8 test fixtures

* fix: centralize obsolete token type updateContext

* fix flow errors

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-09-17 09:36:11 -04:00
JuniorTour
da79c90f2a
fix(babel-parser): Allow line break before assert return type (#13771) 2021-09-16 23:24:11 +02:00
Nicolò Ribaudo
710b3919fa
[estree] Fix conversion of PrivateName in MemberExpression (#13755)
* Update test

* [estree] Fix conversion of `PrivateName` in `MemberExpression`
2021-09-14 17:14:04 +02:00
Babel Bot
34a27e46f8 v7.15.6 2021-09-09 19:22:51 +00:00
Nicolò Ribaudo
3c3f5205c9
Fix right precedence of Hack pipes (#13668) 2021-09-08 17:38:07 +02:00
Sosuke Suzuki
c25ec3e069
[babel-parser] add tests for static blocks with line breaks (#13734) 2021-09-04 16:27:38 +02:00
Sosuke Suzuki
62e42a3f60
fix(babel-parser): Fix end of range of SequenceExpression (#13731) 2021-09-04 12:01:20 +02:00