Introduce Parser::warningAt

This reduces reporting an warning at a particular offset to its bare
essentials, simplifying calls.
This commit is contained in:
wolfbeast 2019-04-06 10:33:24 +02:00 • committed by Roy Tam
commit 218c8ce05c
2 changed files with 19 additions and 12 deletions

View file

@ -909,8 +909,6 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
public:
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,
...);
/* Report the given error at the current offset. */
void error(unsigned errorNumber, ...);
@ -935,6 +933,9 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
/* Report the given warning at the current offset. */
MOZ_MUST_USE bool warning(unsigned errorNumber, ...);
/* Report the given warning at the given offset. */
MOZ_MUST_USE bool warningAt(uint32_t offset, unsigned errorNumber, ...);
/*
* If extra warnings are enabled, report the given warning at the current
* offset.