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

P T Withington ptw at pobox.com
Wed Dec 3 13:11:46 PST 2008


On 2008-12-02, at 18:14EST, André Bargull wrote:

>
>
> 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.

I was thinking I had to make sure not to trip over properties on  
Object.prototype.  But, no one else worries about that, so I won't  
either.

> 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..
>>

Shouldn't be a problem.  The whole node will be gc-ed.

>>> 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"!?

Yes, just a matter of actually coding it up!


More information about the Laszlo-dev mailing list