Changeset 91290 in webkit
- Timestamp:
- Jul 19, 2011 1:03:13 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r91287 r91290 29 29 * fast/dynamic/hover-before-position-after-style-change-expected.txt: Added. 30 30 * fast/dynamic/hover-before-position-after-style-change.html: Added. 31 32 2011-07-19 Gavin Barraclough <barraclough@apple.com> 33 34 https://bugs.webkit.org/show_bug.cgi?id=64679 35 Fix bugs in Array.prototype this handling. 36 37 Reviewed by Oliver Hunt. 38 39 * fast/js/array-prototype-properties-expected.txt: Added. 40 * fast/js/array-prototype-properties.html: Added. 41 * fast/js/script-tests/array-prototype-properties.js: Added. 42 - Added layout test for array prototype functions with undefined as this value. 43 * ietestcenter/Javascript/15.4.4.14-5-28-expected.txt: 44 * ietestcenter/Javascript/15.4.4.15-5-28-expected.txt: 45 - These tests now pass. 31 46 32 47 2011-07-19 Gavin Barraclough <barraclough@apple.com> -
trunk/LayoutTests/ietestcenter/Javascript/15.4.4.14-5-28-expected.txt
r62810 r91290 5 5 6 6 PASS ES5Harness.preconditionPassed is true 7 FAIL ES5Harness.testPassed should be true. Was false. 7 PASS ES5Harness.testPassed is true 8 8 PASS successfullyParsed is true 9 9 -
trunk/LayoutTests/ietestcenter/Javascript/15.4.4.15-5-28-expected.txt
r62810 r91290 5 5 6 6 PASS ES5Harness.preconditionPassed is true 7 FAIL ES5Harness.testPassed should be true. Was false. 7 PASS ES5Harness.testPassed is true 8 8 PASS successfullyParsed is true 9 9 -
trunk/Source/JavaScriptCore/ChangeLog
r91288 r91290 14 14 (JSC::RopeBuilder::JSString): 15 15 (JSC::RopeBuilder::appendStringInConstruct): 16 17 2011-07-19 Gavin Barraclough <barraclough@apple.com> 18 19 https://bugs.webkit.org/show_bug.cgi?id=64679 20 Fix bugs in Array.prototype this handling. 21 22 Reviewed by Oliver Hunt. 23 24 * runtime/ArrayPrototype.cpp: 25 (JSC::arrayProtoFuncJoin): 26 (JSC::arrayProtoFuncConcat): 27 (JSC::arrayProtoFuncPop): 28 (JSC::arrayProtoFuncPush): 29 (JSC::arrayProtoFuncReverse): 30 (JSC::arrayProtoFuncShift): 31 (JSC::arrayProtoFuncSlice): 32 (JSC::arrayProtoFuncSort): 33 (JSC::arrayProtoFuncSplice): 34 (JSC::arrayProtoFuncUnShift): 35 (JSC::arrayProtoFuncFilter): 36 (JSC::arrayProtoFuncMap): 37 (JSC::arrayProtoFuncEvery): 38 (JSC::arrayProtoFuncForEach): 39 (JSC::arrayProtoFuncSome): 40 (JSC::arrayProtoFuncReduce): 41 (JSC::arrayProtoFuncReduceRight): 42 (JSC::arrayProtoFuncIndexOf): 43 (JSC::arrayProtoFuncLastIndexOf): 44 - These methods should throw if this value is undefined. 16 45 17 46 2011-07-19 Gavin Barraclough <barraclough@apple.com> -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r91194 r91290 268 268 EncodedJSValue JSC_HOST_CALL arrayProtoFuncJoin(ExecState* exec) 269 269 { 270 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);270 JSObject* thisObj = exec->hostThisValue().toObject(exec); 271 271 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 272 272 if (exec->hadException()) … … 338 338 JSArray* arr = constructEmptyArray(exec); 339 339 unsigned n = 0; 340 JSValue curArg = thisValue.toThisObject(exec); 340 JSValue curArg = thisValue.toObject(exec); 341 if (exec->hadException()) 342 return JSValue::encode(jsUndefined()); 341 343 size_t i = 0; 342 344 size_t argCount = exec->argumentCount(); … … 370 372 return JSValue::encode(asArray(thisValue)->pop()); 371 373 372 JSObject* thisObj = thisValue.to ThisObject(exec);374 JSObject* thisObj = thisValue.toObject(exec); 373 375 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 374 376 if (exec->hadException()) … … 397 399 } 398 400 399 JSObject* thisObj = thisValue.to ThisObject(exec);401 JSObject* thisObj = thisValue.toObject(exec); 400 402 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 401 403 if (exec->hadException()) … … 419 421 EncodedJSValue JSC_HOST_CALL arrayProtoFuncReverse(ExecState* exec) 420 422 { 421 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);423 JSObject* thisObj = exec->hostThisValue().toObject(exec); 422 424 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 423 425 if (exec->hadException()) … … 445 447 EncodedJSValue JSC_HOST_CALL arrayProtoFuncShift(ExecState* exec) 446 448 { 447 JSObject* thisObj = exec->hostThisValue().toThisObject(exec); 449 JSObject* thisObj = exec->hostThisValue().toObject(exec); 450 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 451 if (exec->hadException()) 452 return JSValue::encode(jsUndefined()); 453 448 454 JSValue result; 449 450 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);451 if (exec->hadException())452 return JSValue::encode(jsUndefined());453 454 455 if (length == 0) { 455 456 putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length)); … … 476 477 { 477 478 // http://developer.netscape.com/docs/manuals/js/client/jsref/array.htm#1193713 or 15.4.4.10 478 JSObject* thisObj = exec->hostThisValue().toThisObject(exec); 479 JSObject* thisObj = exec->hostThisValue().toObject(exec); 480 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 481 if (exec->hadException()) 482 return JSValue::encode(jsUndefined()); 479 483 480 484 // We return a new array 481 485 JSArray* resObj = constructEmptyArray(exec); 482 486 JSValue result = resObj; 483 484 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);485 if (exec->hadException())486 return JSValue::encode(jsUndefined());487 487 488 488 unsigned begin = argumentClampedIndexFromStartOrEnd(exec, 0, length); … … 500 500 EncodedJSValue JSC_HOST_CALL arrayProtoFuncSort(ExecState* exec) 501 501 { 502 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);502 JSObject* thisObj = exec->hostThisValue().toObject(exec); 503 503 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 504 504 if (!length || exec->hadException()) … … 562 562 // 15.4.4.12 563 563 564 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);564 JSObject* thisObj = exec->hostThisValue().toObject(exec); 565 565 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 566 566 if (exec->hadException()) … … 630 630 // 15.4.4.13 631 631 632 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);632 JSObject* thisObj = exec->hostThisValue().toObject(exec); 633 633 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 634 634 if (exec->hadException()) … … 657 657 EncodedJSValue JSC_HOST_CALL arrayProtoFuncFilter(ExecState* exec) 658 658 { 659 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);659 JSObject* thisObj = exec->hostThisValue().toObject(exec); 660 660 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 661 661 if (exec->hadException()) … … 716 716 EncodedJSValue JSC_HOST_CALL arrayProtoFuncMap(ExecState* exec) 717 717 { 718 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);718 JSObject* thisObj = exec->hostThisValue().toObject(exec); 719 719 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 720 720 if (exec->hadException()) … … 778 778 EncodedJSValue JSC_HOST_CALL arrayProtoFuncEvery(ExecState* exec) 779 779 { 780 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);780 JSObject* thisObj = exec->hostThisValue().toObject(exec); 781 781 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 782 782 if (exec->hadException()) … … 836 836 EncodedJSValue JSC_HOST_CALL arrayProtoFuncForEach(ExecState* exec) 837 837 { 838 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);838 JSObject* thisObj = exec->hostThisValue().toObject(exec); 839 839 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 840 840 if (exec->hadException()) … … 886 886 EncodedJSValue JSC_HOST_CALL arrayProtoFuncSome(ExecState* exec) 887 887 { 888 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);888 JSObject* thisObj = exec->hostThisValue().toObject(exec); 889 889 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 890 890 if (exec->hadException()) … … 943 943 EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduce(ExecState* exec) 944 944 { 945 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);945 JSObject* thisObj = exec->hostThisValue().toObject(exec); 946 946 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 947 947 if (exec->hadException()) … … 1018 1018 EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduceRight(ExecState* exec) 1019 1019 { 1020 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);1020 JSObject* thisObj = exec->hostThisValue().toObject(exec); 1021 1021 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 1022 1022 if (exec->hadException()) … … 1093 1093 { 1094 1094 // 15.4.4.14 1095 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);1095 JSObject* thisObj = exec->hostThisValue().toObject(exec); 1096 1096 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 1097 1097 if (exec->hadException()) … … 1114 1114 { 1115 1115 // 15.4.4.15 1116 JSObject* thisObj = exec->hostThisValue().to ThisObject(exec);1116 JSObject* thisObj = exec->hostThisValue().toObject(exec); 1117 1117 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 1118 1118 if (!length)
Note: See TracChangeset
for help on using the changeset viewer.