Reviewers: Vyacheslav Egorov, Description: 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). Please review this at http://codereview.chromium.org/3218010/show SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/ Affected files: M src/builtins.cc M test/mozilla/mozilla.status Index: src/builtins.cc =================================================================== --- src/builtins.cc (revision 5376) +++ src/builtins.cc (working copy) @@ -665,8 +665,9 @@ // 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: test/mozilla/mozilla.status =================================================================== --- test/mozilla/mozilla.status (revision 5376) +++ test/mozilla/mozilla.status (working copy) @@ -235,11 +235,6 @@ # 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. -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
