From 26ec36ba4cb7f8084964f2798a46b3f5a80ce1b6 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Thu, 1 Oct 2015 09:56:15 +0200 Subject: [PATCH] Upstream changes from Bug 1202902 - Give loader scripts and XUL frame scripts a lexical scope that doesn't break everything? One of the patches in https://bugzilla.mozilla.org/show_bug.cgi?id=1202902, specifically [`Mass replace toplevel 'let' with 'var' in preparation for global lexical scope. (rs=jorendorff)`](https://hg.mozilla.org/mozilla-central/rev/380817d573cd), touches PDF.js code. Unfortunately it was landed upstream without, as far as I can tell, notifying us about it. This patch uplifts the relevant changes to avoid future merge conflicts, and for consistency also tweaks `PdfJs-stub.jsm`. --- extensions/firefox/content/PdfJs-stub.jsm | 2 +- extensions/firefox/content/PdfJs.jsm | 4 ++-- extensions/firefox/content/PdfjsChromeUtils.jsm | 2 +- extensions/firefox/content/PdfjsContentUtils.jsm | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/firefox/content/PdfJs-stub.jsm b/extensions/firefox/content/PdfJs-stub.jsm index ad64a1416..2d65e255d 100644 --- a/extensions/firefox/content/PdfJs-stub.jsm +++ b/extensions/firefox/content/PdfJs-stub.jsm @@ -22,6 +22,6 @@ // See https://mxr.mozilla.org/mozilla-central/source/browser/components/nsBrowserGlue.js var EXPORTED_SYMBOLS = ['PdfJs']; -let PdfJs = { +var PdfJs = { init: function PdfJs_init() {} }; diff --git a/extensions/firefox/content/PdfJs.jsm b/extensions/firefox/content/PdfJs.jsm index a6594cd82..b026ad1a4 100644 --- a/extensions/firefox/content/PdfJs.jsm +++ b/extensions/firefox/content/PdfJs.jsm @@ -43,7 +43,7 @@ const PDF_CONTENT_TYPE = 'application/pdf'; Cu.import('resource://gre/modules/XPCOMUtils.jsm'); Cu.import('resource://gre/modules/Services.jsm'); -let Svc = {}; +var Svc = {}; XPCOMUtils.defineLazyServiceGetter(Svc, 'mime', '@mozilla.org/mime;1', 'nsIMIMEService'); @@ -130,7 +130,7 @@ Factory.prototype = { } }; -let PdfJs = { +var PdfJs = { QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver]), _registered: false, _initialized: false, diff --git a/extensions/firefox/content/PdfjsChromeUtils.jsm b/extensions/firefox/content/PdfjsChromeUtils.jsm index 4b1daede9..1a55c3252 100644 --- a/extensions/firefox/content/PdfjsChromeUtils.jsm +++ b/extensions/firefox/content/PdfjsChromeUtils.jsm @@ -32,7 +32,7 @@ const PDF_CONTENT_TYPE = 'application/pdf'; Cu.import('resource://gre/modules/XPCOMUtils.jsm'); Cu.import('resource://gre/modules/Services.jsm'); -let Svc = {}; +var Svc = {}; XPCOMUtils.defineLazyServiceGetter(Svc, 'mime', '@mozilla.org/mime;1', 'nsIMIMEService'); diff --git a/extensions/firefox/content/PdfjsContentUtils.jsm b/extensions/firefox/content/PdfjsContentUtils.jsm index ce8c8b7d1..ce65f8bd5 100644 --- a/extensions/firefox/content/PdfjsContentUtils.jsm +++ b/extensions/firefox/content/PdfjsContentUtils.jsm @@ -29,7 +29,7 @@ const Cu = Components.utils; Cu.import('resource://gre/modules/XPCOMUtils.jsm'); Cu.import('resource://gre/modules/Services.jsm'); -let PdfjsContentUtils = { +var PdfjsContentUtils = { _mm: null, /*