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
// 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;
# 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.