> 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<Array> New(Isolate* isolate, int length = 0);
  static Local<Array> New(Isolate* isolate, Local<Value>* elements,
                          size_t length);

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

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 <bmeu...@chromium.org> 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 <bmeu...@chromium.org>
>> 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 <yhir...@chromium.org> wrote:
>>>
>>>> Hi,
>>>>
>>>> Currently v8::Promise::Resolver::New is declared as follows.
>>>>
>>>> static V8_WARN_UNUSED_RESULT MaybeLocal<Resolver> New(
>>>>     Local<Context> 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<Resolver>, 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&entry=gmail&source=g>
>>>
>>> 80636 München
>>> <https://maps.google.com/?q=Erika-Mann-Stra%C3%9Fe+33+80636+M%C3%BCnchen&entry=gmail&source=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://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.
>>
> --
>
> 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.

Reply via email to