diff --git a/js/src/jsdate.cpp b/js/src/jsdate.cpp index dfd04e1305..e29d6c6b24 100755 --- a/js/src/jsdate.cpp +++ b/js/src/jsdate.cpp @@ -36,6 +36,7 @@ #include "js/Conversions.h" #include "js/Date.h" +#include "unicode/uchar.h" #include "vm/DateTime.h" #include "vm/GlobalObject.h" #include "vm/Interpreter.h" @@ -961,7 +962,13 @@ ParseDate(const CharT* s, size_t length, ClippedTime* result) while (i < length) { int c = s[i]; i++; - + + // CLDR 42 has opened the door to whitespace, + // so let's normalize them all to standard spaces. + if (u_hasBinaryProperty(static_cast(c), UCHAR_WHITE_SPACE)) { + c = ' '; + } + // Spaces, ASCII control characters, and commas are ignored. if (c <= ' ' || c == ',') continue; @@ -998,6 +1005,11 @@ ParseDate(const CharT* s, size_t length, ClippedTime* result) i++; } + // CLDR 42 reprise. + if (u_hasBinaryProperty(static_cast(c), UCHAR_WHITE_SPACE)) { + c = ' '; + } + /* * Allow TZA before the year, so 'Wed Nov 05 21:49:11 GMT-0800 1997' * works.