Re: [v8-users] Should v8::Promise::Resolver construction depend on v8::Context?

2019-02-05 Thread 'Yutaka Hirano' via v8-users
> The Array.prototype is also context dependent, i.e. there's one per
iframe.

Then why Array constructors don't take Context? Currently they are

  static Local New(Isolate* isolate, int length = 0);
  static Local New(Isolate* isolate, Local* elements,
  size_t length);

, but do you mean they should take v8::Local?

By the way, my original motivation was, whether v8::Promise::Resolver::New
could fail (currently it returns MaybeLocal, not Local). I'd like to know
the reason of the signature difference from other types such as Object,
Array and so on.


On Tue, Feb 5, 2019 at 5:37 PM Benedikt Meurer  wrote:

> Yes it's the map on the JSPromise object.
>
> The Array.prototype is also context dependent, i.e. there's one per iframe.
>
> -- Benedikt
>
> On Tue, Feb 5, 2019, 09:33 'Yutaka Hirano' via v8-users <
> v8-users@googlegroups.com> wrote:
>
>> Thank you for the reply!
>>
>> > The context is necessary to find the correct promise map
>> Is the concept corresponding to JSFunction::map()?
>>
>> > (which is context dependent b/c the Promise.prototype is).
>> Does the difference from other types come here? Array.prototype is
>> context independent and Promise.prototype is context dependent, right?
>>
>> > This is hidden somewhere inside Factory.
>>
>>
>> On Tue, Feb 5, 2019 at 5:13 PM Benedikt Meurer 
>> wrote:
>>
>>> Hey Yutaka,
>>>
>>> The context is necessary to find the correct promise map (which is
>>> context dependent b/c the Promise.prototype is). This is hidden somewhere
>>> inside Factory.
>>>
>>> HTH,
>>> Benedikt
>>>
>>> On Tue, Feb 5, 2019, 09:09 Yutaka Hirano  wrote:
>>>
>>>> Hi,
>>>>
>>>> Currently v8::Promise::Resolver::New is declared as follows.
>>>>
>>>> static V8_WARN_UNUSED_RESULT MaybeLocal New(
>>>> Local context);
>>>>
>>>> But Looking at the implementation, I don't see direct context use in
>>>> Factory::NewJSPromise. Do we actually need the context parameter for the
>>>> constructor, or can we pass an Isolate instead and make it return
>>>> Local, like constructors for other types such as v8::Object,
>>>> v8::Array, v8::Map and so on?
>>>>
>>>> Thanks,
>>>>
>>>> --
>>>> --
>>>> v8-users mailing list
>>>> v8-users@googlegroups.com
>>>> http://groups.google.com/group/v8-users
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "v8-users" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to v8-users+unsubscr...@googlegroups.com.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>> --
>>>
>>> Benedikt Meurer
>>>
>>> Software Engineer
>>>
>>> bmeu...@google.com
>>>
>>> Google Germany GmbH
>>>
>>> Erika-Mann-Straße 33
>>> <https://maps.google.com/?q=Erika-Mann-Stra%C3%9Fe+33+80636+M%C3%BCnchen=gmail=g>
>>>
>>> 80636 München
>>> <https://maps.google.com/?q=Erika-Mann-Stra%C3%9Fe+33+80636+M%C3%BCnchen=gmail=g>
>>>
>>> Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
>>>
>>> Registergericht und -nummer: Hamburg, HRB 86891
>>>
>>> Sitz der Gesellschaft: Hamburg
>>>
>>> Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten
>>> haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter,
>>> löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen,
>>> dass die E-Mail an die falsche Person gesendet wurde.
>>>
>>>
>>>
>>> This e-mail is confidential. If you received this communication by
>>> mistake, please don't forward it to anyone else, please erase all copies
>>> and attachments, and please let me know that it has gone to the wrong
>>> person.
>>>
>>> --
>>> --
>>> v8-users mailing list
>>> v8-users@googlegroups.com
>>> http://groups.google.com/group/v8-users
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "v8-users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to v8-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://g

Re: [v8-users] Should v8::Promise::Resolver construction depend on v8::Context?

2019-02-05 Thread 'Yutaka Hirano' via v8-users
Thank you for the reply!

> The context is necessary to find the correct promise map
Is the concept corresponding to JSFunction::map()?

> (which is context dependent b/c the Promise.prototype is).
Does the difference from other types come here? Array.prototype is context
independent and Promise.prototype is context dependent, right?

> This is hidden somewhere inside Factory.


On Tue, Feb 5, 2019 at 5:13 PM Benedikt Meurer  wrote:

> Hey Yutaka,
>
> The context is necessary to find the correct promise map (which is context
> dependent b/c the Promise.prototype is). This is hidden somewhere inside
> Factory.
>
> HTH,
> Benedikt
>
> On Tue, Feb 5, 2019, 09:09 Yutaka Hirano  wrote:
>
>> Hi,
>>
>> Currently v8::Promise::Resolver::New is declared as follows.
>>
>> static V8_WARN_UNUSED_RESULT MaybeLocal New(
>> Local context);
>>
>> But Looking at the implementation, I don't see direct context use in
>> Factory::NewJSPromise. Do we actually need the context parameter for the
>> constructor, or can we pass an Isolate instead and make it return
>> Local, like constructors for other types such as v8::Object,
>> v8::Array, v8::Map and so on?
>>
>> Thanks,
>>
>> --
>> --
>> v8-users mailing list
>> v8-users@googlegroups.com
>> http://groups.google.com/group/v8-users
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "v8-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to v8-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
>
> Benedikt Meurer
>
> Software Engineer
>
> bmeu...@google.com
>
> Google Germany GmbH
>
> Erika-Mann-Straße 33
>
> 80636 München
>
> Geschäftsführer: Paul Manicle, Halimah DeLaine Prado
>
> Registergericht und -nummer: Hamburg, HRB 86891
>
> Sitz der Gesellschaft: Hamburg
>
> Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten
> haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter,
> löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen,
> dass die E-Mail an die falsche Person gesendet wurde.
>
>
>
> This e-mail is confidential. If you received this communication by
> mistake, please don't forward it to anyone else, please erase all copies
> and attachments, and please let me know that it has gone to the wrong
> person.
>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [v8-users] Can v8::Isolate::GetCurrent() return null?

2016-02-29 Thread 'Yutaka Hirano' via v8-users
I see, thank you.


On Mon, Feb 29, 2016 at 3:45 AM, Jochen Eisinger 
wrote:

> Please don't use Isolate::GetCurrent() - it's deprecated.
>
> If you need to know whether the Isolate was disposed or not, why not
> maintain a boolean flag on the worker thread that keeps track of the
> isolate's state?
>
> On Fri, Feb 26, 2016 at 7:16 PM Yutaka Hirano 
> wrote:
>
>> Hi,
>>
>> I'm writing a unit tests in blink and I want to check if an isolate is
>> disposed in a worker thread. In v8.h, v8::Isolate::GetCurrent() header
>> comment says
>>
>>   /**
>>* Returns the entered isolate for the current thread or NULL in
>>* case there is no current isolate.
>>*
>>* This method must not be invoked before V8::Initialize() was invoked.
>>*/
>>
>> , but in the implementation in src/isolate.h, returning null is not
>> allowed.
>>
>> Which is correct? Can I remove the DCHECK?
>>
>> Thanks,
>>
>> --
>> --
>> v8-users mailing list
>> v8-users@googlegroups.com
>> http://groups.google.com/group/v8-users
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "v8-users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to v8-users+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.