On 2009-01-15, at 19:24EST, André Bargull wrote:
Are you sure your comment for "DefaultPresentationType" is valid,
c.f. with "LzDataElementMixin#setAttr" where any non-string input
produces a debug-warning (maybe it should just perform implicit
string-coercion as in as3 instead of the warning...).
I think the implicit conversion in as3 is a bug. I think we really
want to warn when someone sets a non-string value into a dataset,
because that is how they will learn to update their application to
operate correctly. (The string warning was added once presentation
types were working.)
We _could_ make the default presentation type be 'string', but that
would not be backwards compatible.
And I think you shouldn't take the changes in LzDataAttrBind (at
least yet), because all data-classes have this loose distinction
between `null` and `undefined` and if you just change it in one
place, it's likely it could break other things or create an
inconsistent state.
Ok, I will remove that. But, I think there is some general confusion
here. The value argument to acceptAttribute is suppose to be a
String. If the value here is null, it must mean there is no data, so
acceptAttribute should not even be being called...
And finally, these "memoization comparison" bugs are a general issue
we should fix, even base functions like "setAttribute" (with its
magic third argument) have got this bug. How about creating a task
to do some clean-up in the LFC?
Sure. I don't know where they all are, so I just keep fixing them as
I stumble upon them... Gee, if we knew who was introducing these
incorrect memoizations, maybe we could assign it to them and get them
to stop. :)
http://jira.openlaszlo.org/jira/browse/LPP-7635
On 1/15/2009 7:40 PM, P T Withington wrote:
Change 20090115-ptw-u by [email protected] on 2009-01-15
07:57:16 EST
in /Users/ptw/OpenLaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Improve presentation types
Bugs Fixed: LPP-7622 StringPresentationType required
Technical Reviewer: [email protected] (pending)
QA Reviewer: max (pending)
Details:
regression: Revert changes of r10414 that now show up as errors
due to untyped attributes correctly getting databound to
expressions.
presentation-types: Add more tests
LzSprite: Change Debug.write to Debut.error
LzNode: Reinstitute DefaultPresentationType (which is just a
straight pass-through, for backward compatibility). Fix yet
another memoization bug due to using equality rather than
identity.
PresentationTypes: Clean up comments, indentation, whitespace.
Ensure all presentation types have both accept and present methods
(note that static methods are not inherited). Add
DefaultPresentationType for backward compatibility. Rewrite
ExpressionPresentationType to match Adam's 'Laszlo XML DOM Data
Type Strictness - RFC'.
LzDataAttrBind: Remove coercion of undefined to null, fix another
memoization comparison.
Tests:
smokecheck, allcomponents example in debug no longer signals error
Files:
M test/smoke/regression.lzl
M test/smoke/presentation-types.lzl
M WEB-INF/lps/lfc/kernel/swf/LzSprite.as
M WEB-INF/lps/lfc/core/LzNode.lzs
M WEB-INF/lps/lfc/core/PresentationTypes.lzs
M WEB-INF/lps/lfc/data/LzDataAttrBind.lzs
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20090115-ptw-u.tar