[Laszlo-dev] trying to add a warning for bad param to new LzDelegate

P T Withington ptw at pobox.com
Thu Jan 26 07:03:33 PST 2006


This seems like a great idea.  I'll see if I can track down what is  
going on.

On 26 Jan 2006, at 00:51, Sarah Allen wrote:

>
> so... for the twentieth time, I spent a half hour tracking down an  
> LZX bug that eventually turned out to be that I had written:
>   new LzDelegate(this, _callstop, anm, "onstop");
>
> instead of
>   new LzDelegate(this, "_callstop", anm, "onstop");
>
> so I thought I would take 5 minutes and add a warning to the  
> LFC ... er sorry... OLR
>
> for some weird reason I got dozens of wanrings, when I expected to  
> get 2 with this test file:
> <canvas>
>    <view>
>        <method event="oninit">
>            new LzDelegate(this, "foo", this, "onmousedown");
>            new LzDelegate(this, foo, this, "onmousedown");
>            new LzDelegate(this, "foo", this, onmousedown);
>        </method>
>    </view>
> </canvas>
>
> all I did was to add this code to LzDelegate:
>   if ( $debug ){
>        if (typeof(f) != "string")
>            Debug.warn('function name must be a string');
>        if (typeof(eventName) != "string")
>            Debug.warn('event name must be a string');
>    }
>
> Changeset enclosed.  Bug filed LPP-1430
>
> Any ideas anyone?
>
> Thanks,
> Sarah
>
> p.s. how do you add in a way to show what line the warning is  
> coming from?
> <changeset-37783.zip>
> _______________________________________________
> Laszlo-dev mailing list
> Laszlo-dev at openlaszlo.org
> http://www.openlaszlo.org/mailman/listinfo/laszlo-dev



More information about the Laszlo-dev mailing list