Skip to content

Instantly share code, notes, and snippets.

@espindola
Created October 6, 2021 17:53
Show Gist options
  • Save espindola/005d11de531d6ad21631f54cf87b5306 to your computer and use it in GitHub Desktop.
Save espindola/005d11de531d6ad21631f54cf87b5306 to your computer and use it in GitHub Desktop.
Local get example
use v8::Handle;
use rusty_v8 as v8;
pub fn foo<'a>(func: v8::Local<v8::Function>, obj: v8::Local<v8::Object>,scope: &mut v8::HandleScope<'a>,) {
func.call(scope, obj.into(), &[]);
let key = v8::String::new(scope, "key").unwrap();
obj.get(scope).get(scope, key.into()); // this compiles only with "use v8::Handle"
obj.get(scope, key.into()); // this compiles only without "use v8::Handle"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment