Fix deleting prototype getters in Fennec code

RESOLVED FIXED in Firefox 34

Status

()

defect
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jchen, Assigned: madeti, Mentored)

Tracking

Trunk
Firefox 34
All
Android
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [lang=js])

Attachments

(1 attachment, 2 obsolete attachments)

Similar to bug 1010039, we have several places where we try to delete a prototype getter from an object and replace it with a value, which doesn't actually work because you can't delete a prototype getter from an instance.
Below are the places where we want to replace this usage,

>  get foo() {
>    delete this.foo;
>    return this.foo = get_foo();
>  },

with this,

>  get foo() {
>    if (!this._foo) {
>      this._foo = get_foo();
>    }
>    return this._foo;
>  }

http://mxr.mozilla.org/mozilla-central/source/mobile/android/components/ContentDispatchChooser.js#22
http://mxr.mozilla.org/mozilla-central/source/mobile/android/components/PaymentsUI.js#64
http://mxr.mozilla.org/mozilla-central/source/mobile/android/components/ColorPicker.js#22
Assignee: nchen → nobody
Status: ASSIGNED → NEW
Whiteboard: [mentor=jchen][lang=js]
Mentor: nchen
Whiteboard: [mentor=jchen][lang=js] → [lang=js]
Ashish will be working on this bug.
Assignee: nobody → ashishmadeti
Status: NEW → ASSIGNED
Assignee

Comment 3

5 years ago
Posted patch Patch for bug 1012720 (obsolete) — Splinter Review
Assignee

Comment 4

5 years ago
Posted patch Patch for bug 1012720 (obsolete) — Splinter Review
Changed the variable name (so that they are different from the property name).
Attachment #8464052 - Attachment is obsolete: true
Assignee

Comment 6

5 years ago
Updated the patch format.
Attachment #8464060 - Attachment is obsolete: true
Attachment #8464067 - Flags: review?(nchen)
Comment on attachment 8464067 [details] [diff] [review]
Patch for bug 1012720

Review of attachment 8464067 [details] [diff] [review]:
-----------------------------------------------------------------

Looks good!
Attachment #8464067 - Flags: review?(nchen) → review+
https://hg.mozilla.org/integration/fx-team/rev/e80cbf7d0c47
Keywords: checkin-needed
Whiteboard: [lang=js] → [lang=js][fixed-in-fx-team]
https://hg.mozilla.org/mozilla-central/rev/e80cbf7d0c47
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Whiteboard: [lang=js][fixed-in-fx-team] → [lang=js]
Target Milestone: --- → Firefox 34
You need to log in before you can comment on or make changes to this bug.