Alexander Vassilev wrote:
> Hi all,
> I am trying to add a string to a js array in C++, like this:
>
>     n->arr->setIndex(0, jsString(globalExec, "test"));
>
> where arr is of type JSC::JSArray*
> and initialized with JSC::constructEmptyArray();
>
> The javascript code sees the array as a sequence of characters: arr[0]
> becomes 't', arr[1] becomes 'e', arr[2] becomes 's', etc.
> The js code that is used to observe this is:
>     alert('myobj.arr[0] = '+myobj.arr[0]);
>     alert('myobj.arr[1] = '+myobj.arr[1]);
>     alert('myobj.arr[2] = '+myobj.arr[2]);
>
> How can I set arr[0] to contain the whole  string 'test' instead of
> spreading this string over the array elements. I hope this is something
> trivial, but I have no clue at the moment.
>   
I'm sorry, it seems that the problem is related to some memory
corruption, and nothing to do with the api.

Cheers
Alex

begin:vcard
fn:Alexander Vassilev
n:Vassilev;Alexander
org:VoipGATE S.A.
title:Senior Software Engineer
version:2.1
end:vcard

_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to