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

Unified Diff: src/string.js

Issue 669060: Add runtime function for string to array conversion. (Closed)
Patch Set: Created 10 years, 10 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
« src/runtime.cc ('K') | « src/runtime.cc ('k') | no next file » | 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 531c6a9b949bbb4c897c761926fcd9164cbbb024..067578c1414d0e422e17b19354f9ae1497b69304 100644
--- a/src/string.js
+++ b/src/string.js
@@ -530,11 +530,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) {
- var result = $Array(length);
- for (var i = 0; i < length; i++) result[i] = subject[i];
- return result;
- }
+ if (separator_length === 0) return %StringToArray(subject);
var result = [];
var start_index = 0;
« src/runtime.cc ('K') | « src/runtime.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698