Changeset 26676 in webkit for trunk/JavaScriptCore/kjs/date_object.cpp
- Timestamp:
- Oct 16, 2007, 1:13:24 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/date_object.cpp
r26454 r26676 1 1 /* 2 * This file is part of the KDE libraries3 2 * Copyright (C) 1999-2000 Harri Porten ([email protected]) 4 * Copyright (C) 2004 Apple Computer, Inc.3 * Copyright (C) 2004, 2005, 2006, 2007 Apple Inc. All rights reserved. 5 4 * 6 5 * This library is free software; you can redistribute it and/or … … 41 40 #endif 42 41 43 #include <ctype.h>44 42 #include <float.h> 45 43 #include <limits.h> … … 55 53 #include "DateMath.h" 56 54 55 #include <wtf/ASCIICType.h> 57 56 #include <wtf/MathExtras.h> 58 57 #include <wtf/StringExtras.h> … … 61 60 #include <CoreFoundation/CoreFoundation.h> 62 61 #endif 62 63 using namespace WTF; 63 64 64 65 namespace KJS { … … 743 744 }; 744 745 745 inline static void skipSpacesAndComments(const char *&s)746 inline static void skipSpacesAndComments(const char*& s) 746 747 { 747 748 int nesting = 0; 748 749 char ch; 749 750 while ((ch = *s)) { 750 if (!is space(ch)) {751 if (!isASCIISpace(ch)) { 751 752 if (ch == '(') 752 753 nesting++; … … 761 762 762 763 // returns 0-11 (Jan-Dec); -1 on failure 763 static int findMonth(const char *monthStr)764 static int findMonth(const char* monthStr) 764 765 { 765 766 assert(monthStr); … … 768 769 if (!*monthStr) 769 770 return -1; 770 needle[i] = static_cast<char>(to lower(*monthStr++));771 needle[i] = static_cast<char>(toASCIILower(*monthStr++)); 771 772 } 772 773 needle[3] = '\0'; … … 806 807 const char *wordStart = dateString; 807 808 // Check contents of first words if not number 808 while (*dateString && !is digit(*dateString)) {809 if (is space(*dateString) || *dateString == '(') {809 while (*dateString && !isASCIIDigit(*dateString)) { 810 if (isASCIISpace(*dateString) || *dateString == '(') { 810 811 if (dateString - wordStart >= 3) 811 812 month = findMonth(wordStart); … … 956 957 957 958 // ':40 GMT' 958 if (*dateString && *dateString != ':' && !is space(*dateString))959 if (*dateString && *dateString != ':' && !isASCIISpace(*dateString)) 959 960 return NaN; 960 961
Note:
See TracChangeset
for help on using the changeset viewer.