Rename TokenStream::reportStrictWarningErrorNumberVA to

TokenStream::reportExtraWarningErrorNumberVA for clarity.

Emit Extra Warnings instead of Strict Warnings from the BCE where
it makes sense.
This commit is contained in:
wolfbeast 2019-04-06 11:26:49 +02:00 • committed by Roy Tam
commit 0c3fb437a9
5 changed files with 9 additions and 10 deletions

View file

@ -3608,13 +3608,13 @@ BytecodeEmitter::reportError(ParseNode* pn, unsigned errorNumber, ...)
}
bool
BytecodeEmitter::reportStrictWarning(ParseNode* pn, unsigned errorNumber, ...)
BytecodeEmitter::reportExtraWarning(ParseNode* pn, unsigned errorNumber, ...)
{
TokenPos pos = pn ? pn->pn_pos : tokenStream()->currentToken().pos;
va_list args;
va_start(args, errorNumber);
bool result = tokenStream()->reportStrictWarningErrorNumberVA(pos.begin, errorNumber, args);
bool result = tokenStream()->reportExtraWarningErrorNumberVA(pos.begin, errorNumber, args);
va_end(args);
return result;
}
@ -8707,13 +8707,13 @@ BytecodeEmitter::emitStatement(ParseNode* pn)
}
if (directive) {
if (!reportStrictWarning(pn2, JSMSG_CONTRARY_NONDIRECTIVE, directive))
if (!reportExtraWarning(pn2, JSMSG_CONTRARY_NONDIRECTIVE, directive))
return false;
}
} else {
current->currentLine = parser->tokenStream.srcCoords.lineNum(pn2->pn_pos.begin);
current->lastColumn = 0;
if (!reportStrictWarning(pn2, JSMSG_USELESS_EXPR))
if (!reportExtraWarning(pn2, JSMSG_USELESS_EXPR))
return false;
}
}