See [0] & [1] [0] https://github.com/v8/v8-git-mirror/blob/master/samples/shell.cc#L189 [1] https://github.com/v8/v8-git-mirror/blob/master/samples/shell.cc#L235
On Tue, Feb 24, 2015 at 10:05 PM, jency <[email protected]> wrote: > I am trying to read a javascript function written in a file and retrieve it > using the following code and convert it to a script .But i am getting > conversion error > The code I'm using is > > std::ifstream file("sum.js"); > std::string str; > std::string file_contents; > while (std::getline(file, str)) > { > file_contents += str; > file_contents.push_back('\n'); > } > > > the conversion code is > > Handle<Value> hTextJS = String::New( file_contents.c_str() ); > > The error I'm getting is > error: invalid conversion from ‘v8::Value*’ to ‘v8::String*’ [-fpermissive] > > -- > -- > v8-users mailing list > [email protected] > http://groups.google.com/group/v8-users > --- > You received this message because you are subscribed to the Google Groups > "v8-users" 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/d/optout. -- -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users --- You received this message because you are subscribed to the Google Groups "v8-users" 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/d/optout.
