Hi,

(no IRC available as per my previous post, so I have to ask directly
here)

I would appreciate any help regarding these four issues:

1) how do I create (in C++) a JavaScript array, available in global
context? I can do an object (global->Set(somestring,
v8::ObjectTemplate::New()), a string, a number... but how about an
array? And how can I then add its values? And what about more complex
types, such as a Date() or RegExp() ?



2) I fail to create a circular reference:

global->Set(v8::String::New("window"), global);

What am I doing wrong?



3) Why does the 'ExecuteString' function (in shell.cc) need two
arguments, the sourcecode and filename? Is this only used for caching
purposes?


4) Imagine the following scenario:

var A = function() {
  this.name = "name";
  load("printer.js");
}
this.name = "global";
new A();

and printer.js contains:
print(this.name);


This won't work as expected, because printer.js will be executed in
global scope (so it will output "global"). Is it possible to load()
the printer.js file while being in the correct scope (this instanceof
A) ?




Thanks a lot for responses,
sincerely,
Ondrej Zara

--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to