Ah yeah, the 'this' was actually working fine, I changed something right before I posted this and forgot to run the unit tests, when I ran them again I had 2 failed tests.

The comma is fixed, minor... :)

BTW, I am using this project as an initial unit test structure because it has all the aspects like you said so I have to figure out where the code is going to be since I want it part of the suite.

I test each member;

@Test
public void test_secret()
{
    IFunctionNode vnode = findFunction("secret", classNode);
    visitor.visitFunction(vnode);
    assertOut("secret$1: function secret(n) {\n\treturn this.msg + n;\n}");
}


I am still feeling like we are going to need a lot deeper tests with expressions but I am not going to worry about that since it's trivial really. Just work..


BTW, my question about native was wrong, you had already answered why you use native, I MEANT to ask why you took the !native calls out. I managed to get the compiler flagging native calls so we could use that again eventually if you need it.

So sorry to have you write another couple paragraphs on what you already wrote. ;-)


Mike



Quoting Frank Wienberg <fr...@jangaroo.net>:

Mike, this is (attention, pun:) super!

 Like the $static on static methods I asked Frank about, haven't got a
reply.


Got one now! :-)

 Does it matter if the public fields get initialized before the super call?


When writing the Wiki page, I tried out how Flash / mxmlc handle field
initializers (remember, there is no language spec), and to my surprise found
out that non-static field initializer code gets evaluated *before* the
super call
and can't use "this". I did this wrong all the time in Jangaroo and didn't
fix it
yet, so the correct order in the JS prototype got wrong on the last commit
when using the Jangaroo-generated code. Sorry for that.
Does it matter? Well, Jangaroo worked fine for years implementing it
incorrectly, but it worked well for us.
I'd say for the sake of compatibility with "real" ActionScript, for
FalconJx,
let's do it like the original, so your code for "B" is perfect.

Well, almost ;-), two minor glitches I was only able to spot by diffing:

   - constructor: "this." missing before first "count"
   - comma missing before "foo$2: super$foo"


All this is taking shape so quickly, I'm really impressed!

Greetings
-Frank-


--
Michael Schmalle - Teoti Graphix, LLC
http://www.teotigraphix.com
http://blog.teotigraphix.com

Reply via email to