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

Issue 3318017: make Date.parse properly handle TZ offsets... (Closed)

Created:
10 years, 3 months ago by sideshowbarker
Modified:
9 years, 7 months ago
Reviewers:
Lasse Reichstein, Rico
CC:
v8-dev
Visibility:
Public.

Description

make Date.parse properly handle TZ offsets This makes, e.g., Date.parse("2010-08-31T22:35:36-09:00") work as expected. Without this change, the "-9:00" timezone-offset portion causes V8 to fail to properly parse that string into a date. BUG=http://code.google.com/p/v8/issues/detail?id=857 TEST=Try Date.parse("2010-08-31T22:35:36-09:00") and make sure that it gets parsed without errors and does not return NaN.

Patch Set 1 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -2 lines) Patch
M src/dateparser-inl.h View 1 chunk +4 lines, -2 lines 0 comments Download
A test/mjsunit/regress/regress-857.js View 1 chunk +37 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
sideshowbarker
This is the first V8 patch I've ever submitted. It's a trivial change and I'm ...
10 years, 3 months ago (2010-09-08 07:12:40 UTC) #1
Lasse Reichstein
Thank you for the patch. The fix seems fine, the only thing I would want ...
10 years, 3 months ago (2010-09-08 07:29:30 UTC) #2
sideshowbarker
See lint output below. These are for existing lint nonconformances that were in the source ...
10 years, 3 months ago (2010-09-08 11:14:27 UTC) #3
Lasse Reichstein
10 years, 3 months ago (2010-09-08 11:56:00 UTC) #4
LGTM

The ifndef/endif are correct for V8. I'm guessing your gcl lint uses chromium
rules (or something else).
You can lint v8 code by running tools/presubmit.py

http://codereview.chromium.org/3318017/diff/15001/16002
File test/mjsunit/regress/regress-857.js (right):

http://codereview.chromium.org/3318017/diff/15001/16002#newcode36
test/mjsunit/regress/regress-857.js:36: assertEquals(1283261736000,
Date.parse("2010-08-31T22:35:36.0+09:00"));
Looks good.
How about putting the spec-required formats (ES5 15.9.1.15) first, and then the
non-standardized ones after it?

Powered by Google App Engine
This is Rietveld 408576698