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

Unified Diff: src/dateparser.h

Issue 5336005: make DateParser::TimeComposer handle milliseconds properly... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 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 | « no previous file | test/mjsunit/regress/regress-944.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/dateparser.h
===================================================================
--- src/dateparser.h (revision 5890)
+++ src/dateparser.h (working copy)
@@ -87,6 +87,18 @@
return n;
}
+ // Read a string of digits, take the first three or fewer as an unsigned
+ // number of milliseconds, and ignore any digits after the first three.
+ int ReadMilliseconds() {
+ has_read_number_ = true;
+ int n = 0;
+ int p;
Lasse Reichstein 2010/11/26 08:01:28 Call it something readable, like "power" or "posit
+ for (p = 100; IsAsciiDigit(); Next(), p = p/10) {
Lasse Reichstein 2010/11/26 08:01:28 Put spaces around the division operator.
+ n = n + p * (ch_ - '0');
+ }
+ return n;
+ }
+
// Read a word (sequence of chars. >= 'A'), fill the given buffer with a
// lower-case prefix, and pad any remainder of the buffer with zeroes.
// Return word length.
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-944.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698