Status: New
Owner: ----

New issue 3624 by [email protected]: Associate resource names and line numbers with code supplied via "new Function"
https://code.google.com/p/v8/issues/detail?id=3624

In order to implement an experimental module system, I'd like to be able to compile code in a scope other than the global scope. Specifically, I'd like to be able to compile source code with a scope chain that looks as follows:

(new Function(name_1, ..., name_n, source_code)).call(
  source_document, value_1, ..., value_n);

I'm able to roughly do this with the V8 API as follows:

v8::Handle<v8::Function> constructor = ... a handle to |Function| ...
v8::Handle<v8::Object> function = v8::Handle<v8::Object>::Cast(
    constructor->CallAsConstructor(names_and_source_code.size(),
                                   names_and_source_code.data()));
function->CallAsFunction(source_document, values.size(), values.data());

However, this approach doesn't let me associate a resource name or a line number with the source_code.

Ideally, I'd like to be able to use v8::ScriptCompiler or v8::ScriptOrigin and still be able to set up a scope chain like the above...

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
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