// ((IdentifierName | String | Number) ':' AssignmentExpression) |
// (('get' | 'set') (IdentifierName | String | Number) FunctionLiteral)
// ) ',')* '}'
- // (Except that trailing comma is not required and not allowed.)
+ // (Except that the trailing comma is not required.)
int pos = peek_position();
typename Traits::Type::PropertyList properties =
}
properties->Add(property, zone());
- // TODO(1240767): Consider allowing trailing comma.
if (peek() != Token::RBRACE) {
// Need {} because of the CHECK_OK macro.
Expect(Token::COMMA, CHECK_OK);
TEST(StrictObjectLiteralChecking) {
const char* strict_context_data[][2] = {
{"\"use strict\"; var myobject = {", "};"},
+ {"\"use strict\"; var myobject = {", ",};"},
{ NULL, NULL }
};
const char* non_strict_context_data[][2] = {
{"var myobject = {", "};"},
+ {"var myobject = {", ",};"},
{ NULL, NULL }
};
};
const char* statement_data[] = {
+ ",",
"foo: 1, get foo() {}",
"foo: 1, set foo(v) {}",
"\"foo\": 1, get \"foo\"() {}",
TEST(NoErrorsObjectLiteralChecking) {
const char* context_data[][2] = {
{"var myobject = {", "};"},
+ {"var myobject = {", ",};"},
{"\"use strict\"; var myobject = {", "};"},
+ {"\"use strict\"; var myobject = {", ",};"},
{ NULL, NULL }
};