Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Unified Diff: third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp

Issue 2151083002: DevTools: explicitly differentiate ints vs doubles in the protocol bindings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lcean Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp
diff --git a/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp b/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp
index 1c267f871a96b2f56ce26cc07335873c37609b22..4193108b279162d232f681cdd0f74ff250c16fff 100644
--- a/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp
+++ b/third_party/WebKit/Source/platform/inspector_protocol/Parser.cpp
@@ -382,7 +382,11 @@ std::unique_ptr<Value> buildValue(const UChar* start, const UChar* end, const UC
double value = String16::charactersToDouble(tokenStart, tokenEnd - tokenStart, &ok);
if (!ok)
return nullptr;
- result = FundamentalValue::create(value);
+ int number = static_cast<int>(value);
+ if (number == value)
+ result = FundamentalValue::create(number);
+ else
+ result = FundamentalValue::create(value);
break;
}
case StringLiteral: {

Powered by Google App Engine
This is Rietveld 408576698