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

Unified Diff: src/string.js

Issue 232873002: Partially fix semantics of Array.push() (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Add missing test case Created 6 years, 8 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 | « src/hydrogen.cc ('k') | test/mjsunit/array-push2.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 74230c986411247d7d8f5dfdea869a1efff5c49e..83435584f2edac3216e0717e50c704fbddc62bb5 100644
--- a/src/string.js
+++ b/src/string.js
@@ -658,7 +658,7 @@ function StringSplitOnRegExp(subject, separator, limit, length) {
var currentIndex = 0;
var startIndex = 0;
var startMatch = 0;
- var result = [];
+ var result = new InternalArray();
outer_loop:
while (true) {
@@ -703,7 +703,9 @@ function StringSplitOnRegExp(subject, separator, limit, length) {
startIndex = currentIndex = endIndex;
}
- return result;
+ var array_result = [];
+ %MoveArrayContents(result, array_result);
+ return array_result;
}
« no previous file with comments | « src/hydrogen.cc ('k') | test/mjsunit/array-push2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698