On 4/7/10 12:58 PM, P T Withington wrote:
As with any little bit of OL that you start poking your nose into, it's always
more complex than you imagine.
I started tackling http://jira.openlaszlo.org/jira/browse/LPP-7344 thinking
that all I would need to do is take away the type declarations on LzDelegate
and enable the runtime warnings that are used in lieu of type declarations for
the non-typed runtimes.
Well, that was a start. That covers the case of someone trying to constrain to
a property of an object that is not an LzEventable. But the case in
http://jira.openlaszlo.org/jira/browse/LPP-7958 which is related, is actually
because someone is trying to constrain to a method of a non-dynamic object. In
as3, this results in a type error, because the code that is looking for the
dependency function will fail on a sealed object, rather than just returning
null.
Great!
To fix this issue, I propose moving the function dependency calculation into a
runtime support routine that will catch the type error.
I wonder what the overhead will be? Can we do this just for debug mode?
The question is: when you constrain to function that does not have a
dependencies method, should you get a warning (because you might wonder why
your constraint does not update) or should it silently succeed (because that is
what happens in swf8 and DHTML right now)?
It seems like you might want to be able to constraint to arbitrary
functions and have the event system default to lz.Idle.onidle as a
dependency. There should still be a warning in debug mode, so folks
know to update this for efficiency.
Also, while trying to make the error message that you get more useful (by telling you
which constraint it is that is not getting its dependencies right), I notice that we get
a pile of "failed" dependencies already, that are just silently ignored. These
seem to come from dependencies that perhaps are evaluated too soon and hence the context
of the event they want to listen to does not yet exist. It seems we might want to get a
warning on those too?
That would be great!