Implication of the context parameter in v8::Object::Set().

16 views
Skip to first unread message

Jane Chen

unread,
Jan 17, 2017, 3:03:35 PM1/17/17
to v8-users
Why does v8::Object::Set() takes a context parameter now?  Does it mean that if an object is created in one context, it can only be used in that context?

Thanks.

Ben Noordhuis

unread,
Jan 18, 2017, 2:19:06 AM1/18/17
to v8-users
The rules for object and property access didn't change. I think the
context parameter is to disambiguate between method overloads that
return Local and MaybeLocal, since C++ doesn't allow overloading of
just the return value.

Jochen Eisinger

unread,
Jan 18, 2017, 2:24:32 AM1/18/17
to v8-users
right. also, it makes it explicit in which context a possible exception should be thrown

--
--
v8-users mailing list
v8-u...@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+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Toon Verwaest

unread,
Jan 18, 2017, 5:44:33 AM1/18/17
to v8-users
Another major reason is that property access is checked. If you're e.g., trying to set a property on a "window" of an iframe you're not supposed to have access to from the passed in context (other iframe), this won't be allowed.
--

Toon Verwaest | Software Engineer, V8 | Google Germany GmbH | Erika-Mann Str. 33, 80636 München 

Registergericht und -nummer: Hamburg, HRB 86891 | Sitz der Gesellschaft: Hamburg | Geschäftsführer: Matthew Scott Sucherman, Paul Terence Manicle
Reply all
Reply to author
Forward
0 new messages