In my opinion this change set tries to handle too much. It should be
sufficient to handle the original error when there is no dependencies
method for a function and just ignore any error in swf9+, similar to the
swf8 and dhtml behaviour. For example the changes to the components
introduce too much internal stuff, I don't think we want to introduce
things like "$lzc$funcName_dependencies" into user-land (I consider all
components as user-land!).
And searching for functions in constraints in the demo and docs
directory gives these results:
- parseFloat(..)
- Number(..)
- thumbControl(..)
- getEventColor(..)
- formatToString(..)
- escapeText(..)
...
None of these functions is currently handled. And you don't want to add
more exception rules for the compiler resp. handcrafted dependencies
methods, do you?
On 4/9/2010 8:23 PM, P T Withington wrote:
Change 20100409-ptw-7 by [email protected] on 2010-04-09 13:47:40 EDT
in /Users/ptw/OpenLaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Make constraints and dependencies more debuggable and compatible
New Features: You will now get warnings in debug mode when you write
an $always{} constraint whose dependencies cannot be tracked.
Bugs Fixed: LPP-7344 Attepting to constrain a non-LzEventable object property
gives ActionScript error in SWF9
Technical Reviewer: [email protected] (pending)
QA Reviewer: hminsky, max (pending)
Release Notes:
In debug mode, the evaluation of $always{} constraint dependencies
is more careful. You will get a warning when your constraint
depends upon a value or function whose dependencies cannot be
computed. Most often you will find that you probably meant to use
a $once{} constraint (that the value being computed does not
change over time).
Overview:
Removed the type declaration from LzDelegate so that a more
friendly error can be displayed. Added code in debug mode to
validate property and function dependencies and issue a warning
when they cannot be resolved.
Details:
regression: Use data type declaration rather than coercion in
constraint
LzNode: Take greater care installing dependencies. In debug mode
give warnings that relate the dependency errors to the constraint
the user wrote. Ensure that despite failing dependencies, the
constraint is at least evaluated once (for backward compatibility
with swf8 behavior).
LaszloEvents: Revert to runtime type-checking of LzDelegate
arguments. swf8 allows delegates on non-LzEventable for
compatibility with the swf8 kernel, but all other runtimes will
refuse to create delegates if the context is not an LzEventable or
the method is not a method. Similarly, delegates will only be
registered on LzEventable events in the modern runtimes. Also
repaired LzDelegate#_dbg_name_ to work with the new __events
Array.
LzRuntime: Add support for verifying reference dependencies and
calculating method dependencies carefully
ReferenceCollector: Collect annotations for debug mode to support
more intelligible error messages. Removed obsolete 'subfunction'
API, no longer used. Added `pureFunctions` filter to reduce
irrelevant dependency computations.
*Generator: Remove obsolete #pragma "constraintFunction" support.
Compiler, NodeModel: Rework dependencies computation to support
better debugging.
dragstate, basescrollbar, basecomponent, basewindow: Add some
missing dependency methods. Rework conditional constraints (which
the compiler does not really understand) to be method constraints
with appropriate dependencies.
Tests:
Test case from bug. Smokecheck. Calendar, LzPix, Amazon,
Animation demos
Files:
M test/smoke/regression.lzl
M WEB-INF/lps/lfc/core/LzNode.lzs
M WEB-INF/lps/lfc/events/LaszloEvents.lzs
M WEB-INF/lps/lfc/compiler/LzRuntime.lzs
M WEB-INF/lps/server/src/org/openlaszlo/sc/ReferenceCollector.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/JavascriptGenerator.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/Compiler.java
M WEB-INF/lps/server/src/org/openlaszlo/sc/CodeGenerator.java
M WEB-INF/lps/server/src/org/openlaszlo/compiler/NodeModel.java
M lps/components/utils/states/dragstate.lzx
M lps/components/base/basescrollbar.lzx
M lps/components/base/basecomponent.lzx
M lps/components/base/basewindow.lzx
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100409-ptw-7.tar