Revision: 6580 Author: [email protected] Date: Wed Feb 2 06:17:47 2011 Log: Follow up to r6540: remove early return from C++ builtin as well.
Review URL: http://codereview.chromium.org/6347037 http://code.google.com/p/v8/source/detail?r=6580 Modified: /branches/bleeding_edge/src/builtins.cc ======================================= --- /branches/bleeding_edge/src/builtins.cc Mon Jan 31 06:54:53 2011 +++ /branches/bleeding_edge/src/builtins.cc Wed Feb 2 06:17:47 2011 @@ -733,18 +733,15 @@ int len = Smi::cast(array->length())->value(); 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); -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
