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

Side by Side Diff: test/mjsunit/harmony/trailing-commas-length.js

Issue 2638513002: Enable --harmony-trailing-commas (Closed)
Patch Set: rebase Created 3 years, 10 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 | « test/mjsunit/extra-commas.js ('k') | test/mjsunit/regress/regress-2470.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 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-trailing-commas
adamk 2017/01/30 22:41:03 You can leave this flag here until it's actually r
6
7 function f1(a,) {} 5 function f1(a,) {}
8 function f2(a,b,) {} 6 function f2(a,b,) {}
9 function f3(a,b,c,) {} 7 function f3(a,b,c,) {}
10 assertEquals(1, f1.length); 8 assertEquals(1, f1.length);
11 assertEquals(2, f2.length); 9 assertEquals(2, f2.length);
12 assertEquals(3, f3.length); 10 assertEquals(3, f3.length);
13 11
14 function* g1(a,) {} 12 function* g1(a,) {}
15 function* g2(a,b,) {} 13 function* g2(a,b,) {}
16 function* g3(a,b,c,) {} 14 function* g3(a,b,c,) {}
17 assertEquals(1, g1.length); 15 assertEquals(1, g1.length);
18 assertEquals(2, g2.length); 16 assertEquals(2, g2.length);
19 assertEquals(3, g3.length); 17 assertEquals(3, g3.length);
20 18
21 assertEquals(1, (function(a,) {}).length); 19 assertEquals(1, (function(a,) {}).length);
22 assertEquals(2, (function(a,b,) {}).length); 20 assertEquals(2, (function(a,b,) {}).length);
23 assertEquals(3, (function(a,b,c,) {}).length); 21 assertEquals(3, (function(a,b,c,) {}).length);
24 22
25 assertEquals(1, (function*(a,) {}).length); 23 assertEquals(1, (function*(a,) {}).length);
26 assertEquals(2, (function*(a,b,) {}).length); 24 assertEquals(2, (function*(a,b,) {}).length);
27 assertEquals(3, (function*(a,b,c,) {}).length); 25 assertEquals(3, (function*(a,b,c,) {}).length);
28 26
29 assertEquals(1, ((a,) => {}).length); 27 assertEquals(1, ((a,) => {}).length);
30 assertEquals(2, ((a,b,) => {}).length); 28 assertEquals(2, ((a,b,) => {}).length);
31 assertEquals(3, ((a,b,c,) => {}).length); 29 assertEquals(3, ((a,b,c,) => {}).length);
OLDNEW
« no previous file with comments | « test/mjsunit/extra-commas.js ('k') | test/mjsunit/regress/regress-2470.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698