Bug 1094616 - |const| destructuring assignments should shadow |arguments|. (r=shu, a=kwierso)

This commit is contained in:
Eric Faust 2014-11-06 16:19:13 -08:00
parent 307ac4cb7f
commit 418ce627d9
2 changed files with 5 additions and 1 deletions

View File

@ -899,7 +899,8 @@ Parser<FullParseHandler>::checkFunctionArguments()
// ES6 9.2.13.17 says that a lexical binding of 'arguments' shadows the
// arguments object.
bool argumentsHasLocalBinding = maybeArgDef && (maybeArgDef->kind() != Definition::ARG &&
maybeArgDef->kind() != Definition::LET);
maybeArgDef->kind() != Definition::LET &&
maybeArgDef->kind() != Definition::CONST);
bool hasRest = pc->sc->asFunctionBox()->function()->hasRest();
if (hasRest && argumentsHasLocalBinding) {
report(ParseError, false, nullptr, JSMSG_ARGUMENTS_AND_REST);

View File

@ -0,0 +1,3 @@
// |jit-test| error: TypeError
(function () { const [arguments] = 0; })();