You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/es6/default.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ var tests = [
24
24
assert.throws(function(){eval("function f(a, b, a, c = 10) { }");},SyntaxError,"Duplicate parameters are not allowed before the default argument","Duplicate formal parameter names not allowed in this context");
25
25
assert.throws(function(){eval("function f(a, b = 10, a) { }");},SyntaxError,"Duplicate parameters are not allolwed after the default argument","Duplicate formal parameter names not allowed in this context");
26
26
assert.throws(function(){eval("function f(a, b, a, c) { \"use strict\"; }");},SyntaxError,"When function is in strict mode duplicate parameters are not allowed for simple parameter list","Duplicate formal parameter names not allowed in strict mode");
27
-
assert.throws(function(){eval("function f(a, b = 1) { \"use strict\"; }");},SyntaxError,"Strict mode cannot be applied to functions with default parameters","Cannot apply strict mode on functions with non-simple parameter list");
27
+
assert.throws(function(){eval("function f(a, b = 1) { \"use strict\"; }");},SyntaxError,"Strict mode cannot be applied to functions with default parameters","Illegal 'use strict' directive in function with non-simple parameter list");
28
28
assert.throws(function(){eval("function f() { \"use strict\"; function g(a, b, a) { } }");},SyntaxError,"When a function is already in strict mode duplicate parameters are not allowed for simple parameter list","Duplicate formal parameter names not allowed in strict mode");
29
29
assert.throws(function(){eval("function f() { \"use strict\"; function g(a, b, a = 10) { } }");},SyntaxError,"When a function is already in strict mode duplicate parameters are not allowed for formal parameter list","Duplicate formal parameter names not allowed in strict mode");
Copy file name to clipboardExpand all lines: test/es6/rest.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -14,8 +14,8 @@ var tests = [
14
14
assert.throws(function(){eval("var obj = class { method(a, b = 1, ...c = [2,3]) {} };")},SyntaxError,"Rest parameter cannot have a default value");
15
15
assert.throws(function(){eval("function f(c, a, ...a) { }")},SyntaxError,"Duplicate parameters are not allowed for non-simple parameter list with only rest","Duplicate formal parameter names not allowed in this context");
16
16
assert.throws(function(){eval("function f(c = 10, a, ...a) { }")},SyntaxError,"Duplicate parameters are not allowed for non-simple parameter list with both rest and default","Duplicate formal parameter names not allowed in this context");
17
-
assert.throws(function(){eval("function f(...a) { 'use strict'; }");},SyntaxError,"Strict mode cannot be applied to functions with rest parameter","Cannot apply strict mode on functions with non-simple parameter list");
18
-
assert.throws(function(){eval("function f(a, ...b) { 'use strict'; }");},SyntaxError,"Strict mode cannot be applied to functions with rest parameter","Cannot apply strict mode on functions with non-simple parameter list");
17
+
assert.throws(function(){eval("function f(...a) { 'use strict'; }");},SyntaxError,"Strict mode cannot be applied to functions with rest parameter","Illegal 'use strict' directive in function with non-simple parameter list");
18
+
assert.throws(function(){eval("function f(a, ...b) { 'use strict'; }");},SyntaxError,"Strict mode cannot be applied to functions with rest parameter","Illegal 'use strict' directive in function with non-simple parameter list");
19
19
assert.throws(function(){eval("function f() { \"use strict\"; function g(a, b, c, ...a) { } }")},SyntaxError,"Cannot have duplicate parameters for a function with non-simple parameter list, which is already in strict mode","Duplicate formal parameter names not allowed in strict mode");
20
20
assert.throws(function(){eval("function f() { \"use strict\"; function g(a, b, a, ...c) { } }")},SyntaxError,"Cannot have duplicate parameters for a function with non-simple parameter list with rest, which is already in strict mode","Duplicate formal parameter names not allowed in strict mode");
0 commit comments