Fix mozilla and debug check failures.
authorricow@chromium.org <ricow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 31 Aug 2010 07:31:25 +0000 (07:31 +0000)
committerricow@chromium.org <ricow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Tue, 31 Aug 2010 07:31:25 +0000 (07:31 +0000)
This removes the expected failure of a mozilla test that we now pass
(an empty array is returned if Array.splice is called with no
arguments) and fixes debug check failure by allocating a new empty
array using AllocateEmptyArray if splice is called with zero arguments
(makes sure we can always create a handle).

Review URL: http://codereview.chromium.org/3218010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5377 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/builtins.cc
test/mozilla/mozilla.status

index a2ff909..518ecdf 100644 (file)
@@ -665,8 +665,9 @@ BUILTIN(ArraySplice) {
 
   // Return empty array when no arguments are supplied.
   if (n_arguments == 0) {
-    // No handle scope needed since we return directly.
-    return *Factory::NewJSArray(0);
+    Object* result = AllocateEmptyJSArray();
+    if (result->IsFailure()) return result;
+    return JSArray::cast(result);
   }
 
   int relative_start = 0;
index 28fc063..1768c39 100644 (file)
@@ -235,11 +235,6 @@ ecma_3/Number/15.7.4.7-1: FAIL_OK
 # toExponential argument restricted to range 0..20 in JSC/V8
 ecma_3/Number/15.7.4.6-1: FAIL_OK
 
-# Array.prototype.slice with zero arguments return undefined in JSC/V8, 
-# empty array in Spider/TraceMonkey.
-js1_5/Array/regress-451483: FAIL_OK
-
-
 #:=== RegExp:=== 
 # To be compatible with JSC we silently ignore flags that do not make
 # sense.  These tests expects us to throw exceptions.