| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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() { | 5 (function() { |
| 6 | 6 |
| 7 'use strict'; | 7 'use strict'; |
| 8 | 8 |
| 9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
| 10 | 10 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 | 168 |
| 169 if (end < 0) { | 169 if (end < 0) { |
| 170 end += length; | 170 end += length; |
| 171 if (end < 0) end = 0; | 171 if (end < 0) end = 0; |
| 172 } else { | 172 } else { |
| 173 if (end > length) end = length; | 173 if (end > length) end = length; |
| 174 } | 174 } |
| 175 | 175 |
| 176 if ((end - i) > 0 && ObjectIsFrozen(array)) { | 176 if ((end - i) > 0 && ObjectIsFrozen(array)) { |
| 177 throw MakeTypeError("array_functions_on_frozen", | 177 throw MakeTypeError(kArrayFunctionsOnFrozen); |
| 178 ["Array.prototype.fill"]); | |
| 179 } | 178 } |
| 180 | 179 |
| 181 for (; i < end; i++) | 180 for (; i < end; i++) |
| 182 array[i] = value; | 181 array[i] = value; |
| 183 return array; | 182 return array; |
| 184 } | 183 } |
| 185 | 184 |
| 186 // ES6, draft 10-14-14, section 22.1.2.1 | 185 // ES6, draft 10-14-14, section 22.1.2.1 |
| 187 function ArrayFrom(arrayLike, mapfn, receiver) { | 186 function ArrayFrom(arrayLike, mapfn, receiver) { |
| 188 var items = ToObject(arrayLike); | 187 var items = ToObject(arrayLike); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 | 279 |
| 281 // Set up the non-enumerable functions on the Array prototype object. | 280 // Set up the non-enumerable functions on the Array prototype object. |
| 282 InstallFunctions(GlobalArray.prototype, DONT_ENUM, [ | 281 InstallFunctions(GlobalArray.prototype, DONT_ENUM, [ |
| 283 "copyWithin", ArrayCopyWithin, | 282 "copyWithin", ArrayCopyWithin, |
| 284 "find", ArrayFind, | 283 "find", ArrayFind, |
| 285 "findIndex", ArrayFindIndex, | 284 "findIndex", ArrayFindIndex, |
| 286 "fill", ArrayFill | 285 "fill", ArrayFill |
| 287 ]); | 286 ]); |
| 288 | 287 |
| 289 })(); | 288 })(); |
| OLD | NEW |