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 upSupport dictionaries in unions #11612
Closed
Labels
Comments
|
Related to #10605. |
|
So the problem is that for a dictionary I think the |
This was referenced Sep 12, 2016
|
With the following added to a WebIDL file: dictionary EventListenerOptions {
boolean capture = false;
};
void foo(optional (EventListenerOptions or boolean) options);we get
The following patch: diff --git a/components/script/dom/bindings/codegen/CodegenRust.py b/components/script/dom/bindings/codegen/CodegenRust.py
index f531937..6138abb 100644
--- a/components/script/dom/bindings/codegen/CodegenRust.py
+++ b/components/script/dom/bindings/codegen/CodegenRust.py
@@ -4028,6 +4028,9 @@ def getUnionTypeTemplateVars(type, descriptorProvider):
elif type.isEnum():
name = type.inner.identifier.name
typeName = name
+ elif type.isDictionary():
+ name = type.name
+ typeName = name
elif type.isSequence() or type.isMozMap():
name = type.name
inner = getUnionTypeTemplateVars(innerContainerType(type), descriptorProvider)makes this error appear instead:
|
|
I'm having a look. |
bors-servo
added a commit
that referenced
this issue
Jan 20, 2017
Support dictionaries in unions. Fixes #11612. <!-- 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/15125) <!-- Reviewable:end -->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We currently can't do
(FooInit or boolean)whereFooInitis a dictionary in a WebIDL interface.