From 1aa90d738fa590bb26687c26356980fec706b8c5 Mon Sep 17 00:00:00 2001 From: Jonathan Kamens Date: Mon, 5 Aug 2019 09:30:00 -0400 Subject: [PATCH 1/2] Don't convert locale directory names to lower case Fixes andrewplummer/Sugar#654 --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index ee3c7aa47..9b9d2e637 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -793,7 +793,7 @@ function getLocalePaths(l) { var codes = getLocaleCodes(l); function getPath(l) { - return path.join('lib', 'locales', l.toLowerCase() + '.js'); + return path.join('lib', 'locales', l + '.js'); } codes.forEach(function(n) { From 9bc728a3efab8e4d49f7ffac1c047eb70cfeb391 Mon Sep 17 00:00:00 2001 From: Jonathan Kamens Date: Mon, 5 Aug 2019 09:45:01 -0400 Subject: [PATCH 2/2] Fix for getting global context in recent Firefox and Thunderbird If we can't get the global contest from either `global` or `window` and `Cu.getGlobalForObject` exists, then use that. See https://developer.mozilla.org/docs/Mozilla/Tech/XPCOM/Language_Bindings/Components.utils.getGlobalForObject. Fixes andrewplummer/Sugar#627. --- lib/core.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/core.js b/lib/core.js index 9b28df75d..7734598d4 100644 --- a/lib/core.js +++ b/lib/core.js @@ -50,8 +50,13 @@ var DefaultChainable = getNewChainableClass('Chainable'); function getGlobal() { // Get global context by keyword here to avoid issues with libraries // that can potentially alter this script's context object. - return testGlobal(typeof global !== 'undefined' && global) || - testGlobal(typeof window !== 'undefined' && window); + var ret = testGlobal(typeof global !== 'undefined' && global) || + testGlobal(typeof window !== 'undefined' && window); + if (ret) return ret; + // Firefox / Thunderbird specific + if (typeof Cu != 'undefined' && typeof Cu.getGlobalForObject != 'undefined') + ret = testGlobal(Cu.getGlobalForObject(getGlobal)); + return ret; } function testGlobal(obj) {