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

Side by Side Diff: src/array.js

Issue 5516013: Fix sputnik regression introduced in r5943. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 10 years 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 | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 function ConvertToString(x) { 162 function ConvertToString(x) {
163 if (IS_STRING(x)) return x; 163 if (IS_STRING(x)) return x;
164 if (IS_NUMBER(x)) return %_NumberToString(x); 164 if (IS_NUMBER(x)) return %_NumberToString(x);
165 if (IS_BOOLEAN(x)) return x ? 'true' : 'false'; 165 if (IS_BOOLEAN(x)) return x ? 'true' : 'false';
166 return (IS_NULL_OR_UNDEFINED(x)) ? '' : %ToString(%DefaultString(x)); 166 return (IS_NULL_OR_UNDEFINED(x)) ? '' : %ToString(%DefaultString(x));
167 } 167 }
168 168
169 169
170 function ConvertToLocaleString(e) { 170 function ConvertToLocaleString(e) {
171 // e_obj's toLocaleString might be overwritten, check if it is a function. 171 if (e == null) {
172 // Call ConvertToString if toLocaleString is not a function. 172 return '';
173 // See issue 877615. 173 } else {
174 var e_obj = ToObject(e); 174 // e_obj's toLocaleString might be overwritten, check if it is a function.
175 if (IS_FUNCTION(e_obj.toLocaleString)) 175 // Call ToString if toLocaleString is not a function.
176 return ToString(e_obj.toLocaleString()); 176 // See issue 877615.
177 else 177 var e_obj = ToObject(e);
178 return ConvertToString(e); 178 if (IS_FUNCTION(e_obj.toLocaleString))
179 return ToString(e_obj.toLocaleString());
180 else
181 return ToString(e);
182 }
179 } 183 }
180 184
181 185
182 // This function implements the optimized splice implementation that can use 186 // This function implements the optimized splice implementation that can use
183 // special array operations to handle sparse arrays in a sensible fashion. 187 // special array operations to handle sparse arrays in a sensible fashion.
184 function SmartSlice(array, start_i, del_count, len, deleted_elements) { 188 function SmartSlice(array, start_i, del_count, len, deleted_elements) {
185 // Move deleted elements to a new array (the return value from splice). 189 // Move deleted elements to a new array (the return value from splice).
186 // Intervals array can contain keys and intervals. See comment in Concat. 190 // Intervals array can contain keys and intervals. See comment in Concat.
187 var intervals = %GetArrayKeys(array, start_i + del_count); 191 var intervals = %GetArrayKeys(array, start_i + del_count);
188 var length = intervals.length; 192 var length = intervals.length;
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after
1168 "lastIndexOf", getFunction("lastIndexOf", ArrayLastIndexOf, 1), 1172 "lastIndexOf", getFunction("lastIndexOf", ArrayLastIndexOf, 1),
1169 "reduce", getFunction("reduce", ArrayReduce, 1), 1173 "reduce", getFunction("reduce", ArrayReduce, 1),
1170 "reduceRight", getFunction("reduceRight", ArrayReduceRight, 1) 1174 "reduceRight", getFunction("reduceRight", ArrayReduceRight, 1)
1171 )); 1175 ));
1172 1176
1173 %FinishArrayPrototypeSetup($Array.prototype); 1177 %FinishArrayPrototypeSetup($Array.prototype);
1174 } 1178 }
1175 1179
1176 1180
1177 SetupArray(); 1181 SetupArray();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698