From: ricow@chromium.org Date: Tue, 31 Aug 2010 10:39:12 +0000 (+0000) Subject: Simplify Array.splice by simply returning the result of AllocateEmptyJSArray. X-Git-Tag: upstream/4.7.83~21262 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd5224589001449aabc1367a523e2aa1f7ec749e;p=platform%2Fupstream%2Fv8.git Simplify Array.splice by simply returning the result of AllocateEmptyJSArray. Review URL: http://codereview.chromium.org/3216014 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5382 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/builtins.cc b/src/builtins.cc index 489026b..b4f4a06 100644 --- a/src/builtins.cc +++ b/src/builtins.cc @@ -665,9 +665,7 @@ BUILTIN(ArraySplice) { // Return empty array when no arguments are supplied. if (n_arguments == 0) { - Object* result = AllocateEmptyJSArray(); - if (result->IsFailure()) return result; - return JSArray::cast(result); + return AllocateEmptyJSArray(); } int relative_start = 0;