Title: [104258] trunk
Revision
104258
Author
[email protected]
Date
2012-01-05 17:37:39 -0800 (Thu, 05 Jan 2012)

Log Message

Array.prototype.lastIndexOf ignores undefined fromIndex.
https://bugs.webkit.org/show_bug.cgi?id=75678

Reviewed by Sam Weinig.

Source/_javascript_Core: 

array.lastIndexOf(x, undefined) is equivalent to array.lastIndexOf(x, 0), not array.lastIndexOf(x)

* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncLastIndexOf):
    - should check argumnet count, rather than checking agument value for undefined.

LayoutTests: 

* ietestcenter/_javascript_/15.4.4.15-5-4-expected.txt:
    - check in passing result

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (104257 => 104258)


--- trunk/LayoutTests/ChangeLog	2012-01-06 01:32:45 UTC (rev 104257)
+++ trunk/LayoutTests/ChangeLog	2012-01-06 01:37:39 UTC (rev 104258)
@@ -1,3 +1,13 @@
+2012-01-05  Gavin Barraclough  <[email protected]>
+
+        Array.prototype.lastIndexOf ignores undefined fromIndex.
+        https://bugs.webkit.org/show_bug.cgi?id=75678
+
+        Reviewed by Sam Weinig.
+
+        * ietestcenter/_javascript_/15.4.4.15-5-4-expected.txt:
+            - check in passing result
+
 2012-01-05  Jochen Eisinger  <[email protected]>
 
         Unskip fast/storage/storage-detached-iframe.html on chromium

Modified: trunk/LayoutTests/ietestcenter/_javascript_/15.4.4.15-5-4-expected.txt (104257 => 104258)


--- trunk/LayoutTests/ietestcenter/_javascript_/15.4.4.15-5-4-expected.txt	2012-01-06 01:32:45 UTC (rev 104257)
+++ trunk/LayoutTests/ietestcenter/_javascript_/15.4.4.15-5-4-expected.txt	2012-01-06 01:37:39 UTC (rev 104258)
@@ -4,7 +4,7 @@
 
 
 PASS ES5Harness.preconditionPassed is true
-FAIL ES5Harness.testPassed should be true (of type boolean). Was undefined (of type undefined).
+PASS ES5Harness.testPassed is true
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/Source/_javascript_Core/ChangeLog (104257 => 104258)


--- trunk/Source/_javascript_Core/ChangeLog	2012-01-06 01:32:45 UTC (rev 104257)
+++ trunk/Source/_javascript_Core/ChangeLog	2012-01-06 01:37:39 UTC (rev 104258)
@@ -1,5 +1,18 @@
 2012-01-05  Gavin Barraclough  <[email protected]>
 
+        Array.prototype.lastIndexOf ignores undefined fromIndex.
+        https://bugs.webkit.org/show_bug.cgi?id=75678
+
+        Reviewed by Sam Weinig.
+
+        array.lastIndexOf(x, undefined) is equivalent to array.lastIndexOf(x, 0), not array.lastIndexOf(x)
+
+        * runtime/ArrayPrototype.cpp:
+        (JSC::arrayProtoFuncLastIndexOf):
+            - should check argumnet count, rather than checking agument value for undefined.
+
+2012-01-05  Gavin Barraclough  <[email protected]>
+
         Date parsing is too restrictive.
         https://bugs.webkit.org/show_bug.cgi?id=75671
 

Modified: trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp (104257 => 104258)


--- trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp	2012-01-06 01:32:45 UTC (rev 104257)
+++ trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp	2012-01-06 01:37:39 UTC (rev 104258)
@@ -1170,8 +1170,8 @@
         return JSValue::encode(jsNumber(-1));
 
     unsigned index = length - 1;
-    JSValue fromValue = exec->argument(1);
-    if (!fromValue.isUndefined()) {
+    if (exec->argumentCount() >= 2) {
+        JSValue fromValue = exec->argument(1);
         double fromDouble = fromValue.toInteger(exec);
         if (fromDouble < 0) {
             fromDouble += length;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to