Auto merge of #12546 - malisas:malisa-bytestring-unions, r=KiChjang

Union types now allow ByteString

<!-- Please describe your changes on the following line: -->
This PR addresses issue #12527 to allow ByteStrings in union types.
---
<!-- 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 #12527  (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/12546)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-07-21 21:25:42 -05:00 committed by GitHub
commit 6064f31f19
3 changed files with 35 additions and 1 deletions

View file

@ -2077,7 +2077,7 @@ def UnionTypes(descriptors, dictionaries, callbacks, config):
'dom::bindings::conversions::root_from_handlevalue',
'dom::bindings::error::throw_not_in_union',
'dom::bindings::js::Root',
'dom::bindings::str::{DOMString, USVString}',
'dom::bindings::str::{ByteString, DOMString, USVString}',
'dom::types::*',
'js::jsapi::JSContext',
'js::jsapi::{HandleValue, MutableHandleValue}',
@ -3754,6 +3754,9 @@ def getUnionTypeTemplateVars(type, descriptorProvider):
name = str(type)
# XXXjdm dunno about typeName here
typeName = "/*" + type.name + "*/"
elif type.isByteString():
name = type.name
typeName = "ByteString"
elif type.isDOMString():
name = type.name
typeName = "DOMString"