Closed
Bug 1138873
Opened 10 years ago
Closed 10 years ago
Remove use of expression closures from browser-fullZoom.js
Categories
(Firefox :: General, defect)
Firefox
General
Tracking
()
RESOLVED
FIXED
Firefox 39
Tracking | Status | |
---|---|---|
firefox39 | --- | fixed |
People
(Reporter: dao, Assigned: zmiller12, Mentored)
References
Details
(Whiteboard: [good first bug][lang=js])
Attachments
(1 file, 1 obsolete file)
+++ This bug was initially created as a clone of Bug #1122356 +++
Expression closures (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Expression_closures) are a nonstandard language extension we'd like to remove from SpiderMonkey.
In browser-fullZoom.js, I believe this only affects the following handleResult method:
http://hg.mozilla.org/mozilla-central/annotate/0b3c520002ad/browser/base/content/browser-fullZoom.js#l165
The general pattern is that 'function (x) y' should be replaced with 'function (x) { return y; }'. However, I don't think we actually want handleResult to return something, so the 'return' statement should be omitted.
Reporter | ||
Comment 2•10 years ago
|
||
(In reply to zmiller12 from comment #1)
> I would like to work on this.
Please go ahead and let me know if you have questions.
Hello Dão, Should the handleResult methods on lines 234 and 498 be replaced as well?
Reporter | ||
Comment 4•10 years ago
|
||
(In reply to zmiller12 from comment #3)
> Hello Dão, Should the handleResult methods on lines 234 and 498 be replaced
> as well?
Yeah, looks like I missed them earlier. Good catch!
Ok great, hopefully I'll get the patch in by this afternoon. This will be my first!
Reporter | ||
Comment 7•10 years ago
|
||
Comment on attachment 8576221 [details] [diff] [review]
Bug1138873.diff : Repleace expression closures from browser-fullZoom.js
>- handleResult: function () hasPref = true,
>+ handleResult: function () {hasPref = true},
Looks good, just two minor things: Can you please add a space after { and before } and a semicolon after hasPref = true?
>- handleResult: function (resultPref) value = resultPref.value,
>+ handleResult: function (resultPref) {value = resultPref.value},
same here
>- handleResult: function (pref) value = pref.value,
>+ handleResult: function (pref) {value = pref.value},
and here too
Reporter | ||
Updated•10 years ago
|
Assignee: nobody → zmiller12
Attachment #8576221 -
Attachment is obsolete: true
Reporter | ||
Comment 10•10 years ago
|
||
Comment on attachment 8576340 [details] [diff] [review]
Bug1138873 : Removed use of expression closures from handleResult methods in browser-fullZoom.js
Thanks!
Attachment #8576340 -
Flags: review+
Reporter | ||
Comment 11•10 years ago
|
||
Comment 12•10 years ago
|
||
Status: NEW → RESOLVED
Closed: 10 years ago
status-firefox39:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 39
You need to log in
before you can comment on or make changes to this bug.
Description
•