mirror of
https://github.com/DoneJS-Runtime/quickjs-done-nextgen.git
synced 2025-01-09 17:43:15 +00:00
Fix declaring property named get/set/async
This commit is contained in:
parent
da5b95dcaf
commit
c4d3833966
2 changed files with 9 additions and 2 deletions
|
@ -20889,7 +20889,7 @@ static int __exception js_parse_property_name(JSParseState *s,
|
||||||
goto fail1;
|
goto fail1;
|
||||||
if (s->token.val == ':' || s->token.val == ',' ||
|
if (s->token.val == ':' || s->token.val == ',' ||
|
||||||
s->token.val == '}' || s->token.val == '(' ||
|
s->token.val == '}' || s->token.val == '(' ||
|
||||||
s->token.val == '=') {
|
s->token.val == '=' || s->token.val == ';') {
|
||||||
is_non_reserved_ident = TRUE;
|
is_non_reserved_ident = TRUE;
|
||||||
goto ident_found;
|
goto ident_found;
|
||||||
}
|
}
|
||||||
|
@ -20906,7 +20906,7 @@ static int __exception js_parse_property_name(JSParseState *s,
|
||||||
goto fail1;
|
goto fail1;
|
||||||
if (s->token.val == ':' || s->token.val == ',' ||
|
if (s->token.val == ':' || s->token.val == ',' ||
|
||||||
s->token.val == '}' || s->token.val == '(' ||
|
s->token.val == '}' || s->token.val == '(' ||
|
||||||
s->token.val == '=') {
|
s->token.val == '=' || s->token.val == ';') {
|
||||||
is_non_reserved_ident = TRUE;
|
is_non_reserved_ident = TRUE;
|
||||||
goto ident_found;
|
goto ident_found;
|
||||||
}
|
}
|
||||||
|
|
|
@ -349,10 +349,17 @@ function test_class()
|
||||||
assert(S.z === 42);
|
assert(S.z === 42);
|
||||||
|
|
||||||
class P {
|
class P {
|
||||||
|
get;
|
||||||
|
set;
|
||||||
|
async;
|
||||||
get = () => "123";
|
get = () => "123";
|
||||||
|
set = () => "456";
|
||||||
|
async = () => "789";
|
||||||
static() { return 42; }
|
static() { return 42; }
|
||||||
}
|
}
|
||||||
assert(new P().get() === "123");
|
assert(new P().get() === "123");
|
||||||
|
assert(new P().set() === "456");
|
||||||
|
assert(new P().async() === "789");
|
||||||
assert(new P().static() === 42);
|
assert(new P().static() === 42);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue