Ensure JavaScript functions are not converted to empty objects
This commit is contained in:
parent
1d3880d652
commit
038246f054
1 changed files with 4 additions and 0 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue