Consider the following case:
function regularNew() {
temp.foo = new TServerPlayer("ropguy");
echo(temp.foo.account);
}
GS2, in some cases, appears to call initializer functions for certain new objects. At the current moment, I've only seen it in TServerPlayer so far, but I'm sure that other objects have this as well.
Here's an example decompiled output of the above:
function regularNew()
{
new_node#3 = new TServerPlayer("ropguy");
fn_call#6 = <new_node.loadAccount>#5();
<temp.foo>#7 = new_node#3;
fn_call#11 = echo#10(<temp.foo.account>#9);
}
In the above case, the official GS2 compiler will inject a loadAccount function call after instantiating TServerPlayer.
Consider the following case:
GS2, in some cases, appears to call initializer functions for certain
newobjects. At the current moment, I've only seen it inTServerPlayerso far, but I'm sure that other objects have this as well.Here's an example decompiled output of the above:
In the above case, the official GS2 compiler will inject a
loadAccountfunction call after instantiatingTServerPlayer.