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

Side by Side Diff: test/mjsunit/es6/rest-params.js

Issue 1519073004: Remove always-on --harmony-rest-parameters flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 2014 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
6
7 (function testRestIndex() { 5 (function testRestIndex() {
8 assertEquals(5, (function(...args) { return args.length; })(1,2,3,4,5)); 6 assertEquals(5, (function(...args) { return args.length; })(1,2,3,4,5));
9 assertEquals(4, (function(a, ...args) { return args.length; })(1,2,3,4,5)); 7 assertEquals(4, (function(a, ...args) { return args.length; })(1,2,3,4,5));
10 assertEquals(3, (function(a, b, ...args) { return args.length; })(1,2,3,4,5)); 8 assertEquals(3, (function(a, b, ...args) { return args.length; })(1,2,3,4,5));
11 assertEquals(2, (function(a, b, c, ...args) { 9 assertEquals(2, (function(a, b, c, ...args) {
12 return args.length; })(1,2,3,4,5)); 10 return args.length; })(1,2,3,4,5));
13 assertEquals(1, (function(a, b, c, d, ...args) { 11 assertEquals(1, (function(a, b, c, d, ...args) {
14 return args.length; })(1,2,3,4,5)); 12 return args.length; })(1,2,3,4,5));
15 assertEquals(0, (function(a, b, c, d, e, ...args) { 13 assertEquals(0, (function(a, b, c, d, e, ...args) {
16 return args.length; })(1,2,3,4,5)); 14 return args.length; })(1,2,3,4,5));
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 function(){ eval("(class{foo(...rest) {'use strict';}});") }, SyntaxError); 210 function(){ eval("(class{foo(...rest) {'use strict';}});") }, SyntaxError);
213 211
214 assertThrows( 212 assertThrows(
215 function(){ eval("function(a, ...rest){'use strict';}") }, SyntaxError); 213 function(){ eval("function(a, ...rest){'use strict';}") }, SyntaxError);
216 assertThrows( 214 assertThrows(
217 function(){ eval("(a, ...rest) => {'use strict';}") }, SyntaxError); 215 function(){ eval("(a, ...rest) => {'use strict';}") }, SyntaxError);
218 assertThrows( 216 assertThrows(
219 function(){ eval("(class{foo(a, ...rest) {'use strict';}});") }, 217 function(){ eval("(class{foo(a, ...rest) {'use strict';}});") },
220 SyntaxError); 218 SyntaxError);
221 })(); 219 })();
OLDNEW
« no previous file with comments | « test/mjsunit/es6/regress/regress-513474.js ('k') | test/mjsunit/es6/rest-params-lazy-parsing.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698