Changeset 248738 in webkit
- Timestamp:
- Aug 15, 2019 12:31:13 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JSTests/ChangeLog
r248716 r248738 1 2019-08-15 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 DateConversion::formatDateTime incorrectly formats negative years 4 https://bugs.webkit.org/show_bug.cgi?id=199964 5 6 Reviewed by Ross Kirsling. 7 8 * test262/expectations.yaml: Mark 6 test cases as passing. 9 1 10 2019-08-15 Mark Lam <mark.lam@apple.com> 2 11 -
trunk/JSTests/test262/expectations.yaml
r248115 r248738 859 859 default: 'TypeError: Type error' 860 860 strict mode: 'TypeError: Type error' 861 test/built-ins/Date/prototype/toDateString/negative-year.js:862 default: 'Test262Error: Date.prototype.toDateString serializes year -1 to "-0001" Expected SameValue(«-001», «-0001») to be true'863 strict mode: 'Test262Error: Date.prototype.toDateString serializes year -1 to "-0001" Expected SameValue(«-001», «-0001») to be true'864 861 test/built-ins/Date/prototype/toJSON/invoke-result.js: 865 862 default: 'TypeError: toISOString did not return a primitive value' … … 874 871 default: 'TypeError: toISOString did not return a primitive value' 875 872 strict mode: 'TypeError: toISOString did not return a primitive value' 876 test/built-ins/Date/prototype/toString/negative-year.js:877 default: 'Test262Error: Date.prototype.toString serializes year -1 to "-0001" Expected SameValue(«-001», «-0001») to be true'878 strict mode: 'Test262Error: Date.prototype.toString serializes year -1 to "-0001" Expected SameValue(«-001», «-0001») to be true'879 test/built-ins/Date/prototype/toUTCString/negative-year.js:880 default: 'Test262Error: Date.prototype.toUTCString serializes year -1 to "-0001" Expected SameValue(«-001», «-0001») to be true'881 strict mode: 'Test262Error: Date.prototype.toUTCString serializes year -1 to "-0001" Expected SameValue(«-001», «-0001») to be true'882 873 test/built-ins/Error/proto-from-ctor-realm.js: 883 874 default: 'Test262Error: Expected SameValue(«Error», «Error») to be true' -
trunk/Source/JavaScriptCore/ChangeLog
r248716 r248738 1 2019-08-15 Alexey Shvayka <shvaikalesh@gmail.com> 2 3 DateConversion::formatDateTime incorrectly formats negative years 4 https://bugs.webkit.org/show_bug.cgi?id=199964 5 6 Reviewed by Ross Kirsling. 7 8 Currently, year is always padded to max length of 4, including the minus sign "-". 9 With this change, only absolute value of year is padded to max length of 4 and 10 preceded by minus sign "-" if the year is negative. 11 (steps 6-10 of https://tc39.es/ecma262/#sec-datestring) 12 13 * runtime/DateConversion.cpp: 14 (JSC::appendNumber): 15 1 16 2019-08-15 Mark Lam <mark.lam@apple.com> 2 17 -
trunk/Source/JavaScriptCore/runtime/DateConversion.cpp
r242592 r248738 42 42 static inline void appendNumber(StringBuilder& builder, int value) 43 43 { 44 int fillingZerosCount = width;45 44 if (value < 0) { 46 45 builder.append('-'); 47 46 value = -value; 48 --fillingZerosCount;49 47 } 50 48 String valueString = String::number(value); 51 fillingZerosCount -=valueString.length();49 int fillingZerosCount = width - valueString.length(); 52 50 for (int i = 0; i < fillingZerosCount; ++i) 53 51 builder.append('0');
Note: See TracChangeset
for help on using the changeset viewer.