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] Classes are compiled to put this before super() calls. #18

Closed
trusktr opened this issue Oct 6, 2017 · 4 comments
Closed

[BUG] Classes are compiled to put this before super() calls. #18

trusktr opened this issue Oct 6, 2017 · 4 comments

Comments

@trusktr
Copy link
Contributor

trusktr commented Oct 6, 2017

I added my own support number based on ie:10, so it looks like this:

		    10: 0b1000000000000000000000000000010,

I wanted to leave classes alone, to compile those with Babel afterword.

It turns out, Buble is modifying the classes, and putting this before super() which turns into an error in Babel because this isn't allowed to be used before super(). The output look like this:

        constructor (options) {
            var this$1 = this;
            if ( options === void 0 ) options = {};

            super(options);

            // use options
        }

Oddly, this$1 is never used for anything. Not sure why Buble would put that there.

@trusktr
Copy link
Contributor Author

trusktr commented Oct 6, 2017

I'm using rollup-plugin-buble. Could it be a problem there?

@adrianheine
Copy link
Member

Can you give an example? I couldn't reproduce the issue.

@trusktr
Copy link
Contributor Author

trusktr commented Dec 9, 2017

Dang, I should've forked my repo and posted it. Will do next time. I may get around to it while testing builds for browsers before next release of my project.

@adrianheine
Copy link
Member

Please feel free to reopen if you see the issue again.

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

No branches or pull requests

2 participants