Status: New
Owner: ----

New issue 2695 by [email protected]: How to deal with a.js quoting b.js
http://code.google.com/p/v8/issues/detail?id=2695

Hi, everyone,
I do a test, a.js call function 'b()' in b.js.
a.js is the main work file,
b.js is the library of functions developed by another develoer.

In Chrome, I can using the following code, the test goes well.
//----------------------------------------------------------
a.js:
new_element=document.createElement("script");
new_element.setAttribute("type", "text/javascript");
new_element.setAttribute("src", "b.js");
document.body.appendChild(new_element);
function a()
{
   //...
   b();
}

b.js:
function b()
{
   //...
}
//----------------------------------------------------------

Now, I need do the test with V8, I can use the following code, but it will be complicated and not elegant
//----------------------------------------------------------
string scriptFileText = getFileContents("a.js") + getFileContents("b.js");
Handle<String> scriptSource = String::New(scriptFileText.c_str());
Handle<Script> script = Script::Compile(scriptSource);

How can I deal with it, Any of your help will be appreciated!

--
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/groups/opt_out.


Reply via email to