Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in class mixin compilation. #243

Open
snuggs opened this issue Feb 14, 2020 · 2 comments
Open

Bug in class mixin compilation. #243

snuggs opened this issue Feb 14, 2020 · 2 comments
Labels

Comments

@snuggs
Copy link

snuggs commented Feb 14, 2020

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 and assign to a constant. This is used later with the Class Mixin pattern.

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
Capture d’écran 2020-02-14 à 14 03 56

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
Capture d’écran 2020-02-14 à 14 07 31

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!

@snuggs
Copy link
Author

snuggs commented Mar 6, 2020

Anybody?
/cc @mourner

@mourner mourner added the bug label Mar 6, 2020
@snuggs
Copy link
Author

snuggs commented May 9, 2020

@Rich-Harris what's good homie! Long time! I know you recently stepped down from project. But I swear I remember us working on this almost a couple years ago. I would try to fix it myself if I had clear direction of acorn etc. But now have people bugging me about this issue in a library I maintain that depends upon this package. Just let me know next step. Would hate to have to switch to babel. I'm loyal and would rather fix this. 💪

Thank you and PEACE! 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants