Use JSON serialization to get better debug printouts.

This commit is contained in:
Richard Dodd
2019-01-09 17:10:24 +00:00
parent 0d3f9eb02b
commit 34bab511e5
2 changed files with 36 additions and 8 deletions

View File

@ -299,6 +299,18 @@ impl<'a> Context<'a> {
))
})?;
self.bind("__wbindgen_is_array", &|me| {
me.expose_get_object();
Ok(String::from(
"
function(i) {
const val = getObject(i);
return Array.isArray(val) ? 1 : 0;
}
",
))
})?;
self.bind("__wbindgen_is_function", &|me| {
me.expose_get_object();
Ok(String::from(