[Laszlo-dev] For Review: Change 20081130-ptw-v Summary: Revert init arg behavior

André Bargull andre.bargull at udo.edu
Tue Dec 2 15:14:47 PST 2008



On 12/2/2008 7:17 PM, P T Withington wrote:
> Ok, I updated the change, if you would like to re-review it.  

Sure :-)

> +    for (var key in cargs) {
> +      // A constructor is allowed to override an arg
> +      if (! iargs.hasOwnProperty(key)) {
> +        iargs[key] = cargs[key];
> +      }
> +    }

Why not using the "in"-operator? I know that it doesn't really work for 
undefined values in swf8. But nevertheless is much faster, for swf8 it 
was about 30-40% less time, for dhtml 10-15% less time.


tested with:
//both runtimes need approx. 1sec to execute the code
var m=80000; //800000 for dhtml
var o={}; //var o={foo:true}
var d=new Date()
for(var i=0;i<m;++i)
//if(o.hasOwnProperty('foo')) ;
if('foo' in o) ;
Debug.write(new Date()-d);



> +    this.__LzValueExprs = null;

The property isn't set to null if the previous return statement is 
executed..



>> btw:
>>> // Install any class decls that the tag compiler could't
>>> // figure out (because it does not know the built-in class
>>> // setters, c.f., ClassCompiler.java)
>>
>> Still true? Doesn't the compiler know all setters now at compiler-time?
> 
> It does not know the setters for the LFC classes.

Hm, it should be easy to identify all setters since they're all named 
"$lzc$set_xxx"!?




More information about the Laszlo-dev mailing list