On Tue, Sep 30, 2008 at 5:22 PM, ondras <[EMAIL PROTECTED]> wrote:
>
> Hi Bryan,
>
> thanks for a supersonic response!
>
>>
>> Here is a fragement of my code that does just that:
>>
>> v8::Local<v8::Array> path = v8::Array::New(PathElems.size());
>> for(int i = 0; i < PathElems.size(); ++i)
>> path->Set(V8Int(i),V8Str(PathElems[i]));
>> req->Set(V8Str("PathElems"),path);
>>
>
> okay, I will try this tomorrow.
It might be more clear if I provided my definitions for V8Int and V8Str:
inline v8::Handle<v8::String> V8Str(string const &s)
{ return v8::String::New(s.c_str(),s.length()); }
inline v8::Handle<v8::String> V8Str(const char *s)
{ return v8::String::New(s ? s : ""); }
inline v8::Handle<v8::Integer> V8Int(int64_t v)
{ return v8::Integer::New(v); }
>> > 2) I fail to create a circular reference:
>>
>> > global->Set(v8::String::New("window"), global);
>>
> In browser environment, the global context is known as "window". In my
> opinion, this means that there exists a property "window" of global
> object, which referes to global object itself. In other words, one can
> write (in Firebug's console for instance) "this == window" (and this
> assertion holds). My goal is to create something similar in server-
> side V8.
It seems like it should work. How is it failing?
--
Bryan White
--~--~---------~--~----~------------~-------~--~----~
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
-~----------~----~----~----~------~----~------~--~---