Get JsRuntime execution output #12635
-
Hello, I'd like to reopen the issue #11105 of getting something useful from the script evaluation of deno_code. So, I'd like to use deno to interpret js at runtime and get the result, for instance: let res = runtime.execute_script("<main>", "123");
assert!(res.unwrap() == serde_json::Value::from(123)) But I cannot understand how to transform a Global into something useful. Is there any way to achieve this? enum EvalResult {
Deserializable(?)
Other(Global<Value>)
} |
Beta Was this translation helpful? Give feedback.
Answered by
lucacasonato
Nov 3, 2021
Replies: 1 comment 3 replies
-
There are two things you can do:
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
gufoe
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are two things you can do:
Global<Value>
into a string using the v8 API:serde_v8
to deserialize a V8 value into any Rust value that implementsserde::Deserialize
: