mirror of
https://github.com/bellard/quickjs.git
synced 2025-05-12 11:06:10 +08:00
setters cannot have rest arguments
This commit is contained in:
parent
99a855f2c7
commit
5e71d148f2
@ -34126,6 +34126,8 @@ static __exception int js_parse_function_decl2(JSParseState *s,
|
|||||||
int idx, has_initializer;
|
int idx, has_initializer;
|
||||||
|
|
||||||
if (s->token.val == TOK_ELLIPSIS) {
|
if (s->token.val == TOK_ELLIPSIS) {
|
||||||
|
if (func_type == JS_PARSE_FUNC_SETTER)
|
||||||
|
goto fail_accessor;
|
||||||
fd->has_simple_parameter_list = FALSE;
|
fd->has_simple_parameter_list = FALSE;
|
||||||
rest = TRUE;
|
rest = TRUE;
|
||||||
if (next_token(s))
|
if (next_token(s))
|
||||||
@ -34239,6 +34241,7 @@ static __exception int js_parse_function_decl2(JSParseState *s,
|
|||||||
}
|
}
|
||||||
if ((func_type == JS_PARSE_FUNC_GETTER && fd->arg_count != 0) ||
|
if ((func_type == JS_PARSE_FUNC_GETTER && fd->arg_count != 0) ||
|
||||||
(func_type == JS_PARSE_FUNC_SETTER && fd->arg_count != 1)) {
|
(func_type == JS_PARSE_FUNC_SETTER && fd->arg_count != 1)) {
|
||||||
|
fail_accessor:
|
||||||
js_parse_error(s, "invalid number of arguments for getter or setter");
|
js_parse_error(s, "invalid number of arguments for getter or setter");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user