From 7278b0b505fb01b2ce0f80813d20f82ecd3fa8e7 Mon Sep 17 00:00:00 2001 From: IWANABETHATGUY Date: Wed, 21 Sep 2022 23:13:48 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=F0=9F=A4=96=20update=20parser=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/rome_js_parser/src/syntax/expr.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/crates/rome_js_parser/src/syntax/expr.rs b/crates/rome_js_parser/src/syntax/expr.rs index 2032ba3177c..3d27d30e528 100644 --- a/crates/rome_js_parser/src/syntax/expr.rs +++ b/crates/rome_js_parser/src/syntax/expr.rs @@ -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?.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.") @@ -787,14 +794,6 @@ fn parse_new_expr(p: &mut Parser, context: ExpressionContext) -> ParsedSyntax { // class Test {} // new Test(); - // test_err ts invalid_optional_chain_from_new_expressions - // new Test?.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(); }