Commit be1f20f8 authored by antonm@chromium.org's avatar antonm@chromium.org

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
parent 0097f005
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment