diff --git a/Cargo.toml b/Cargo.toml index 4de28b9..23a5401 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ssr_rs" -version = "0.5.6" +version = "0.5.7" authors = ["Valerio "] edition = "2021" description = "Server side rendering with the v8 engine for parse and evaluate the javascript code" @@ -22,7 +22,7 @@ name = "ssr_rs" path = "src/lib.rs" [dependencies] -v8= "0.96.0" +v8= "0.100.0" [dev-dependencies] diff --git a/src/lib.rs b/src/lib.rs index 79b01ab..9fb9a1a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -10,7 +10,7 @@ //! Currently it works with [Vite](https://vitejs.dev/), [Webpack](https://webpack.js.org/), [Rspack](https://www.rspack.dev/), [React 18](https://react.dev/) and [Svelte 4](https://svelte.dev/) - Check the examples folder. //! //! > Check here the -//! benchmarks results. +//! > benchmarks results. //! //! # Getting started //! ```bash diff --git a/src/ssr.rs b/src/ssr.rs index 29a288a..16ff453 100644 --- a/src/ssr.rs +++ b/src/ssr.rs @@ -106,14 +106,12 @@ where None => return Err("Failed to get function from obj"), }; - let func = unsafe { v8::Local::::cast(func) }; - let fn_name = match name.to_string(&mut scope) { Some(val) => val.to_rust_string_lossy(&mut scope), None => return Err("Failed to find function name"), }; - Ok((fn_name, scope.escape(func))) + Ok((fn_name, scope.escape(func.cast()))) }, ) // TODO: collect directly the values into a map