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

Unified Diff: src/array.js

Issue 6357025: ArraySplice builtin should return empty array and not alter receiver if invoked with no arguments. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Earlier return 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 | test/mjsunit/array-splice.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/array.js
diff --git a/src/array.js b/src/array.js
index 0d7a7cbc85e1f89a490d229fa759d047b3966fa6..86738ff33f3e69386c38c9b2aabd163d63f48904 100644
--- a/src/array.js
+++ b/src/array.js
@@ -592,6 +592,8 @@ function ArraySlice(start, end) {
function ArraySplice(start, delete_count) {
var num_arguments = %_ArgumentsLength();
+ if (num_arguments == 0) return [];
+
var len = TO_UINT32(this.length);
var start_i = TO_INTEGER(start);
« no previous file with comments | « no previous file | test/mjsunit/array-splice.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698