diff --git a/src/conversions.rs b/src/conversions.rs index c301fb658..50bc637e0 100644 --- a/src/conversions.rs +++ b/src/conversions.rs @@ -172,6 +172,16 @@ impl ToJSValConvertible for JSVal { } } +impl FromJSValConvertible for JSVal { + type Config = (); + unsafe fn from_jsval(_cx: *mut JSContext, + value: HandleValue, + _option: ()) + -> Result { + Ok(value.get()) + } +} + impl ToJSValConvertible for HandleValue { #[inline] unsafe fn to_jsval(&self, cx: *mut JSContext, rval: MutableHandleValue) {