Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
chore: 馃 update parser test
Browse files Browse the repository at this point in the history
  • Loading branch information
IWANABETHATGUY committed Sep 21, 2022
1 parent fb8b5f7 commit 7278b0b
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions crates/rome_js_parser/src/syntax/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,13 @@ fn parse_new_expr(p: &mut Parser, context: ExpressionContext) -> ParsedSyntax {
.or_add_diagnostic(p, expected_expression)
.map(|expr| parse_member_expression_rest(p, expr, context, false, &mut false))
{
// test_err ts invalid_optional_chain_from_new_expressions
// new Test<string>?.test();
// new Test?.test();
// new A.b?.c()
// new (A.b)?.c()
// new (A.b?.()).c()
// new A.b?.()()
if p.at(T![?.]) {
let error = p
.err_builder("Invalid optional chain from new expression.")
Expand All @@ -787,14 +794,6 @@ fn parse_new_expr(p: &mut Parser, context: ExpressionContext) -> ParsedSyntax {
// class Test<A, B, C> {}
// new Test<A, B, C>();

// test_err ts invalid_optional_chain_from_new_expressions
// new Test<string>?.test();
// new Test?.test();
// new A.b?.c()
// new (A.b)?.c()
// new (A.b?.()).c()
// new A.b?.()()
// p.
if p.at(T!['(']) {
parse_call_arguments(p).unwrap();
}
Expand Down

0 comments on commit 7278b0b

Please sign in to comment.