Ensure JavaScript functions are not converted to empty objects

This commit is contained in:
Tobie Morgan Hitchcock 2022-08-16 19:27:59 +01:00
parent 1d3880d652
commit 038246f054

View file

@ -76,6 +76,10 @@ impl<'js> FromJs<'js> for Value {
}
return Ok(x.into());
}
// Check to see if this object is a function
if v.as_function().is_some() {
return Ok(Value::None);
}
// This object is a normal object
let mut x = Object::default();
for i in v.props() {