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

Side by Side Diff: test/mjsunit/harmony/default-parameters.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
« no previous file with comments | « test/mjsunit/harmony/block-sloppy-function.js ('k') | test/mjsunit/harmony/destructuring.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 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 // Flags: --harmony-default-parameters --harmony-rest-parameters 5 // Flags: --harmony-default-parameters
6 6
7 7
8 (function TestDefaults() { 8 (function TestDefaults() {
9 function f1(x = 1) { return x } 9 function f1(x = 1) { return x }
10 assertEquals(1, f1()); 10 assertEquals(1, f1());
11 assertEquals(1, f1(undefined)); 11 assertEquals(1, f1(undefined));
12 assertEquals(2, f1(2)); 12 assertEquals(2, f1(2));
13 assertEquals(null, f1(null)); 13 assertEquals(null, f1(null));
14 14
15 function f2(x, y = x) { return x + y; } 15 function f2(x, y = x) { return x + y; }
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 assertThrows(function(){ eval("(x=1) => {'use strict';}") }, SyntaxError); 356 assertThrows(function(){ eval("(x=1) => {'use strict';}") }, SyntaxError);
357 assertThrows( 357 assertThrows(
358 function(){ eval("(class{foo(x=1) {'use strict';}});") }, SyntaxError); 358 function(){ eval("(class{foo(x=1) {'use strict';}});") }, SyntaxError);
359 359
360 assertThrows( 360 assertThrows(
361 function(){ eval("function(a, x=1){'use strict';}") }, SyntaxError); 361 function(){ eval("function(a, x=1){'use strict';}") }, SyntaxError);
362 assertThrows(function(){ eval("(a, x=1) => {'use strict';}") }, SyntaxError); 362 assertThrows(function(){ eval("(a, x=1) => {'use strict';}") }, SyntaxError);
363 assertThrows( 363 assertThrows(
364 function(){ eval("(class{foo(a, x=1) {'use strict';}});") }, SyntaxError); 364 function(){ eval("(class{foo(a, x=1) {'use strict';}});") }, SyntaxError);
365 })(); 365 })();
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/block-sloppy-function.js ('k') | test/mjsunit/harmony/destructuring.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698