[X2Go-Commits] [pale-moon] 234/294: Inline Parser::checkAssignmentToCall into its sole caller.
git-admin at x2go.org
git-admin at x2go.org
Sat Apr 27 08:58:22 CEST 2019
This is an automated email from the git hooks/post-receive script.
x2go pushed a commit to branch upstream/28.5.0
in repository pale-moon.
commit 194e6155211353738bb14ffd1ca9e9662a455b0e
Author: wolfbeast <mcwerewolf at wolfbeast.com>
Date: Sat Apr 6 10:55:02 2019 +0200
Inline Parser::checkAssignmentToCall into its sole caller.
---
js/src/frontend/Parser.cpp | 19 +++++--------------
js/src/frontend/Parser.h | 2 --
2 files changed, 5 insertions(+), 16 deletions(-)
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
index 3f793ff..041c92f 100644
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -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;
diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h
index 70d3825..8bffafc 100644
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -1432,8 +1432,6 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
bool checkDestructuringObject(Node objectPattern, mozilla::Maybe<DeclarationKind> maybeDecl);
bool checkDestructuringName(Node expr, mozilla::Maybe<DeclarationKind> maybeDecl);
- bool checkAssignmentToCall(Node node, unsigned errnum);
-
Node newNumber(const Token& tok) {
return handler.newNumber(tok.number(), tok.decimalPoint(), tok.pos);
}
--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/pale-moon.git
More information about the x2go-commits
mailing list