Bug 1012720 - Fix deleting in prototype getters in Fennec code. r=jchen
authorAshish Madeti <ashishmadeti@gmail.com>
Tue, 29 Jul 2014 09:27:00 +0200
changeset 196708 e80cbf7d0c47d9c5209e2a86104cb13b18f310b2
parent 196707 2b9fbe98ce7712050272ba5f2e3e82b2a5239513
child 196709 0f4ca87b15f88310724829cf7d15c30378f95498
push id27222
push usercbook@mozilla.com
push dateWed, 30 Jul 2014 11:51:44 +0000
treeherdermozilla-central@88b5980fb105 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjchen
bugs1012720
milestone34.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 1012720 - Fix deleting in prototype getters in Fennec code. r=jchen
mobile/android/components/ColorPicker.js
mobile/android/components/ContentDispatchChooser.js
mobile/android/components/PaymentsUI.js
--- a/mobile/android/components/ColorPicker.js
+++ b/mobile/android/components/ColorPicker.js
@@ -16,18 +16,20 @@ function ColorPicker() {
 }
 
 ColorPicker.prototype = {
   _initial: 0,
   _domWin: null,
   _title: "",
 
   get strings() {
-    delete this.strings;
-    return this.strings = Services.strings.createBundle("chrome://browser/locale/browser.properties");
+    if (!this._strings) {
+      this._strings = Services.strings.createBundle("chrome://browser/locale/browser.properties");
+    }
+    return this._strings;
   },
 
   init: function(aParent, aTitle, aInitial) {
     this._domWin = aParent;
     this._initial = aInitial;
     this._title = aTitle;
   },
 
--- a/mobile/android/components/ContentDispatchChooser.js
+++ b/mobile/android/components/ContentDispatchChooser.js
@@ -14,18 +14,20 @@ function ContentDispatchChooser() {}
 
 ContentDispatchChooser.prototype =
 {
   classID: Components.ID("5a072a22-1e66-4100-afc1-07aed8b62fc5"),
 
   QueryInterface: XPCOMUtils.generateQI([Ci.nsIContentDispatchChooser]),
 
   get protoSvc() {
-    delete this.protoSvc;
-    return this.protoSvc = Cc["@mozilla.org/uriloader/external-protocol-service;1"].getService(Ci.nsIExternalProtocolService);
+    if (!this._protoSvc) {
+      this._protoSvc = Cc["@mozilla.org/uriloader/external-protocol-service;1"].getService(Ci.nsIExternalProtocolService);
+    }
+    return this._protoSvc;
   },
 
   _getChromeWin: function getChromeWin() {
     try {
       return Services.wm.getMostRecentWindow("navigator:browser");
     } catch (e) {
       throw Cr.NS_ERROR_FAILURE;
     }
--- a/mobile/android/components/PaymentsUI.js
+++ b/mobile/android/components/PaymentsUI.js
@@ -56,18 +56,20 @@ function closePaymentTab(aId, aCallback)
   aCallback();
 }
 
 function PaymentUI() {
 }
 
 PaymentUI.prototype = {
   get bundle() {
-    delete this.bundle;
-    return this.bundle = Services.strings.createBundle("chrome://browser/locale/payments.properties");
+    if (!this._bundle) {
+      this._bundle = Services.strings.createBundle("chrome://browser/locale/payments.properties");
+    }
+    return this._bundle;
   },
 
   confirmPaymentRequest: function confirmPaymentRequest(aRequestId,
                                                         aRequests,
                                                         aSuccessCb,
                                                         aErrorCb) {
     let _error = this._error(aErrorCb);