Huáng Jùnliàng
1382437ad6
Add js extension to preset-env generated polyfill imports ( #10862 )
2020-12-10 20:16:46 +01:00
Nicolò Ribaudo
bf417186bf
Setup JSX runtime even if the file doesn't contain JSX ( #12479 )
2020-12-10 19:27:22 +01:00
Huáng Jùnliàng
e5b2680756
Move some build steps to gulp ( #12127 )
...
* chore: move generate-standalone to gulp tasks
* move build-flow-typings to gulp tasks
* chore: move build-typescript-typings to gulp tasks
* move generate-type-helpers to gulp tasks
* chore: include build-typings and generate-type-helpers in gulp build
* update generate-standalone comments
* address review comments
* chore: revert build-typings refactor
* fix: run build-typings in build-no-bundle
2020-12-10 12:25:16 -05:00
Mateusz Burzyński
1ef9e196d3
Allow multiple __self/__source props with classic JSX runtime ( #12475 )
2020-12-10 18:17:20 +01:00
Nicolò Ribaudo
e8176de528
[babel 8] Remove the jsonCompatibleStrings option ( #12477 )
...
Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
2020-12-10 18:14:13 +01:00
Nicolò Ribaudo
e901454096
v7.12.10
2020-12-09 23:44:59 +01:00
Nicolò Ribaudo
a17e4715c9
[babel 8] Enable allowDeclareFields option by default w/ Flow ( #12457 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Ajaykumar <pajay2507@gmail.com>
2020-12-09 00:16:10 +01:00
Nicolò Ribaudo
98aa72ca74
Use native Node.js functions when available ( #12458 )
2020-12-09 00:03:47 +01:00
Mateusz Burzyński
c2fcd69e94
Stop using old JSX transform ( #12253 )
2020-12-08 22:41:13 +01:00
Nicolò Ribaudo
b422c7f0ef
[babel 8] Disallow sequence expressions in JSX expression containers ( #12447 )
...
* jsx: fix sequence expression at JSXAttributeValue (#8787 )
* jsx: fix sequence expression at JSXAttributeValue
* Change logic for detecting unparenthesized expressions
* use parseMaybeAssign instead of custom error handling
Co-authored-by: Daniel Tschinder <daniel@tschinder.de>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* I'm not good at booleans
* Format
* Throw a recoverable error
Co-authored-by: Bruno Macabeus <macabeus@users.noreply.github.com>
Co-authored-by: Daniel Tschinder <daniel@tschinder.de>
2020-12-08 10:15:03 +01:00
Sosuke Suzuki
2ba9265198
Add missing semicolon in AST spec ( #12454 )
...
[skip ci]
2020-12-07 19:32:35 +01:00
Nicolò Ribaudo
b5b95f81dc
Add @babel/traverse tests for re-exported bindings ( #12429 )
2020-12-06 19:33:21 +01:00
Sosuke Suzuki
285402d82f
Add StaticBlock to Table of Contents in AST spec ( #12449 )
2020-12-05 14:12:42 +01:00
Nicolò Ribaudo
c139d1602b
Prepare codebase for inline Babel 8 breaking changes ( #12440 )
2020-12-04 21:30:40 +01:00
Huáng Jùnliàng
3bd6a3d781
Make sure estree test should not throw if babel parser does not throw ( #12443 )
...
* test: run estree on tests that does not expect an errors
* fix: record the directive expression value to extra AST properties
2020-12-04 13:58:01 -05:00
Nicolò Ribaudo
208acb1d6c
Use require.resolve instead of the resolve package ( #12439 )
2020-12-04 08:57:09 +01:00
Huáng Jùnliàng
8478027d1a
Make sure babel parser throws exactly same recoverable errors when estree plugin is enabled ( #12375 )
...
* refactor: introduce isPrivateName and getPrivateNameSV
* feat: check recoverable errors on estree-throw
* fix: pass through all params of parseBlockBody
* fix: set bigInt to null when invalid bigInt value is parsed
e.g. 0.1n
* fix: use string literal value in error message
When estree plugin is enabled, stringLiteral#extra.raw is not accessible. Use StringLiteral#value instead.
* refactor: introduce hasPropertyAsPrivateName
* fix: adapt to ChainExpression
* fix: port checkLVal early return for method in object pattern
* fix: throw new a?.() on estree
* fix: early return for __proto__ in accessors
* fix: test record element via isObjectProperty
* fix: pass through isLHS in toAssignable
* refactor: introduce isObjectMethod methods
2020-12-03 08:36:54 +00:00
Huáng Jùnliàng
7000ae04a5
refactor: move @babel/helper-annotate-as-pure to ts ( #12415 )
...
* refactor: move @babel/helper-annotate-as-pure to ts
* chore: add flow types
2020-12-01 11:23:23 -05:00
Huáng Jùnliàng
5e4b85ab1c
refactor: move @babel/helper-get-function-arity to ts ( #12414 )
...
* refactor: move @babel/helper-get-function-arity to ts
* Review comments
* chore: add flow interface
2020-12-01 10:45:05 -05:00
Huáng Jùnliàng
3266d2679a
move @babel/helper-optimise-call-expression to ts ( #12411 )
...
* move @babel/helper-optimise-call-expression to ts
* chore: add flow interface
2020-12-01 10:31:39 -05:00
Andrew Smith
71f87874ce
Clarify warning source about underspecified corejs option in preset-env. ( #12402 )
...
* Clarify these warnings are for babel-preset-env.
* Fix lint.
* Fix specs.
* Fix merge conflict.
* PR feedback.
2020-12-01 08:58:06 +00:00
Brian Ng
7018ed6e46
Fix printing BigIntLiterals/DecimalLiterals with compact option ( #12424 )
2020-11-30 20:18:57 -06:00
Bogdan Savluk
2ca28d78e6
@babel/types: update OptionalCallExpression to support ArgumentPlaceholder ( #12418 )
2020-11-30 12:49:22 -05:00
Huáng Jùnliàng
9891c020b1
Bump core-js-compat to version 3.8.0 ( #12399 )
2020-11-25 22:46:07 +01:00
Huáng Jùnliàng
89f3247e32
refactor: simplify isAwaitAllowed ( #12398 )
2020-11-25 13:49:35 -05:00
Nicolò Ribaudo
645fe637f2
Fix t.isReferenced() for named re-exports ( #12395 )
2020-11-25 19:39:45 +01:00
Nicolò Ribaudo
695abb8dfc
Set correct path.context un push/unshiftContainer ( #12394 )
2020-11-25 16:51:58 +01:00
Nicolò Ribaudo
e334a88884
v7.12.9
2020-11-24 21:59:33 +01:00
Huáng Jùnliàng
eea3065039
Update pathCache in NodePath#_replaceWith ( #12391 )
...
* add tests on regression 12386
* fix: update cache on _replaceWith
* fix: pathCache in replaceWithMultiple could be nullish
* Update packages/babel-traverse/src/path/replacement.js
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
* test: add replaceWith test to traverse
Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-11-24 15:07:20 -05:00
Nicolò Ribaudo
16184887ab
v7.12.8
2020-11-23 23:26:07 +01:00
Nicolò Ribaudo
4f9ad5cc3a
Avoid infinite loops in type inference logic ( #12390 )
2020-11-23 17:03:01 +01:00
Nicolò Ribaudo
7d2a14b856
Initialize NodePath context when using getSibling ( #12387 )
2020-11-23 16:03:11 +01:00
Filipp Riabchun
2b13863680
Fix Node version check ( #12382 )
...
`process.version` always starts with `v`, so `parseInt(process.version)` always evaluates to `NaN`. See https://nodejs.org/api/process.html#process_process_version
2020-11-23 09:00:50 -05:00
Nicolò Ribaudo
23226d93d4
v7.12.7
2020-11-20 22:02:43 +01:00
Huáng Jùnliàng
a44151acef
optimize optional chain when expression will be cast to boolean ( #12291 )
2020-11-20 20:55:33 +01:00
Nicolò Ribaudo
e7e0c25d6a
Archive @babel/helper-regex ( #12377 )
...
babel/babel-archive@32d1b8eeaf
2020-11-20 10:40:48 -05:00
Huáng Jùnliàng
2e3eec6646
refactor: use option-validator in preset-typescript ( #12347 )
2020-11-20 15:11:20 +01:00
Huáng Jùnliàng
ab5a90ce47
refactor: remove @babel/helper-regex usage ( #12349 )
2020-11-18 10:06:59 -05:00
Nicolò Ribaudo
6a0e909c13
Don't compile import() in development ( #12288 )
2020-11-18 16:02:02 +01: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
2db500451b
Bump caniuse-lite resolutions ( #12368 )
2020-11-17 16:38: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
Bogdan Savluk
0f838be944
improve asserts type annotations ( #12341 )
2020-11-16 11:21:30 -05:00
Sosuke Suzuki
a4e4aede14
[ts]Set false to default value of TsTypePredicate.asserts ( #12352 )
2020-11-16 09:51:27 -06:00
Huáng Jùnliàng
f54f1ee492
Fix: correctly transform this.#m?.(...arguments) ( #12350 )
...
* add tests on @babel/helper-optimise-call-expression
* fix: correctly optimise `a.b?.(...arguments)`
* add integration test with properties transform
2020-11-16 10:16:46 -05:00
Huáng Jùnliàng
5bbad8936b
fix: disallow all parenthesized pattern except parsing LHS ( #12327 )
...
* fix: disallow all parenthesized pattern except parsing LHS
* fix: forStatement requires LHS
* simplify toAssignable
* add more test cases
* fix: pass through isLHS on object property and assignment expression
* fix: record parenthesized identifier error for LHS
* remove duplicated skipped tests
* fix: do not record errors on ancestry arrow head
* Update packages/babel-parser/src/util/expression-scope.js
Co-authored-by: Brian Ng <bng412@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-11-10 14:42:37 -05:00
Brian Ng
08c7280167
Fix support for polyfilling Array.prototype.values in core-js@2 ( #12340 )
2020-11-10 16:43:11 +01:00
ExE Boss
3505eaadba
Add type definitions for assertion methods ( #11883 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-11-10 16:42:25 +01:00
Nicolò Ribaudo
2984f0cb88
Use the correct context when re-using a cached NodePath ( #12331 )
2020-11-10 15:03:21 +01:00
Jason Miller
ddd868f838
Account for ConfigItem being generated by another copy of Babel ( #11734 )
...
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-11-10 15:02:46 +01:00