Closed Bug 1478855 Opened 3 years ago Closed 3 years ago

Use ES6 default parameter in updateBrowserRemotenessByURL

Categories

(Firefox :: Tabbed Browser, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
Firefox 63
Tracking Status
firefox63 --- fixed

People

(Reporter: dao, Assigned: sahilbhosale63, Mentored)

Details

(Keywords: good-first-bug, Whiteboard: [lang=js])

Attachments

(1 file, 2 obsolete files)

updateBrowserRemotenessByURL is currently written like this:

  updateBrowserRemotenessByURL(aBrowser, aURL, aOptions) {
    aOptions = aOptions || {};
    ...

https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/browser/base/content/tabbrowser.js#1675-1676

We should use an ES6 default parameter instead:

  updateBrowserRemotenessByURL(aBrowser, aURL, aOptions = {}) {
    ...
I would like to work on this as this is gng to be my first contribution.
Flags: needinfo?(dao+bmo)
(In reply to Niranjana from comment #1)
> I would like to work on this as this is gng to be my first contribution.

Do you have the source code? Have you read instructions on how to create a patch?
Flags: needinfo?(dao+bmo) → needinfo?(niranj22)
I don't have source code. Can you give me the link that I have to follow to pick up the source code.
Flags: needinfo?(niranj22) → needinfo?(dao+bmo)
Hi! I'd like to work on this as my first contribution. I have the source code. I'm just wondering, is the bug legit to just change the code from aOptions to aOptions = {} and remove the line below? There must be something more to it. I'm new to this haha
(In reply to Niranjana from comment #3)
> I don't have source code. Can you give me the link that I have to follow to
> pick up the source code.

See https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Source_Code/Mercurial

(In reply to jwilander from comment #4)
> Hi! I'd like to work on this as my first contribution. I have the source
> code. I'm just wondering, is the bug legit to just change the code from
> aOptions to aOptions = {} and remove the line below? There must be something
> more to it. I'm new to this haha

No, that's indeed all. :) Good first bugs tend to be simple because their point is to give newcomers a chance to get familiar with the development process.
Flags: needinfo?(dao+bmo)
Alright! Now just need to figure out how to create a patch :)
Can I work on this issue??
(In reply to Sahil Bhosale from comment #7)
> Can I work on this issue??

Yeah... Looks like jwilander gave up. :/
Assignee: nobody → sahilbhosale63
Attached patch mybug.patch (obsolete) — Splinter Review
Bug 1478855
Use ES6 default parameter in updateBrowserRemotenessByURL

Made the changes.
Attachment #9000408 - Flags: review?(dao+bmo)
Comment on attachment 9000408 [details] [diff] [review]
mybug.patch

>-  updateBrowserRemotenessByURL(aBrowser, aURL, aOptions) {
>-    aOptions = aOptions || {};
>+  updateBrowserRemotenessByURL(aBrowser, aURL, aOptions = {}) {
> 
>     if (!gMultiProcessBrowser)
>       return this.updateBrowserRemoteness(aBrowser, false);

Can you please remove the empty line?
Attachment #9000408 - Flags: review?(dao+bmo)
before the if statement??
Attached patch mybug2.patch (obsolete) — Splinter Review
Made the required change.
Attachment #9000487 - Flags: review?(dao+bmo)
Comment on attachment 9000487 [details] [diff] [review]
mybug2.patch

This looks like it applies after the previous patch. Instead we'll need all changes in one patch.
Attachment #9000487 - Flags: review?(dao+bmo)
Attached patch bug.patchSplinter Review
Done.
Attachment #9000736 - Flags: review?(dao+bmo)
Attachment #9000408 - Attachment is obsolete: true
Attachment #9000487 - Attachment is obsolete: true
Comment on attachment 9000736 [details] [diff] [review]
bug.patch

Looks good, thanks!
Attachment #9000736 - Flags: review?(dao+bmo) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/ed3e05886ae8
Use ES6 default parameter in updateBrowserRemotenessByURL. r=dao
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/ed3e05886ae8
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
You need to log in before you can comment on or make changes to this bug.