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

Side by Side Diff: test/mjsunit/harmony/arrow-rest-params-lazy-parsing.js

Issue 1235153006: [es6] re-implement rest parameters via desugaring (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More/fewer removals Created 5 years, 5 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
OLDNEW
1 // Copyright 2014 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 // Flags: --harmony-rest-parameters --harmony-arrow-functions 5 // Flags: --harmony-rest-parameters --harmony-arrow-functions
6 // Flags: --min-preparse-length=0
6 7
7 (function testRestIndex() { 8 (function testRestIndex() {
8 assertEquals(5, ((...args) => args.length)(1,2,3,4,5)); 9 assertEquals(5, ((...args) => args.length)(1,2,3,4,5));
9 assertEquals(4, ((a, ...args) => args.length)(1,2,3,4,5)); 10 assertEquals(4, ((a, ...args) => args.length)(1,2,3,4,5));
10 assertEquals(3, ((a, b, ...args) => args.length)(1,2,3,4,5)); 11 assertEquals(3, ((a, b, ...args) => args.length)(1,2,3,4,5));
11 assertEquals(2, ((a, b, c, ...args) => args.length)(1,2,3,4,5)); 12 assertEquals(2, ((a, b, c, ...args) => args.length)(1,2,3,4,5));
12 assertEquals(1, ((a, b, c, d, ...args) => args.length)(1,2,3,4,5)); 13 assertEquals(1, ((a, b, c, d, ...args) => args.length)(1,2,3,4,5));
13 assertEquals(0, ((a, b, c, d, e, ...args) => args.length)(1,2,3,4,5)); 14 assertEquals(0, ((a, b, c, d, e, ...args) => args.length)(1,2,3,4,5));
14 })(); 15 })();
15 16
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 })(); 134 })();
134 135
135 136
136 (function testUnmappedArguments() { 137 (function testUnmappedArguments() {
137 // Normal functions make their arguments object unmapped, but arrow 138 // Normal functions make their arguments object unmapped, but arrow
138 // functions don't have an arguments object anyway. Check that the 139 // functions don't have an arguments object anyway. Check that the
139 // right thing happens for arguments in arrow functions with rest 140 // right thing happens for arguments in arrow functions with rest
140 // parameters. 141 // parameters.
141 assertSame(arguments, ((...rest) => arguments)()); 142 assertSame(arguments, ((...rest) => arguments)());
142 })(); 143 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698