mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 823310 - Only report strict warnings when JSOPTION_STRICT is set. r=njn,jorendorff
This commit is contained in:
parent
eaecff5d2f
commit
9e26bef53b
@ -1718,7 +1718,7 @@ BytecodeEmitter::reportStrictWarning(ParseNode *pn, unsigned errorNumber, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, errorNumber);
|
||||
bool result = tokenStream()->reportStrictWarningErrorNumberVA(pn, sc->strict, errorNumber, args);
|
||||
bool result = tokenStream()->reportStrictWarningErrorNumberVA(pn, errorNumber, args);
|
||||
va_end(args);
|
||||
return result;
|
||||
}
|
||||
|
@ -518,8 +518,7 @@ Parser::reportStrictWarning(ParseNode *pn, unsigned errorNumber, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, errorNumber);
|
||||
bool result = tokenStream.reportStrictWarningErrorNumberVA(pn, pc->sc->strict,
|
||||
errorNumber, args);
|
||||
bool result = tokenStream.reportStrictWarningErrorNumberVA(pn, errorNumber, args);
|
||||
va_end(args);
|
||||
return result;
|
||||
}
|
||||
|
@ -612,10 +612,9 @@ TokenStream::reportWarning(unsigned errorNumber, ...)
|
||||
}
|
||||
|
||||
bool
|
||||
TokenStream::reportStrictWarningErrorNumberVA(ParseNode *pn, bool strictMode, unsigned errorNumber,
|
||||
va_list args)
|
||||
TokenStream::reportStrictWarningErrorNumberVA(ParseNode *pn, unsigned errorNumber, va_list args)
|
||||
{
|
||||
if (!strictMode && !cx->hasStrictOption())
|
||||
if (!cx->hasStrictOption())
|
||||
return true;
|
||||
|
||||
return reportCompileErrorNumberVA(NULL, JSREPORT_STRICT | JSREPORT_WARNING, errorNumber, args);
|
||||
|
@ -541,8 +541,7 @@ class TokenStream
|
||||
va_list args);
|
||||
bool reportStrictModeErrorNumberVA(ParseNode *pn, bool strictMode, unsigned errorNumber,
|
||||
va_list args);
|
||||
bool reportStrictWarningErrorNumberVA(ParseNode *pn, bool strictMode, unsigned errorNumber,
|
||||
va_list args);
|
||||
bool reportStrictWarningErrorNumberVA(ParseNode *pn, unsigned errorNumber, va_list args);
|
||||
|
||||
private:
|
||||
// These are private because they should only be called by the tokenizer
|
||||
|
7
js/src/jit-test/tests/basic/bug823310.js
Normal file
7
js/src/jit-test/tests/basic/bug823310.js
Normal file
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
options("werror");
|
||||
|
||||
// This construct causes a strict warning, but we shouldn't get one since
|
||||
// JSOPTION_STRICT isn't enabled.
|
||||
var x;
|
||||
eval("if (x = 3) {}");
|
Loading…
Reference in New Issue
Block a user