85 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
Nicolò Ribaudo
2f755ef052 v7.12.17 2021-02-18 15:58:43 +01:00
Nicolò Ribaudo
8063fde0d8
Reuse the readOnlyError helper for private methods (#12792) 2021-02-12 14:33:23 +01:00
Babel Bot
dd5c9f958c v7.12.16 2021-02-11 22:36:24 +00: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
Nicolò Ribaudo
d291edbdf1 v7.12.13 2021-02-03 01:59:31 +01:00
Nicolò Ribaudo
3d69dc9471
Add # to the private name in "write-only" errors (#12713) 2021-01-29 17:58:13 +01:00
Federico Ciardi
5a020b24b7
fix: throw error when accessing private method without a getter (#12689)
* fix: class private accessor without getter

* Provide default return if 'writeOnlyError' is not available

* Add warning for old `@babel/helpers`

* Add missing helper call
2021-01-26 11:16:47 -05:00
Zen
cba64f9a09
Correctly access shadowed class binding in super.* (#12544)
* rename own binding inside methods if it collides with class ref. fix #11994

* fix name collisions in constructor

* do fix name collisions in constructor

* move logic in ReplaceSupers

* fix tests of helper-create-class-features-plugin

* remove replaceSupers in pushConstructor

* use environmentVisitor

* skip classLike nodes

* fix super ref in computed key
2021-01-12 02:31:06 +01:00
Daniel Arthur Gallagher
e8b08523f4
docs: add package-specific documentation links (#12531)
[skip ci]
2021-01-06 14:11:53 +01:00
Álvaro Mondéjar
b649f8d192
Fix packages documentation README links. (#12289) 2020-10-30 21:19:21 +01:00
Nicolò Ribaudo
ed498a772b
Use workspace:* for devDependencies (again) (#12217)
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-10-19 18:32:06 +02: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
6cb0056519
Remove unused dependencies and devDependencies (#12175) 2020-10-15 10:01:30 +02: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
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
Huáng Jùnliàng
f7964a9ac5 v7.10.5 2020-07-14 14:10:36 -04:00
Huáng Jùnliàng
5dd64ecc4a
Disallow duplicated AST nodes (#11807) 2020-07-14 08:32:16 -05:00
Huáng Jùnliàng
7fd40d86a0 v7.10.4 2020-06-30 09:04:22 -04:00
Huáng Jùnliàng
2787ee2f96 v7.10.3 2020-06-19 16:42:41 -04:00
Huáng Jùnliàng
1e115aed33
fix: ensure (a?.b)() has proper this (#11623)
* fix: ensure (a?.b)() has proper this

* let test be more restrictive

* fix: transformed member call should preserve computed

* chore: revamp test files

* refactor: simplify

* fix: unwrap parthenthesizedExpression

* add loose test cases

* add `(a?.#b)()` support

* add with-transform test cases

* Update packages/babel-plugin-proposal-optional-chaining/src/index.js

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>

* address review comments

* update test fixtures

Co-authored-by: Justin Ridgewell <justin@ridgewell.name>
2020-06-01 10:25:22 -04:00
Ajay Poshak
b1923fd140
Add a check for privateMap's existence (#11571)
Co-authored-by: Ajay Poshak <ajay.poshak@bookmyshow.com>
2020-05-30 22:38:15 +02:00
Nicolò Ribaudo
b0350e5b1e v7.10.2 2020-05-30 19:16:08 +00:00
Nicolò Ribaudo
e6d873e061
Class features loose should have precedence over preset-env (#11634)
* Class features loose should have precedence over preset-env

* Comment

* Update packages/babel-helper-create-class-features-plugin/src/features.js

[skip ci]

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

* Future proof

* Add warning when loose mode changes automatically

* Better message

Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-05-29 23:56:32 +02:00
Nicolò Ribaudo
88f57a7ea6 v7.10.1 2020-05-27 21:56:37 +00:00
Saulo Santiago
242d9e0b20
Use repository.directory field in package.json files (#11625)
Co-authored-by: Nicolas Stepien <567105+nstepien@users.noreply.github.com>
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
2020-05-27 16:32:25 +02:00
Nicolò Ribaudo
5da2440adf v7.10.0 2020-05-26 21:20:43 +00:00
Justin Ridgewell
bda759ac3d Handle private access chained on an optional chain (#11248)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
2020-05-26 22:18:17 +02:00
Justin Ridgewell
7459038db8 Add private-property-in-object support (#11372)
https://github.com/tc39/proposal-private-fields-in-in

Co-Authored-By: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
Co-Authored-By: Huáng Jùnliàng <jlhwung@gmail.com>
2020-05-26 22:18:17 +02:00
Nicolò Ribaudo
9c2846bcac v7.9.6 2020-04-29 20:33:47 +02:00
Chintan Acharya
93429f8b09
Fix helpers.unsupportedIterableToArray for Map and Set (#11495)
Fixes #11494
2020-04-28 07:27:03 +02:00
Justin Ridgewell
d6efed5b22
Fix redeclaring private in nested class's superClass (#11424)
If a nested class's `superClass` redeclares the outer class's private field and access it in a computed key, that should fail.

Follow up to #11405.
2020-04-20 16:54:14 +02:00
Justin Ridgewell
9b48a8ead7
Fix nested classes reference private fields (#11405)
* Fix nested classes reference private fields

* Process only visible private fields when redeclaring

* Comments

* Skip class traversal if there are no private fields

* Handle redeclared private field in computed key
2020-04-14 21:51:51 +02:00
Nicolò Ribaudo
5b97e77e03 v7.9.5 2020-04-07 21:15:23 +02:00
Oliver Dunk
71e7a7b1e0
Ignore abstract methods when decorating class (#11345)
* Ignore abstract methods when decorating class

* Address Nico's feedback

* Add input/output test

* Update test output to account for _nonIterableRest changes
2020-03-29 00:17:29 +01:00
Nicolò Ribaudo
750d3dde3b v7.8.6 2020-02-27 13:17:19 +01:00
Siddhant N Trivedi
3fc904e1d4
Fix classNameTDZError in computed prototype methods with class fields (#11068)
* Draft fix for TDZError in computed prototype methods

* Added tests for loose:false and also extracted handleClassTDZ

* Added state parameter to handleClassTDZ function

* Extracted the state object to a variable

* Added helper comments for environmentVisitor

* Added else condition to traverse computed Path

* Cached computed path key into a variable
2020-02-12 11:55:38 +01:00
Nicolò Ribaudo
a7620bd266 v7.8.3 2020-01-13 22:36:19 +01:00
Nicolò Ribaudo
8fce431d88
Revert "chore: specify package type (#10849)" (#11003)
This reverts commit e8dac621de9dba27b47646169562c0a0c2e02c96.

Fixes installs when using npm <= 3.9.5 (Node.js <= 6.2.2)
2020-01-13 21:18:42 +01:00
Nicolò Ribaudo
2486615a74 v7.8.0 2020-01-12 01:09:29 +01:00
Huáng Jùnliàng
e8dac621de
chore: specify package type (#10849) 2020-01-09 21:40:15 -05:00
Nicolò Ribaudo
75767d87cb v7.7.4 2019-11-23 00:05:58 +01:00
Brian Ng
c37361ba2e Bump prettier@1.19.1 (#10728) 2019-11-16 16:05:40 +01:00
Nicolò Ribaudo
97faa83953 v7.7.0 2019-11-05 11:27:14 +01:00
Nicolò Ribaudo
e9c1bce50f
Add support for TS declare modifier on fields (#10545)
* [parser] Add support for TS declare modifier on fields (#10484)

* [parser] Add support for TS declare modifier on fields

* Use Object.create(null)

* Comment

* Add support for TS declare types to types and generator (#10544)

* Transform TypeScript "declare" fields (#10546)

* Transform TypeScript "declare" fields

* Remove multiple spaces

* declareFields -> allowDeclareFields

* Update after rebase
2019-11-05 10:56:57 +01:00
Nicolò Ribaudo
cbd5a26e57
v7.6.0 2019-09-06 19:25:16 +02:00
Tim McClure
3e4889d649 Class Private Static Accessors (#10217)
* Remove error for static private accessors

* Private static accessors strict

* Add loose mode support

* Move `value` decl for early return

* Reuse getter/setter template

* Reuse getter/setter templates

* Use `buildUndefinedNode` in accessor templates

* Extract `isAccessor` variable
2019-09-06 18:08:10 +02:00
Daniel Tschinder
4f0840ab88
Update dev dependencies and fix linting errors (#10228)
* chore: Uppate dev dependencies

* chore: Fix lint errors

* chore: Format options.json files

* chore: Fix stupid flow errors

* Update test262 whitelist

Seems test262-stream was updated and now these tests work.
2019-07-27 15:09:30 +02:00