Title: [207344] trunk
Revision
207344
Author
ryanhad...@apple.com
Date
2016-10-14 09:23:42 -0700 (Fri, 14 Oct 2016)

Log Message

Unreviewed, rolling out r207322.

This change caused JSC test failures

Reverted changeset:

"Fix Array.prototype.splice ES6 compliance."
https://bugs.webkit.org/show_bug.cgi?id=163372
http://trac.webkit.org/changeset/207322

Modified Paths

Removed Paths

Diff

Modified: trunk/JSTests/ChangeLog (207343 => 207344)


--- trunk/JSTests/ChangeLog	2016-10-14 16:23:18 UTC (rev 207343)
+++ trunk/JSTests/ChangeLog	2016-10-14 16:23:42 UTC (rev 207344)
@@ -1,3 +1,15 @@
+2016-10-14  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r207322.
+
+        This change caused JSC test failures
+
+        Reverted changeset:
+
+        "Fix Array.prototype.splice ES6 compliance."
+        https://bugs.webkit.org/show_bug.cgi?id=163372
+        http://trac.webkit.org/changeset/207322
+
 2016-10-14  Mark Lam  <mark....@apple.com>
 
         JSON.parse should not modify frozen objects.

Deleted: trunk/JSTests/stress/array-splice-on-frozen-object.js (207343 => 207344)


--- trunk/JSTests/stress/array-splice-on-frozen-object.js	2016-10-14 16:23:18 UTC (rev 207343)
+++ trunk/JSTests/stress/array-splice-on-frozen-object.js	2016-10-14 16:23:42 UTC (rev 207344)
@@ -1,72 +0,0 @@
-//@ runFTLNoCJIT
-
-let totalFailed = 0;
-
-function shouldEqual(testId, actual, expected) {
-    if (actual != expected) {
-        throw testId + ": ERROR: expect " + expected + ", actual " + actual;
-    }
-}
-
-function makeArray() {
-    return ['unmodifiable'];
-}
-
-function makeArrayLikeObject() {
-    var obj = {};
-    obj[0] = 'unmodifiable';
-    obj.length = 1; 
-    return obj;
-}
-
-function emptyArraySourceMaker() {
-    return [];
-}
-
-function singleElementArraySourceMaker() {
-    return ['modified_1'];
-}
-
-// Make test functions with unique codeblocks.
-function makeSpliceWithNoArgsTest(testId) {
-    return new Function("arr", "arr.splice(); return " + testId + ";");
-}
-function makeSpliceTest(testId) {
-    return new Function("arr", "arr.splice(0); return " + testId + ";");
-}
-
-let numIterations = 10000;
-
-function runTest(testId, testMaker, targetMaker, sourceMaker, expectedValue, expectedException) {
-    var test = testMaker(testId);
-    noInline(test);
-
-    for (var i = 0; i < numIterations; i++) {
-        var exception = undefined;
-
-        var obj = targetMaker();
-        obj = Object.freeze(obj);
-
-        var arr = sourceMaker();
-        arr.constructor = { [Symbol.species]: function() { return obj; } };
-
-        try {
-            test(arr);
-        } catch (e) {
-            exception = "" + e;
-            exception = exception.substr(0, 10); // Search for "TypeError:".
-        }
-        shouldEqual(testId, exception, expectedException);
-        shouldEqual(testId, obj[0], expectedValue);
-    }
-}
-
-runTest(10010, makeSpliceWithNoArgsTest, makeArray,           emptyArraySourceMaker,         "unmodifiable", "TypeError:");
-runTest(10011, makeSpliceWithNoArgsTest, makeArray,           singleElementArraySourceMaker, "unmodifiable", "TypeError:");
-runTest(10020, makeSpliceWithNoArgsTest, makeArrayLikeObject, emptyArraySourceMaker,         "unmodifiable", "TypeError:");
-runTest(10021, makeSpliceWithNoArgsTest, makeArrayLikeObject, singleElementArraySourceMaker, "unmodifiable", "TypeError:");
-
-runTest(10110, makeSpliceTest, makeArray,           emptyArraySourceMaker,         "unmodifiable", "TypeError:");
-runTest(10111, makeSpliceTest, makeArray,           singleElementArraySourceMaker, "unmodifiable", "TypeError:");
-runTest(10120, makeSpliceTest, makeArrayLikeObject, emptyArraySourceMaker,         "unmodifiable", "TypeError:");
-runTest(10121, makeSpliceTest, makeArrayLikeObject, singleElementArraySourceMaker, "unmodifiable", "TypeError:");

