Bug 1102131 - Part 4: Log console warnings for deprecated let blocks. r=shu

This commit is contained in:
Chris Peterson 2014-11-16 00:49:20 -08:00
Родитель 1ddf74d05c
Коммит fdd5ba04f0
3 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -3660,7 +3660,10 @@ Parser<ParseHandler>::letBlock(LetContext letContext)
if (!expr)
return null();
MUST_MATCH_TOKEN(TOK_RC, JSMSG_CURLY_AFTER_LET);
sawDeprecatedLetBlock = true;
if (!report(ParseWarning, pc->sc->strict, expr, JSMSG_DEPRECATED_LET_BLOCK))
return null();
} else {
MOZ_ASSERT(letContext == LetExpression);
expr = assignExpr();

Просмотреть файл

@ -226,6 +226,7 @@ MSG_DEF(JSMSG_CURLY_IN_COMPOUND, 0, JSEXN_SYNTAXERR, "missing } in compoun
MSG_DEF(JSMSG_DECLARATION_AFTER_EXPORT,0, JSEXN_SYNTAXERR, "missing declaration after 'export' keyword")
MSG_DEF(JSMSG_DECLARATION_AFTER_IMPORT,0, JSEXN_SYNTAXERR, "missing declaration after 'import' keyword")
MSG_DEF(JSMSG_DEPRECATED_DELETE_OPERAND, 0, JSEXN_SYNTAXERR, "applying the 'delete' operator to an unqualified name is deprecated")
MSG_DEF(JSMSG_DEPRECATED_LET_BLOCK, 0, JSEXN_NONE, "JavaScript 1.7's let blocks are deprecated")
MSG_DEF(JSMSG_DEPRECATED_LET_EXPRESSION, 0, JSEXN_NONE, "JavaScript 1.7's let expressions are deprecated")
MSG_DEF(JSMSG_DEPRECATED_OCTAL, 0, JSEXN_SYNTAXERR, "octal literals and octal escape sequences are deprecated")
MSG_DEF(JSMSG_DEPRECATED_PRAGMA, 1, JSEXN_NONE, "Using //@ to indicate {0} pragmas is deprecated. Use //# instead")

Просмотреть файл

@ -34,7 +34,7 @@ namespace js {
* Nightly) and without (all others). FIXME: Bug 1066322 - Enable ES6 symbols
* in all builds.
*/
static const uint32_t XDR_BYTECODE_VERSION_SUBTRAHEND = 218;
static const uint32_t XDR_BYTECODE_VERSION_SUBTRAHEND = 220;
static_assert(XDR_BYTECODE_VERSION_SUBTRAHEND % 2 == 0, "see the comment above");
static const uint32_t XDR_BYTECODE_VERSION =
uint32_t(0xb973c0de - (XDR_BYTECODE_VERSION_SUBTRAHEND