Changeset 50927 in webkit


Ignore:
Timestamp:
Nov 12, 2009 9:08:00 PM (14 years ago)
Author:
eric@webkit.org
Message:

2009-11-12 Steve VanDeBogart <vandebo@chromium.org>

Reviewed by Adam Barth.

Calculate the time offset only if we were able to parse
the date string. This saves an IPC in Chromium for
invalid date strings.
https://bugs.webkit.org/show_bug.cgi?id=31416

  • wtf/DateMath.cpp: (WTF::parseDateFromNullTerminatedCharacters): (JSC::parseDateFromNullTerminatedCharacters):
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r50916 r50927  
     12009-11-12  Steve VanDeBogart  <vandebo@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Calculate the time offset only if we were able to parse
     6        the date string. This saves an IPC in Chromium for
     7        invalid date strings.
     8        https://bugs.webkit.org/show_bug.cgi?id=31416
     9
     10        * wtf/DateMath.cpp:
     11        (WTF::parseDateFromNullTerminatedCharacters):
     12        (JSC::parseDateFromNullTerminatedCharacters):
     13
    1142009-11-12  Oliver Hunt  <oliver@apple.com>
    215
  • trunk/JavaScriptCore/wtf/DateMath.cpp

    r50711 r50927  
    825825    int offset;
    826826    double ms = parseDateFromNullTerminatedCharacters(dateString, haveTZ, offset);
     827    if (isnan(ms))
     828        return NaN;
     829
    827830    // fall back to local timezone
    828831    if (!haveTZ) {
     
    968971    int offset;
    969972    double ms = WTF::parseDateFromNullTerminatedCharacters(dateString, haveTZ, offset);
     973    if (isnan(ms))
     974        return NaN;
     975
    970976    // fall back to local timezone
    971977    if (!haveTZ) {
Note: See TracChangeset for help on using the changeset viewer.