SmartClient Version: v10.0p_2015-12-02/Pro Deployment (built 2015-12-02)
The documentation for the Class.Super instance method states that the method calls "the SuperClass implementation of an instance method" ...which from what I can tell is not actually true. In order to explain what I mean, see the following code snippet:
When this runs, the console reads "first, second, third". Based on this result, the Super call within the initWidget of the SecondTest.create method is actually calling the initWidget on the default implementation for the class rather than the initWidget of it's super class. I actually know this for sure because I replace the console logs in each of the above initWidget definitions with 'this.getSuperClass()' - I get the result of "Canvas, FirstTest, FirstTest". So if Super really does call the super class implementation of the method, the original console logs should read "first, third" but that is just not the case.
It is almost as if every time you create an instance of a class, it creates a subclass behind the scenes and considers the class that the instance is made up of as a super class. That is all fine and dandy, but don't you think that should be explained in the documentation for the Super method?
This is not something that I am trying to throw in anyone's face or anything like that - it is just something that I guess I would like to confirm and get some explanation on.
Thank you
The documentation for the Class.Super instance method states that the method calls "the SuperClass implementation of an instance method" ...which from what I can tell is not actually true. In order to explain what I mean, see the following code snippet:
Code:
isc.defineClass("FirstTest", "Canvas").addProperties({ height: 500, width: 500, backgroundColor: "red", initWidget: function () { this.Super("initWidget", arguments); console.log("first"); } }); isc.defineClass("SecondTest", "FirstTest").addProperties({ initWidget: function () { this.Super("initWidget", arguments); console.log("second"); } }); isc.SecondTest.create({ initWidget: function () { this.Super("initWidget", arguments); console.log("third"); } });
It is almost as if every time you create an instance of a class, it creates a subclass behind the scenes and considers the class that the instance is made up of as a super class. That is all fine and dandy, but don't you think that should be explained in the documentation for the Super method?
This is not something that I am trying to throw in anyone's face or anything like that - it is just something that I guess I would like to confirm and get some explanation on.
Thank you
Comment