Changeset 92093 in webkit
- Timestamp:
- Jul 31, 2011, 6:50:16 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/js/array-prototype-properties-expected.txt (modified) (1 diff)
-
LayoutTests/ietestcenter/Javascript/15.4.4.14-5-28-expected.txt (modified) (1 diff)
-
LayoutTests/ietestcenter/Javascript/15.4.4.15-5-28-expected.txt (modified) (1 diff)
-
Source/JavaScriptCore/ChangeLog (modified) (1 diff)
-
Source/JavaScriptCore/runtime/ArrayPrototype.cpp (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r92091 r92093 1 2011-07-31 Gavin Barraclough <barraclough@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=64679 4 Fix bugs in Array.prototype this handling. 5 6 Unreviewed - rolling out r91290. 7 8 Checking in failing results - we can't fix this bug just yet 9 for web compatibility reasons. 10 11 * fast/js/array-prototype-properties-expected.txt: 12 * ietestcenter/Javascript/15.4.4.14-5-28-expected.txt: 13 * ietestcenter/Javascript/15.4.4.15-5-28-expected.txt: 14 1 15 2011-07-31 Ryosuke Niwa <rniwa@webkit.org> 2 16 -
trunk/LayoutTests/fast/js/array-prototype-properties-expected.txt
r91290 r92093 6 6 PASS Array.prototype.toString.call(undefined) threw exception TypeError: Type error. 7 7 PASS Array.prototype.toLocaleString.call(undefined) threw exception TypeError: Type error. 8 PASS Array.prototype.concat.call(undefined, []) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.concat.call(undefined, [])').9 PASS Array.prototype.join.call(undefined, []) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.join.call(undefined, [])').10 PASS Array.prototype.pop.call(undefined) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.pop.call(undefined)').11 PASS Array.prototype.push.call(undefined, {}) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.push.call(undefined, {})').12 PASS Array.prototype.reverse.call(undefined) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.reverse.call(undefined)').13 PASS Array.prototype.shift.call(undefined) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.shift.call(undefined)').14 PASS Array.prototype.slice.call(undefined, 0, 1) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.slice.call(undefined, 0, 1)').15 PASS Array.prototype.sort.call(undefined) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.sort.call(undefined)').16 PASS Array.prototype.splice.call(undefined, 0, 1) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.splice.call(undefined, 0, 1)').17 PASS Array.prototype.unshift.call(undefined, {}) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.unshift.call(undefined, {})').18 PASS Array.prototype.every.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.every.call(undefined, toString)').19 PASS Array.prototype.forEach.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.forEach.call(undefined, toString)').20 PASS Array.prototype.some.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.some.call(undefined, toString)').21 PASS Array.prototype.indexOf.call(undefined, 0) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.indexOf.call(undefined, 0)').8 FAIL Array.prototype.concat.call(undefined, []) should throw an exception. Was [object DOMWindow]. 9 FAIL Array.prototype.join.call(undefined, []) should throw an exception. Was . 10 FAIL Array.prototype.pop.call(undefined) should throw an exception. Was undefined. 11 FAIL Array.prototype.push.call(undefined, {}) should throw an exception. Was 1. 12 FAIL Array.prototype.reverse.call(undefined) should throw an exception. Was [object DOMWindow]. 13 FAIL Array.prototype.shift.call(undefined) should throw an exception. Was [object Object]. 14 FAIL Array.prototype.slice.call(undefined, 0, 1) should throw an exception. Was . 15 FAIL Array.prototype.sort.call(undefined) should throw an exception. Was [object DOMWindow]. 16 FAIL Array.prototype.splice.call(undefined, 0, 1) should throw an exception. Was . 17 FAIL Array.prototype.unshift.call(undefined, {}) should throw an exception. Was 1. 18 FAIL Array.prototype.every.call(undefined, toString) should throw an exception. Was true. 19 FAIL Array.prototype.forEach.call(undefined, toString) should throw an exception. Was undefined. 20 FAIL Array.prototype.some.call(undefined, toString) should throw an exception. Was true. 21 FAIL Array.prototype.indexOf.call(undefined, 0) should throw an exception. Was -1. 22 22 PASS Array.prototype.indlastIndexOfexOf.call(undefined, 0) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.indlastIndexOfexOf.call'). 23 PASS Array.prototype.filter.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.filter.call(undefined, toString)').24 PASS Array.prototype.reduce.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.reduce.call(undefined, toString)').25 PASS Array.prototype.reduceRight.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.reduceRight.call(undefined, toString)').26 PASS Array.prototype.map.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.map.call(undefined, toString)').23 FAIL Array.prototype.filter.call(undefined, toString) should throw an exception. Was [object Object]. 24 FAIL Array.prototype.reduce.call(undefined, toString) should throw an exception. Was [object Object]. 25 FAIL Array.prototype.reduceRight.call(undefined, toString) should throw an exception. Was [object Object]. 26 FAIL Array.prototype.map.call(undefined, toString) should throw an exception. Was [object DOMWindow]. 27 27 PASS successfullyParsed is true 28 28 -
trunk/LayoutTests/ietestcenter/Javascript/15.4.4.14-5-28-expected.txt
r91290 r92093 5 5 6 6 PASS ES5Harness.preconditionPassed is true 7 PASS ES5Harness.testPassed is true 7 FAIL ES5Harness.testPassed should be true. Was false. 8 8 PASS successfullyParsed is true 9 9 -
trunk/LayoutTests/ietestcenter/Javascript/15.4.4.15-5-28-expected.txt
r91290 r92093 5 5 6 6 PASS ES5Harness.preconditionPassed is true 7 PASS ES5Harness.testPassed is true 7 FAIL ES5Harness.testPassed should be true. Was false. 8 8 PASS successfullyParsed is true 9 9 -
trunk/Source/JavaScriptCore/ChangeLog
r92092 r92093 1 2011-07-31 Gavin Barraclough <barraclough@apple.com> 2 3 https://bugs.webkit.org/show_bug.cgi?id=64679 4 Fix bugs in Array.prototype this handling. 5 6 Unreviewed - rolling out r91290. 7 8 Looks like the wild wild web isn't ready for this yet. 9 10 This change broke http://slides.html5rocks.com/#landing-slide. 11 Interestingly, this might only be due to our lack of bind support - 12 it looks like this site is calling Array.prototype.slice as a part 13 of its bind implementation. 14 15 * runtime/ArrayPrototype.cpp: 16 (JSC::arrayProtoFuncJoin): 17 (JSC::arrayProtoFuncConcat): 18 (JSC::arrayProtoFuncPop): 19 (JSC::arrayProtoFuncPush): 20 (JSC::arrayProtoFuncReverse): 21 (JSC::arrayProtoFuncShift): 22 (JSC::arrayProtoFuncSlice): 23 (JSC::arrayProtoFuncSort): 24 (JSC::arrayProtoFuncSplice): 25 (JSC::arrayProtoFuncUnShift): 26 (JSC::arrayProtoFuncFilter): 27 (JSC::arrayProtoFuncMap): 28 (JSC::arrayProtoFuncEvery): 29 (JSC::arrayProtoFuncForEach): 30 (JSC::arrayProtoFuncSome): 31 (JSC::arrayProtoFuncReduce): 32 (JSC::arrayProtoFuncReduceRight): 33 (JSC::arrayProtoFuncIndexOf): 34 (JSC::arrayProtoFuncLastIndexOf): 35 1 36 2011-07-31 Filip Pizlo <fpizlo@apple.com> 2 37 -
trunk/Source/JavaScriptCore/runtime/ArrayPrototype.cpp
r91824 r92093 268 268 EncodedJSValue JSC_HOST_CALL arrayProtoFuncJoin(ExecState* exec) 269 269 { 270 JSObject* thisObj = exec->hostThisValue().to Object(exec);270 JSObject* thisObj = exec->hostThisValue().toThisObject(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.toObject(exec); 341 if (exec->hadException()) 342 return JSValue::encode(jsUndefined()); 340 JSValue curArg = thisValue.toThisObject(exec); 343 341 size_t i = 0; 344 342 size_t argCount = exec->argumentCount(); … … 372 370 return JSValue::encode(asArray(thisValue)->pop()); 373 371 374 JSObject* thisObj = thisValue.to Object(exec);372 JSObject* thisObj = thisValue.toThisObject(exec); 375 373 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 376 374 if (exec->hadException()) … … 399 397 } 400 398 401 JSObject* thisObj = thisValue.to Object(exec);399 JSObject* thisObj = thisValue.toThisObject(exec); 402 400 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 403 401 if (exec->hadException()) … … 421 419 EncodedJSValue JSC_HOST_CALL arrayProtoFuncReverse(ExecState* exec) 422 420 { 423 JSObject* thisObj = exec->hostThisValue().to Object(exec);421 JSObject* thisObj = exec->hostThisValue().toThisObject(exec); 424 422 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 425 423 if (exec->hadException()) … … 447 445 EncodedJSValue JSC_HOST_CALL arrayProtoFuncShift(ExecState* exec) 448 446 { 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 447 JSObject* thisObj = exec->hostThisValue().toThisObject(exec); 454 448 JSValue result; 449 450 unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec); 451 if (exec->hadException()) 452 return JSValue::encode(jsUndefined()); 453 455 454 if (length == 0) { 456 455 putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length)); … … 477 476 { 478 477 // http://developer.netscape.com/docs/manuals/js/client/jsref/array.htm#1193713 or 15.4.4.10 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()); 478 JSObject* thisObj = exec->hostThisValue().toThisObject(exec); 483 479 484 480 // We return a new array 485 481 JSArray* resObj = constructEmptyArray(exec); 486 482 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 Object(exec);502 JSObject* thisObj = exec->hostThisValue().toThisObject(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 Object(exec);564 JSObject* thisObj = exec->hostThisValue().toThisObject(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 Object(exec);632 JSObject* thisObj = exec->hostThisValue().toThisObject(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 Object(exec);659 JSObject* thisObj = exec->hostThisValue().toThisObject(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 Object(exec);718 JSObject* thisObj = exec->hostThisValue().toThisObject(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 Object(exec);780 JSObject* thisObj = exec->hostThisValue().toThisObject(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 Object(exec);838 JSObject* thisObj = exec->hostThisValue().toThisObject(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 Object(exec);888 JSObject* thisObj = exec->hostThisValue().toThisObject(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 Object(exec);945 JSObject* thisObj = exec->hostThisValue().toThisObject(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 Object(exec);1020 JSObject* thisObj = exec->hostThisValue().toThisObject(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 Object(exec);1095 JSObject* thisObj = exec->hostThisValue().toThisObject(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 Object(exec);1116 JSObject* thisObj = exec->hostThisValue().toThisObject(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.