Closed
Bug 1121471
Opened 11 years ago
Closed 11 years ago
Remove use of expression closures (shorthand function syntax) from browser-ctrlTab.js
Categories
(Firefox :: General, defect)
Firefox
General
Tracking
()
RESOLVED
FIXED
Firefox 38
People
(Reporter: dao, Assigned: vikramcse.10, Mentored)
References
Details
(Whiteboard: [good first bug][lang=js])
Attachments
(1 file, 4 obsolete files)
|
1.53 KB,
patch
|
dao
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #1120159 +++
Expression closures (shorthand function syntax) are a nonstandard language extension we'd like to remove from SpiderMonkey.
In browser-ctrlTab.js, this affects the selected, isOpen, tabCount and tabPreviewCount getters:
https://hg.mozilla.org/mozilla-central/annotate/21edbaa22144/browser/base/content/browser-ctrlTab.js#l187
e.g.:
get selected () this._selectedIndex < 0 ?
document.activeElement :
this.previews.item(this._selectedIndex),
should be replaced with:
get selected () {
return this._selectedIndex < 0 ?
document.activeElement :
this.previews.item(this._selectedIndex);
},
| Reporter | ||
Updated•11 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Hi, I am a first time beginner and I would like to work on this bug :) I will need some mentorship to get setup.
| Reporter | ||
Comment 2•11 years ago
|
||
(In reply to Adrian C from comment #1)
> Hi, I am a first time beginner and I would like to work on this bug :) I
> will need some mentorship to get setup.
Hi. Have you read <https://developer.mozilla.org/en-US/docs/Introduction>? For any fundamental questions e.g. about how to build Firefox or how to generate a patch, it's probably best to ask in the #introduction chat room on irc.mozilla.org. If anything is unclear about this particular bug, I'm the best person to ask -- please don't hesitate.
| Assignee | ||
Comment 3•11 years ago
|
||
Hi I am a beginner.
I would like to work on this bug.
I already build the firefox code.
Thanks.
| Reporter | ||
Comment 4•11 years ago
|
||
As long as this bug isn't assigned to a particular person, feel free to upload a patch or ask questions.
| Assignee | ||
Comment 5•11 years ago
|
||
Hi
I updated the code
so are there any tests so i can be sure about it?
| Reporter | ||
Comment 6•11 years ago
|
||
Yes, there's browser/base/content/test/general/browser_ctrlTab.js
| Reporter | ||
Comment 7•11 years ago
|
||
(In reply to Dão Gottwald [:dao] from comment #6)
> Yes, there's browser/base/content/test/general/browser_ctrlTab.js
You can run that this way:
./mach mochitest-browser browser/base/content/test/general/browser_ctrlTab.js
| Assignee | ||
Comment 8•11 years ago
|
||
Here i uploaded the patch.
removed all the expression closures.
And the tests had no error.
Please let me know if there is any problem or wrong step.
Thanks
Attachment #8550268 -
Flags: review?(dao)
| Reporter | ||
Comment 9•11 years ago
|
||
Comment on attachment 8550268 [details] [diff] [review]
Bug1121471_Remove_use_of_expression_closures.diff
There are some tab stops in there messing up the indentation ... please use spaces instead. Looks good otherwise.
Attachment #8550268 -
Flags: review?(dao) → review+
| Assignee | ||
Comment 10•11 years ago
|
||
Is this looks good now?
If any query please let me know?
thanks.
Attachment #8550282 -
Flags: review?(dao)
| Reporter | ||
Comment 11•11 years ago
|
||
Comment on attachment 8550282 [details] [diff] [review]
Bug1121471_Remove_use_of_expression_closures.diff
>+ return this._selectedIndex < 0 ?
>+ document.activeElement :
>+ this.previews.item(this._selectedIndex);
Still two tabs left :)
The last two lines should be indented like I did in comment 0.
Attachment #8550282 -
Flags: review?(dao)
| Assignee | ||
Comment 12•11 years ago
|
||
Actually I updated the indentation of code but somehow my queue is not updated so i created new queue.
so is this sounds good?
Attachment #8550298 -
Flags: review?(dao)
| Reporter | ||
Comment 13•11 years ago
|
||
Comment on attachment 8550298 [details] [diff] [review]
Bug1121471_Remove_use_of_expression_closure_rev2.diff
This looks good, but in order to land this we'll need all changes in one patch.
Attachment #8550298 -
Flags: review?(dao) → review+
| Assignee | ||
Comment 14•11 years ago
|
||
Sorry but how to do that can you tell me!!
| Reporter | ||
Comment 15•11 years ago
|
||
(In reply to Vikram Jadhav from comment #14)
> Sorry but how to do that can you tell me!!
I don't use mercurial queues myself, so I'm not sure what went wrong. It's probably best to ask in the #introduction channel on irc.mozilla.org.
| Reporter | ||
Updated•11 years ago
|
Assignee: nobody → vikramcse.10
| Reporter | ||
Comment 16•11 years ago
|
||
Vikram, were you able to get any help yet? You can easily join the #introduction channel here: https://chat.mibbit.com/?url=irc%3A%2F%2Firc.mozilla.org%2F%23introduction
| Assignee | ||
Comment 17•11 years ago
|
||
All changes into one file.
Thanks.
Attachment #8551274 -
Flags: review?(dao)
| Reporter | ||
Comment 18•11 years ago
|
||
Comment on attachment 8551274 [details] [diff] [review]
Bug1121471_Remove_use_of_expression_closure_rev3.diff
>- get selected () {
>- return this._selectedIndex < 0 ?
>- document.activeElement :
>- this.previews.item(this._selectedIndex);
>- },
>- get isOpen () {
>- return this.panel.state == "open" || this.panel.state == "showing" || this._timer;
>- },
>- get tabCount () {
>- return this.tabList.length;
>- },
>- get tabPreviewCount () {
>- return Math.min(this.maxTabPreviews, this.tabCount);
>- },
>- get tabList () {
>- return this._recentlyUsedTabs;
>- },
Hmm, this patch says you removed lines with tab stops here, but I don't see these tab stops here: https://hg.mozilla.org/mozilla-central/file/tip/browser/base/content/browser-ctrlTab.js#l187
>+ get selected () {
>+ return this._selectedIndex < 0 ?
>+ document.activeElement :
>+ this.previews.item(this._selectedIndex);
>+ },
>+ get isOpen () {
>+ return this.panel.state == "open" || this.panel.state == "showing" || this._timer;
>+ },
>+ get tabCount () {
>+ return this.tabList.length;
>+ },
>+ get tabPreviewCount () {
>+ return Math.min(this.maxTabPreviews, this.tabCount);
>+ },
>+ get tabList () {
>+ return this._recentlyUsedTabs;
>+ },
All lines but the first one are indented too far. Also, there are tab stops after "return this.tabList.length;" and "return Math.min(this.maxTabPreviews, this.tabCount);" that shouldn't be there.
Attachment #8551274 -
Flags: review?(dao)
| Assignee | ||
Comment 19•11 years ago
|
||
get selected () {
return this._selectedIndex < 0 ?
document.activeElement :
this.previews.item(this._selectedIndex);
},
get isOpen () {
return this.panel.state == "open" || this.panel.state == "showing" || this._timer;
},
get tabCount () {
rerurn this.tabList.length
},
get tabPreviewCount () {
return Math.min(this.maxTabPreviews, this.tabCount);
},
what about the indentation, is it right?
| Reporter | ||
Comment 20•11 years ago
|
||
(In reply to Vikram Jadhav from comment #19)
> get selected () {
> return this._selectedIndex < 0 ?
> document.activeElement :
> this.previews.item(this._selectedIndex);
> },
> get isOpen () {
> return this.panel.state == "open" || this.panel.state == "showing" ||
> this._timer;
> },
> get tabCount () {
> rerurn this.tabList.length
> },
> get tabPreviewCount () {
> return Math.min(this.maxTabPreviews, this.tabCount);
> },
>
> what about the indentation, is it right?
Yes, this looks perfect.
| Assignee | ||
Comment 21•11 years ago
|
||
Sorry,
Actually i just messed out my hg queue that's why my code was not updationg.
i think this patch would work!!
Thanks.
Attachment #8551331 -
Flags: review?(dao)
| Reporter | ||
Comment 22•11 years ago
|
||
Comment on attachment 8551331 [details] [diff] [review]
Bug1121471_removed_indentation_problem
Looks good!
Attachment #8551331 -
Flags: review?(dao) → review+
| Reporter | ||
Updated•11 years ago
|
Attachment #8551331 -
Attachment is patch: true
| Reporter | ||
Updated•11 years ago
|
Attachment #8551274 -
Attachment is obsolete: true
| Reporter | ||
Updated•11 years ago
|
Attachment #8550268 -
Attachment is obsolete: true
| Reporter | ||
Updated•11 years ago
|
Attachment #8550298 -
Attachment is obsolete: true
| Reporter | ||
Updated•11 years ago
|
Attachment #8550282 -
Attachment is obsolete: true
| Reporter | ||
Comment 23•11 years ago
|
||
Comment 24•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 38
You need to log in
before you can comment on or make changes to this bug.
Description
•