14752 Commits

Author SHA1 Message Date
Mickey Rose
da1d166ea6
perf: minor tokenizer tweaks (#13652) 2021-08-09 21:20:44 +02:00
Sosuke Suzuki
8a09993e39
fix(parser): add attachComment to ParserOptions type (#13657) 2021-08-09 10:05:19 +02:00
overlookmotel
39ba1ff300
Reduce stat calls in register (#13654) 2021-08-09 09:14:52 +02:00
Babel Bot
ebc55398a3 Add v7.15.2 to CHANGELOG.md [skip ci] 2021-08-08 16:14:38 +00:00
Babel Bot
084870faad v7.15.2 2021-08-08 16:05:27 +00:00
Sosuke Suzuki
e294beb3ac
Add .errors to the @babel/parser return type definitions (#13653) 2021-08-07 19:37:03 +02:00
Babel Bot
5884adaa93
chore: update test262 to e6c21464f5f9d46679ad537dbc3e2be753fb5b5c (#13646) 2021-08-06 08:36:36 +02:00
Nicolò Ribaudo
f9dcc4e4bb
Fix array destructuring elision parsing in TS arrow functions (#13641) 2021-08-05 21:47:30 +02:00
Nicolò Ribaudo
bdc75dce72
Update @babel/* devDependencies to 7.15.0 (#13633) 2021-08-05 10:35:18 +02:00
Babel Bot
482e33b068 Add v7.15.1 to CHANGELOG.md [skip ci] 2021-08-05 07:29:13 +00:00
Nicolò Ribaudo
546e3d958d v7.15.1 2021-08-05 09:17:03 +02:00
Nicolò Ribaudo
da2168e110
Revert "Add display name after create context (#13501)" (#13637)
This reverts commit e9bc7c18c0de029e1cc0e0935c26f208a683e75b.
2021-08-05 09:04:57 +02:00
Babel Bot
e891601cb5 Add v7.15.0 to CHANGELOG.md [skip ci] 2021-08-04 21:13:43 +00:00
Nicolò Ribaudo
6912f968a6 v7.15.0 2021-08-04 23:00:40 +02:00
Yeonju Hwang
0671afcf87
[ts] support optional chain call with generic (#13513)
* support optional chain call with generic

* Add testcase handling new line

* allow only call if optional chain type parameter

* use exact error message

* add transform-typescript optional-chain call test

* use exact error message

* apply feedbacks

* Fix lint error

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-08-04 17:29:44 +02:00
Huáng Jùnliàng
d5b0d9e33d
Add attachComment parser option to disable comment attachment (#13229) 2021-08-04 17:04:22 +02:00
Nicolò Ribaudo
fc3b09e533
Minor updates after merging 7.15.0 PRs (#13628) 2021-08-04 09:38:10 -04:00
Tony Gorez
70c66b3799
Handle typescript function overloading in a default export (#13605)
* feat(ransform-typescript): add test case

* feat(transform-typescript): avoid calling registerGlobalType if node.id is not defined
2021-08-04 00:37:53 +02:00
Sosuke Suzuki
13af87cd3b
standalone: update preset-stage-* (#13476)
* Move classStaticBlock to stage-3

* Remove stage-4 proposals

* Move PrivatePropertyInObject

* Remove options from preset-stage-3

* Move RecordAndTuple to stage-2

* Move ModuleBlocks to stage-2

* Undo breaking change

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-08-04 00:36:38 +02:00
Nicolò Ribaudo
ddaf0d4296
Enable top-level await parsing by default (#13387) 2021-08-04 00:00:04 +02:00
Nicolò Ribaudo
b707842dd0
Support TypeScript const enums (#13324) 2021-08-03 23:57:09 +02:00
王清雨
0542f0d7da
feat(typescript): implement namespace alias (#13528)
support `import alias = Namespace`, reject `import alias = require('foo')`

fix #12345
2021-08-03 23:55:56 +02:00
Federico Ciardi
7e50ee2d82
feat: add noIncompleteNsImportDetection assumption to plugin-transform-modules-commonjs (#13290) 2021-08-03 23:55:09 +02:00
Federico Ciardi
c35637e247
feat(ts): raise error for abstract property with initializer (#13523)
* feat: raise error for abstract property with initializer

* Improve tests

* Address review

* JLHwung review

* Update packages/babel-parser/src/plugins/typescript/index.js

* update test fixtures

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2021-08-03 23:50:27 +02:00
Huáng Jùnliàng
e9bc7c18c0
Add display name after create context (#13501) 2021-08-03 23:32:54 +02:00
Huáng Jùnliàng
15f2f171ab feat: support hack pipeline in @babel/standalone (#13555) 2021-08-03 23:30:16 +02:00
Nicolò Ribaudo
ff287ac5a5 Fix %== parsing in hack pipes (#13536)
* Fix `%==` parsing in hack pipes

* Use custom token type

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

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>

* Apply suggestions from code review

Co-authored-by: J. S. Choi <jschoi@jschoi.org>

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
Co-authored-by: J. S. Choi <jschoi@jschoi.org>
2021-08-03 23:30:16 +02:00
J. S. Choi
35e4e1f067 Hack-pipe proposal with % topic token (#13416)
Co-authored-by: Federico Ciardi <fed.ciardi@gmail.com>
2021-08-03 23:30:16 +02:00
J. S. Choi
cd4b3fbffe parser: Fix Hack/smart-pipe error positions (#13426) 2021-08-03 23:30:16 +02:00
J. S. Choi
6276853eb9 Add support for the "Hack" pipeline proposal (#13191)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-08-03 23:30:16 +02:00
Nicolò Ribaudo
885e1e02f5
Expose @babel/eslint-parser/experimental-worker (#13398)
* Expose `@babel/eslint-parser/experimental-worker`

* Fix `@babel/runtime` build on Windows
2021-08-03 23:23:32 +02:00
Samuel Gaus
830b99dc83
Add support for rhino as a compilation target (#13448)
* Add support for rhino as a compilation target

* Add tests for target: rhino

* Fix test failing due to whitespace

* Keep consistent names for rhino tests in babel 7 and 8

* Bump core-js-compat to 3.15.0

* Change references to rhino to include patch version

* Update compat table data import

* Split transpilation of arrow function features more finely

* Rename rhino fixtures to include the patch number and update to include syntax that is and isn't supported for better testing

* Only use the relevant features for transform-new-target and transform-classes
2021-08-03 23:03:16 +02:00
Nicolò Ribaudo
a254ea38a4
Enable ergonomic brand checks (#priv in) by default (#13554)
* Enable ergonomic brand checks by default in `@babel/parser`

* Enable ergonomic brand checks by default in `preset-env`

* Fix error position

* Update Babel 8 tests
2021-08-03 23:02:17 +02:00
Tony Gorez
5f4b58f678
chore(doc): add jest specific pckg command (#13607)
* chore(doc): add jest specific pckg command

* chore(doc): add debug and grep

* fix(doc): nitpicks

* chore(doc): 🎨 reshape a bit

* fix(doc): 🔍 fix nitpicks 2

* fix(doc): useless tabs

* chore(doc): simplify few lines

* chore(doc): nit picks
2021-08-03 10:25:14 -04:00
王清雨
1960f23c22
Add typings to create-class-features-plugin helper (#13570)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-08-02 21:22:37 +02:00
Oleksandr T
b3ab4769d0
fix(ts): raise error for export default interface {} (#13622) 2021-08-02 18:16:01 +02:00
Babel Bot
86fae72e5b Add v7.14.9 to CHANGELOG.md [skip ci] 2021-08-01 07:53:51 +00:00
Babel Bot
aa2cac5edc v7.14.9 2021-08-01 07:42:57 +00:00
Nicolò Ribaudo
93bade2a71
Update core-js@3 packages (#13621)
* Update `core-js@3` packages

* Update fixtures

* Update Babel 8 fixtures
2021-08-01 09:22:09 +02:00
Huáng Jùnliàng
d3a7cd5e8d
Replace generic __clone call by specific methods (#13611)
* update benchmark babel parser version

* perf: replace generic __clone by specific methods

baseline 256 length-1 named export: 4_704 ops/sec ±1.59% (0.213ms)
baseline 512 length-1 named export: 2_426 ops/sec ±0.52% (0.412ms)
baseline 1024 length-1 named export: 1_118 ops/sec ±1.23% (0.895ms)
baseline 2048 length-1 named export: 556 ops/sec ±0.77% (1.799ms)
current 256 length-1 named export: 7_073 ops/sec ±33.67% (0.141ms)
current 512 length-1 named export: 4_441 ops/sec ±0.79% (0.225ms)
current 1024 length-1 named export: 2_142 ops/sec ±1.09% (0.467ms)
current 2048 length-1 named export: 943 ops/sec ±2.12% (1.06ms)

* breaking: remove Node#__clone in Babel 8

* test: use t.cloneNode
2021-07-30 22:19:35 +02:00
Babel Bot
2340b87094
Update test262 (#13619) 2021-07-30 09:38:34 +02:00
Nicolò Ribaudo
862d9f8dfd
Update Rollup to ~2.54.0 (#13614) 2021-07-29 10:01:06 -04:00
Nicolò Ribaudo
82350d529b
[eslint, babel 8] Pass cwd to worker (#13526) 2021-07-28 23:12:19 +02:00
王清雨
d45ad500e7
Improve path.get typings with TS template literal types (#13588) 2021-07-28 21:47:29 +02:00
Henry Zhu
0a4b1b339c
Update README.md (github sponsors link) (#13610) 2021-07-28 19:03:46 +02:00
Huáng Jùnliàng
e4de256cdd
chore: reorganize benchmarks (#13606) 2021-07-28 07:10:29 -04:00
Anna Henningsen
d1f908924c
Fix completion record for variable declarations (#13596) 2021-07-27 23:50:47 +02:00
王清雨
e0dc925bbe
feat(traverse): specific return type for virtual types' validators (#13578)
* feat(traverse): specific return type for virtual types' validators

update generator script to use virtualType.types[0] as it's type

fix #13576

* fix: remove unused ts-expect-error

so glad that it works

* feat: use VirtualTypeAliases to generate validators for virtual types

* fix: return boolean when it doesn't have any alias

* fix: use type only import and simplify condition
2021-07-27 10:02:09 -04:00
Nicolò Ribaudo
790c5180d4
Extract computed keys from the class closure (#13600) 2021-07-26 23:31:45 +02:00
Rin Tepis
224a35c5c6
Don't insert __self: this within constructors of derived classes (#13552)
* Don't insert `__self: this` prior to `super()` calls (#13550)

`__self: this` is inserted for debugging purposes. However, it will cause a runtime error if it is inserted prior to a `super()` call in a constructor. This commit will prevent `__self: this` from inserted when there is a following `super()` call.

* Prevent adding `__self` within a constructor that has `super()` altogether.

* Fix 2 typos in the comments.

* Add an additional test case for constructors that do not have a `super()` call.

* Detect `super()` call by testing whether the class has a superclass.

* Update method name and corresponding comments

* Add an additional test for the case where the derived class do not have a `super()` call.

* Apply the same changes to babel-plugin-transform-react-jsx
2021-07-26 13:32:29 -04:00