From f19d6133f298f704ece8ec4ff9e41e2f09a333a5 Mon Sep 17 00:00:00 2001 From: "ricow@chromium.org" Date: Tue, 31 Aug 2010 07:31:25 +0000 Subject: [PATCH] Fix mozilla and debug check failures. 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 | 5 +++-- test/mozilla/mozilla.status | 5 ----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/builtins.cc b/src/builtins.cc index a2ff909..518ecdf 100644 --- a/src/builtins.cc +++ b/src/builtins.cc @@ -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; diff --git a/test/mozilla/mozilla.status b/test/mozilla/mozilla.status index 28fc063..1768c39 100644 --- a/test/mozilla/mozilla.status +++ b/test/mozilla/mozilla.status @@ -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. -- 2.7.4