[Pkg-javascript-commits] [dojo] 33/149: Check for legacy module in i18n sync require. Fixes #18448.
David Prévot
taffit at moszumanska.debian.org
Sat Feb 27 03:13:44 UTC 2016
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository dojo.
commit 207202b487a9c673a77cb29e14f773ec5ad483e7
Author: Clément Mathieu <clement.mathieu at outlook.com>
Date: Mon Jan 26 15:41:33 2015 +0100
Check for legacy module in i18n sync require. Fixes #18448.
---
i18n.js | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/i18n.js b/i18n.js
index 604aad8..d522296 100644
--- a/i18n.js
+++ b/i18n.js
@@ -528,13 +528,15 @@ define(["./_base/kernel", "require", "./has", "./_base/array", "./_base/config",
results.push(cache[url]);
}else{
var bundle = require.syncLoadNls(mid);
- // don't need to check for legacy since syncLoadNls returns a module if the module
- // (1) was already loaded, or (2) was in the cache. In case 1, if syncRequire is called
- // from getLocalization --> load, then load will have called checkForLegacyModules() before
- // calling syncRequire; if syncRequire is called from preloadLocalizations, then we
- // don't care about checkForLegacyModules() because that will be done when a particular
- // bundle is actually demanded. In case 2, checkForLegacyModules() is never relevant
- // because cached modules are always v1.7+ built modules.
+ // need to check for legacy module here because there might be a legacy module for a
+ // less specific locale (which was not looked up during the first checkForLegacyModules
+ // call in load()).
+ // Also need to reverse the locale and the module name in the mid because syncRequire
+ // deps parameters uses the AMD style package/nls/locale/module while legacy code uses
+ // package/nls/module/locale.
+ if(!bundle){
+ bundle = checkForLegacyModules(mid.replace(/nls\/([^\/]*)\/([^\/]*)$/, "nls/$2/$1"));
+ }
if(bundle){
results.push(bundle);
}else{
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git
More information about the Pkg-javascript-commits
mailing list