Diff
Modified: trunk/LayoutTests/ChangeLog (92092 => 92093)
--- trunk/LayoutTests/ChangeLog 2011-07-31 23:48:27 UTC (rev 92092)
+++ trunk/LayoutTests/ChangeLog 2011-08-01 01:50:16 UTC (rev 92093)
@@ -1,3 +1,17 @@
+2011-07-31 Gavin Barraclough <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=64679
+ Fix bugs in Array.prototype this handling.
+
+ Unreviewed - rolling out r91290.
+
+ Checking in failing results - we can't fix this bug just yet
+ for web compatibility reasons.
+
+ * fast/js/array-prototype-properties-expected.txt:
+ * ietestcenter/_javascript_/15.4.4.14-5-28-expected.txt:
+ * ietestcenter/_javascript_/15.4.4.15-5-28-expected.txt:
+
2011-07-31 Ryosuke Niwa <[email protected]>
Fix fast/dom/Range/getBoundingClientRect.html after r92089.
Modified: trunk/LayoutTests/fast/js/array-prototype-properties-expected.txt (92092 => 92093)
--- trunk/LayoutTests/fast/js/array-prototype-properties-expected.txt 2011-07-31 23:48:27 UTC (rev 92092)
+++ trunk/LayoutTests/fast/js/array-prototype-properties-expected.txt 2011-08-01 01:50:16 UTC (rev 92093)
@@ -5,25 +5,25 @@
PASS Array.prototype.toString.call(undefined) threw exception TypeError: Type error.
PASS Array.prototype.toLocaleString.call(undefined) threw exception TypeError: Type error.
-PASS Array.prototype.concat.call(undefined, []) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.concat.call(undefined, [])').
-PASS Array.prototype.join.call(undefined, []) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.join.call(undefined, [])').
-PASS Array.prototype.pop.call(undefined) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.pop.call(undefined)').
-PASS Array.prototype.push.call(undefined, {}) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.push.call(undefined, {})').
-PASS Array.prototype.reverse.call(undefined) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.reverse.call(undefined)').
-PASS Array.prototype.shift.call(undefined) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.shift.call(undefined)').
-PASS Array.prototype.slice.call(undefined, 0, 1) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.slice.call(undefined, 0, 1)').
-PASS Array.prototype.sort.call(undefined) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.sort.call(undefined)').
-PASS Array.prototype.splice.call(undefined, 0, 1) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.splice.call(undefined, 0, 1)').
-PASS Array.prototype.unshift.call(undefined, {}) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.unshift.call(undefined, {})').
-PASS Array.prototype.every.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.every.call(undefined, toString)').
-PASS Array.prototype.forEach.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.forEach.call(undefined, toString)').
-PASS Array.prototype.some.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.some.call(undefined, toString)').
-PASS Array.prototype.indexOf.call(undefined, 0) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.indexOf.call(undefined, 0)').
+FAIL Array.prototype.concat.call(undefined, []) should throw an exception. Was [object DOMWindow].
+FAIL Array.prototype.join.call(undefined, []) should throw an exception. Was .
+FAIL Array.prototype.pop.call(undefined) should throw an exception. Was undefined.
+FAIL Array.prototype.push.call(undefined, {}) should throw an exception. Was 1.
+FAIL Array.prototype.reverse.call(undefined) should throw an exception. Was [object DOMWindow].
+FAIL Array.prototype.shift.call(undefined) should throw an exception. Was [object Object].
+FAIL Array.prototype.slice.call(undefined, 0, 1) should throw an exception. Was .
+FAIL Array.prototype.sort.call(undefined) should throw an exception. Was [object DOMWindow].
+FAIL Array.prototype.splice.call(undefined, 0, 1) should throw an exception. Was .
+FAIL Array.prototype.unshift.call(undefined, {}) should throw an exception. Was 1.
+FAIL Array.prototype.every.call(undefined, toString) should throw an exception. Was true.
+FAIL Array.prototype.forEach.call(undefined, toString) should throw an exception. Was undefined.
+FAIL Array.prototype.some.call(undefined, toString) should throw an exception. Was true.
+FAIL Array.prototype.indexOf.call(undefined, 0) should throw an exception. Was -1.
PASS Array.prototype.indlastIndexOfexOf.call(undefined, 0) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.indlastIndexOfexOf.call').
-PASS Array.prototype.filter.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.filter.call(undefined, toString)').
-PASS Array.prototype.reduce.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.reduce.call(undefined, toString)').
-PASS Array.prototype.reduceRight.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.reduceRight.call(undefined, toString)').
-PASS Array.prototype.map.call(undefined, toString) threw exception TypeError: 'undefined' is not an object (evaluating 'Array.prototype.map.call(undefined, toString)').
+FAIL Array.prototype.filter.call(undefined, toString) should throw an exception. Was [object Object].
+FAIL Array.prototype.reduce.call(undefined, toString) should throw an exception. Was [object Object].
+FAIL Array.prototype.reduceRight.call(undefined, toString) should throw an exception. Was [object Object].
+FAIL Array.prototype.map.call(undefined, toString) should throw an exception. Was [object DOMWindow].
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/ietestcenter/_javascript_/15.4.4.14-5-28-expected.txt (92092 => 92093)
--- trunk/LayoutTests/ietestcenter/_javascript_/15.4.4.14-5-28-expected.txt 2011-07-31 23:48:27 UTC (rev 92092)
+++ trunk/LayoutTests/ietestcenter/_javascript_/15.4.4.14-5-28-expected.txt 2011-08-01 01:50:16 UTC (rev 92093)
@@ -4,7 +4,7 @@
PASS ES5Harness.preconditionPassed is true
-PASS ES5Harness.testPassed is true
+FAIL ES5Harness.testPassed should be true. Was false.
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/LayoutTests/ietestcenter/_javascript_/15.4.4.15-5-28-expected.txt (92092 => 92093)
--- trunk/LayoutTests/ietestcenter/_javascript_/15.4.4.15-5-28-expected.txt 2011-07-31 23:48:27 UTC (rev 92092)
+++ trunk/LayoutTests/ietestcenter/_javascript_/15.4.4.15-5-28-expected.txt 2011-08-01 01:50:16 UTC (rev 92093)
@@ -4,7 +4,7 @@
PASS ES5Harness.preconditionPassed is true
-PASS ES5Harness.testPassed is true
+FAIL ES5Harness.testPassed should be true. Was false.
PASS successfullyParsed is true
TEST COMPLETE
Modified: trunk/Source/_javascript_Core/ChangeLog (92092 => 92093)
--- trunk/Source/_javascript_Core/ChangeLog 2011-07-31 23:48:27 UTC (rev 92092)
+++ trunk/Source/_javascript_Core/ChangeLog 2011-08-01 01:50:16 UTC (rev 92093)
@@ -1,3 +1,38 @@
+2011-07-31 Gavin Barraclough <[email protected]>
+
+ https://bugs.webkit.org/show_bug.cgi?id=64679
+ Fix bugs in Array.prototype this handling.
+
+ Unreviewed - rolling out r91290.
+
+ Looks like the wild wild web isn't ready for this yet.
+
+ This change broke http://slides.html5rocks.com/#landing-slide.
+ Interestingly, this might only be due to our lack of bind support -
+ it looks like this site is calling Array.prototype.slice as a part
+ of its bind implementation.
+
+ * runtime/ArrayPrototype.cpp:
+ (JSC::arrayProtoFuncJoin):
+ (JSC::arrayProtoFuncConcat):
+ (JSC::arrayProtoFuncPop):
+ (JSC::arrayProtoFuncPush):
+ (JSC::arrayProtoFuncReverse):
+ (JSC::arrayProtoFuncShift):
+ (JSC::arrayProtoFuncSlice):
+ (JSC::arrayProtoFuncSort):
+ (JSC::arrayProtoFuncSplice):
+ (JSC::arrayProtoFuncUnShift):
+ (JSC::arrayProtoFuncFilter):
+ (JSC::arrayProtoFuncMap):
+ (JSC::arrayProtoFuncEvery):
+ (JSC::arrayProtoFuncForEach):
+ (JSC::arrayProtoFuncSome):
+ (JSC::arrayProtoFuncReduce):
+ (JSC::arrayProtoFuncReduceRight):
+ (JSC::arrayProtoFuncIndexOf):
+ (JSC::arrayProtoFuncLastIndexOf):
+
2011-07-31 Filip Pizlo <[email protected]>
JSC GC lays out size classes under wrong assumptions about expected
Modified: trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp (92092 => 92093)
--- trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp 2011-07-31 23:48:27 UTC (rev 92092)
+++ trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp 2011-08-01 01:50:16 UTC (rev 92093)
@@ -267,7 +267,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncJoin(ExecState* exec)
{
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -337,9 +337,7 @@
JSValue thisValue = exec->hostThisValue();
JSArray* arr = constructEmptyArray(exec);
unsigned n = 0;
- JSValue curArg = thisValue.toObject(exec);
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
+ JSValue curArg = thisValue.toThisObject(exec);
size_t i = 0;
size_t argCount = exec->argumentCount();
while (1) {
@@ -371,7 +369,7 @@
if (isJSArray(&exec->globalData(), thisValue))
return JSValue::encode(asArray(thisValue)->pop());
- JSObject* thisObj = thisValue.toObject(exec);
+ JSObject* thisObj = thisValue.toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -398,7 +396,7 @@
return JSValue::encode(jsNumber(array->length()));
}
- JSObject* thisObj = thisValue.toObject(exec);
+ JSObject* thisObj = thisValue.toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -420,7 +418,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncReverse(ExecState* exec)
{
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -446,12 +444,13 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncShift(ExecState* exec)
{
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
+ JSValue result;
+
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
- JSValue result;
if (length == 0) {
putProperty(exec, thisObj, exec->propertyNames().length, jsNumber(length));
result = jsUndefined();
@@ -476,15 +475,16 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncSlice(ExecState* exec)
{
// http://developer.netscape.com/docs/manuals/js/client/jsref/array.htm#1193713 or 15.4.4.10
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
- unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
- if (exec->hadException())
- return JSValue::encode(jsUndefined());
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
// We return a new array
JSArray* resObj = constructEmptyArray(exec);
JSValue result = resObj;
+ unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
+ if (exec->hadException())
+ return JSValue::encode(jsUndefined());
+
unsigned begin = argumentClampedIndexFromStartOrEnd(exec, 0, length);
unsigned end = argumentClampedIndexFromStartOrEnd(exec, 1, length, length);
@@ -499,7 +499,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncSort(ExecState* exec)
{
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (!length || exec->hadException())
return JSValue::encode(thisObj);
@@ -561,7 +561,7 @@
{
// 15.4.4.12
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -629,7 +629,7 @@
{
// 15.4.4.13
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -656,7 +656,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncFilter(ExecState* exec)
{
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -715,7 +715,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncMap(ExecState* exec)
{
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -777,7 +777,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncEvery(ExecState* exec)
{
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -835,7 +835,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncForEach(ExecState* exec)
{
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -885,7 +885,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncSome(ExecState* exec)
{
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -942,7 +942,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduce(ExecState* exec)
{
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -1017,7 +1017,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncReduceRight(ExecState* exec)
{
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -1092,7 +1092,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncIndexOf(ExecState* exec)
{
// 15.4.4.14
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (exec->hadException())
return JSValue::encode(jsUndefined());
@@ -1113,7 +1113,7 @@
EncodedJSValue JSC_HOST_CALL arrayProtoFuncLastIndexOf(ExecState* exec)
{
// 15.4.4.15
- JSObject* thisObj = exec->hostThisValue().toObject(exec);
+ JSObject* thisObj = exec->hostThisValue().toThisObject(exec);
unsigned length = thisObj->get(exec, exec->propertyNames().length).toUInt32(exec);
if (!length)
return JSValue::encode(jsNumber(-1));