so i think i've narrowed down the problem, as i described the compilation fails on the isString() function , but from the output i see that everything is printed alright except '\n' which is printed as ?? in stderr. it happens with NewStringFromUtf as well as with NewStringFromAscii .
so how should i insert the \n correctly? (seeing as they were in the code prior to any transformation i did , and i didn't at all insert \n) On Saturday, January 19, 2013 11:39:17 AM UTC+2, sc wrote: > > hi, > im working on js code coverage implemented directly to the compilation > process of v8. at first stage i need to "snatch" the code at the start of > compile function , do some transformation on the code directly (add prints > essentially) > and switch it with the original code , to be compiled as usual. > so far i have encountered 2 ways to ways to extract the string value from > handle<Internal::String> , one is by using GET , the other by toCstring > method of the class string. efficiency aside, assume we use the Get method. > now we have got the code and successfully done the transformation we > needed. now i want to create Handle<Internal::String> taht will contain > this string instead of the original. > unlike the v8::String , Internal::String does not have a New option. so > i've discovered i can use the original Handle<Internal::String> to get the > isolate , and from there i go the the factory and create a string from > ascii. > it looks something like this : > source = > source->isolate()->factory->newStringFromAscii(cStrVector(newJsCode,length)); > > now , the compilation fails because it arrives to isString() function > along some test and fails there (some characters in the print are not > recognized) . > i have 2 quesstions: > 1. should i use NewStringFromUtf8? or is there another way to create > handle<Internal::String> ? > 2. i don't yet understand what is exactly isolate? can someone explain it? > and is my new "source" variable will catually contain the same isolate as > the original? > -- v8-users mailing list v8-users@googlegroups.com http://groups.google.com/group/v8-users