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

Sarah Allen sallen at laszlosystems.com
Wed Jan 25 21:51:43 PST 2006


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?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: changeset-37783.zip
Type: application/x-zip-compressed
Size: 13359 bytes
Desc: not available
Url : http://openlaszlo.org/pipermail/laszlo-dev/attachments/20060125/e82681fe/changeset-37783.bin


More information about the Laszlo-dev mailing list