Oops, I didn't look closely enough at your example. What ben said. But if you want to store them longer, then you'll want the global..
On Tuesday, November 28, 2017 at 11:18:35 PM UTC-8, Zac Hansen wrote: > > You'll want to put it in a global, not a local. Globals outlive their > lexical scope. > > Just as a note, they're move-only. > > On Tuesday, November 28, 2017 at 12:20:00 AM UTC-8, dark...@gmail.com > wrote: >> >> I have code like: >> >> >> v8::Isolate::Scope isolate_scope(isolate); >> v8::HandleScope handle_scope(isolate); >> >> v8::Local<v8::Context> context = v8::Context::New(isolate); >> v8::Context::Scope context_scope(isolate); >> >> { >> std::vector<v8::Local<v8::Object> > ret = some_func(); >> some_another_func(ret); >> } >> >> >> Is this code valid if container lifetime < lifetime of handle_scope? Is >> normal to store v8::Local in heap (like std containers do)? >> >> >> >> >> >> >> >> >> -- -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.