Ok, my confusion here.
I guess my complaint is that the compiler will not declare the
attributes that have no initial value, so that `'cundef' in canvas`
will test false for them, event though they have been declared. This
seems wrong to me.
In the same vein, the runtime should be only warning if the property
does not exist at all, not if the property is undefined.
Unfortunately, we can't do this in swf because the in operator is not
implemented there.
See http://jira.openlaszlo.org/jira/browse/LPP-969
But in any case, you can disregard my comment with respect to your
change. And it's great to see you making changes!
On 2007-08-27, at 16:29 EDT, André Bargull wrote:
Until now I haven't found this "optimization", see i.e. this simple
testcase.
It will only print the "undefined property"-warning for "cundef"
and for "attrundef" (just SWF-Runtime, in DHTML it'll print "(void
0)" for the undefined values without any warnings; tested in FF2,
IE6, Opera9 on wafflecone)
[code]
<canvas debug="true" >
<attribute name="cundef" />
<attribute name="cnull" value="null" />
<class name="test" >
<attribute name="attrundef" />
<attribute name="attrnull" value="null" />
</class>
<test id="foo" />
<handler name="oninit" >
Debug.write("canvas.cundef=%w", canvas.cundef);
Debug.write("canvas.cnull=%w", canvas.cnull);
Debug.write("foo.attrundef=%w", foo.attrundef);
Debug.write("foo.attrnull=%w", foo.attrnull);
</handler>
</canvas>
[/code]
P T Withington wrote:
There may be a (n incorrect) optimization in the compiler that
drops null attributes thinking they are equivalent to undefined
(which they clearly are not).
---
L'iPhone, c'est moi.
On Aug 25, 2007, at 4:50 PM, André Bargull <[EMAIL PROTECTED]>
wrote:
Actually, there shouldn't be any warnings, since "_widthdel" and
"_heightdel" are both defined as "null" and not as
"undefined" (see l.44 resp. l.46 in basefocusview.lzx).
However, if you want me to change the if-clauses for "_widthdel"
and for "_heightdel", I'd suggest I'll also change the if-clause
for "_xydelegate", so we use the same pattern to check for
"null" / "undefined" values.
André
Max Carlson wrote:
Welcome aboard - it's great having you as a committer!
Approved, provided you change lookups to prevent warnings, e.g.:
if ( !this._widthdel )
should be
if ( !this['_widthdel'] )
André Bargull wrote:
Change 20070825-bargull-6 by [EMAIL PROTECTED] on
2007-08-25 16:48:55
in /home/Admin/src/svn/openlaszlo/branches/wafflecone
for http://svn.openlaszlo.org/openlaszlo/branches/wafflecone
Summary:
Fixed tracking in basefocusview
New Features:
Bugs Fixed:
LPP-4553 "basefocusview warnings when canvas size changes"
Technical Reviewer: max
QA Reviewer: ben
Doc Reviewer: (pending)
Documentation:
The whole width/height tracking was broken for basefocusview,
this is now fixed.
Release Notes:
Details:
Tests:
Two testcases can be found at the bugreport (LPP-4553)
Files:
M lps/components/base/basefocusview.lzx
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/
20070825-bargull-6.tar
--
Official OpenLaszlo-Committer ^_^
--
Official OpenLaszlo-Committer ^_^