mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-02 22:08:40 +09:00
Inline Parser::checkAssignmentToCall into its sole caller.
This commit is contained in:
parent
de1ec588d2
commit
598c71feb0
2 changed files with 5 additions and 16 deletions
|
|
@ -4084,19 +4084,6 @@ Parser<ParseHandler>::PossibleError::transferErrorsTo(PossibleError* other)
|
|||
transferErrorTo(ErrorKind::Expression, other);
|
||||
}
|
||||
|
||||
template <typename ParseHandler>
|
||||
bool
|
||||
Parser<ParseHandler>::checkAssignmentToCall(Node target, unsigned msg)
|
||||
{
|
||||
MOZ_ASSERT(handler.isFunctionCall(target));
|
||||
|
||||
// Assignment to function calls is forbidden in ES6. We're still somewhat
|
||||
// concerned about sites using this in dead code, so forbid it only in
|
||||
// strict mode code (or if the werror option has been set), and otherwise
|
||||
// warn.
|
||||
return reportWithNode(ParseStrictError, pc->sc()->strict(), target, msg);
|
||||
}
|
||||
|
||||
template <>
|
||||
bool
|
||||
Parser<FullParseHandler>::checkDestructuringName(ParseNode* expr, Maybe<DeclarationKind> maybeDecl)
|
||||
|
|
@ -7862,7 +7849,11 @@ Parser<ParseHandler>::checkAndMarkAsIncOperand(Node target, AssignmentFlavor fla
|
|||
if (!reportIfArgumentsEvalTarget(target))
|
||||
return false;
|
||||
} else if (handler.isFunctionCall(target)) {
|
||||
if (!checkAssignmentToCall(target, JSMSG_BAD_INCOP_OPERAND))
|
||||
// Assignment to function calls is forbidden in ES6. We're still
|
||||
// somewhat concerned about sites using this in dead code, so forbid it
|
||||
// only in strict mode code (or if the werror option has been set), and
|
||||
// otherwise warn.
|
||||
if (!reportWithNode(ParseStrictError, pc->sc()->strict(), target, JSMSG_BAD_INCOP_OPERAND))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue