mirror of
https://github.com/servo/servo.git
synced 2025-06-08 00:23:30 +00:00
Auto merge of #24469 - saschanaz:urp-default, r=Manishearth
Support USVString as default value of a union argument <!-- Please describe your changes on the following line: --> I don't expect this fixes any test though... --- <!-- 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 #22543 <!-- Either: --> - [x] There are tests for these 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. -->
This commit is contained in:
commit
32eb858a6a
3 changed files with 10 additions and 8 deletions
|
@ -732,6 +732,10 @@ def getJSToNativeConversionInfo(type, descriptorProvider, failureCode=None,
|
|||
default = "%s::Boolean(%s)" % (
|
||||
union_native_type(type),
|
||||
"true" if defaultValue.value else "false")
|
||||
elif tag is IDLType.Tags.usvstring:
|
||||
default = '%s::USVString(USVString("%s".to_owned()))' % (
|
||||
union_native_type(type),
|
||||
defaultValue.value)
|
||||
else:
|
||||
raise("We don't currently support default values that aren't null, boolean or default dictionary")
|
||||
elif dictionaries:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue