mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(parser): parse DecoratorCallExpression when Arguments contains MemberExpression (#3265)
closes #3261 closes #3262 ``` DecoratorCallExpression[Yield, Await] : DecoratorMemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await] ```
This commit is contained in:
parent
3644400aed
commit
c4ccf9f4d8
6 changed files with 16 additions and 9 deletions
|
|
@ -750,7 +750,10 @@ impl<'a> ParserImpl<'a> {
|
||||||
) -> Result<Expression<'a>> {
|
) -> Result<Expression<'a>> {
|
||||||
// ArgumentList[Yield, Await] :
|
// ArgumentList[Yield, Await] :
|
||||||
// AssignmentExpression[+In, ?Yield, ?Await]
|
// AssignmentExpression[+In, ?Yield, ?Await]
|
||||||
let call_arguments = self.with_context(Context::In, CallArguments::parse)?;
|
let ctx = self.ctx;
|
||||||
|
self.ctx = ctx.and_in(true).and_decorator(false);
|
||||||
|
let call_arguments = CallArguments::parse(self)?;
|
||||||
|
self.ctx = ctx;
|
||||||
Ok(self.ast.call_expression(
|
Ok(self.ast.call_expression(
|
||||||
self.end_span(lhs_span),
|
self.end_span(lhs_span),
|
||||||
lhs,
|
lhs,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
codegen_misc Summary:
|
codegen_misc Summary:
|
||||||
AST Parsed : 15/15 (100.00%)
|
AST Parsed : 16/16 (100.00%)
|
||||||
Positive Passed: 15/15 (100.00%)
|
Positive Passed: 16/16 (100.00%)
|
||||||
|
|
|
||||||
4
tasks/coverage/misc/pass/oxc-3262.js
Normal file
4
tasks/coverage/misc/pass/oxc-3262.js
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
class Foo {
|
||||||
|
@Bar({ x: Map['String'] })
|
||||||
|
quaz() {}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
parser_misc Summary:
|
parser_misc Summary:
|
||||||
AST Parsed : 15/15 (100.00%)
|
AST Parsed : 16/16 (100.00%)
|
||||||
Positive Passed: 15/15 (100.00%)
|
Positive Passed: 16/16 (100.00%)
|
||||||
Negative Passed: 8/8 (100.00%)
|
Negative Passed: 8/8 (100.00%)
|
||||||
|
|
||||||
× Unexpected token
|
× Unexpected token
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
prettier_misc Summary:
|
prettier_misc Summary:
|
||||||
AST Parsed : 15/15 (100.00%)
|
AST Parsed : 16/16 (100.00%)
|
||||||
Positive Passed: 8/15 (53.33%)
|
Positive Passed: 9/16 (56.25%)
|
||||||
Expect to Parse: "pass/oxc-1740.tsx"
|
Expect to Parse: "pass/oxc-1740.tsx"
|
||||||
Expect to Parse: "pass/oxc-2087.ts"
|
Expect to Parse: "pass/oxc-2087.ts"
|
||||||
Expect to Parse: "pass/oxc-2394.ts"
|
Expect to Parse: "pass/oxc-2394.ts"
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,3 @@
|
||||||
transformer_misc Summary:
|
transformer_misc Summary:
|
||||||
AST Parsed : 15/15 (100.00%)
|
AST Parsed : 16/16 (100.00%)
|
||||||
Positive Passed: 15/15 (100.00%)
|
Positive Passed: 16/16 (100.00%)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue