[dojo-contributors] IE6's stack may be smaller than you think

Mark Hays haysmark at us.ibm.com
Thu Oct 28 18:41:58 EDT 2010


Another group tried to implement CommonJS just a few months back and hit 
the Stack Overflow in IE6 we are encountering with the new define() API 
for the loader (cf #11883):

http://cappuccino.org/discuss/2010/03/01/internet-explorer-global-variables-and-stack-overflows/

In their stupidly trivial example, they declared a recursive function, 
stored it on the window, and then called it. As few as 13 recursive calls 
to this function triggered a Stack Overflow error in IE6.

On the other hand, when they stored the function in an object hanging off 
the window (read: dojo) the function could be called an arbitrarily large 
number of times recursively without fail.

I mention this because I noticed we declare define() in a manner 
consistent with their example (we declare this.define where this==window), 
so I am wondering if there is another way to store define() so that it 
doesn't live on the window yet widget files that use it can get to it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.dojotoolkit.org/pipermail/dojo-contributors/attachments/20101028/b2a45f30/attachment.htm 


More information about the dojo-contributors mailing list