mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Support get/set as property name in object literal (#3340)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik frobert@inf.u-szeged.hu
This commit is contained in:
parent
279d4d4119
commit
62356796fc
@ -2472,6 +2472,7 @@ lexer_expect_object_literal_id (parser_context_t *context_p, /**< context */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
&& context_p->source_p[0] != LIT_CHAR_COMMA
|
||||
&& context_p->source_p[0] != LIT_CHAR_RIGHT_BRACE
|
||||
&& context_p->source_p[0] != LIT_CHAR_LEFT_PAREN
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
&& context_p->source_p[0] != LIT_CHAR_COLON)
|
||||
{
|
||||
@ -2593,6 +2594,7 @@ lexer_scan_identifier (parser_context_t *context_p, /**< context */
|
||||
#if ENABLED (JERRY_ES2015)
|
||||
&& context_p->source_p[0] != LIT_CHAR_COMMA
|
||||
&& context_p->source_p[0] != LIT_CHAR_RIGHT_BRACE
|
||||
&& context_p->source_p[0] != LIT_CHAR_LEFT_PAREN
|
||||
#endif /* ENABLED (JERRY_ES2015) */
|
||||
&& context_p->source_p[0] != LIT_CHAR_COLON)
|
||||
{
|
||||
|
||||
@ -70,3 +70,8 @@ default:
|
||||
assert(o.get == 8);
|
||||
assert(o.set == 12);
|
||||
}
|
||||
|
||||
var obj = { get() { return 5; }, set() { return 6; } };
|
||||
|
||||
assert (obj.get() === 5);
|
||||
assert (obj.set() === 6);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user