What i"m doing wrong ? v8::Local<v8::Object> obj = m_Context->Global();
1) Local<Array> arr = obj->GetPropertyNames(m_Context).ToLocalChecked(); // I got arr->Length = 0 2) Local<Array> arr= obj->GetPropertyNames(m_Context, KeyCollectionMode::kIncludePrototypes, PropertyFilter::ALL_PROPERTIES, IndexFilter::kSkipIndices).ToLocalChecked(); // i got 71 items , but none of them are mine 3) Local<Value> key =obj->Get(m_Context, v8::String::NewFromUtf8(m_Isolate, "AA")).ToLocalChecked(); // i got undefined Thanks a lot for all your help Oren On Thursday, July 2, 2020 at 2:57:35 PM UTC+3, Leszek Swirski wrote: > > You can access your K object via the context's global object > <https://v8.github.io/api/head/classv8_1_1Context.html#af5cd9f97ef6a3307c1c21f80f4b743eb>, > > and then iterate it's properties from there. > > On Thu, Jul 2, 2020 at 1:47 PM <[email protected] <javascript:>> wrote: > >> i"m trying to get the variable from context / global without success. >> >> Any idea how to do it correctly? >> >> >> On Wednesday, July 1, 2020 at 7:36:48 PM UTC+3, [email protected] wrote: >>> >>> Thanks, I got you. >>> Do you know how I retrieve objects from context? >>> >>> On Wednesday, July 1, 2020 at 1:31:54 PM UTC+3, Jakob Kummerow wrote: >>>> >>>> On Wed, Jul 1, 2020 at 12:13 PM <[email protected]> wrote: >>>> >>>>> Why do you say its global? >>>>> >>>> >>>> After evaluating the string "const K = {...}", K is a global variable >>>> in the provided context. >>>> >>>> At the sample code, I read the K object from a specific context. >>>> >>>> >>>> No, that's not what you're doing. You're creating an object wrapper >>>> around a string "K". That object creation needs a context, but that's not >>>> the same as reading a variable from that context. >>>> >>>> -- >> -- >> v8-dev mailing list >> [email protected] <javascript:> >> 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] <javascript:>. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/v8-dev/c5187f07-6220-471b-958e-ab12f74bb614o%40googlegroups.com >> >> <https://groups.google.com/d/msgid/v8-dev/c5187f07-6220-471b-958e-ab12f74bb614o%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 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/01ac6bc4-a9fe-493c-8bdc-9cb28998379co%40googlegroups.com.
