12 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
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
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
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
Chintan Acharya
93429f8b09
Fix helpers.unsupportedIterableToArray for Map and Set (#11495)
Fixes #11494
2020-04-28 07:27:03 +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
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
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
pnowak
3aaafae053
proper feature call isLoose function #9424 2019-03-24 10:21:44 +01:00
Brian Ng
f77c450cda
Bump prettier (#9373) 2019-01-22 09:16:32 -06:00
Andy Edwards
3c8e15dbc1 don't throw classNameTDZError if referenced identifier is within a TypeAnnotation (#9190)
fix #9189

Obviously this code is intended to throw an error if someone tries to reference a class before it's defined, like:
```js
class Foo {
  someField = Foo;
}
```
But there's no problem with referencing the class in a type annotation before it's defined, and this is often necessary for tree structures:
```js
class Foo {
  [someSymbol]: Foo;
}
```
2018-12-15 15:16:43 +01:00
Nicolò Ribaudo
4e28459a2f
Make @babel/plugin-class-features a normal helper package (#9083)
* Make @babel/plugin-class-features a normal helper package

This effectively disallows using it directly.

* Rename helper

* Style

* Don't add prefix to plugin name

* Move private methods plugin
2018-11-29 16:42:45 +01:00