You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an action is called over an object and its parent has a method with the same name that gets called in the action, all the actions called in the parent method gets a wrong super call.
The gist is supposed to console log only 1 'foo' string, but it gets called twice.
I reproduce the bug using an action called refresh that calls the refresh method on the Ember.Route class. That method calls the action "willTransition" and that action gets the wrong super call.
The bug only can be reproduced on a minified version of Ember, where "sourceAvailable" variable is false when setting super methods.
Regards,
The text was updated successfully, but these errors were encountered:
The sourceAvailable check was broken when minified until #12463 landed in 2.1.1. It basically forced all minified checks for sourceAvailable to be 'false'.
However, the providing of super should have still worked (it just would miss out on the optimization of avoiding adding a super wrapper when it isn't needed). So this bug may still manifest even on latest versions on platforms that do not support Function.prototype.toString.
OK, after re-reviewing the attached gist, it turns out this is a duplicate of #13230. What is happening is that the _super property is not being properly reset between method invocations, and calling this._super from within actions.bar is actually invoking the foo function.
I had started working on a fix in #13242, but I believe that the solution isn't quite that simple. We will likely attempt to introduce an error/warning/etc when you attempt to call _super when there is no parent class super function to invoke (this mimics the behavior of super from within ES6 classes and most other languages).
Thank you for reporting this issue, and sorry it has taken so long for me to fully understand what is going on. I'm going to close this issue, but continue tracking the problem in #13242 and #13230.
Hi,
Debugging a wierd behaviour on a production app I realiced that super calls are broken on all versions of Ember 1.13. Can't tell if it goes higher.
The bug is tested though this gist. Ember must be placed as minified version.
https://gist.github.com/adrigzr/66aedb0801c29db44203
When an action is called over an object and its parent has a method with the same name that gets called in the action, all the actions called in the parent method gets a wrong super call.
The gist is supposed to console log only 1 'foo' string, but it gets called twice.
I reproduce the bug using an action called refresh that calls the refresh method on the Ember.Route class. That method calls the action "willTransition" and that action gets the wrong super call.
The bug only can be reproduced on a minified version of Ember, where "sourceAvailable" variable is false when setting super methods.
Regards,
The text was updated successfully, but these errors were encountered: