We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 57522cd commit 53b0cd0Copy full SHA for 53b0cd0
crates/webidl/src/util.rs
@@ -580,6 +580,20 @@ impl<'src> FirstPassRecord<'src> {
580
let structural =
581
force_structural || is_structural(signature.orig.attrs.as_ref(), container_attrs);
582
let catch = force_throws || throws(&signature.orig.attrs);
583
+ let ret_ty = if id == &OperationId::IndexingGetter {
584
+ // All indexing getters should return optional values (or
585
+ // otherwise be marked with catch).
586
+ match ret_ty {
587
+ IdlType::Nullable(_) => ret_ty,
588
+ ref ty @ _ => if catch {
589
+ ret_ty
590
+ } else {
591
+ IdlType::Nullable(Box::new(ty.clone()))
592
+ },
593
+ }
594
595
596
+ };
597
let variadic = signature.args.len() == signature.orig.args.len()
598
&& signature
599
.orig
0 commit comments