summaryrefslogtreecommitdiffstats
path: root/js/src/frontend/Parser.h
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-04-05 20:54:29 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-04-05 20:54:29 +0200
commit8bbd0d556c0bf583b16076844b9e263a5f996495 (patch)
treec99321586e367572d2dc534a99f6aaeb486e0928 /js/src/frontend/Parser.h
parentc3b63b831cd2c64700e875b28540212c7c881ac6 (diff)
downloadUXP-8bbd0d556c0bf583b16076844b9e263a5f996495.tar
UXP-8bbd0d556c0bf583b16076844b9e263a5f996495.tar.gz
UXP-8bbd0d556c0bf583b16076844b9e263a5f996495.tar.lz
UXP-8bbd0d556c0bf583b16076844b9e263a5f996495.tar.xz
UXP-8bbd0d556c0bf583b16076844b9e263a5f996495.zip
Split Parser::report into Parser::zeport (a temporary name) that uses
the current offset, and Parser::reportWithNode that derives it from a Node.
Diffstat (limited to 'js/src/frontend/Parser.h')
-rw-r--r--js/src/frontend/Parser.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/js/src/frontend/Parser.h b/js/src/frontend/Parser.h
index 090931f5b..88d705108 100644
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -769,13 +769,13 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
*
* Ex:
* PossibleError possibleError(*this);
- * possibleError.setPendingExpressionError(pn, JSMSG_BAD_PROP_ID);
+ * possibleError.setPendingExpressionErrorAt(pos, JSMSG_BAD_PROP_ID);
* // A JSMSG_BAD_PROP_ID ParseError is reported, returns false.
* if (!possibleError.checkForExpressionError())
* return false; // we reach this point with a pending exception
*
* PossibleError possibleError(*this);
- * possibleError.setPendingExpressionError(pn, JSMSG_BAD_PROP_ID);
+ * possibleError.setPendingExpressionErrorAt(pos, JSMSG_BAD_PROP_ID);
* // Returns true, no error is reported.
* if (!possibleError.checkForDestructuringError())
* return false; // not reached, no pending exception
@@ -815,7 +815,7 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
// Set a pending error. Only a single error may be set per instance and
// error kind.
- void setPending(ErrorKind kind, Node pn, unsigned errorNumber);
+ void setPending(ErrorKind kind, const TokenPos& pos, unsigned errorNumber);
// If there is a pending error, report it and return false, otherwise
// return true.
@@ -830,12 +830,12 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
// Set a pending destructuring error. Only a single error may be set
// per instance, i.e. subsequent calls to this method are ignored and
// won't overwrite the existing pending error.
- void setPendingDestructuringError(Node pn, unsigned errorNumber);
+ void setPendingDestructuringErrorAt(const TokenPos& pos, unsigned errorNumber);
// Set a pending expression error. Only a single error may be set per
// instance, i.e. subsequent calls to this method are ignored and won't
// overwrite the existing pending error.
- void setPendingExpressionError(Node pn, unsigned errorNumber);
+ void setPendingExpressionErrorAt(const TokenPos& pos, unsigned errorNumber);
// If there is a pending destructuring error, report it and return
// false, otherwise return true. Clears any pending expression error.
@@ -907,7 +907,8 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
bool reportHelper(ParseReportKind kind, bool strict, uint32_t offset,
unsigned errorNumber, va_list args);
public:
- bool report(ParseReportKind kind, bool strict, Node pn, unsigned errorNumber, ...);
+ bool zeport(ParseReportKind kind, bool strict, unsigned errorNumber, ...);
+ bool reportWithNode(ParseReportKind kind, bool strict, Node pn, unsigned errorNumber, ...);
bool reportNoOffset(ParseReportKind kind, bool strict, unsigned errorNumber, ...);
bool reportWithOffset(ParseReportKind kind, bool strict, uint32_t offset, unsigned errorNumber,
...);