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 (function(global, utils, extrasUtils) { | 5 (function(global, utils, extrasUtils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 func = this.join; | 398 func = this.join; |
399 if (func === ArrayJoin) { | 399 if (func === ArrayJoin) { |
400 return Join(this, this.length, ',', ConvertToString); | 400 return Join(this, this.length, ',', ConvertToString); |
401 } | 401 } |
402 array = this; | 402 array = this; |
403 } else { | 403 } else { |
404 array = TO_OBJECT(this); | 404 array = TO_OBJECT(this); |
405 func = array.join; | 405 func = array.join; |
406 } | 406 } |
407 if (!IS_CALLABLE(func)) { | 407 if (!IS_CALLABLE(func)) { |
408 return %_CallFunction(array, ObjectToString); | 408 return %_Call(ObjectToString, array); |
409 } | 409 } |
410 return %_Call(func, array); | 410 return %_Call(func, array); |
411 } | 411 } |
412 | 412 |
413 | 413 |
414 function InnerArrayToLocaleString(array, length) { | 414 function InnerArrayToLocaleString(array, length) { |
415 var len = TO_LENGTH_OR_UINT32(length); | 415 var len = TO_LENGTH_OR_UINT32(length); |
416 if (len === 0) return ""; | 416 if (len === 0) return ""; |
417 return Join(array, len, ',', ConvertToLocaleString); | 417 return Join(array, len, ',', ConvertToLocaleString); |
418 } | 418 } |
(...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1950 %InstallToContext([ | 1950 %InstallToContext([ |
1951 "array_pop", ArrayPop, | 1951 "array_pop", ArrayPop, |
1952 "array_push", ArrayPush, | 1952 "array_push", ArrayPush, |
1953 "array_shift", ArrayShift, | 1953 "array_shift", ArrayShift, |
1954 "array_splice", ArraySplice, | 1954 "array_splice", ArraySplice, |
1955 "array_slice", ArraySlice, | 1955 "array_slice", ArraySlice, |
1956 "array_unshift", ArrayUnshift, | 1956 "array_unshift", ArrayUnshift, |
1957 ]); | 1957 ]); |
1958 | 1958 |
1959 }); | 1959 }); |
OLD | NEW |