OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 "use strict"; | 5 "use strict"; |
6 | 6 |
7 // This file relies on the fact that the following declarations have been made | 7 // This file relies on the fact that the following declarations have been made |
8 // in runtime.js: | 8 // in runtime.js: |
9 // var $Array = global.Array; | 9 // var $Array = global.Array; |
10 | 10 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 func = this.join; | 342 func = this.join; |
343 if (func === ArrayJoin) { | 343 if (func === ArrayJoin) { |
344 return Join(this, this.length, ',', ConvertToString); | 344 return Join(this, this.length, ',', ConvertToString); |
345 } | 345 } |
346 array = this; | 346 array = this; |
347 } else { | 347 } else { |
348 array = ToObject(this); | 348 array = ToObject(this); |
349 func = array.join; | 349 func = array.join; |
350 } | 350 } |
351 if (!IS_SPEC_FUNCTION(func)) { | 351 if (!IS_SPEC_FUNCTION(func)) { |
352 return %_CallFunction(array, ObjectToString); | 352 return %_CallFunction(array, NoSideEffectsObjectToString); |
353 } | 353 } |
354 return %_CallFunction(array, func); | 354 return %_CallFunction(array, func); |
355 } | 355 } |
356 | 356 |
357 | 357 |
358 function ArrayToLocaleString() { | 358 function ArrayToLocaleString() { |
359 var array = ToObject(this); | 359 var array = ToObject(this); |
360 var arrayLen = array.length; | 360 var arrayLen = array.length; |
361 var len = TO_UINT32(arrayLen); | 361 var len = TO_UINT32(arrayLen); |
362 if (len === 0) return ""; | 362 if (len === 0) return ""; |
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 )); | 1564 )); |
1565 | 1565 |
1566 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( | 1566 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( |
1567 "join", getFunction("join", ArrayJoin), | 1567 "join", getFunction("join", ArrayJoin), |
1568 "pop", getFunction("pop", ArrayPop), | 1568 "pop", getFunction("pop", ArrayPop), |
1569 "push", getFunction("push", ArrayPush) | 1569 "push", getFunction("push", ArrayPush) |
1570 )); | 1570 )); |
1571 } | 1571 } |
1572 | 1572 |
1573 SetUpArray(); | 1573 SetUpArray(); |
OLD | NEW |