Bug in class mixin compilation.
- Dominant language
- JavaScript
- Stars
- 874
- Forks
- 62
- PR merge metrics
- No merged PRs in 30d
Description
I could have sworn this was addressed last year. Actually have been waiting for this to sort out for a couple years now. Am patient as the `acorn` library is still a mystery to me or I would submit a PR _(not an issue)_.
We need to [create a thunk](https://en.wikipedia.org/wiki/Thunk) and assign to a constant. This is used later with the [`Class Mixin` pattern](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Mix-ins).
```javascript
const Foo = Bar => class extends Bar {}
// ... a few moments later ...
class Baz extends Foo(x)
```
with `0.19.6` we could bypass by wrapping class in parenthesis `(class extends Bar {})`
However, upgrading to 0.19.8 issued the following malformed code

Attempted on https://buble.surge.sh site but gives yet another permutation of broken code.
repro: https://buble.surge.sh/#const%20Foo%20%3D%20Bar%20%3D%3E%20class%20extends%20Bar%20%7B%7D

Please let me know if I am doing something wrong. Or where I can help. My only caveat is a lack of knowledge on the innards of `acorn`.
Thanks in advance!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.