Introduce Parser::errorAt

This reduces reporting an error at a particular offset to its bare
essentials, simplifying calls.
This commit is contained in:
wolfbeast 2019-04-06 06:39:27 +02:00 • committed by Roy Tam
commit 07c1fa20ea
2 changed files with 42 additions and 32 deletions

View file

@ -915,6 +915,9 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
/* Report the given error at the current offset. */
void error(unsigned errorNumber, ...);
/* Report the given error at the given offset. */
void errorAt(uint32_t offset, unsigned errorNumber, ...);
/*
* Handle a strict mode error at the current offset. Report an error if in
* strict mode code, or warn if not, using the given error number and