fix: codegen on callback (#32537)

* Fix codegen on callback

* Add test callbacks to testbinding.rs
This commit is contained in:
Ngo Iok Ui (Wu Yu Wei) 2024-06-19 01:00:14 +09:00 committed by GitHub
parent d4db08113d
commit 63889b732f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 24 additions and 8 deletions

View file

@ -612,14 +612,18 @@ impl TestBindingMethods for TestBinding {
unsignedShortValue: None,
usvstringValue: None,
nonRequiredNullable: None,
nonRequiredNullable2: Some(None), // null
nonRequiredNullable2: Some(None),
noCallbackImport: None,
noCallbackImport2: None,
})
}
fn DictMatchesPassedValues(&self, arg: RootedTraceableBox<TestDictionary>) -> bool {
arg.type_.as_ref().map(|s| s == "success").unwrap_or(false) &&
arg.nonRequiredNullable.is_none() &&
arg.nonRequiredNullable2 == Some(None)
arg.nonRequiredNullable2 == Some(None) &&
arg.noCallbackImport == None &&
arg.noCallbackImport2 == None
}
fn PassBoolean(&self, _: bool) {}