mirror of
https://github.com/danbulant/oxc
synced 2026-05-25 04:42:10 +00:00
fix(ast): AcessorProperty is missing decorators (#2176)
This commit is contained in:
parent
2e3153e16f
commit
ea8cc98c34
4 changed files with 12 additions and 4 deletions
|
|
@ -2052,6 +2052,7 @@ pub struct AccessorProperty<'a> {
|
|||
pub value: Option<Expression<'a>>,
|
||||
pub computed: bool,
|
||||
pub r#static: bool,
|
||||
pub decorators: Vec<'a, Decorator<'a>>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Hash)]
|
||||
|
|
|
|||
|
|
@ -886,6 +886,7 @@ impl<'a> AstBuilder<'a> {
|
|||
value: Option<Expression<'a>>,
|
||||
computed: bool,
|
||||
r#static: bool,
|
||||
decorators: Vec<'a, Decorator<'a>>,
|
||||
) -> ClassElement<'a> {
|
||||
ClassElement::AccessorProperty(self.alloc(AccessorProperty {
|
||||
span,
|
||||
|
|
@ -893,6 +894,7 @@ impl<'a> AstBuilder<'a> {
|
|||
value,
|
||||
computed,
|
||||
r#static,
|
||||
decorators,
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -478,6 +478,13 @@ impl<'a> Parser<'a> {
|
|||
) -> Result<ClassElement<'a>> {
|
||||
let value =
|
||||
self.eat(Kind::Eq).then(|| self.parse_assignment_expression_base()).transpose()?;
|
||||
Ok(self.ast.accessor_property(self.end_span(span), key, value, computed, r#static))
|
||||
Ok(self.ast.accessor_property(
|
||||
self.end_span(span),
|
||||
key,
|
||||
value,
|
||||
computed,
|
||||
r#static,
|
||||
self.state.consume_decorators(),
|
||||
))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
codegen_typescript Summary:
|
||||
AST Parsed : 5243/5243 (100.00%)
|
||||
Positive Passed: 5214/5243 (99.45%)
|
||||
Positive Passed: 5216/5243 (99.49%)
|
||||
Expect to Parse: "compiler/binopAssignmentShouldHaveType.ts"
|
||||
Expect to Parse: "compiler/castExpressionParentheses.ts"
|
||||
Expect to Parse: "compiler/elidedEmbeddedStatementsReplacedWithSemicolon.ts"
|
||||
|
|
@ -14,8 +14,6 @@ Expect to Parse: "compiler/modularizeLibrary_Dom.asynciterable.ts"
|
|||
Expect to Parse: "compiler/modularizeLibrary_Worker.asynciterable.ts"
|
||||
Expect to Parse: "compiler/typeAliasDeclarationEmit3.ts"
|
||||
Expect to Parse: "conformance/constEnums/constEnum4.ts"
|
||||
Expect to Parse: "conformance/decorators/legacyDecorators-contextualTypes.ts"
|
||||
Expect to Parse: "conformance/esDecorators/esDecorators-contextualTypes.ts"
|
||||
Expect to Parse: "conformance/expressions/asOperator/asOpEmitParens.ts"
|
||||
Expect to Parse: "conformance/expressions/elementAccess/letIdentifierInElementAccess01.ts"
|
||||
Expect to Parse: "conformance/jsx/jsxReactTestSuite.tsx"
|
||||
|
|
|
|||
Loading…
Reference in a new issue