mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #12541 - jdm:seqseq, r=nox
Support sequences of sequences in generated bindings. This fixes a blocker for #11897. `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. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #12528 (github issue number if applicable). - [X] There are tests for these changes <!-- 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/12541) <!-- Reviewable:end -->
This commit is contained in:
commit
4ae0897175
3 changed files with 24 additions and 5 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue