[dojo-contributors] self executing scripts

James Burke jburke at dojotoolkit.org
Sun May 31 17:54:59 EDT 2009

On Sun, May 31, 2009 at 12:43 PM, Peter E Higgins <dante at dojotoolkit.org> wrote:
> makes it more complicated than it is worth, thus eliminating the
> usefulness. :)

OK. I have not felt a need for it, but if folks seem to like it, then
I would go for the smallest patch possible:
- in hostenv_browser, hold on to the script element (or just grab the
innerHTML, whatever is easiest/shortest)
- in dojo/_base/browser.js, just put in the one or two lines you need
to do the eval and cleanup after the dojo.forEach for the dojo.require
calls. The djConfig.require calls should happen before this innerHTML
eval. I wouldn't bother with the anon function wrapper around the eval
part, unless the alternative makes the code bigger.

I wouldn't bother with the rest of the boilerplate/extra module -- it
takes up more space than the actual functionality. Also I would not
provide a build switch. The functionality is so small as to make the
build switch not worth it.


More information about the dojo-contributors mailing list