Changeset 9932 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jul 27, 2005, 4:44:59 PM (20 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r9929 r9932 1 2005-07-27 Geoffrey Garen <[email protected]> 2 3 - fixed http://bugzilla.opendarwin.org/show_bug.cgi?id=4147 4 Array.toString() and toLocaleString() improvements from KDE KJS 5 (rolled in KDE changes) 6 7 Test cases added: 8 9 * layout-tests/fast/js/toString-overrides-expected.txt: Added. 10 * layout-tests/fast/js/toString-overrides.html: Added. 11 12 * kjs/array_object.cpp: 13 (ArrayProtoFuncImp::call): 14 1 15 2005-07-27 Maciej Stachowiak <[email protected]> 2 16 -
trunk/JavaScriptCore/kjs/array_object.cpp
r9889 r9932 483 483 continue; 484 484 485 Object o = element.toObject(exec); 486 Object conversionFunction; 485 bool fallback = false; 487 486 if (id == ToLocaleString) { 488 conversionFunction = Object::dynamicCast(o.get(exec, toLocaleStringPropertyName)); 489 } else { 490 conversionFunction = Object::dynamicCast(o.get(exec, toStringPropertyName)); 491 } 492 str += conversionFunction.call(exec, o, List()).toString(exec); 493 487 Object o = element.toObject(exec); 488 Object conversionFunction = 489 Object::dynamicCast(o.get(exec, toLocaleStringPropertyName)); 490 if (conversionFunction.isValid() && 491 conversionFunction.implementsCall()) { 492 str += conversionFunction.call(exec, o, List()).toString(exec); 493 } else { 494 // try toString() fallback 495 fallback = true; 496 } 497 } 498 499 if (id == ToString || id == Join || fallback) { 500 if (element.type() == ObjectType) { 501 Object o = Object::dynamicCast(element); 502 Object conversionFunction = 503 Object::dynamicCast(o.get(exec, toStringPropertyName)); 504 if (conversionFunction.isValid() && 505 conversionFunction.implementsCall()) { 506 str += conversionFunction.call(exec, o, List()).toString(exec); 507 } else { 508 UString msg = "Can't convert " + o.className() + 509 " object to string"; 510 Object error = Error::create(exec, RangeError, 511 msg.cstring().c_str()); 512 exec->setException(error); 513 return error; 514 } 515 } else { 516 str += element.toString(exec); 517 } 518 } 519 494 520 if ( exec->hadException() ) 495 521 break;
Note:
See TracChangeset
for help on using the changeset viewer.