[v8-users] Limiting memory allocation / run time of JS code

2018-06-26 Thread Gonzalo Diethelm
I have reviewed previous posts and it seems this has been discussed before, but the answer seems to be very dependent on the V8 version. Is there a way to configure V8 prior to a call to script->Run(context), so that there are hard(ish) limits on the amount of memory allocated by V8 during the

Re: [v8-users] Re: Where are let / const objects stored?

2018-06-22 Thread Gonzalo Diethelm
>> I don't know the answer, but they are accessible via the debugging >> interface, so that may be a place to look. >> >> On Wednesday, June 20, 2018 at 11:01:23 PM UTC-7, Gonzalo Diethelm wrote: >>> >>> I run the following JS code in the Chrome console: >>

Re: [v8-users] Running instanceof from C++ given a class name as a string

2018-06-21 Thread Gonzalo Diethelm
Object("Car"); > object->InstanceOf(context, car_class); // Should return Just(true). > Throws if car_class is not a function. > > On Wed, Jun 20, 2018 at 11:00 PM Gonzalo Diethelm > wrote: > >> I run the following JS code in the Chrome console: >> >&

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

2018-06-21 Thread Gonzalo Diethelm
expected behavior of using an empty value as a key into an object is. >>> >>> These are all just guesses - if someone else answers differently, I'm >>> probably wrong. >>> >>> >>> On Thursday, June 21, 2018 at 5:07:50 AM UTC-7, Gonzalo

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

2018-06-21 Thread Gonzalo Diethelm
u tried setting slot to a fixed string value > before using it as a key for storing/lookup? I don't know what the > expected behavior of using an empty value as a key into an object is. > > These are all just guesses - if someone else answers differently, I'm > probably wrong. > >

[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 Bu

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

2018-06-21 Thread Gonzalo Diethelm
l 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: >>> >>> // V

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

2018-06-21 Thread Gonzalo Diethelm
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 Build) (64-bit) >> >> var x = [1, 2, {"foo": 11}]; >> x[2].bar = x; >>

[v8-users] Where are let / const objects stored?

2018-06-21 Thread Gonzalo Diethelm
I run the following JS code in the Chrome console: // Version 67.0.3396.87 (Official Build) (64-bit) var p = 11 p // returns 11 let q = 12 q // returns 12 const r = 13 r // returns 13 Now, from C++ code, I can look up p in the global context, and it is found; its value is, unsurprisingly,

[v8-users] Running instanceof from C++ given a class name as a string

2018-06-21 Thread Gonzalo Diethelm
I run the following JS code in the Chrome console: // Version 67.0.3396.87 (Official Build) (64-bit) function Car(make) { this.make = make } var car = new Car('Ferrari') car instanceof Car // returns true Now, on my C++ code I get ahold of car (by looking "car" up in the global context), and

[v8-users] Finding cycles in an object

2018-06-20 Thread Gonzalo Diethelm
I run the following JS code in the Chrome console: // Version 67.0.3396.87 (Official Build) (64-bit) var x = [1, 2, {"foo": 11}]; x[2].bar = x; Now from C++ code, I get ahold of x as a Local, and wish to traverse the whole structure; for the sake of the example, let's say I am converting it