mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-18 07:21:24 +00:00
Remove RefCell
This commit is contained in:
@ -82,6 +82,8 @@ fn parse(webidl_source: &str, allowed_types: Option<&[&str]>) -> Result<Program>
|
||||
|
||||
let mut first_pass_record: FirstPassRecord = Default::default();
|
||||
first_pass_record.builtin_idents = builtin_idents();
|
||||
first_pass_record.immutable_f32_whitelist = immutable_f32_whitelist();
|
||||
|
||||
definitions.first_pass(&mut first_pass_record, ())?;
|
||||
let mut program = Default::default();
|
||||
let mut submodules = Vec::new();
|
||||
@ -179,6 +181,26 @@ fn builtin_idents() -> BTreeSet<Ident> {
|
||||
)
|
||||
}
|
||||
|
||||
fn immutable_f32_whitelist() -> BTreeSet<&'static str> {
|
||||
BTreeSet::from_iter(
|
||||
vec![
|
||||
// WebGlRenderingContext
|
||||
"uniform1fv",
|
||||
"uniform2fv",
|
||||
"uniform3fv",
|
||||
"uniform4fv",
|
||||
"uniformMatrix2fv",
|
||||
"uniformMatrix3fv",
|
||||
"uniformMatrix4fv",
|
||||
"vertexAttrib1fv",
|
||||
"vertexAttrib2fv",
|
||||
"vertexAttrib3fv",
|
||||
"vertexAttrib4fv",
|
||||
// TODO: Add another type's functions here. Leave a comment header with the type name
|
||||
]
|
||||
)
|
||||
}
|
||||
|
||||
/// Run codegen on the AST to generate rust code.
|
||||
fn compile_ast(mut ast: Program) -> String {
|
||||
// Iteratively prune all entries from the AST which reference undefined
|
||||
|
Reference in New Issue
Block a user