Re: [v8-users] Is it safe to consume v8::Private methods?

2017-07-14 Thread Jakob Kummerow
Gautham, I think you might be misunderstanding how the Maybe<> API is supposed to be used. When used correctly, it is absolutely safe and will never crash. - Maybe::FromJust() / MaybeLocal::ToLocalChecked() are intended for when you know for sure that the Maybe / MaybeLocal is not empty. Usually,

Re: [v8-users] Is it safe to consume v8::Private methods?

2017-07-14 Thread Ben Noordhuis
On Fri, Jul 14, 2017 at 5:52 AM, Gautham B A wrote: > No, .ToLocalChecked() is called by my code, not from V8. > > I would like to know if the APIs under v8::Private namespace has been battle > tested. Node.js uses them and I'm fairly sure Chromium does too, so yes,

Re: [v8-users] Is it safe to consume v8::Private methods?

2017-07-13 Thread Gautham B A
No, .ToLocalChecked() is called by my code, not from V8. I would like to know if the APIs under v8::Private namespace has been battle tested. On Wednesday, 12 July 2017 14:53:57 UTC+5:30, Ben Noordhuis wrote: > > On Wed, Jul 12, 2017 at 11:15 AM, Gautham B A > wrote:

Re: [v8-users] Is it safe to consume v8::Private methods?

2017-07-12 Thread Ben Noordhuis
On Wed, Jul 12, 2017 at 11:15 AM, Gautham B A wrote: > I've observed that the exception thrown is - > # > # Fatal error in v8::ToLocalChecked > # Empty MaybeLocal. > # > > Is it possible to catch that exception to prevent v8 process from crashing? Don't call

Re: [v8-users] Is it safe to consume v8::Private methods?

2017-07-12 Thread Gautham B A
I've observed that the exception thrown is - # # Fatal error in v8::ToLocalChecked # Empty MaybeLocal. # Is it possible to catch that exception to prevent v8 process from crashing? On Wednesday, 12 July 2017 12:15:51 UTC+5:30, Ben Noordhuis wrote: > > On Wed, Jul 12, 2017 at 7:34 AM, Gautham B

Re: [v8-users] Is it safe to consume v8::Private methods?

2017-07-12 Thread Ben Noordhuis
On Wed, Jul 12, 2017 at 7:34 AM, Gautham B A wrote: > Hi all, > > I'm trying to use the private field of a v8::Object to store some data in it > as shown here - https://github.com/nodejs/nan/issues/587. > I was wondering if it's safe to use because when I try to read

[v8-users] Is it safe to consume v8::Private methods?

2017-07-11 Thread Gautham B A
Hi all, I'm trying to use the private field of a v8::Object to store some data in it as shown here - https://github.com/nodejs/nan/issues/587. I was wondering if it's safe to use because when I try to read the private field (Using FromJust() in the process), in the documentation