From 038246f0540b97915238c5c77b119c59861369f1 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Tue, 16 Aug 2022 19:27:59 +0100 Subject: [PATCH] Ensure JavaScript functions are not converted to empty objects --- lib/src/fnc/script/from.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/src/fnc/script/from.rs b/lib/src/fnc/script/from.rs index f4d962a4..df06dbb5 100644 --- a/lib/src/fnc/script/from.rs +++ b/lib/src/fnc/script/from.rs @@ -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() {