605 Commits

Author SHA1 Message Date
Nicolò Ribaudo
6ef7b51a11 Implement assumptions defined in the babel/rfcs#5 RFC
- `mutableTemplateObject` and `ignoreToPrimitiveHint` (#12408)
- `setClassMethods` (#12407)
- `setComputedProperties` (#12490)
- `ignoreFunctionLength` (#12491)
- `noDocumentAll` (#12481)
- `iterableIsArray` and `arrayLikeIsIterable` (#12489)
- `pureGetters` (#12504)
- `skipForOfIteratorClosing` (#12496)
- `objectRestNoSymbols`, `setSpreadProperties` and `pureGetters` (#12505)
- `noNewArrows` (#12613, #12793)
- `setPublicClassFields` and `privateFieldsAsProperties` (#12497)
- `constantReexports` and `enumerableModuleMeta` (#12618)
- `constantSuper`, `superIsCallableConstructor` and `noClassCalls` (#12726)

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
Co-authored-by: Huáng Jùnliàng <JLHwung@users.noreply.github.com>
2021-02-21 17:09:45 +01:00
Federico Ciardi
8316cdaa8a
typo: correct variable name (#12837) 2021-02-20 22:03:24 +01:00
overlookmotel
792672ec60
Fix scope of computed method keys (#12812)
* Fix scope of computed method keys

* Test for nested computed keys

* Fix scope.rename with computed method keys

* Optional chaining tests
2021-02-19 02:36:34 +01:00
Nicolò Ribaudo
2f755ef052 v7.12.17 2021-02-18 15:58:43 +01:00
Huáng Jùnliàng
4462eeae6b
Clean up traverse scope (#12797) 2021-02-16 23:23:34 +01:00
Nicolò Ribaudo
d291edbdf1 v7.12.13 2021-02-03 01:59:31 +01:00
Nicolò Ribaudo
bab5c62f90
Fix class fields when super() is in a default param (#12729)
* Fix class fields when `super()` is in a default param

* Use assertion instead of type cast
2021-02-02 15:38:07 +01: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
Bogdan Savluk
d98418efbe
Convert @babel/traverse to TypeScript (#12488)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2021-01-24 01:33:09 +01:00
Nicolò Ribaudo
f795fff1e4
[babel 8] Update globals, find-cache-dir and slash (#12656) 2021-01-22 17:57:07 +01:00
Brian Ng
fec4a132ad
Bump prettier@2.2.1 (#12633) 2021-01-14 14:10:47 -05:00
Daniel Arthur Gallagher
e8b08523f4
docs: add package-specific documentation links (#12531)
[skip ci]
2021-01-06 14:11:53 +01:00
Nicolò Ribaudo
d88c60cea9 v7.12.12 2020-12-23 14:55:59 +01:00
Zen
e08f68bf61
Skip discriminant when renaming starting from SwitchStatement (#12530) 2020-12-22 03:10:43 +01:00
Nicolò Ribaudo
e901454096 v7.12.10 2020-12-09 23:44:59 +01:00
Nicolò Ribaudo
b5b95f81dc
Add @babel/traverse tests for re-exported bindings (#12429) 2020-12-06 19:33:21 +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
Nicolò Ribaudo
23226d93d4 v7.12.7 2020-11-20 22:02:43 +01:00
Nicolò Ribaudo
2984f0cb88
Use the correct context when re-using a cached NodePath (#12331) 2020-11-10 15:03:21 +01:00
Huáng Jùnliàng
0641a15030
Reduce linear search on list traversing (#12302)
* perf: reduce linear search on list traversing

* fix: remove parent cache when replacing node
2020-11-04 20:14:51 -05:00
Huáng Jùnliàng
6cb6f9f5ea
test: add tests about behaviour of replaceWithMultiple (#12309)
* test: add tests about behaviour of replaceWithMultiple

* add more tests
2020-11-04 14:46:53 -05:00
Nicolò Ribaudo
dd5a977048
Revert "Mark ThisExpression and Super as Purish" (#12307) 2020-11-04 11:50:46 +01:00
Nicolò Ribaudo
a41da05ce9 v7.12.5 2020-11-03 23:30:17 +01:00
Álvaro Mondéjar
b649f8d192
Fix packages documentation README links. (#12289) 2020-10-30 21:19:21 +01:00
Huáng Jùnliàng
ea2892fefc
add declare to class properties type annotations (#12257)
* add declare to class properties type annotations

* chore: use preset-flow
2020-10-27 10:05:01 -04:00
Nicolò Ribaudo
df908fc63b
Mark ThisExpression and Super as Purish (#12251)
* Mark `ThisExpression` as `Purish`

The other purish types are functions and literals, so I
guess it means "it doesn't have side effects"

* Super & tests

* Fix tests
2020-10-27 13:12:49 +01:00
Nicolò Ribaudo
7f4b83833f v7.12.1 2020-10-16 00:36:30 +02:00
Huáng Jùnliàng
eec01fe078
chore: use workspace:* for dev deps (#12186) 2020-10-15 14:03:50 -04:00
Nicolò Ribaudo
726154c78e v7.12.0 2020-10-14 21:48:45 +02:00
Huáng Jùnliàng
f697e7995d Transform class static block (#12143)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Brian Ng <bng412@gmail.com>
2020-10-14 21:16:24 +02:00
James Addison
94b5f92e39
Replace lodash 'defaults' usage with ES6 Spread initializer (#11797)
Co-authored-by: Corey Farrell <git@cfware.com>
2020-10-14 20:10:44 +02:00
Huáng Jùnliàng
e0b2bfb78f
fix: mark Pattern in CatchClause as scope (#12119) 2020-09-29 15:04:24 -04:00
Barron Wei
1a8e7ff2ec
fix(do-expr): SwitchStatement with IfStatement cases (#11728)
* test(do-expr): condition before break

* test(do-expr): labeled break

* fix(do-expr): add check for break in BlockStatement

* fix(do-expr): add LabeledStatement case for getCompletionRecords

* test(do-expr): rename condition before break to condition before expression

* revert(do-expr): undo remove break for do switch

* revert(do-expr): undo remove labeled break

* test(do-expr): add condition before break

* test(do-expr): update condition before break

* test(do-expr): remove labeled break

* fix(do-expr): add tree search in findBreak

* fix(do-expr): ignore isFunction case in findBreak
2020-09-18 10:34:35 -04:00
Huáng Jùnliàng
af64ccb2b0 v7.11.5 2020-08-31 15:54:06 -04:00
Huáng Jùnliàng
3fad7eab9b
Use Yarn 2 (#11962)
* chore: use yarn 2

* chore: remove redundant yarn locks

* chore: remove publishEslintPkg

* chore: remove redundant make bootstrap

* Update .yarnrc.yml

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>

* chore: use workspace protocol for eslint packages in the root

Co-Authored-By: merceyz <merceyz@users.noreply.github.com>

* chore: pin caniuse-lite versions

Testcases in packages/babel-preset-env/test/fixtures/debug/browserslists-defaults-not-ie
depends on specific caniuse-lite versions. We pinned the version here
so we don't have to deal with fixture different in e2e-tests
where all deps will be updated and tested.

* chore: resolve yarn install warnings

* chore: update yarn cache path on circle/travis

* chore: add yarn deduplicate plugin

* chore: deduplicate lock files

* chore: move devDependencies to leaf packages

* chore: remove @yarnpkg/plugin-constraints

* chore: remove unused dedupe options

* test: fix unwanted self reference

* chore: remove output-file-sync dependency

* chore: update browserify to 16.5.2

Co-authored-by: Kristoffer K. <merceyz@users.noreply.github.com>
2020-08-25 14:37:30 -04:00
Johan Holmerin
b9407d7660
Forward deopt node path in NodePath#evaludate (#11832)
* Forward deopt node path

* Move deopt evaluation tests

* Document evaluate deopt property
2020-08-20 16:20:19 -04:00
Huáng Jùnliàng
45fdb87747 v7.11.0 2020-07-30 17:12:07 -04:00
James Addison
9daa50e005
babel-traverse: prefer clearer, reduced-bias option naming (#11791)
* babel-traverse: prefer clearer, reduced-bias option naming

* Apply suggestions from code review

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

Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-07-29 16:41:20 -04:00
Huáng Jùnliàng
8f191ead92
chore: fix typo in codebase (#11846) 2020-07-16 16:01:20 -05:00
Huáng Jùnliàng
f7964a9ac5 v7.10.5 2020-07-14 14:10:36 -04:00
Brian Ng
ffb42488ba
Bump some deps for audit (#11818) 2020-07-10 21:42:18 +02:00
James Addison
55ce749f42
Replace lodash 'clone' usage with ES6 Spread initializer (#11811) 2020-07-09 10:32:04 -05:00
James Addison
3e55270135
Reduce dependency on lodash functions: includes, uniq, repeat, isinteger (#11790)
* Replace lodash 'includes' usage with Array.prototype.includes

* Replace lodash 'values' usage with Object.values

* Replace lodash 'uniq' usage with Array.from(new Set(...))

* Property safety: ensure that ignoreSuites/ignoreTasks are populated prior to access

* Property safety: ensure that blacklistTypes is populated prior to access

* Revert "Replace lodash 'values' usage with Object.values"

This reverts commit 9fd3679d6db03066daee09fad0050e5292a32aa1.

* Replace lodash 'repeat' usage with String.prototype.repeat

* Replace lodash 'isinteger' usage with Number.isInteger

* Remove explicit lodash dependency from babel-generator package

* Update packages/babel-helper-transform-fixture-test-runner/src/index.js

Co-authored-by: Brian Ng <bng412@gmail.com>

* Rely on optional chaining operator as sole boolean check

* Handle additional optional chaining operator simplification

* Update type signature

Co-authored-by: Brian Ng <bng412@gmail.com>
2020-07-06 09:27:41 +02:00
Huáng Jùnliàng
7fd40d86a0 v7.10.4 2020-06-30 09:04:22 -04:00
Wojciech Maj
1dd94e813e
Replace non-inclusive "whitelist" and "blacklist" terms with "allowlist" etc. (#11758) 2020-06-29 15:39:38 -04:00