Harbs,

Can you provide a link to more info on how 'this' works in statics?  MDN makes 
it sound like it points to the global object even in ES6.

I saw an article that code duplication isn't a perfect emulation of ES6 statics 
in ES5.
https://www.bennadel.com/blog/3300-static-methods-are-inherited-when-using-es6-extends-syntax-in-javascript-and-node-js.htm

On 4/22/18, 11:46 PM, "Harbs" <harbs.li...@gmail.com> wrote:

    It seems like ES6 supports static inheritance. The means you can define a 
class with static methods which can be called in subclasses. You can also use 
“this” in static methods which will refer to the subclass methods if 
overridden. This is obviously something which doesn’t work in AS3.
    
     I’m porting an ES6 library to AS3 and I’m trying to figure out the best 
way to port this kind of code. I’m thinking that code duplication is probably 
simplest, although I might just convert the static classes into singletons.
    
    Harbs

Reply via email to