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 upReplace `fallible` boolean arguments with an enum #26047
Comments
|
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in the If you intend to work on this issue, then add |
|
@highfive: assign me |
|
Hey @skrzyp1! Thanks for your interest in working on this issue. It's now assigned to you! |
|
Where would the enum be defined? Its being used my multiple WebGL objects. Also do we need a new name for the second argument now that its an enum? Something like 'operation_fallibility' instead of 'fallible'? |
|
Defining the enum in webglrenderingcontext.rs is probably fine; I think all of those files already import things from that module. Renaming it like you suggest sounds fine. |
|
Sorry i forgot about that ill get to work unless its already WiP by someone else |
|
I haven't started working on the issue yet. Just wanted to know how to solve it. I know it was assigned to you so if you still want to work on it go ahead! Sorry for the confusion. |
|
@highfive: assign me |
|
Hey @he4d! Thanks for your interest in working on this issue. It's now assigned to you! |
|
Do I need to write some tests for this? |
|
No - if it builds, that's good enough for a PR. |
Replaced failible boolean with an enum
<!-- Please describe your changes on the following line: -->
Replaced the boolean `fallible` argument of some WebGL object methods with the new `enum Operation { Fallible, Infallible }` that was added to the `webglrenderingcontext`. This improves the readability of that methods.
---
<!-- 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 #26047 (GitHub issue number if applicable)
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the issue says so
<!-- 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. -->
Replaced failible boolean with an enum
<!-- Please describe your changes on the following line: -->
Replaced the boolean `fallible` argument of some WebGL object methods with the new `enum Operation { Fallible, Infallible }` that was added to the `webglrenderingcontext`. This improves the readability of that methods.
---
<!-- 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 #26047 (GitHub issue number if applicable)
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the issue says so
<!-- 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. -->
Replaced failible boolean with an enum
<!-- Please describe your changes on the following line: -->
Replaced the boolean `fallible` argument of some WebGL object methods with the new `enum Operation { Fallible, Infallible }` that was added to the `webglrenderingcontext`. This improves the readability of that methods.
---
<!-- 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 #26047 (GitHub issue number if applicable)
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the issue says so
<!-- 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. -->
Replaced failible boolean with an enum
<!-- Please describe your changes on the following line: -->
Replaced the boolean `fallible` argument of some WebGL object methods with the new `enum Operation { Fallible, Infallible }` that was added to the `webglrenderingcontext`. This improves the readability of that methods.
---
<!-- 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 #26047 (GitHub issue number if applicable)
<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the issue says so
<!-- 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. -->
Various methods in WebGL objects have
falliblearguments that are used to support operations that can fail during object destruction that do not indicate a total failure. We should replace these booleans with aenum Operation { Fallible, Infallible }instead to make the code readable:Code:
servo/components/script/dom/webgltexture.rs
Line 192 in cf725fc
servo/components/script/dom/webglbuffer.rs
Lines 94 to 104 in cf725fc
servo/components/script/dom/webglvertexarrayobject.rs
Line 44 in 67b4336
servo/components/script/dom/webglvertexarrayobjectoes.rs
Line 44 in 67b4336
servo/components/script/dom/webglsampler.rs
Line 93 in 67b4336
servo/components/script/dom/webglsync.rs
Line 85 in 67b4336
servo/components/script/dom/webgltransformfeedback.rs
Line 101 in 67b4336
servo/components/script/dom/webglquery.rs
Line 99 in 67b4336
servo/components/script/dom/webglrenderbuffer.rs
Line 93 in 67b4336
servo/components/script/dom/vertexarrayobject.rs
Line 47 in a927f1a
servo/components/script/dom/webglprogram.rs
Line 87 in 67b4336
servo/components/script/dom/webglshader.rs
Line 306 in 67b4336
servo/components/script/dom/webgltexture.rs
Line 186 in 67b4336
servo/components/script/dom/webglframebuffer.rs
Line 205 in 67b4336