Dynamically assigning different data type to v8::localargv[1]
Dynamically assigning different data type to v8::local<v8::value>argv[1]
How to assign two data type to v8::Local<v8::Value>argv[1] based on incoming data(int,string,bool) type as below.
v8::Local<v8::Value>argv[1]
v8::Local<v8::Value> argv[1];
if(Isint)
argv[0] = Nan::New<v8::Number>(intValue).ToLocalChecked();
if(IsString)
argv[0] = Nan::New<v8::String>(stringValue);
if(IsBool)
argv[0] = Nan::New<v8::Boolean>(boolValue);
Note : Final argv[0] will hold only one value either int,string or bool based on if check performed above.
Above implementation throw run time error as terminated SIGSEGV. Please help me to fix this. This my first attemp on V8.
Can argv[0] assigned as above?
IsInt
IsString
IsBool
intvalue
stringValue
boolValue
IsInt IsString and IsBool is funtion which return o and 1. example if IsInt return 1 . The i need to assign argv[0] with integer value This integer value is global and assignment is done during int.
– josp
Aug 19 at 19:09
OK but your error could be in
IsString for instance. So post the code for IsString. Don't just post the code where you think the error is (you might be wrong). Post all the code.– john
Aug 19 at 19:53
IsString
IsString
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
What are
IsInt,IsString,IsBool,intvalue,stringValueandboolValue? Presumably you've defined those somewhere in your code but how do you know that your error isn't in that bit of your code? More to the point how to we know?– john
Aug 19 at 19:01