How to store persistent handles in V8?

后端 未结 1 1839
独厮守ぢ
独厮守ぢ 2020-12-31 16:52

I want my class to hold a v8::Context and a v8::External as members. Therefore, I thought I had to use persistent handles.

class Sc         


        
相关标签:
1条回答
  • 2020-12-31 17:29

    By default, persistent handles use a non copyable trait. Explicitly passing the copyable trait as template argument makes them work like in prior versions.

    Persistent<Value, CopyablePersistentTraits<Value>> persistent(isolate, value);
    
    0 讨论(0)
提交回复
热议问题