[Dojo-checkins] [dojo] #9393: Custom build fails in jslib/i18nUtil.flattenLayerFileBundles()
dojo
trac at dojotoolkit.org
Thu Jun 11 19:29:37 EDT 2009
#9393: Custom build fails in jslib/i18nUtil.flattenLayerFileBundles()
---------------------------------+------------------------------------------
Reporter: William Chapman | Owner: jburke
Type: defect | Status: new
Priority: normal | Milestone: tbd
Component: BuildTools | Version: 1.3.0
Severity: normal | Resolution:
Keywords: i18n, custom build, |
---------------------------------+------------------------------------------
Comment(by William Chapman):
William Chapman added the following comment about
util/buildscrxipts/jslib/i18nUtil.flattenLayerFileBundles():
I've noticed the following undesirable (to me) behavior in this method
(for which I needed to rework my code to get as far as I did) that might
need some work:
(1) This line of code (line 62) finds the dojo.requireLocalization()
calls:
{{{
var requireStatements =
fileContents.match(/dojo\.requireLocalization\(.*\)\;/g);
}}}
But this code is not sensitive to comments, so it includes commented out
calls.[[BR]]
Perhaps comments should be stripped before processing.
(2) This code block (lines 55-60) gets tripped up if the bundlename
argument of the dojo.requireLocalization() call contains anything but a
literal string:
{{{
var drl = dojo.requireLocalization;
dojo.requireLocalization = function(modulename, bundlename,
locale){
drl(modulename, bundlename, locale);
//TODO: avoid dups?
djLoadedBundles.push({modulename: modulename, module:
eval(modulename), bundlename: bundlename});
};
}}}
So, as it stands, developers need to know - that if they intend to use the
build utility - to avoid writing something like this:[[BR]]
{{{
lang.requireLocales = function (locale) {
dojo.forEach(["bundle1", "bundle2", "bundle3"], function (bundle)
{
dojo.requireLocalization("moduleName", bundle, null);
});
};
}}}
--
Ticket URL: <http://bugs.dojotoolkit.org/ticket/9393#comment:4>
dojo <http://dojotoolkit.org/>
The Dojo UI Toolkit
More information about the Dojo-checkins
mailing list