handle NaN conversion from V8
This commit is contained in:
parent
db156865e7
commit
fedf1d889b
1 changed files with 6 additions and 2 deletions
|
@ -320,8 +320,12 @@ base::Value* V8ValueConverter::FromV8ValueImpl(
|
|||
if (val->IsInt32())
|
||||
return new base::Value(val->ToInt32()->Value());
|
||||
|
||||
if (val->IsNumber())
|
||||
return new base::Value(val->ToNumber()->Value());
|
||||
if (val->IsNumber()) {
|
||||
double val_as_double = val->ToNumber()->Value();
|
||||
if (!std::isfinite(val_as_double))
|
||||
return nullptr;
|
||||
return new base::Value(val_as_double);
|
||||
}
|
||||
|
||||
if (val->IsString()) {
|
||||
v8::String::Utf8Value utf8(val->ToString());
|
||||
|
|
Loading…
Reference in a new issue