Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Unified Diff: src/builtins.cc

Issue 6347037: Follow up to r6540: remove early return from C++ builtin as well. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins.cc
diff --git a/src/builtins.cc b/src/builtins.cc
index 759ef1d5ade48f8c1539731c56787db9cb90760a..d604226d752dc21ffb3a8d5eb597ce3515abe504 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698