Closed Bug 401514 Opened 17 years ago Closed 16 years ago

Don't use a getter when a property will do

Categories

(Firefox Graveyard :: RSS Discovery and Preview, defect)

defect
Not set
trivial

Tracking

(Not tracked)

RESOLVED FIXED
Firefox 3 beta5

People

(Reporter: Waldo, Assigned: Waldo)

Details

Attachments

(1 file)

Attached patch PatchSplinter Review
...specifically, after the getter runs once and creates the value that it then always returns thereafter.  Note that a property with only a getter is read-only, hence the delete.
Attachment #286520 - Flags: review?(gavin.sharp)
Do you intend to fix all of these patterns in the tree? See bug 385809.
This was just something I ran across in passing; there's a little too much AST to really find this pattern everywhere in the tree, let alone fix all of them.
Attachment #286520 - Flags: review?(gavin.sharp) → review+
Attachment #286520 - Flags: approval1.9b4?
Comment on attachment 286520 [details] [diff] [review]
Patch

For consideration after beta4.
Attachment #286520 - Flags: approval1.9b4?
Attachment #286520 - Flags: approval1.9b4-
Attachment #286520 - Flags: approval1.9?
Comment on attachment 286520 [details] [diff] [review]
Patch

a1.9=beltzner
Attachment #286520 - Flags: approval1.9? → approval1.9+
In, with a tweak to accommodate the service changing from a var to a function -- was breaking Mochitests, actually, but I hadn't taken the time to figure out the problem -- did so before checkin.  :-)
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: Firefox 3 beta2 → Firefox 3 beta5
Product: Firefox → Firefox Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: