On Thu, May 31, 2018 at 3:31 PM, A.M. <[email protected]> wrote:
> Thanks, Ben
>
>> Not a bug, as far as I'm aware.
>
> How can ths be not a bug - the script source *does take* a script ID and
> ignores it? Without this value being passed around, one would have to
> compare script names, which is more expensive.

You can retrieve the script id after compiling with
v8::UnboundScript::GetId().  (Yes, the casing is inconsistent.)

I just noticed there doesn't seem to be a method for retrieving the id
of an es6 module but it wouldn't be hard to add one.

> Another thing that hints a bug in the script compiler is that Doxygen
> comments above `Compile` methods are out of wack and don't reflect what
> methods do or take.
>
>> but newly compiled code is always assigned a new id.
>
> If it's a new ID, what's the logic I can rely on? Why does it start at 10,
> does it always increment, is it per isolate, per context, per script
> compiler, per v8 instance, etc?

You should treat it as an arbitrary number but if you're curious why
it starts at 10, the first few are V8's internal helper scripts.

-- 
-- 
v8-users mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to