From: antonm@chromium.org Date: Wed, 2 Feb 2011 14:17:47 +0000 (+0000) Subject: Follow up to r6540: remove early return from C++ builtin as well. X-Git-Tag: upstream/4.7.83~20364 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=be1f20f8280ce79d8cfa10d8a5c3f06bdff97cea;p=platform%2Fupstream%2Fv8.git Follow up to r6540: remove early return from C++ builtin as well. Review URL: http://codereview.chromium.org/6347037 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6580 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/builtins.cc b/src/builtins.cc index 759ef1d..d604226 100644 --- a/src/builtins.cc +++ b/src/builtins.cc @@ -734,17 +734,14 @@ BUILTIN(ArraySplice) { int n_arguments = args.length() - 1; - // Return empty array when no arguments are supplied. - if (n_arguments == 0) { - return AllocateEmptyJSArray(); - } - int relative_start = 0; - Object* arg1 = args[1]; - if (arg1->IsSmi()) { - relative_start = Smi::cast(arg1)->value(); - } else if (!arg1->IsUndefined()) { - return CallJsBuiltin("ArraySplice", args); + if (n_arguments > 0) { + Object* arg1 = args[1]; + if (arg1->IsSmi()) { + relative_start = Smi::cast(arg1)->value(); + } else if (!arg1->IsUndefined()) { + return CallJsBuiltin("ArraySplice", args); + } } int actual_start = (relative_start < 0) ? Max(len + relative_start, 0) : Min(relative_start, len);