Skip to content

Commit de51531

Browse files
authored
Fix parsing of invalid asterix symbol after private field symbol (#5155)
Raise syntax error instead of crashing. JerryScript-DCO-1.0-Signed-off-by: Ádám Kulcsár kuladam@inf.u-szeged.hu
1 parent 2dbb6f7 commit de51531

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

jerry-core/parser/js/js-parser-expr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,7 @@ parser_parse_class_body (parser_context_t *context_p, /**< context */
689689
is_private = true;
690690
}
691691

692-
if (!lexer_consume_generator (context_p))
692+
if (is_private || !lexer_consume_generator (context_p))
693693
{
694694
lexer_expect_object_literal_id (context_p, ident_opts);
695695
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Copyright JS Foundation and other contributors, http://js.foundation
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
class C { async #*method() }

0 commit comments

Comments
 (0)