[dojo-contributors] self executing scripts

Peter E Higgins dante at dojotoolkit.org
Sun May 31 18:45:42 EDT 2009


James Burke wrote:
> 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:
>   
Yah, that's really what I'm trying to gauge here. Relative interest
amongst the group.  So far no one is _really_ excited, just amused. :)
> - 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.
>
>   
That makes sense. dojo._scriptHtml = scripts[i].innerHTML; then later
dojo['eval'](dojo._scriptHtml)
> 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.
>   
My putting that there wasn't so much for the size of the functionality,
but as a way to say "this non-standard behavior can be disabled if you
really prefer it"

Regards,
Peter

-- 
Peter E Higgins
Dojo Project Lead : http://dojotoolkit.org 



More information about the dojo-contributors mailing list