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 upUpdate bindings generator to support default ByteString values in a dictionary #12737
Comments
|
@malisas: are you planning to work on this? Feel free to ping me or jdm if you need help. |
|
Sure, I'll give it a shot! |
|
There will be two parts to this - allowing default values for ByteStrings in the parser, and generating appropriate Rust code for ByteString values with default values in the code generator. As a good testcase for this work, I suggest adding a ByteString dictionary member with a default value to Code: |
|
Relevant code in CodegenRust.py is in the |
Update bindings generator to support default ByteString values in a dictionary <!-- Please describe your changes on the following line: --> Update bindings generator to support default ByteString values in a dictionary. --- <!-- 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 #12737 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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/12790) <!-- Reviewable:end -->
The Web IDL ByteString spec previously said:
But in response to an issue I filed, it has now been changed to say:
Conclusion: Servo's bindings generator should be updated to support default ByteString values in a dictionary.
More about string literals: here
This blocks #11896