mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
Bug 508637: Allow trailing commas in object initializers in strict mode. r=igor
This commit is contained in:
parent
bba15fbb29
commit
8028f6393e
@ -240,7 +240,7 @@ MSG_DEF(JSMSG_ANON_NO_RETURN_VALUE, 157, 0, JSEXN_TYPEERR, "anonymous function
|
||||
MSG_DEF(JSMSG_DEPRECATED_USAGE, 158, 1, JSEXN_REFERENCEERR, "deprecated {0} usage")
|
||||
MSG_DEF(JSMSG_BAD_URI, 159, 0, JSEXN_URIERR, "malformed URI sequence")
|
||||
MSG_DEF(JSMSG_GETTER_ONLY, 160, 0, JSEXN_TYPEERR, "setting a property that has only a getter")
|
||||
MSG_DEF(JSMSG_TRAILING_COMMA, 161, 0, JSEXN_SYNTAXERR, "trailing comma is not legal in ECMA-262 object initializers")
|
||||
MSG_DEF(JSMSG_UNUSED161, 161, 0, JSEXN_NONE, "unused161")
|
||||
MSG_DEF(JSMSG_UNDEFINED_PROP, 162, 1, JSEXN_REFERENCEERR, "reference to undefined property {0}")
|
||||
MSG_DEF(JSMSG_USELESS_EXPR, 163, 0, JSEXN_TYPEERR, "useless expression")
|
||||
MSG_DEF(JSMSG_REDECLARED_PARAM, 164, 1, JSEXN_TYPEERR, "redeclaration of formal parameter {0}")
|
||||
|
@ -7945,13 +7945,6 @@ PrimaryExpr(JSContext *cx, JSTokenStream *ts, JSTreeContext *tc,
|
||||
pn3->pn_atom = CURRENT_TOKEN(ts).t_atom;
|
||||
break;
|
||||
case TOK_RC:
|
||||
if (afterComma &&
|
||||
!js_ReportCompileErrorNumber(cx, ts, NULL,
|
||||
JSREPORT_WARNING |
|
||||
JSREPORT_STRICT,
|
||||
JSMSG_TRAILING_COMMA)) {
|
||||
return NULL;
|
||||
}
|
||||
goto end_obj_init;
|
||||
default:
|
||||
js_ReportCompileErrorNumber(cx, ts, NULL, JSREPORT_ERROR,
|
||||
|
Loading…
Reference in New Issue
Block a user