Bug 1207491 - Part 20: Remove use of expression closure from browser/components/translation/. r=Gijs
authorTooru Fujisawa <arai_a@mac.com>
Wed, 23 Sep 2015 18:36:24 +0900
changeset 264357 b38d6ae28083544b3951c1bd546923c4b2322af2
parent 264356 22b2b6e2f21f7409ea455f07d45defe9129c5c9c
child 264358 94d51a413fba7a8132f38073909693f04eb2f535
push id65606
push userarai_a@mac.com
push dateFri, 25 Sep 2015 08:14:49 +0000
treeherdermozilla-inbound@e4f5f909df68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs
bugs1207491
milestone44.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1207491 - Part 20: Remove use of expression closure from browser/components/translation/. r=Gijs
browser/components/translation/Translation.jsm
--- a/browser/components/translation/Translation.jsm
+++ b/browser/components/translation/Translation.jsm
@@ -124,17 +124,19 @@ this.Translation = {
  * - originalShown, boolean indicating if the original or translated
  *   version of the page is shown.
  */
 function TranslationUI(aBrowser) {
   this.browser = aBrowser;
 }
 
 TranslationUI.prototype = {
-  get browser() this._browser,
+  get browser() {
+    return this._browser;
+  },
   set browser(aBrowser) {
     if (this._browser)
       this._browser.messageManager.removeMessageListener("Translation:Finished", this);
     aBrowser.messageManager.addMessageListener("Translation:Finished", this);
     this._browser = aBrowser;
   },
   translate: function(aFrom, aTo) {
     if (aFrom == aTo ||
@@ -196,17 +198,19 @@ TranslationUI.prototype = {
 
     let addId = this.originalShown ? "translate" : "translated";
     PopupNotifications.show(this.browser, addId, null,
                             addId + "-notification-icon", null, null,
                             {dismissed: true, eventCallback: callback});
   },
 
   _state: 0,
-  get state() this._state,
+  get state() {
+    return this._state;
+  },
   set state(val) {
     let notif = this.notificationBox.getNotificationWithValue("translation");
     if (notif)
       notif.state = val;
     this._state = val;
   },
 
   originalShown: true,
@@ -218,17 +222,19 @@ TranslationUI.prototype = {
   },
 
   showTranslatedContent: function() {
     this.originalShown = false;
     this.showURLBarIcon();
     this.browser.messageManager.sendAsyncMessage("Translation:ShowTranslation");
   },
 
-  get notificationBox() this.browser.ownerGlobal.gBrowser.getNotificationBox(this.browser),
+  get notificationBox() {
+    return this.browser.ownerGlobal.gBrowser.getNotificationBox(this.browser);
+  },
 
   showTranslationInfoBar: function() {
     let notificationBox = this.notificationBox;
     let notif = notificationBox.appendNotification("", "translation", null,
                                                    notificationBox.PRIORITY_INFO_HIGH);
     notif.init(this);
     return notif;
   },