Re: [v8-users] Re: Finding cycles in an object

2018-06-21 Thread Gonzalo Diethelm
Jakob, you rule. That in fact fixed all my problems. Thanks to you and Zac for all the guidance! On Thursday, June 21, 2018 at 11:12:24 PM UTC+2, Jakob Kummerow wrote: > > The Local class defines an operator == that should do exactly what you > need. > > On Thu, Jun 21, 2018 at 5:43 AM Gonzalo

Re: [v8-users] Re: Finding cycles in an object

2018-06-21 Thread Jakob Kummerow
The Local class defines an operator == that should do exactly what you need. On Thu, Jun 21, 2018 at 5:43 AM Gonzalo Diethelm wrote: > Sure, slot does have a value, I just didn't include it in the code. > Something like: > > Local slot = String::NewFromUtf8(isolate, "MyBeautifulSlot", >

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Gonzalo Diethelm
Sure, slot does have a value, I just didn't include it in the code. Something like: Local slot = String::NewFromUtf8(isolate, "MyBeautifulSlot", NewStringType::kNormal).ToLocalChecked(); Cheers! On Thursday, June 21, 2018 at 2:27:00 PM UTC+2, Zac Hansen wrote: > > You're dereferencing a

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Zac Hansen
You're dereferencing a "super pointer" to get to a "pointer", hence * not &. You can't "go back" because the local/global represents an "reference count" to the object which must be known to the JS runtime. As for p0 and p1, have you tried setting slot to a fixed string value before using

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Gonzalo Diethelm
Note to self: this might be related to Local vs Global (or Persistent? so many names...) Need to look into that. On Thursday, June 21, 2018 at 7:58:37 AM UTC+2, Gonzalo Diethelm wrote: > > I run the following JS code in the Chrome console: > > // Version 67.0.3396.87 (Official Build) (64-bit) >

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Gonzalo Diethelm
Never mind my last question, it didn't really make much sense. So, I have found some basic behaviour related to this, which really surprised me: Local parent; // this will be a JS object Local slot;// this will be a new slot in parent Local object = // this will be the value we want to

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Gonzalo Diethelm
Thanks, that is useful (not sure why it is unary * instead of unary &, but meh). Do you know if there is any way to then go from the T* back into the Local? Something like: Handle object = Object::New(isolate); Local ret = Local::Cast(object); Object* ptr = *object; // this works, according to

[v8-users] Re: Finding cycles in an object

2018-06-21 Thread Zac Hansen
unary * on a local gives a T*: https://v8.paulfryzel.com/docs/master/classv8_1_1_local.html#a3c96c0bc5db1288bad5769e8e54e26da On Wednesday, June 20, 2018 at 10:58:37 PM UTC-7, Gonzalo Diethelm wrote: > > I run the following JS code in the Chrome console: > > // Version 67.0.3396.87 (Official