Closed bronson closed 10 years ago
I've always used sc_super(), so I'm not really sure about this method. Since Safari 2, the apparent browser that can't use this, is essentially non-existent anymore, maybe we can start using this function instead of sc_super. If that is the case, I would want to rename it.
@mauritslamers and I have been discussing related behavior. Apparently ES5 or something no longer supports arguments.callee in strict mode, which could be a consideration in the future. Also I've never been a fan of the string replacement that sc_super entails. It's a weird requirement for the build tools.
The trouble is that without arguments.callee, there is no way for the function to endogenously access itself, right? How does the superclass method accomplish this?
Anyway, assuming that's the case, then the developer will have to refer to it by name on the superclass... which is potentially fragile and mildly annoying, but is it a big deal? Please discuss amongst yourselves.
At any rate, agreed that the behavior of superclass should be consistentified.
Alright the whole point of SC.Object#superclass
was to allow use of SC without the build tools, which I think is an old, broken dream. Not only that, but it appears that superclass
is inferior to sc_super();
in that it requires the developer to know and pass the arguments individually. I'm going to deprecate the instance method for 1.11.
The superclass property/method is inconsistent: in a class it's a property that contains the superclass, in an instance it's a method that calls the superclass's method of the same name.
This seems unnecessarily confusing.
Apologies if I got anything wrong, I'm just trying to understand http://docs.sproutcore.com/?#doc=SC.Object&method=superclass&src=false