Hi Jakob, Thank you for the answer. Now that you mention it, even with the `Local<RegExp> New(Local<String> pattern, Flags flags)` method, I'd need an isolate to hold the pattern indeed.
Then I have the following question: Is it a good idea for me to try and instantiate an Isolate of some sort, and have that run in the native thread I try to run the regexp into? Le lun. 3 août 2020 à 17:44, Jakob Kummerow <[email protected]> a écrit : > A v8::RegExp requires an Isolate. (There are at least two indicators for > this: (1) the class RegExp derives from Object, as such they are JavaScript > objects, and JavaScript objects always belong to an Isolate; (2) Local<>s > are used to hold RegExp instances, and Locals are used to refer to objects > on the managed heap, which is part of an Isolate.) > > Aside from that, v8::RegExps operate on v8::Strings, which also require an > Isolate to live in. > > > On Mon, Aug 3, 2020 at 10:37 PM Paul Maréchal <[email protected]> > wrote: > >> Hi, >> >> I am writing a Node.js addon that does work in a native thread. I need to >> run a regex match in said thread and I was hoping to use V8's RegExp >> objects. >> >> It is fair to say that I'm not a C++ expert, so I was wondering if anyone >> had any pointers regarding this? Is it even possible/a good idea? >> >> The API I am looking at has a deprecated static method that looked >> interesting but I don't understand how I am supposed to use the new one? >> https://v8docs.nodesource.com/node-10.15/d8/da7/classv8_1_1_reg_exp.html#aad5eb4ac27a23660c32f289da9427367 >> >> Thanks in advance, >> Paul. >> >> -- >> -- >> v8-dev mailing list >> [email protected] >> http://groups.google.com/group/v8-dev >> --- >> You received this message because you are subscribed to the Google Groups >> "v8-dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/v8-dev/667aed79-f5df-4005-ab55-e079cfc20b92n%40googlegroups.com >> <https://groups.google.com/d/msgid/v8-dev/667aed79-f5df-4005-ab55-e079cfc20b92n%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> > -- > -- > v8-dev mailing list > [email protected] > http://groups.google.com/group/v8-dev > --- > You received this message because you are subscribed to a topic in the > Google Groups "v8-dev" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/v8-dev/B7tJko0Itnk/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/v8-dev/CAKSzg3QpALxgBg8d4x1Uc8DENY09xRmhT%2Bjuo%2B_GYpOFDfpgng%40mail.gmail.com > <https://groups.google.com/d/msgid/v8-dev/CAKSzg3QpALxgBg8d4x1Uc8DENY09xRmhT%2Bjuo%2B_GYpOFDfpgng%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/CAOKZV0a-X7RVVrr%3DQ%2B%2B%2Bi0FsCdfXt8VdTGWycofVvXJYyeTdfQ%40mail.gmail.com.
