mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-18 07:21:24 +00:00
Add WebIDL support for the ArrayBuffer
type
Should help enable a slew of new bindings as well.
This commit is contained in:
@ -102,6 +102,7 @@ fn compile_ast(mut ast: backend::ast::Program) -> String {
|
||||
vec![
|
||||
"str", "char", "bool", "JsValue", "u8", "i8", "u16", "i16", "u32", "i32", "u64", "i64",
|
||||
"usize", "isize", "f32", "f64", "Result", "String", "Vec", "Option",
|
||||
"ArrayBuffer",
|
||||
].into_iter()
|
||||
.map(|id| proc_macro2::Ident::new(id, proc_macro2::Span::call_site())),
|
||||
);
|
||||
|
@ -422,9 +422,16 @@ impl<'a> FirstPassRecord<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
// This seems like a "naively correct" mapping, but the online docs
|
||||
// are a bit scary in this regard...
|
||||
//
|
||||
// https://heycam.github.io/webidl/#es-buffer-source-types
|
||||
webidl::ast::TypeKind::ArrayBuffer => {
|
||||
simple_path_ty(vec![rust_ident("js_sys"), rust_ident("ArrayBuffer")])
|
||||
}
|
||||
|
||||
// Support for these types is not yet implemented, so skip
|
||||
// generating any bindings for this function.
|
||||
webidl::ast::TypeKind::ArrayBuffer
|
||||
| webidl::ast::TypeKind::DataView
|
||||
| webidl::ast::TypeKind::Error
|
||||
| webidl::ast::TypeKind::FrozenArray(_)
|
||||
|
Reference in New Issue
Block a user