Re: Problem with "this" inside static method

2018-06-19 Thread Alex Harui
On 6/19/18, 4:03 AM, "Harbs" wrote: I can rewrite the cases I keep bumping into with these problems, but it seems to me like this is something we really need to fix. Makes sense. Go for it. Good luck. I looked at the compiler code, but I don’t see any comments on why this

Re: Problem with "this" inside static method

2018-06-19 Thread Harbs
I’m pretty sure this is not a problem with static functions per se. It seems to be a general functional problem. Here’s another place I ran into issues: I have some code inside a public function: this.glyphInfos = glyphRun.glyphs.map(function(glyph):GlyphInfo{return new GlyphInfo(this.font,

Re: Problem with "this" inside static method

2018-06-17 Thread Harbs
> I'm unclear as to what the desired JS output really should be. Would it > really work in JS if the function was directly assigned to a slot on the > instance instead of a temporary variable first? If so why? Yes. Because it’s a reference to an instance variable function “cal"l can replace

Problem with "this" inside static method

2018-06-17 Thread Harbs
I have the following class: https://paste.apache.org/r7Ek Which gets cross-compiled to: https://paste.apache.org/3k1r The problem is here: struct.process = function():void { if (this.version === 0) { for (var i:int = 0;