Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upScript: removed a few opts::get() #23539
Conversation
highfive
commented
Jun 8, 2019
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jun 8, 2019
|
r? @jdm |
|
@jdm could you bors-retry since there's been a network issue again. Thank you!
|
|
@bors-servo try=wpt @oneturkmen No worries about the Travis failure if it's network issue :) We mainly see the CI result from bors-servo. btw, bors can't retry Travis |
Script: removed a few opts::get() <!-- Please describe your changes on the following line: --> I removed only a few opts::get() from the components/script because all other code with "opts::get()" is reused by many other parts within the same component. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix *partially* #22854 (GitHub issue number if applicable) <!-- Either: --> - [x] These changes do not require tests because these are cleanup changes. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23539) <!-- Reviewable:end -->
|
|
|
@oneturkmen Could you show a few examples of what you mean by "all other code with "opts::get()" is reused by many other parts within the same component"? |
|
Error syncing changes upstream. Logs saved in error-snapshot-1560658517075. |
|
Looks like the rebase didn't go as planned. I recommend |
25ee27b
to
8748634
|
@jdm sorry for the long delay. I will push the changes for the three bools in a bit. One example of what I meant would be this opts::get(). It is defined in function Another example is with opts::get() in dom/permissions.rs. The same recurring call pattern exists there. I hope this clarifies the issue. |
|
I think in many cases we can add such options as members of GlobalScope, and then code can either access it transitively through the parent field (https://doc.servo.org/script/dom/index.html#inheritance), or by calling the |
8748634
to
aec9552
|
@jdm I may need your guidance here, if you don't mind. I am currently trying to remove As you mentioned, I am passing parameters all along through "pub fn new()" and then via "fn new_inherited()" within the same struct implementation. However, I reached the moment where I have to change the signature of Document constructor (i.e. pub fn new()), but it is used in other 10-12 places ... I feel like I am doing something wrong here. Could you give any hint/prompt on how (or where) to look to make change(s)? |
|
Great, that's a very concrete question I can answer :) I recommend storing a |
|
@jdm thanks for the answer! do you think I could do the same (if technically possible) for other Update: never mind. It's a vague question to ask since it really depends on the context, i.e. methods/functions and structs used. If I find something very ambiguous, I will let you know (with another specific question hehe). |
Script: removed a few opts::get() <!-- Please describe your changes on the following line: --> I removed only a few opts::get() from the components/script because all other code with "opts::get()" is reused by many other parts within the same component. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix *partially* #22854 (GitHub issue number if applicable) <!-- Either: --> - [x] These changes do not require tests because these are cleanup changes. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23539) <!-- Reviewable:end -->
|
Non-linux builds reported this error:
|
6b578e9
to
0da2b74
Yup, removed. |
|
@bors-servo r+ |
|
|
Script: removed a few opts::get() <!-- Please describe your changes on the following line: --> I removed only a few opts::get() from the components/script because all other code with "opts::get()" is reused by many other parts within the same component. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix *partially* #22854 (GitHub issue number if applicable) <!-- Either: --> - [x] These changes do not require tests because these are cleanup changes. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23539) <!-- Reviewable:end -->
|
Seems that it fails even on warnings (forgot to prefix the unused variable). Pushing changes now. |
0da2b74
to
4256928
|
@bors-servo r+ |
|
|
Script: removed a few opts::get() <!-- Please describe your changes on the following line: --> I removed only a few opts::get() from the components/script because all other code with "opts::get()" is reused by many other parts within the same component. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix *partially* #22854 (GitHub issue number if applicable) <!-- Either: --> - [x] These changes do not require tests because these are cleanup changes. <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23539) <!-- Reviewable:end -->
|
|
oneturkmen commentedJun 8, 2019
•
edited by SimonSapin
I removed only a few opts::get() from the components/script because all other code with "opts::get()" is reused by many other parts within the same component.
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is