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

Side by Side Diff: src/array.js

Issue 8503016: Merge r9917 into 3.5 branch. This fixes issue 103259. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.5
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 // remaining elements are also likely to be numbers. 165 // remaining elements are also likely to be numbers.
166 if (!IS_NUMBER(array[0])) { 166 if (!IS_NUMBER(array[0])) {
167 for (var i = 0; i < length; i++) { 167 for (var i = 0; i < length; i++) {
168 var e = array[i]; 168 var e = array[i];
169 if (!IS_STRING(e)) e = convert(e); 169 if (!IS_STRING(e)) e = convert(e);
170 elements[i] = e; 170 elements[i] = e;
171 } 171 }
172 } else { 172 } else {
173 for (var i = 0; i < length; i++) { 173 for (var i = 0; i < length; i++) {
174 var e = array[i]; 174 var e = array[i];
175 if (IS_NUMBER(e)) { 175 if (IS_NUMBER(e)) {
176 e = %_NumberToString(e); 176 e = %_NumberToString(e);
177 } else if (!IS_STRING(e)) { 177 } else if (!IS_STRING(e)) {
178 e = convert(e); 178 e = convert(e);
179 } 179 }
180 elements[i] = e; 180 elements[i] = e;
181 } 181 }
182 } 182 }
183 var result = %_FastAsciiArrayJoin(elements, separator); 183 var result = %_FastAsciiArrayJoin(elements, separator);
184 if (!IS_UNDEFINED(result)) return result; 184 if (!IS_UNDEFINED(result)) return result;
185 185
186 return %StringBuilderJoin(elements, length, separator); 186 return %StringBuilderJoin(elements, length, separator);
187 } finally { 187 } finally {
188 // Make sure to remove the last element of the visited array no 188 // Make sure to remove the last element of the visited array no
189 // matter what happens. 189 // matter what happens.
190 if (is_array) visited_arrays.length = visited_arrays.length - 1; 190 if (is_array) visited_arrays.length = visited_arrays.length - 1;
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 InternalArray.prototype.join = getFunction("join", ArrayJoin); 1377 InternalArray.prototype.join = getFunction("join", ArrayJoin);
1378 InternalArray.prototype.pop = getFunction("pop", ArrayPop); 1378 InternalArray.prototype.pop = getFunction("pop", ArrayPop);
1379 InternalArray.prototype.push = getFunction("push", ArrayPush); 1379 InternalArray.prototype.push = getFunction("push", ArrayPush);
1380 InternalArray.prototype.toString = function() { 1380 InternalArray.prototype.toString = function() {
1381 return "Internal Array, length " + this.length; 1381 return "Internal Array, length " + this.length;
1382 }; 1382 };
1383 } 1383 }
1384 1384
1385 1385
1386 SetupArray(); 1386 SetupArray();
OLDNEW
« no previous file with comments | « no previous file | src/runtime.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698