You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xap-dev@incubator.apache.org by James Margaris <jm...@nexaweb.com> on 2006/10/03 00:19:12 UTC
Dojo.require() and stack overflow issues
So I hit an interesting problem today. Apparently in IE if you have a
file that requires another file that requires a third file etc etc you
can get a stack overflow error somewhat quickly. (After about 10 levels
of nesting or so.)
Thinking of ways to avoid this, one thing I think would make sense would
be to organize things like utils so that it has a package-level listing,
and structure that so that things required by other thing are on top.
For example, Hashtable requires Exception. So if we list them like:
Hashtable
Exception
When hashtable is loaded it will then load exception. If we list them
like:
Exception
Hashtable
Then when Hashtable is loaded Exception has already been loaded first.
If exception itself requires other classes this can save a few stack
frames.
---
This is more a problem with unit tests right now as a real application
should run against a compiled profile that should have more things baked
into it rather than a bunch of nested requires.
James Margaris