Add WebIDL support for the ArrayBuffer type

Should help enable a slew of new bindings as well.
This commit is contained in:
Alex Crichton
2018-08-04 13:51:22 -07:00
parent 57fd1dedd6
commit a98b5ea2a0
10 changed files with 48 additions and 6 deletions

View File

@ -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(_)