The function we're looking at is the constructor function for an LzText object, it gets called via the LzNode initialization sequence, so you are guaranteed that 'args' will always be an object (it won't be null). It may or may not have a "height" property.
On LzView, I see this line
LzView.prototype.height = null;
So the value if not set explicitly should be inheriting from the LzView class default, so it's OK not to set it at all in the LzText constructor.
The init sequence for LzNode is documented someplace, but I need to find that.
The important detail in that sequence here is that LzNode's "initialize" function calls the class's "construct" method, and then it calls __LZApplyArgs with the args object. __LZApplyArgs will iterate over the args key/value pairs, and if a setter exists for that property it will call it, otherwise it will just set this[key] = value.
Actually right below the code we're talking about in LzText.construct I see this:
// Default the scrollheight to the visible height.
this.scrollheight = this.height;
But this.height would never be set at that point, and it looks like "scrollheight" isn't used anywhere anymore, so that line can almost certainly be removed. It must be some old Flash 5 thing that is no longer used.
On 5/12/06, Philip Romanik <[EMAIL PROTECTED]> wrote:
If a statement like this will trigger a warning, what is the correct way to
fix this problem? Should I look through the code and make sure it is
initialized to null?
Thanks!
Phil
> >> if ( args.height)
>
> Note that if args.height does not exist or is set to the undefined
> value, this will still trigger a warning.
--
Henry Minsky
Software Architect
[EMAIL PROTECTED]
_______________________________________________ Laszlo-dev mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-dev
