Changes between Initial Version and Version 21 of Ticket #14685


Ignore:
Timestamp:
Jun 4, 2012, 3:33:20 AM (7 years ago)
Author:
Eugene Lazutkin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14685

    • Property Owner set to Mark Wubben
    • Property Status changed from new to closed
    • Property Resolution changed from to wontfix
    • Property Cc ben hockey added
  • Ticket #14685 – Description

    initial v21  
    11Deferred is using recursion for the chain:
    2   then() -> complete() -> notify() -> {repeat}
     2
     3{{{
     4#!js
     5then() -> complete() -> notify() -> {repeat}
     6}}}
    37
    48This blows the stack when there are a 100 or so elements in the chain in IE, 1000 for FF, and 1700 for Chrome.
     
    610Here's a test body to illustrate:
    711
     12{{{
     13#!js
    814var first = new dojo.Deferred(),
    915  d = first, i, recurses = 0, max = 5000;
     
    1622}
    1723first.resolve();
     24}}}
    1825
    19 --
    2026Instead of recursion this can be written with a task queue and then queueing the calls to "notify" done in "complete" and "then".
    2127