Bug 1275240 - Fix the type of parameter redeclaration from TypeError to SyntaxError. r=shu

This commit is contained in:
Tooru Fujisawa 2016-05-26 01:26:35 +09:00
Родитель 200bc0e463
Коммит 763f8a6b4d
2 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -296,7 +296,7 @@ MSG_DEF(JSMSG_PAREN_IN_PAREN, 0, JSEXN_SYNTAXERR, "missing ) in parenth
MSG_DEF(JSMSG_RC_AFTER_EXPORT_SPEC_LIST, 0, JSEXN_SYNTAXERR, "missing '}' after export specifier list")
MSG_DEF(JSMSG_RC_AFTER_IMPORT_SPEC_LIST, 0, JSEXN_SYNTAXERR, "missing '}' after module specifier list")
MSG_DEF(JSMSG_REDECLARED_CATCH_IDENTIFIER, 1, JSEXN_SYNTAXERR, "redeclaration of identifier '{0}' in catch")
MSG_DEF(JSMSG_REDECLARED_PARAM, 1, JSEXN_TYPEERR, "redeclaration of formal parameter {0}")
MSG_DEF(JSMSG_REDECLARED_PARAM, 1, JSEXN_SYNTAXERR, "redeclaration of formal parameter {0}")
MSG_DEF(JSMSG_RESERVED_ID, 1, JSEXN_SYNTAXERR, "{0} is a reserved identifier")
MSG_DEF(JSMSG_REST_WITH_DEFAULT, 0, JSEXN_SYNTAXERR, "rest parameter may not have a default")
MSG_DEF(JSMSG_SELFHOSTED_TOP_LEVEL_LEXICAL, 1, JSEXN_SYNTAXERR, "self-hosted code cannot contain top-level {0} declarations")

Просмотреть файл

@ -22,7 +22,7 @@ function test()
// ------- Comment #92 From Jesse Ruderman
expect = 'TypeError: redeclaration of formal parameter e';
expect = 'SyntaxError: redeclaration of formal parameter e';
try
{
eval('(function (e) { var e; const e = undefined; });');
@ -31,8 +31,8 @@ function test()
{
actual = ex + '';
}
// Without patch: "TypeError: redeclaration of var e"
// expected new behavior // With patch: "TypeError: redeclaration of formal parameter e:"
// Without patch: "SyntaxError: redeclaration of var e"
// expected new behavior // With patch: "SyntaxError: redeclaration of formal parameter e:"
reportCompare(expect, actual, summary);