Possibly not the right thread but it is function related question so...
Code:
function f1(n*) ( n.v1 = 1; );
function f2(n*) ( n.v2 = 1; );
obj.type = 1;
obj.type ? f1(obj) : f2(obj);
When I run this code, obj gets both a v1 and a v2 even though f2() isn't actually called. I sort of think that's probably the expected behaviour because f2(obj) is referenced even though it not called. The compiler has to initialize the variables that would be required by f2(obj), just in case. Is that right?