| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 // This files contains runtime support implemented in JavaScript. | 5 // This files contains runtime support implemented in JavaScript. |
| 6 | 6 |
| 7 // CAUTION: Some of the functions specified in this file are called | 7 // CAUTION: Some of the functions specified in this file are called |
| 8 // directly from compiled code. These are the functions with names in | 8 // directly from compiled code. These are the functions with names in |
| 9 // ALL CAPS. The compiled code passes the first argument in 'this'. | 9 // ALL CAPS. The compiled code passes the first argument in 'this'. |
| 10 | 10 |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 function AddIndexedProperty(obj, index, value) { | 212 function AddIndexedProperty(obj, index, value) { |
| 213 if (index === TO_UINT32(index) && index !== kMaxUint32) { | 213 if (index === TO_UINT32(index) && index !== kMaxUint32) { |
| 214 %AddElement(obj, index, value); | 214 %AddElement(obj, index, value); |
| 215 } else { | 215 } else { |
| 216 %AddNamedProperty(obj, TO_STRING(index), value, NONE); | 216 %AddNamedProperty(obj, TO_STRING(index), value, NONE); |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 %SetForceInlineFlag(AddIndexedProperty); | 219 %SetForceInlineFlag(AddIndexedProperty); |
| 220 | 220 |
| 221 | 221 |
| 222 // ES6, draft 10-14-14, section 22.1.3.1.1 | |
| 223 function IsConcatSpreadable(O) { | |
| 224 if (!IS_SPEC_OBJECT(O)) return false; | |
| 225 var spreadable = O[isConcatSpreadableSymbol]; | |
| 226 if (IS_UNDEFINED(spreadable)) return IS_ARRAY(O); | |
| 227 return TO_BOOLEAN(spreadable); | |
| 228 } | |
| 229 | |
| 230 | |
| 231 function ToPositiveInteger(x, rangeErrorIndex) { | 222 function ToPositiveInteger(x, rangeErrorIndex) { |
| 232 var i = TO_INTEGER_MAP_MINUS_ZERO(x); | 223 var i = TO_INTEGER_MAP_MINUS_ZERO(x); |
| 233 if (i < 0) throw MakeRangeError(rangeErrorIndex); | 224 if (i < 0) throw MakeRangeError(rangeErrorIndex); |
| 234 return i; | 225 return i; |
| 235 } | 226 } |
| 236 | 227 |
| 237 | 228 |
| 238 function MaxSimple(a, b) { | 229 function MaxSimple(a, b) { |
| 239 return a > b ? a : b; | 230 return a > b ? a : b; |
| 240 } | 231 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 "concat_iterable_to_array_builtin", CONCAT_ITERABLE_TO_ARRAY, | 265 "concat_iterable_to_array_builtin", CONCAT_ITERABLE_TO_ARRAY, |
| 275 "reflect_apply_prepare_builtin", REFLECT_APPLY_PREPARE, | 266 "reflect_apply_prepare_builtin", REFLECT_APPLY_PREPARE, |
| 276 "reflect_construct_prepare_builtin", REFLECT_CONSTRUCT_PREPARE, | 267 "reflect_construct_prepare_builtin", REFLECT_CONSTRUCT_PREPARE, |
| 277 ]); | 268 ]); |
| 278 | 269 |
| 279 %InstallToContext([ | 270 %InstallToContext([ |
| 280 "concat_iterable_to_array", ConcatIterableToArray, | 271 "concat_iterable_to_array", ConcatIterableToArray, |
| 281 ]); | 272 ]); |
| 282 | 273 |
| 283 }) | 274 }) |
| OLD | NEW |