Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: src/harmony-spread.js

Issue 1398733002: Move builtin JavaScript sources into own directory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Also move macros.py file. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/harmony-simd.js ('k') | src/harmony-tostring.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 (function(global, utils) {
6
7 'use strict';
8
9 // -------------------------------------------------------------------
10 // Imports
11 var InternalArray = utils.InternalArray;
12
13 // -------------------------------------------------------------------
14
15 function SpreadArguments() {
16 var count = %_ArgumentsLength();
17 var args = new InternalArray();
18
19 for (var i = 0; i < count; ++i) {
20 var array = %_Arguments(i);
21 var length = array.length;
22 for (var j = 0; j < length; ++j) {
23 args.push(array[j]);
24 }
25 }
26
27 return args;
28 }
29
30
31 function SpreadIterable(collection) {
32 if (IS_NULL_OR_UNDEFINED(collection)) {
33 throw MakeTypeError(kNotIterable, collection);
34 }
35
36 var args = new InternalArray();
37 for (var value of collection) {
38 args.push(value);
39 }
40 return args;
41 }
42
43 // ----------------------------------------------------------------------------
44 // Exports
45
46 %InstallToContext([
47 "spread_arguments", SpreadArguments,
48 "spread_iterable", SpreadIterable,
49 ]);
50
51 })
OLDNEW
« no previous file with comments | « src/harmony-simd.js ('k') | src/harmony-tostring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698