OLD | NEW |
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 if (IS_NUMBER(x)) return %_NumberToString(x); | 197 if (IS_NUMBER(x)) return %_NumberToString(x); |
198 if (IS_BOOLEAN(x)) return x ? 'true' : 'false'; | 198 if (IS_BOOLEAN(x)) return x ? 'true' : 'false'; |
199 return (IS_NULL_OR_UNDEFINED(x)) ? '' : %ToString(%DefaultString(x)); | 199 return (IS_NULL_OR_UNDEFINED(x)) ? '' : %ToString(%DefaultString(x)); |
200 } | 200 } |
201 | 201 |
202 | 202 |
203 function ConvertToLocaleString(e) { | 203 function ConvertToLocaleString(e) { |
204 if (IS_NULL_OR_UNDEFINED(e)) { | 204 if (IS_NULL_OR_UNDEFINED(e)) { |
205 return ''; | 205 return ''; |
206 } else { | 206 } else { |
207 // According to ES5, seciton 15.4.4.3, the toLocaleString conversion | 207 // According to ES5, section 15.4.4.3, the toLocaleString conversion |
208 // must throw a TypeError if ToObject(e).toLocaleString isn't | 208 // must throw a TypeError if ToObject(e).toLocaleString isn't |
209 // callable. | 209 // callable. |
210 var e_obj = ToObject(e); | 210 var e_obj = ToObject(e); |
211 return %ToString(e_obj.toLocaleString()); | 211 return %ToString(e_obj.toLocaleString()); |
212 } | 212 } |
213 } | 213 } |
214 | 214 |
215 | 215 |
216 // This function implements the optimized splice implementation that can use | 216 // This function implements the optimized splice implementation that can use |
217 // special array operations to handle sparse arrays in a sensible fashion. | 217 // special array operations to handle sparse arrays in a sensible fashion. |
(...skipping 1200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 // exposed to user code. | 1418 // exposed to user code. |
1419 // Adding only the functions that are actually used. | 1419 // Adding only the functions that are actually used. |
1420 SetUpLockedPrototype(InternalArray, $Array(), $Array( | 1420 SetUpLockedPrototype(InternalArray, $Array(), $Array( |
1421 "join", getFunction("join", ArrayJoin), | 1421 "join", getFunction("join", ArrayJoin), |
1422 "pop", getFunction("pop", ArrayPop), | 1422 "pop", getFunction("pop", ArrayPop), |
1423 "push", getFunction("push", ArrayPush) | 1423 "push", getFunction("push", ArrayPush) |
1424 )); | 1424 )); |
1425 } | 1425 } |
1426 | 1426 |
1427 SetUpArray(); | 1427 SetUpArray(); |
OLD | NEW |