Split Parser::report into Parser::zeport (a temporary name) that uses

the current offset, and Parser::reportWithNode that derives it from a
Node.
This commit is contained in:
wolfbeast 2019-04-05 20:54:29 +02:00 • committed by Roy Tam
commit e9ffb69b02
4 changed files with 198 additions and 209 deletions

View file

@ -3559,9 +3559,11 @@ BytecodeEmitter::maybeSetSourceMap()
if (parser->options().sourceMapURL()) {
// Warn about the replacement, but use the new one.
if (parser->ss->hasSourceMapURL()) {
if(!parser->report(ParseWarning, false, nullptr, JSMSG_ALREADY_HAS_PRAGMA,
parser->ss->filename(), "//# sourceMappingURL"))
if (!parser->reportNoOffset(ParseWarning, false, JSMSG_ALREADY_HAS_PRAGMA,
parser->ss->filename(), "//# sourceMappingURL"))
{
return false;
}
}
if (!parser->ss->setSourceMapURL(cx, parser->options().sourceMapURL()))