summaryrefslogtreecommitdiffstats
path: root/js/src
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-04-06 11:20:43 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-04-06 11:20:43 +0200
commitf38ef66b7b9f1d1c85c5d8a7a5bbaa5f6c3c9948 (patch)
treee75ab677945a0242fc50c1b6c7b52236c6f1f7d1 /js/src
parent4f62fda966af85252f8345e51d694cd6d3a063c8 (diff)
downloadUXP-f38ef66b7b9f1d1c85c5d8a7a5bbaa5f6c3c9948.tar
UXP-f38ef66b7b9f1d1c85c5d8a7a5bbaa5f6c3c9948.tar.gz
UXP-f38ef66b7b9f1d1c85c5d8a7a5bbaa5f6c3c9948.tar.lz
UXP-f38ef66b7b9f1d1c85c5d8a7a5bbaa5f6c3c9948.tar.xz
UXP-f38ef66b7b9f1d1c85c5d8a7a5bbaa5f6c3c9948.zip
Inline Parser::reportHelper into its callers.
Diffstat (limited to 'js/src')
-rw-r--r--js/src/frontend/Parser.cpp37
1 files changed, 29 insertions, 8 deletions
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
index c08ba4889..30a627a65 100644
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -603,7 +603,7 @@ Parser<ParseHandler>::error(unsigned errorNumber, ...)
#ifdef DEBUG
bool result =
#endif
- reportHelper(ParseError, false, pos().begin, errorNumber, args);
+ tokenStream.reportCompileErrorNumberVA(pos().begin, JSREPORT_ERROR, errorNumber, args);
MOZ_ASSERT(!result, "reporting an error returned true?");
va_end(args);
}
@@ -617,7 +617,7 @@ Parser<ParseHandler>::errorAt(uint32_t offset, unsigned errorNumber, ...)
#ifdef DEBUG
bool result =
#endif
- reportHelper(ParseError, false, offset, errorNumber, args);
+ tokenStream.reportCompileErrorNumberVA(offset, JSREPORT_ERROR, errorNumber, args);
MOZ_ASSERT(!result, "reporting an error returned true?");
va_end(args);
}
@@ -628,7 +628,8 @@ Parser<ParseHandler>::warning(unsigned errorNumber, ...)
{
va_list args;
va_start(args, errorNumber);
- bool result = reportHelper(ParseWarning, false, pos().begin, errorNumber, args);
+ bool result =
+ tokenStream.reportCompileErrorNumberVA(pos().begin, JSREPORT_WARNING, errorNumber, args);
va_end(args);
return result;
}
@@ -639,7 +640,8 @@ Parser<ParseHandler>::warningAt(uint32_t offset, unsigned errorNumber, ...)
{
va_list args;
va_start(args, errorNumber);
- bool result = reportHelper(ParseWarning, false, offset, errorNumber, args);
+ bool result =
+ tokenStream.reportCompileErrorNumberVA(offset, JSREPORT_WARNING, errorNumber, args);
va_end(args);
return result;
}
@@ -650,7 +652,7 @@ Parser<ParseHandler>::extraWarning(unsigned errorNumber, ...)
{
va_list args;
va_start(args, errorNumber);
- bool result = reportHelper(ParseExtraWarning, false, pos().begin, errorNumber, args);
+ bool result = tokenStream.reportStrictWarningErrorNumberVA(pos().begin, errorNumber, args);
va_end(args);
return result;
}
@@ -661,7 +663,9 @@ Parser<ParseHandler>::strictModeError(unsigned errorNumber, ...)
{
va_list args;
va_start(args, errorNumber);
- bool res = reportHelper(ParseStrictError, pc->sc()->strict(), pos().begin, errorNumber, args);
+ bool res =
+ tokenStream.reportStrictModeErrorNumberVA(pos().begin, pc->sc()->strict(),
+ errorNumber, args);
va_end(args);
return res;
}
@@ -672,7 +676,8 @@ Parser<ParseHandler>::strictModeErrorAt(uint32_t offset, unsigned errorNumber, .
{
va_list args;
va_start(args, errorNumber);
- bool res = reportHelper(ParseStrictError, pc->sc()->strict(), offset, errorNumber, args);
+ bool res =
+ tokenStream.reportStrictModeErrorNumberVA(offset, pc->sc()->strict(), errorNumber, args);
va_end(args);
return res;
}
@@ -683,7 +688,23 @@ Parser<ParseHandler>::reportNoOffset(ParseReportKind kind, bool strict, unsigned
{
va_list args;
va_start(args, errorNumber);
- bool result = reportHelper(kind, strict, TokenStream::NoOffset, errorNumber, args);
+ bool result = false;
+ uint32_t offset = TokenStream::NoOffset;
+ switch (kind) {
+ case ParseError:
+ result = tokenStream.reportCompileErrorNumberVA(offset, JSREPORT_ERROR, errorNumber, args);
+ break;
+ case ParseWarning:
+ result =
+ tokenStream.reportCompileErrorNumberVA(offset, JSREPORT_WARNING, errorNumber, args);
+ break;
+ case ParseExtraWarning:
+ result = tokenStream.reportStrictWarningErrorNumberVA(offset, errorNumber, args);
+ break;
+ case ParseStrictError:
+ result = tokenStream.reportStrictModeErrorNumberVA(offset, strict, errorNumber, args);
+ break;
+ }
va_end(args);
return result;
}