[X2Go-Commits] [pale-moon] 216/294: Specify an explicit offset when warning about "use asm" found in the directive prologue of a script (rather than a function body).
git-admin at x2go.org
git-admin at x2go.org
Sat Apr 27 08:58:18 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 1ee96e39db760004c33a235ea691ab06bac21375
Author: wolfbeast <mcwerewolf at wolfbeast.com>
Date: Fri Apr 5 21:30:52 2019 +0200
Specify an explicit offset when warning about "use asm" found in the
directive prologue of a script (rather than a function body).
---
js/src/frontend/FullParseHandler.h | 2 +-
js/src/frontend/Parser.cpp | 9 +++++----
js/src/frontend/SyntaxParseHandler.h | 2 +-
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/js/src/frontend/FullParseHandler.h b/js/src/frontend/FullParseHandler.h
index 0fd1377..da068e5 100644
--- a/js/src/frontend/FullParseHandler.h
+++ b/js/src/frontend/FullParseHandler.h
@@ -845,7 +845,7 @@ class FullParseHandler
MOZ_MUST_USE ParseNode* setLikelyIIFE(ParseNode* pn) {
return parenthesize(pn);
}
- void setPrologue(ParseNode* pn) {
+ void setInDirectivePrologue(ParseNode* pn) {
pn->pn_prologue = true;
}
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
index 8ad8813..afbf4c4 100644
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -3811,10 +3811,10 @@ Parser<FullParseHandler>::asmJS(Node list)
*/
template <typename ParseHandler>
bool
-Parser<ParseHandler>::maybeParseDirective(Node list, Node pn, bool* cont)
+Parser<ParseHandler>::maybeParseDirective(Node list, Node possibleDirective, bool* cont)
{
TokenPos directivePos;
- JSAtom* directive = handler.isStringExprStatement(pn, &directivePos);
+ JSAtom* directive = handler.isStringExprStatement(possibleDirective, &directivePos);
*cont = !!directive;
if (!*cont)
@@ -3831,7 +3831,7 @@ Parser<ParseHandler>::maybeParseDirective(Node list, Node pn, bool* cont)
// directive in the future. We don't want to interfere with people
// taking advantage of directive-prologue-enabled features that appear
// in other browsers first.
- handler.setPrologue(pn);
+ handler.setInDirectivePrologue(possibleDirective);
if (directive == context->names().useStrict) {
// Functions with non-simple parameter lists (destructuring,
@@ -3867,7 +3867,8 @@ Parser<ParseHandler>::maybeParseDirective(Node list, Node pn, bool* cont)
} else if (directive == context->names().useAsm) {
if (pc->isFunctionBox())
return asmJS(list);
- return reportWithNode(ParseWarning, false, pn, JSMSG_USE_ASM_DIRECTIVE_FAIL);
+ return reportWithOffset(ParseWarning, false, directivePos.begin,
+ JSMSG_USE_ASM_DIRECTIVE_FAIL);
}
}
return true;
diff --git a/js/src/frontend/SyntaxParseHandler.h b/js/src/frontend/SyntaxParseHandler.h
index b7f0060..85695ba 100644
--- a/js/src/frontend/SyntaxParseHandler.h
+++ b/js/src/frontend/SyntaxParseHandler.h
@@ -519,7 +519,7 @@ class SyntaxParseHandler
MOZ_MUST_USE Node setLikelyIIFE(Node pn) {
return pn; // Remain in syntax-parse mode.
}
- void setPrologue(Node pn) {}
+ void setInDirectivePrologue(Node pn) {}
bool isConstant(Node pn) { return false; }
--
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