*Here is sample:*

auto isolate = v8::Isolate::GetCurrent();

Local<ObjectTemplate> global = ObjectTemplate::New(isolate);

global->Set(v8_str(isolate, "i"), Number::New(isolate, *4*));

Local<Context> context = Context::New(isolate, nullptr, global);
Context::Scope context_scope(context);

auto i = context->Global()->Get(context, v8_str(isolate, 

std::cout << "i: " << i->NumberValue() << std::endl;


*i: 4*

*But replace:*
global->Set(v8_str(isolate, "i"), Number::New(isolate, 4));


global->Set(v8_str(isolate, "i"), Number::New(isolate, 4.4));

*and out:*

i: nan


v8-users mailing list
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 v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to