Re: [DOMCore] Traversal

On Fri, Jul 22, 2011 at 11:08 AM, Anne van Kesteren <annevk@opera.com> wrote:
> On Fri, 22 Jul 2011 19:46:36 +0200, Jonas Sicking <jonas@sicking.cc> wrote:
>>
>> This is not the case in gecko. We don't have any specific recursion
>> detecting code here. We just use the generic "javascript is recursing
>> too deep" detection code. So if you just recur once, that works just
>> fine and dandy. But if you recurse infinitely, you'll get an
>> exception.
>>
>> I'd much rather depend on that rather than plugging recursion
>> protection leaks in any API that uses callbacks (there's a lot). This
>> seems better both from a user point of view, and from an
>> implementation point of view.
>
> http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsTraversal.cpp#77

Ah, right, allowing iteration during iteration does indeed create a
lot of hard-to-define edge cases, so just throwing seems like the
simplest thing to do unfortunately.

For posterity, we did this in response to [1]

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=559526

/ Jonas

Received on Friday, 22 July 2011 20:02:25 UTC