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

Unified Diff: src/string.js

Issue 4750003: Make String.prototype.split honor limit when separator is empty. (Closed)
Patch Set: Created 10 years, 1 month 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 | « src/runtime.cc ('k') | test/mjsunit/string-split.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/string.js
diff --git a/src/string.js b/src/string.js
index d82ce05237ef2def6e2050d9520098db50edeb54..a82a3545962e75c7bd0c7dd32574f7e2eba9b676 100644
--- a/src/string.js
+++ b/src/string.js
@@ -552,7 +552,7 @@ function StringSplit(separator, limit) {
var separator_length = separator.length;
// If the separator string is empty then return the elements in the subject.
- if (separator_length === 0) return %StringToArray(subject);
+ if (separator_length === 0) return %StringToArray(subject, limit);
Mads Ager (chromium) 2010/11/10 09:45:32 Accidental indentation change?
var result = %StringSplit(subject, separator, limit);
« no previous file with comments | « src/runtime.cc ('k') | test/mjsunit/string-split.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698