[Laszlo-dev] [Laszlo-user] API change proposal: <node>/destroy behavior, when destroying child nodes recursively
André Bargull
andre.bargull at udo.edu
Tue Feb 3 07:02:19 PST 2009
It's easily possible for every runtime except DHTML+IE, see [1] for a plan.
[1]
"http://www.openlaszlo.org/pipermail/laszlo-dev/2009-January/019461.html"
On 2/3/2009 5:34 AM, Max Carlson wrote:
> How difficult would it be to add warnings for invalid/deleted nodes so
> we can track down bugs in the source? Ideally this behavior would be
> tied to a 'strict mode' that could be turned on or off to help diagnose
> issues. We could use 'strict mode' to clean up the LFC, then allow
> folks to turn it on for their LZX if they choose.
>
> P T Withington wrote:
>> On 2009-01-27, at 14:52EST, André Bargull wrote:
>>
>>> On 1/27/2009 4:47 PM, P T Withington wrote:
>>>> On 2009-01-27, at 09:46EST, André Bargull wrote:
>>>>>
>>>>> On 1/27/2009 1:03 AM, P T Withington wrote:
>>>>>> On 2009-01-26, at 18:24EST, André Bargull wrote:
>>>>>>> Oh wait, you just said nothing in the LFC depends on the current
>>>>>>> way things work. I really believed in you,
>>>>>> But wait, I said:
>>>>>> "where a child node _needs_ to access it's parent when the parent
>>>>>> is in the process of being deleted"
>>>>>> so, there may be cases where it _does_ access the parent, but does
>>>>>> it _need_ to? I don't think it does. So it is just a matter of
>>>>>> fixing those cases to be careful.
>>>>>
>>>>> How do you plan to find those cases?
>>>> One way would be to set parent to null and then fix the bugs it
>>>> reveals.
>>>
>>> It'd be great to have JS2 getters in this case. So you can generate a
>>> debugger warning in one release and by that give people the chance to
>>> update their sources. And in a next release, you'd apply the real
>>> proposed change. That way user applications continue to work.
>>> Like:
>>> ---
>>> private var _parent:LzNode;
>>> public function get parent () :LzNode {
>>> if ($debug) {
>>> if (_parent.__LZdeleted) {
>>> Debug.warn("danger");
>>> }
>>> }
>>> // return parent but give a warning when parent is already destroyed
>>> return this._parent;
>>> }
>>> ---
>>>>
>>
>> If wishes were horses...
>>
>> Given that we don't have setters, what do you propose?
More information about the Laszlo-dev
mailing list