Commit ea14a17b authored by tkent's avatar tkent Committed by Commit bot

binding: Simplify v8DateOrNaN().

isfinite() check is unnecessary here because -Infinity and +Infinity will be
converted to NaN in i::JSDate::New(), which is called by v8::Date::New.

This CL has no behavior changes.

Review-Url: https://codereview.chromium.org/2602723002
Cr-Commit-Position: refs/heads/master@{#440745}
parent 0b31cc60
......@@ -658,9 +658,7 @@ inline double toCoreDate(v8::Isolate* isolate,
inline v8::MaybeLocal<v8::Value> v8DateOrNaN(v8::Isolate* isolate,
double value) {
ASSERT(isolate);
return v8::Date::New(
isolate->GetCurrentContext(),
std::isfinite(value) ? value : std::numeric_limits<double>::quiet_NaN());
return v8::Date::New(isolate->GetCurrentContext(), value);
}
// FIXME: Remove the special casing for NodeFilter and XPathNSResolver.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment