Changeset 195431 in webkit
- Timestamp:
- Jan 21, 2016 6:05:28 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r195428 r195431 1 2016-01-21 Andy VanWagoner <andy@instructure.com> 2 3 [INTL] Implement Array.prototype.toLocaleString in ECMA-402 4 https://bugs.webkit.org/show_bug.cgi?id=147614 5 6 Reviewed by Benjamin Poulain. 7 8 * js/array-toLocaleString-expected.txt: Added. 9 * js/array-toLocaleString.html: Added. 10 * js/script-tests/array-toLocaleString.js: Added. 11 1 12 2016-01-21 Ryan Haddad <ryanhaddad@apple.com> 2 13 -
trunk/Source/JavaScriptCore/ChangeLog
r195425 r195431 1 2016-01-21 Andy VanWagoner <andy@instructure.com> 2 3 [INTL] Implement Array.prototype.toLocaleString in ECMA-402 4 https://bugs.webkit.org/show_bug.cgi?id=147614 5 6 Reviewed by Benjamin Poulain. 7 8 The primary changes in the ECMA-402 version, and the existing implementation 9 are passing the arguments on to each element's toLocaleString call, and 10 missing/undefined/null elements become empty string instead of being skipped. 11 12 * runtime/ArrayPrototype.cpp: 13 (JSC::arrayProtoFuncToLocaleString): 14 1 15 2016-01-21 Per Arne Vollan <peavo@outlook.com> 2 16 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r194310 r195431 337 337 return JSValue::encode(jsUndefined()); 338 338 339 #if ENABLE(INTL) 340 ArgList arguments(exec); 341 for (unsigned i = 0; i < length; ++i) { 342 JSValue element = thisObject->getIndex(exec, i); 343 if (exec->hadException()) 344 return JSValue::encode(jsUndefined()); 345 if (element.isUndefinedOrNull()) 346 element = jsEmptyString(exec); 347 else { 348 JSValue conversionFunction = element.get(exec, exec->propertyNames().toLocaleString); 349 if (exec->hadException()) 350 return JSValue::encode(jsUndefined()); 351 CallData callData; 352 CallType callType = getCallData(conversionFunction, callData); 353 if (callType != CallTypeNone) { 354 element = call(exec, conversionFunction, callType, callData, element, arguments); 355 if (exec->hadException()) 356 return JSValue::encode(jsUndefined()); 357 } 358 } 359 stringJoiner.append(*exec, element); 360 if (exec->hadException()) 361 return JSValue::encode(jsUndefined()); 362 } 363 #else // !ENABLE(INTL) 339 364 for (unsigned i = 0; i < length; ++i) { 340 365 JSValue element = thisObject->getIndex(exec, i); … … 357 382 return JSValue::encode(jsUndefined()); 358 383 } 384 #endif // !ENABLE(INTL) 359 385 360 386 return JSValue::encode(stringJoiner.join(*exec));
Note: See TracChangeset
for help on using the changeset viewer.