Created
October 6, 2021 17:53
-
-
Save espindola/005d11de531d6ad21631f54cf87b5306 to your computer and use it in GitHub Desktop.
Local get example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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