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 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 func = this.join; | 354 func = this.join; |
355 if (func === ArrayJoin) { | 355 if (func === ArrayJoin) { |
356 return Join(this, this.length, ',', ConvertToString); | 356 return Join(this, this.length, ',', ConvertToString); |
357 } | 357 } |
358 array = this; | 358 array = this; |
359 } else { | 359 } else { |
360 array = ToObject(this); | 360 array = ToObject(this); |
361 func = array.join; | 361 func = array.join; |
362 } | 362 } |
363 if (!IS_SPEC_FUNCTION(func)) { | 363 if (!IS_SPEC_FUNCTION(func)) { |
364 return %_CallFunction(array, DefaultObjectToString); | 364 return %_CallFunction(array, ObjectToString); |
365 } | 365 } |
366 return %_CallFunction(array, func); | 366 return %_CallFunction(array, func); |
367 } | 367 } |
368 | 368 |
369 | 369 |
370 function ArrayToLocaleString() { | 370 function ArrayToLocaleString() { |
371 var array = ToObject(this); | 371 var array = ToObject(this); |
372 var arrayLen = array.length; | 372 var arrayLen = array.length; |
373 var len = TO_UINT32(arrayLen); | 373 var len = TO_UINT32(arrayLen); |
374 if (len === 0) return ""; | 374 if (len === 0) return ""; |
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 )); | 1581 )); |
1582 | 1582 |
1583 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( | 1583 SetUpLockedPrototype(InternalPackedArray, $Array(), $Array( |
1584 "join", getFunction("join", ArrayJoin), | 1584 "join", getFunction("join", ArrayJoin), |
1585 "pop", getFunction("pop", ArrayPop), | 1585 "pop", getFunction("pop", ArrayPop), |
1586 "push", getFunction("push", ArrayPush) | 1586 "push", getFunction("push", ArrayPush) |
1587 )); | 1587 )); |
1588 } | 1588 } |
1589 | 1589 |
1590 SetUpArray(); | 1590 SetUpArray(); |
OLD | NEW |