It seems that `ScriptCompiler::Source` ignores script ID when initialized
with the origin. For example, if I compile a script this way:
v8::ScriptOrigin origin(scriptName, v8::Local<v8::Integer>(), v8::Local<v8::
Integer>(), v8::Local<v8::Boolean>(), v8::Integer::New(isolate, scriptID));
v8::ScriptCompiler::Source source(scriptText, origin, cached_data);
compiledScript = v8::ScriptCompiler::Compile(context, &source,
compile_options, no_cache_reason);
When I catch an exception when running the compiled script, the script ID
in the message is always 10:
if(try_catch.HasCaught()) {
v8::Local<v8::Integer> script_id = try_catch.Message()->GetScriptOrigin
().ScriptID();
if(!script_id.IsEmpty()) {
scriptID = script_id->Int32Value(); // <-- always returns 10 for
the first script
}
Compiling multiple scripts increments the script ID for each subsequent
script and completely ignores the actual script ID in the origin.
Looking at `ScriptCompiler::Source`, it appears that only some origin data
is kept and script ID is not tracked in `ScriptCompiler::Source`. Anybody
knows if it's a bug or there is a way to set script ID for compiled scripts?
Thanks!
Andre
--
--
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.