This API was removed when V8 implemented tail calls: there's no way to
guarantee that we get the right calling context.

While we could technically reintroduce something like GetCallingContext now
that we don't support tail calls anyway, it might make more sense to have
explicit support for context-independent accessors. We've had something
like that in the past. Basically it would simply be a FunctionTemplate
installed on an object that keeps the context as is (or its native context
at least) when being called. Object.getOwnPropertyDescriptor would return a
JSFunction from the context that accessed the property. So

// context 1
function access_from_context1(o) { return
Object.getOwnPropertyDescriptor(o, "a").get }
// context 2
function access_from_context2(o) { return
Object.getOwnPropertyDescriptor(o, "a").get }
access_from_context1(o) != access_from_context2(o)

Would that cover your needs? The API change would basically simply be a
flag on FunctionTemplates used as lazy accessors indicating that they
shouldn't swap the context.

On Mon, Dec 2, 2019 at 3:57 PM madana gopal <madanagopal...@gmail.com>
wrote:

> Any suggestions team on this?.
>
> Thanks.
>
> Regards,
> Madan
>
> --
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/v8-users/ae49be52-cf16-4112-8181-02e14b005780%40googlegroups.com
> <https://groups.google.com/d/msgid/v8-users/ae49be52-cf16-4112-8181-02e14b005780%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/v8-users/CANS-YRoNoMDuS3CejcpNieKXHgZUEeVbQfPYm3-tTdXVYOzYqA%40mail.gmail.com.

Reply via email to