On 2015/01/28 10:52:56, Yang wrote:
On 2015/01/28 09:47:30, Yang wrote:
> I will need some more convincing.
>
> Why is this change necessary? The way I see it, you need a way to attach a > boolean metadata to script objects, and retrieve that piece of metadata both
via
> API and in Javascript. The content of that metadata is not interesting to
V8,
as
> it only passes that through.
>
> There are better ways to do this. Script objects are wrapped in JSValue
objects,
> which are JSObjects. As such, you can just manipulate them as normal
Javascript
> objects. You could
> 1) Attach a property to the script object to contain that metadata. If that > property has to be hidden, you can simply use a Symbol as property name. (It > seems to me that this is not a requirement, given that you implemented the
> accessor).
> 2) Use a WeakMap to map script object to the metadata. This is virtually
> equivalent to (1).
>
> Either way, there is no need to make this intrusive change to V8.
>
> Btw. this should actually be done for is_shared_cross_origin as well.
>
> https://codereview.chromium.org/879553002/diff/60001/src/accessors.cc
> File src/accessors.cc (right):
>
>

https://codereview.chromium.org/879553002/diff/60001/src/accessors.cc#newcode794
> src/accessors.cc:794: void Accessors::ScriptIsDebuggerScriptGetter(
> Why is this necessary? I don't see it for the is_shared_cross_origin flag.

Upon closer inspection it seems to me that you would need to get the script
object from the message to be able to use the property. I propose exposing
that
and deprecate ScriptOrigin. I found some bugs in the way we return
ScriptOrigin
values and it just seems to me that there is a lot of redundancy. ScriptOrigin
was intended to pass a set of values to V8, not return from it.

Also there is no test case in this CL that's supposed to test how you intend to
use this new API.

https://codereview.chromium.org/879553002/

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

Reply via email to