Modified: trunk/Source/_javascript_Core/ChangeLog (207343 => 207344)


--- trunk/Source/_javascript_Core/ChangeLog	2016-10-14 16:23:18 UTC (rev 207343)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-10-14 16:23:42 UTC (rev 207344)
@@ -1,3 +1,15 @@
+2016-10-14  Ryan Haddad  <ryanhad...@apple.com>
+
+        Unreviewed, rolling out r207322.
+
+        This change caused JSC test failures
+
+        Reverted changeset:
+
+        "Fix Array.prototype.splice ES6 compliance."
+        https://bugs.webkit.org/show_bug.cgi?id=163372
+        http://trac.webkit.org/changeset/207322
+
 2016-10-14  Mark Lam  <mark....@apple.com>
 
         JSON.parse should not modify frozen objects.

Modified: trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp (207343 => 207344)


--- trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp	2016-10-14 16:23:18 UTC (rev 207343)
+++ trunk/Source/_javascript_Core/runtime/ArrayPrototype.cpp	2016-10-14 16:23:42 UTC (rev 207344)
@@ -922,12 +922,9 @@
     }
 
     unsigned actualStart = argumentClampedIndexFromStartOrEnd(exec, 0, length);
-    RETURN_IF_EXCEPTION(scope, encodedJSValue());
 
     unsigned actualDeleteCount = length - actualStart;
-    unsigned insertCount = 0;
     if (exec->argumentCount() > 1) {
-        insertCount = exec->argumentCount() - 2;
         double deleteCount = exec->uncheckedArgument(1).toInteger(exec);
         if (deleteCount < 0)
             actualDeleteCount = 0;
@@ -937,13 +934,9 @@
             actualDeleteCount = static_cast<unsigned>(deleteCount);
     }
 
-    // FIXME: Need to implement step 8 of the spec https://tc39.github.io/ecma262/#sec-array.prototype.splice here.
-    // https://bugs.webkit.org/show_bug.cgi?id=163417
-
     std::pair<SpeciesConstructResult, JSObject*> speciesResult = speciesConstructArray(exec, thisObj, actualDeleteCount);
-    ASSERT(!scope.exception() || speciesResult.first == SpeciesConstructResult::Exception);
     if (speciesResult.first == SpeciesConstructResult::Exception)
-        return encodedJSValue();
+        return JSValue::encode(jsUndefined());
 
     JSObject* result = nullptr;
     if (speciesResult.first == SpeciesConstructResult::FastPath && isJSArray(thisObj) && length == getLength(exec, thisObj))
@@ -973,14 +966,10 @@
                     continue;
                 result->initializeIndex(vm, k, v);
             }
-            ASSERT(!scope.exception());
         }
-        setLength(exec, vm, result, actualDeleteCount);
-        RETURN_IF_EXCEPTION(scope, encodedJSValue());
     }
 
-    unsigned itemCount = insertCount;
-    ASSERT(itemCount == static_cast<unsigned>(std::max<int>(exec->argumentCount() - 2, 0)));
+    unsigned itemCount = std::max<int>(exec->argumentCount() - 2, 0);
     if (itemCount < actualDeleteCount) {
         shift<JSArray::ShiftCountForSplice>(exec, thisObj, actualStart, actualDeleteCount, itemCount, length);
         RETURN_IF_EXCEPTION(scope, encodedJSValue());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to