-
Notifications
You must be signed in to change notification settings - Fork 148
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
Proper handling of super() call semantics #186
Comments
I was looking at this a few weeks ago and it seemed that if any pathway of the code referenced I also agree with your first approach. |
No, I think that's it. I was wondering whether one could define a function internally using We also need to watch out for false-positives. The following code is valid: constructor() {
var foo = function() {
return this;
};
super();
foo.call(this);
} But this is not: constructor() {
var foo = () => {
return this;
};
super();
foo();
} Which I think simply comes down to that we should not look for |
Lebab will currently produce invalid ES2015 code for
super()
:super()
must be called before any references tothis
. The following code will fail:super()
must always be called from subclass constructor. The following code will fail:I basically see two solutions:
I'm leaning towards the first approach as that's what Lebab has been doing in all other transforms so far.
The text was updated successfully, but these errors were encountered: