Make options parameter default to {}
Categories
(Remote Protocol :: Agent, enhancement, P3)
Tracking
(firefox73 fixed)
Tracking | Status | |
---|---|---|
firefox73 | --- | fixed |
People
(Reporter: impossibus, Assigned: mohitsingh1930, Mentored)
References
Details
(Keywords: good-first-bug, Whiteboard: [lang=js])
Attachments
(2 files)
We have a few methods in the form of someMethod(options)
, where options
is then unpacked in the method body. To prevent hitting a TypeError when options
is undefined, we have to make sure it defaults to an object literal: someMethod(options = {})
Here's a search that shows the affected methods:
https://searchfox.org/mozilla-central/search?q=options%29+%7B&path=remote%2F**.jsm
Documentation about the Remote Protocol product is at:
https://firefox-source-docs.mozilla.org/remote/index.html
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Reporter | ||
Updated•6 years ago
|
Beside the fix it would be good to also add a new browser chrome test specific for the changed method. Those can be found at:
https://searchfox.org/mozilla-central/source/remote/test/browser/
Assignee | ||
Comment 2•6 years ago
|
||
Hello sir, i would like to work on this issue.
Reporter | ||
Comment 3•6 years ago
|
||
You may begin. We will assign the bug to you once you submit your patch for review.
Here is an overview of the contribution process; it includes instructions for getting the code, building, and submitting a patch: https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Introduction
At some point in the instructions, you'll be asked to run ./mach bootstrap
-- when you do, make sure to choose Firefox for Desktop Artifact Mode
And here is documentation about the tests Henrik mentioned: https://firefox-source-docs.mozilla.org/remote/Testing.html#browser-chrome-tests
If you have any questions along the line, feel free to ask in #interop on Mozilla's IRC, or you can put questions in bug comments here and check "Request information from..." at the bottom of this page.
Assignee | ||
Comment 4•6 years ago
|
||
i am new to open source, and this is my first contribution can you guide me through the process?
Reporter | ||
Comment 5•6 years ago
|
||
Welcome! Happy to guide you: please read the comments and resources linked above carefully and try following the instructions. Ask questions about the instructions if you get stuck in the process. The setup process may take some time -- that's normal. :)
Assignee | ||
Comment 6•6 years ago
|
||
Do i have to use mercurial for downloading mozilla-central repo?
Assignee | ||
Comment 7•6 years ago
|
||
Also i want to know that how should i proceed to get the code, the documentation suggest either manually install and configure the development enviroment or use pre-configured ecosystem.
Here:
https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Source_Code
Reporter | ||
Comment 8•6 years ago
|
||
You should do a manual install. I think the pre-configured system isn't working now.
Mozilla development happens in a mercurial repository, but you can use git locally with a tool called git-cinnabar. You can follow these instructions up to "With this setup, you can e.g. create new topic branches based on the remote branches:..." https://github.com/glandium/git-cinnabar/wiki/Mozilla:-A-git-workflow-for-Gecko-development
To submit code for review, you'll need to setup some accounts: https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html#quick-start
Assignee | ||
Comment 9•6 years ago
|
||
I installed mercurial and also downloaded the mozilla-central bundle. But should i need to configure mercurial for future progress in the issue?
Also what other tools do i need except mercurial?
Any help is appreciated, thanks in advance.
Reporter | ||
Comment 10•6 years ago
|
||
Great. I assume you're following https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Source_Code/Mercurial/Bundles for the bundle.
Once you have a clone of mozilla-central, as in the link above, run ./mach bootstrap
-- it will take care of configuring your environment, including installing additional tools/dependencies. Essentially, follow the instructions at https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build
Assignee | ||
Comment 11•6 years ago
|
||
Do i also need to install visual studio, if i am on windows.
Comment 12•6 years ago
|
||
Greetings,
I would like to work on this issue, I am new to Open Source this is the first time.
I have done all the setup, following this https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites.
While doing setup I chosen Firefox for Desktop, and make build, and build was successful.
Then ran ./mach-run.
And did changes in these file as mentioned:
remote/domains/content/Page.jsm
137 setLifecycleEventsEnabled(options) {
remote/domains/parent/Input.jsm
36 async dispatchKeyEvent(options) {
remote/domains/parent/Network.jsm
83 setUserAgentOverride(options) {
After that please guide me, what to do next step or if anything I missed. Please help me.
Thank You.
Assignee | ||
Comment 13•6 years ago
|
||
@(In reply to Abhishek Gupta from comment #12)
Greetings,
I would like to work on this issue, I am new to Open Source this is the first time.
I have done all the setup, following this https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites.
While doing setup I chosen Firefox for Desktop, and make build, and build was successful.
Then ran ./mach-run.And did changes in these file as mentioned:
remote/domains/content/Page.jsm
137 setLifecycleEventsEnabled(options) {
remote/domains/parent/Input.jsm
36 async dispatchKeyEvent(options) {
remote/domains/parent/Network.jsm
83 setUserAgentOverride(options) {After that please guide me, what to do next step or if anything I missed. Please help me.
Thank You.
I am currently working on this issue. Can you find something else?It is not good practice to ask such questions when someone else is working on a issue
Assignee | ||
Comment 14•6 years ago
|
||
i am getting this error on running "./mach bootstrap" :-
which: no python2.7 in (/c/Users/TECHIE MOHIT/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/cmd:/c/Program Files/Java/jdk-12.0.2/bin:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/cmd:/c/Program Files/nodejs:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/c/Program Files (x86)/Brackets/command:/c/Users/Mohit/AppData/Local/atom/bin:/c/Program Files/PuTTY:/c/Users/TECHIE MOHIT/AppData/Local/Programs/Python/Python37/Scripts:/c/Users/TECHIE MOHIT/AppData/Local/Programs/Python/Python37:/c/Users/Mohit/AppData/Local/atom/bin:/c/Users/TECHIE MOHIT/AppData/Roaming/npm:/c/Program Files/MySQL/MySQL Server 8.0/bin:/c/Users/TECHIE MOHIT/AppData/Local/hyper/app-3.0.2/resources/bin:/c/Program Files/heroku/bin:/c/Users/TECHIE MOHIT/AppData/Local/Programs/Microsoft VS Code/bin:/c/GCC_7.2/MinGW/bin:/c/Program Files (x86)/Mercurial:/usr/bin/vendor_perl:/usr/bin/core_perl)
./mach: line 118: exec: python: cannot execute: Is a directory
Comment 15•6 years ago
|
||
(In reply to mohitsingh1930 from comment #13)
@(In reply to Abhishek Gupta from comment #12)
Greetings,
I would like to work on this issue, I am new to Open Source this is the first time.
I have done all the setup, following this https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites.
While doing setup I chosen Firefox for Desktop, and make build, and build was successful.
Then ran ./mach-run.And did changes in these file as mentioned:
remote/domains/content/Page.jsm
137 setLifecycleEventsEnabled(options) {
remote/domains/parent/Input.jsm
36 async dispatchKeyEvent(options) {
remote/domains/parent/Network.jsm
83 setUserAgentOverride(options) {After that please guide me, what to do next step or if anything I missed. Please help me.
Thank You.
I am currently working on this issue. Can you find something else?It is not good practice to ask such questions when someone else is working on a issue
I am sorry Mohit. I thought it was free as this issue is unassigned.
Assignee | ||
Comment 16•6 years ago
|
||
(In reply to Abhishek Gupta from comment #15)
(In reply to mohitsingh1930 from comment #13)
@(In reply to Abhishek Gupta from comment #12)
Greetings,
I would like to work on this issue, I am new to Open Source this is the first time.
I have done all the setup, following this https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites.
While doing setup I chosen Firefox for Desktop, and make build, and build was successful.
Then ran ./mach-run.And did changes in these file as mentioned:
remote/domains/content/Page.jsm
137 setLifecycleEventsEnabled(options) {
remote/domains/parent/Input.jsm
36 async dispatchKeyEvent(options) {
remote/domains/parent/Network.jsm
83 setUserAgentOverride(options) {After that please guide me, what to do next step or if anything I missed. Please help me.
Thank You.
I am currently working on this issue. Can you find something else?It is not good practice to ask such questions when someone else is working on a issue
I am sorry Mohit. I thought it was free as this issue is unassigned.
Yes it is unassigned but it may get assigned when patch gets accepted. I am already working on this issue, and i am sorry for that much delay in my work and also very thankful to you for understanding.
I am making my efforts to resolve is as soon as possible.
Reporter | ||
Comment 17•6 years ago
|
||
You don't need to install Visual Studio. Any plain-text editor will do.
(In reply to mohitsingh1930 from comment #14)
i am getting this error on running "./mach bootstrap" :-
...
./mach: line 118: exec: python: cannot execute: Is a directory
I assume you're following the instructions at https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Windows_Prerequisites -- In particular, make sure you are using MozillaBuild. It ensures that you have the right version of Python available. For further troubleshooting with ./mach bootstrap, please ask questions on #introduction on Mozilla's IRC network.
Updated•6 years ago
|
Assignee | ||
Comment 18•6 years ago
|
||
Sorry for the delay, i build the firefox with ./mach build, now what steps further i should do?
Reporter | ||
Comment 19•6 years ago
|
||
Great. Once you've made the changes described in Comment 0, please submit them for review in Phabricator. You can use moz-phab submit
to do so. Resources:
- installing moz-phab: https://moz-conduit.readthedocs.io/en/latest/mozphab-windows.html
- Phabricator setup: https://moz-conduit.readthedocs.io/en/latest/phabricator-user.html#creating-an-account
Assignee | ||
Comment 20•6 years ago
|
||
i installed mozphab, created account and install certificate to mozphab. Now what next, can i talk to you on IRC?
Reporter | ||
Comment 21•6 years ago
|
||
All the information has already been provided to you above in previous comments, so please read carefully and try working on the bug. If you don't understand the description in Comment 0, or you get stuck elsewhere, then ask specific questions about it either here on on IRC #interop.
Assignee | ||
Comment 22•6 years ago
|
||
Updated•6 years ago
|
Assignee | ||
Comment 23•6 years ago
|
||
I submit the patch with moz-phab submit command here:(https://phabricator.services.mozilla.com/D57745).
Comment 24•6 years ago
|
||
Please note that the landed patch doesn't fix all the instances. There are still some remaining. Please see the link in comment 0.
Maybe you didn't update your tree to the latest changeset, and as such haven't seen it. Please run hg pull
and hg rebase -d central
and hg up central
to be on the latest revision. As best wait until your former patch got merged to mozilla-central. A comment will be posted when this happened.
Assignee | ||
Comment 26•6 years ago
|
||
What does this means doesn't fix all instances? Can you talk on IRC network?
As said check: https://searchfox.org/mozilla-central/search?q=options%29+%7B&path=remote%2F**.jsm
There are 5 instances listed, and you only fixed 3 of them.
Also if you want to talk on IRC just join and ping us. No need to ask here for permission. Thanks.
Comment 28•6 years ago
|
||
Searchfox is great for searching the codebase. You can also use grep(1).
See here for a complete list of options
without = {}
:
https://searchfox.org/mozilla-central/search?q=(options)&case=false®exp=false&path=remote%2Fdomains%2F**%2F*.js
Assignee | ||
Comment 29•6 years ago
|
||
When i repaired there was only 3, so what next should i do?
Assignee | ||
Comment 30•6 years ago
|
||
Also the patch get accepted, if this doesn't fix all instances then how did the patch get accepted?
Reporter | ||
Comment 31•6 years ago
|
||
Thanks for the patch.
(In reply to mohitsingh1930 from comment #30)
Also the patch get accepted, if this doesn't fix all instances then how did the patch get accepted?
The person who reviewed your patch probably didn't see that there were more lines to fix. Sometimes we accept a patch and then notice that more work is still needed; that's okay. As Henrik said, please pull to get the most up-to-date code and submit a second patch with more changes.
Assignee | ||
Comment 32•6 years ago
|
||
Ok, i will resubmit the patch after making changes.
Assignee | ||
Comment 33•6 years ago
|
||
When will i need to submit the patch again? As i am trying to submit but as the revision closed it refused to complete the process.
The following error popup: "ERR_CLOSED: This revision has already been closed."
Reporter | ||
Comment 34•6 years ago
|
||
You cannot amend your existing patch, you need to add a new one with just the new changes. Your first patch is already landed (integrated) so it can't be modified anymore, that's why it's closed.
Assignee | ||
Comment 35•6 years ago
|
||
How can i add new one, as the commit format i have to mention the bugid.
Reporter | ||
Comment 36•6 years ago
|
||
You can have many commits that refer to the same bug. Here's a possible commit message: "Bug 1601037 - Fix remaining options parameters to have a default"
Assignee | ||
Comment 37•6 years ago
|
||
(In reply to mohitsingh1930 from comment #33)
When will i need to submit the patch again? As i am trying to submit but as the revision closed it refused to complete the process.
The following error popup: "ERR_CLOSED: This revision has already been closed."
This is what i am getting when trying to submit a patch.
Assignee | ||
Comment 38•6 years ago
|
||
Can you help me in resolving this error?
Reporter | ||
Comment 39•6 years ago
|
||
I set the status to "Open" on Phabricator. Try again.
As I already set please use a new bookmark as created based from mozilla-central. The one you used so far (I hope you did) will not work anymore.
Comment 41•6 years ago
|
||
bugherder |
Assignee | ||
Comment 42•6 years ago
|
||
How to create a new bookmark? As previously i just add the comment with the mentioned bug and submitted the patch the revision was automatically created, now when again commit and trying to submit the patch it tried to submit on the old revision and refused to submit as it was closed
https://mozilla-version-control-tools.readthedocs.io/en/latest/hgmozilla/bookmarks.html describes in how to use bookmarks. All work you do should basically happen on a bookmark and not directly on mozilla-central. Reason is that this can cause merge conflicts you aren't easily able to solve, and further it doesn't allow you to work on multiple patches in parallel. Best is to remove your own commit via hg strip
, run a hg pull && hg update central
, and start from fresh. Your former patch already landed on central, so only the remaining places have to be fixed.
Assignee | ||
Comment 44•6 years ago
|
||
Can i use hg pull then update and merge? After that retry to make patch submission?
Assignee | ||
Comment 45•6 years ago
|
||
Comment 46•6 years ago
|
||
Comment 47•6 years ago
|
||
bugherder |
Description
•