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

Unified Diff: runtime/vm/object.cc

Issue 8468025: Fix integer's % operation; fix parsing of doubles; update co19 tests. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month 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
« no previous file with comments | « runtime/lib/integers.dart ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 1585)
+++ runtime/vm/object.cc (working copy)
@@ -5277,6 +5277,11 @@
}
+static bool IsWhiteSpace(char ch) {
+ return ch == '\0' || ch == '\n' || ch == '\r' || ch == ' ' || ch == '\t';
+}
+
+
RawDouble* Double::New(const String& str, Heap::Space space) {
// TODO(regis): For now, we use strtod to convert a string to double.
const char* nptr = str.ToCString();
@@ -5284,7 +5289,7 @@
double double_value = strtod(nptr, &endptr);
// We do not treat overflow or underflow as an error and therefore do not
// check errno for ERANGE.
- if ((*endptr != '\0')) {
+ if (!IsWhiteSpace(*endptr)) {
return Double::Handle().raw();
}
return New(double_value, space);
« no previous file with comments | « runtime/lib/integers.dart ('k') | tests/co19/co19-runtime.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698