diff options
author | Josh Matthews <josh@joshmatthews.net> | 2016-07-21 10:09:52 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2016-07-21 10:26:57 -0400 |
commit | 9ef848b65effd13601fbf24d53842a4b4d469006 (patch) | |
tree | b2ea32451d803e80dc2487318cd8ee73e6237a4b /components/script/dom/testbinding.rs | |
parent | 2df5d705e13f78afc8ceeb1b5333fc886e2691fa (diff) | |
download | servo-9ef848b65effd13601fbf24d53842a4b4d469006.tar.gz servo-9ef848b65effd13601fbf24d53842a4b4d469006.zip |
Support sequences of sequences in generated bindings.
unroll recursively gets the inner type of any sequence type encountered, so it's inappropriate for codegen that only wants the immediate inner type. However, if a type identifies as a sequence and is nullable, we need to reach through the nullable wrapper first. Gecko does very similar things.
Diffstat (limited to 'components/script/dom/testbinding.rs')
-rw-r--r-- | components/script/dom/testbinding.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index 64fb6fb7578..66a6f97f333 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -9,7 +9,7 @@ use dom::bindings::codegen::Bindings::FunctionBinding::Function; use dom::bindings::codegen::Bindings::TestBindingBinding; use dom::bindings::codegen::Bindings::TestBindingBinding::{TestBindingMethods, TestDictionary}; use dom::bindings::codegen::Bindings::TestBindingBinding::{TestDictionaryDefaults, TestEnum}; -use dom::bindings::codegen::UnionTypes::{BlobOrBoolean, BlobOrBlobSequence}; +use dom::bindings::codegen::UnionTypes::{BlobOrBoolean, BlobOrBlobSequence, LongOrLongSequenceSequence}; use dom::bindings::codegen::UnionTypes::{BlobOrString, BlobOrUnsignedLong, EventOrString}; use dom::bindings::codegen::UnionTypes::{EventOrUSVString, HTMLElementOrLong}; use dom::bindings::codegen::UnionTypes::{HTMLElementOrUnsignedLongOrStringOrBoolean, LongSequenceOrBoolean}; @@ -572,6 +572,17 @@ impl TestBindingMethods for TestBinding { fn FuncControlledMethodDisabled(&self) {} fn FuncControlledMethodEnabled(&self) {} + fn PassSequenceSequence(&self, _seq: Vec<Vec<i32>>) {} + fn ReturnSequenceSequence(&self) -> Vec<Vec<i32>> { vec![] } + fn PassUnionSequenceSequence(&self, seq: LongOrLongSequenceSequence) { + match seq { + LongOrLongSequenceSequence::Long(_) => (), + LongOrLongSequenceSequence::LongSequenceSequence(seq) => { + let _seq: Vec<Vec<i32>> = seq; + } + } + } + #[allow(unsafe_code)] fn CrashHard(&self) { static READ_ONLY_VALUE: i32 = 0; |