-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
super() not calling parent's constructor on IE9 #133
Comments
Hmm. That's def not a babelify issue. I'm surprised it works with babel@5 because of https://github.com/babel/babel.github.io/blob/862b43d/docs/advanced/caveats.md#classes-10-and-below. Try using loose mode. |
I just stumbled on this exact issue. Super class constructor is never called with 'es2015' or 'es2015-loose' presets and with or without mentioned proto to assign plugin. |
I run into exact same issue. loose doesn't work. I revert back to Babel5. minimal code example: test is not printed on IE9,10 with babel6
|
This issue should be moved to Babel |
In IE 10 I installed
Hope it will help for IE9 too |
Object.setPrototypeOf is undefined on IE <= 11, and babel doesn't seem to handle this case. You could use a polyfill for the moment : https://gist.github.com/edoardocavazza/47246856759f2273e48b#file-object-setprototypeof-ie9-js |
What about this issue? :( |
For This is the minimal set of transforms you need to get classes with super and inheritance working in IE9: browserify('./index.js')
.transform('babelify', {
plugins: [
'transform-es2015-block-scoping',
['transform-es2015-classes', {loose: true}],
'transform-proto-to-assign',
],
})
.bundle()
.pipe(fs.createWriteStream('out.js')); |
Here is a fully working gist https://gist.github.com/zertosh/4f818163e4d68d58c0fa |
@zertosh, thanks for the minimal set of transforms, this has gotten our project to work again in IE 9 after the update to babel 6. For reference, the previous solution was to use So far this fixes our issues with IE 9 and everything still seems to work, my only concern is that I cannot use the |
Documenting my findings for others with similar issues. This is my current babel configuration
This will still give the same problem, but if we use the
which is the same function found in The
NOTE: if you want to use
For some reason using it by itself it replaces WARNING: when using the polyfill make sure to put it on its own file and then import it at the top of your main file. That is, don't use the polyfill like this:
This will make
where |
Is this still an issue? I tried to run a few tests and I didn't encounter any problems anymore on IE9. I used the es2015-loose preset without transform-proto-to-assign. My code is in here: https://jsfiddle.net/peternoordijk/ymtyud9y/ |
Please, what's the final word on this? It seems like |
@zertosh I have tried your solution,my part of
but I meet another trouble:
Do you have any idea? |
@Pines-Cheng the 3 plugins did not solve this issue for me either (using babel-core 6.13.2), but using preset |
Hello,
After upgrading to babel@6.0.14, babelify@7.1.0 and babel-preset-es2015@ 6.0.14 it seems that on IE9, calling super() on a child class' constructor doesn't call the parent's constructor anymore.
The two classes live on different files and I import/export the whole using the ES2015 module syntax.
Like so:
And in my gulp task:
It's working well on IE >= 10 but unfortunately not on IE9.
I'm opening the issue on the babelify repo since I'm using it but maybe it belongs to the babel one.
Reverting back to babel@5 and babelify@6 fixes the issue.
Thanks for the support and continue the good work guys !
The text was updated successfully, but these errors were encountered: