OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 var $spreadArguments; | |
6 var $spreadIterable; | |
7 | |
8 (function(global, utils) { | 5 (function(global, utils) { |
9 | 6 |
10 'use strict'; | 7 'use strict'; |
11 | 8 |
12 // ------------------------------------------------------------------- | 9 // ------------------------------------------------------------------- |
13 // Imports | 10 // Imports |
14 var InternalArray = utils.InternalArray; | 11 var InternalArray = utils.InternalArray; |
15 | 12 |
16 // ------------------------------------------------------------------- | 13 // ------------------------------------------------------------------- |
17 | 14 |
(...skipping 18 matching lines...) Expand all Loading... |
36 throw MakeTypeError(kNotIterable, collection); | 33 throw MakeTypeError(kNotIterable, collection); |
37 } | 34 } |
38 | 35 |
39 var args = new InternalArray(); | 36 var args = new InternalArray(); |
40 for (var value of collection) { | 37 for (var value of collection) { |
41 args.push(value); | 38 args.push(value); |
42 } | 39 } |
43 return args; | 40 return args; |
44 } | 41 } |
45 | 42 |
46 $spreadArguments = SpreadArguments; | 43 // ---------------------------------------------------------------------------- |
47 $spreadIterable = SpreadIterable; | 44 // Exports |
| 45 |
| 46 %InstallToContext([ |
| 47 "spread_arguments", SpreadArguments, |
| 48 "spread_iterable", SpreadIterable, |
| 49 ]); |
48 | 50 |
49 }) | 51 }) |
OLD | NEW |