[Pkg-javascript-commits] [dojo] 02/29: Check for legacy module in i18n sync require. Fixes #18448.

David Prévot taffit at moszumanska.debian.org
Thu Mar 24 04:28:33 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to annotated tag 1.8.11
in repository dojo.

commit b9a16bc8fa0a0162baad7794a95c0e26bf2d2869
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 720bb3c..1eb92fe 100644
--- a/i18n.js
+++ b/i18n.js
@@ -530,13 +530,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