2020-01-19 21:16:37 -05:00
|
|
|
// Copyright 2019-2020 the Deno authors. All rights reserved. MIT license.
|
|
|
|
use rusty_v8 as v8;
|
|
|
|
|
|
|
|
pub fn main() {
|
2020-02-11 17:01:27 -05:00
|
|
|
let mut isolate = v8::Isolate::new(mock());
|
2020-02-12 18:20:24 -05:00
|
|
|
let mut hs1 = v8::HandleScope::new(&mut isolate);
|
|
|
|
let hs1 = hs1.enter();
|
2020-01-19 21:16:37 -05:00
|
|
|
|
2020-02-12 18:20:24 -05:00
|
|
|
let _local = {
|
|
|
|
let mut hs2 = v8::HandleScope::new(hs1);
|
2020-01-19 21:16:37 -05:00
|
|
|
let hs2 = hs2.enter();
|
|
|
|
|
2020-02-12 18:20:24 -05:00
|
|
|
let mut hs3 = v8::EscapableHandleScope::new(hs2);
|
|
|
|
let hs3 = hs3.enter();
|
|
|
|
|
|
|
|
let value: v8::Local<v8::Value> = v8::Integer::new(hs3, 42).into();
|
|
|
|
hs3.escape(value)
|
2020-01-19 21:16:37 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
fn mock<T>() -> T {
|
|
|
|
unimplemented!()
|
|
|
|
}
|