Yes, the output is uglier. But, this is necessary for me to refactor
`replaceSupers` for #7733, which is necessary for both #7555 and
https://github.com/babel/babel/pull/7553#issuecomment-381434519.
I'm still in the middle of cleaning up all this code. Don't expect
`transformClass` to survive much longer as it's written currently.
We were using `Object.create` to setup the prototype chain at the start of the class definition, which lead to #7771.
I was a bit worried about a speed hit, but it seems everyone optimizes the two patterns the same way.
https://jsbench.github.io/#f9fca52407643d96458a35763b201215Fixes#7771.
* Implement MemberExpressionToFunctions helper
Fixes#7733.
This will also be used to simplify the Private Fields transform, which had [almost the same code](ccd941057a/packages/babel-plugin-proposal-class-properties/src/index.js (L114-L217)) hand written.
* Cleanup
* Little more comment cleanup
* Use unary plus
This can't be redefined, unlike the `Number` identifier.
* Review comments
* Remove unused deps
* drop support for Node.js v4; closes#7753
- remove version 4 from Travis build matrix
- update environment support doc
- update `CONTRIBUTING.md`
- update `engines` field of root `package.json`
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
* update engines for babylon
Signed-off-by: Christopher Hiller <boneskull@boneskull.com>
* Improve asyncIterator error
When an object is has neither asyncIterator or iterator defined, throw the "not an async iterable" error
* Correct logic
* reduce access
* Update helpers.js
* Update decorators parsing
This commit introduces three changes:
1) Class properties can be decorated
2) Decorators can contain arbitrary expressions, using @(...)
3) The Decorator node type has a new property, "arguments". This
makes it possible do distinguish @dec() and @(dec()), which have
different behaviors because @(dec()) is equivalent to @(dec())().
* Rename Decorator#expression to Decorator#callee
* Add test for @dec()()
* Fix class properties after nested class' bare super
Fixes#7371.
* Fix node 4 test
* This damn node 4 test
* All of the ClassBody, but not the methods or field inits
* tmp
* tmp
* Use common class environment visitor
* Tests
* Use skipKey to avoid recursive traversal
* Remove old state
* Use jest expect