The only way to test this at least for my current expertise in Rust :
is by adding a print statement in drop impl for OwnedIsolate or a break point.
the following example:
let ctx = MiniV8::new();
let obj = ctx.create_object();
let fc = ctx.create_function(|env| {
let me = env
.this
.as_object()
.ok_or(mini_v8::Error::FromJsConversionError {
from: "value",
to: "object",
})?;
let v: Value = me.get("name")?;
return Ok(v);
});
obj.set("name", "jack").unwrap();
obj.set("getName", fc).unwrap();
ctx.global().set("person", obj).unwrap();
let returned_name: String = ctx.eval("person.getName()").unwrap();
println!("person.getName() = {:?}", returned_name);
drop(ctx);
before this apply this pr nether the print statement nor the break point will be reached & v8::OwnedIsolate wont be dropped.
after applying it, it just works.
The only way to test this
at least for my current expertise in Rust
:before this apply this pr nether the print statement nor the break point will be reached &
v8::OwnedIsolate
wont be dropped. after applying it, it just works.