Article View: comp.lang.javascript
Article #29Re: recursive requestAnimationFrame
From: Mikko
Date: Tue, 10 Nov 2026 07:31
Date: Tue, 10 Nov 2026 07:31
27 lines
2593 bytes
2593 bytes
On 09/11/2026 19:32, Jon Ribbens wrote:
> On 2026-11-09, Mikko <mikko.levanto@iki.fi> wrote:
>> On 09/11/2026 15:53, Stefan Ram wrote:
>>> ram@zedat.fu-berlin.de (Stefan Ram) wrote or quoted:
>>>> Maybe that browser is showing you the /asynchronous call stack/
>>>> ("Async Stack Traces"), not the execution stack. This async stack
>>>> seems to be a history of scheduling ancestry. The browser saved
>>>> a history of who scheduled whom.
>>>
>>> It's also possible that what you see /is/ the actual call stack,
>>> and there is some other part of the code that actually /is/
>>> recursive. I don't have Safari here to check this out.
>>
>> As my animation code calls requestAnimationFrame there is an indirect
>> recursion if requestAnimationFrame is recursive. Otherwise I have no
>> recursion that involves requestAnimationFrame.
>
> I'm pretty sure requestAnimationFrame is like setTimeout - it
> always returns immediately, and the function you pass it is
> called asynchronously at a later point.
So am I. Nothing else makes sense. But the stack shown by the debugger
looks strange. The same happens when setTimeout is used but not when
setInterval is used.
--
Mikko
Technical Details
Message-ID:
<11cuh83$1upa6$1@dont-email.me>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mailReferences:
<11csaeg$169bs$1@dont-email.me> <stack-20261109141457@ram.dialup.fu-berlin.de> <stack-20261109145242@ram.dialup.fu-berlin.de> <11csv2v$1eil0$2@dont-email.me> <slrn11f40t2.2pa.jon+usenet@raven.unequivocal.eu>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.hispagatos.org!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: Mikko <mikko.levanto@iki.fi> Newsgroups: comp.lang.javascript Subject: Re: recursive requestAnimationFrame Date: Tue, 10 Nov 2026 09:31:14 +0200 Organization: A noiseless patient Spider Lines: 27 Message-ID: <11cuh83$1upa6$1@dont-email.me> References: <11csaeg$169bs$1@dont-email.me> <stack-20261109141457@ram.dialup.fu-berlin.de> <stack-20261109145242@ram.dialup.fu-berlin.de> <11csv2v$1eil0$2@dont-email.me> <slrn11f40t2.2pa.jon+usenet@raven.unequivocal.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 10 Nov 2026 07:31:15 +0000 (UTC) Injection-Info: dont-email.me; logging-data="2057542"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+m7GRvjgETh0EAF+iQG7T1"; posting-host="b8adc6d4de38fc43ff19f14d5dccab01" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:axU8J4fDWG7K1YGJeMtRzWh7Cz0= sha256:y7kB+Ke5maqxeoyldbZzZokl4JzOSDJ3JGACsOVXnzM= sha1:QAX6G4fuDgpEWwBeGRGNJS5i+Cg= sha256:A3RFVVOiHoPns8t4jp1+4UGciZOHXZQS+mRw5k8XLJk= In-Reply-To: <slrn11f40t2.2pa.jon+usenet@raven.unequivocal.eu>