diff --git a/crates/oxc_ast/src/ast/js.rs b/crates/oxc_ast/src/ast/js.rs index 6cf1d2cb49fa3..ad1ca827bd4ee 100644 --- a/crates/oxc_ast/src/ast/js.rs +++ b/crates/oxc_ast/src/ast/js.rs @@ -1547,6 +1547,7 @@ pub enum BindingPatternKind<'a> { #[ast(visit)] #[derive(Debug)] #[generate_derive(CloneIn, GetSpan, GetSpanMut, ContentEq, ESTree)] +#[estree(add_fields(decorators = TsEmptyArray))] pub struct AssignmentPattern<'a> { pub span: Span, pub left: BindingPattern<'a>, diff --git a/crates/oxc_ast/src/generated/derive_estree.rs b/crates/oxc_ast/src/generated/derive_estree.rs index 76aaa4527630c..c4abf2f5fdcc7 100644 --- a/crates/oxc_ast/src/generated/derive_estree.rs +++ b/crates/oxc_ast/src/generated/derive_estree.rs @@ -1279,6 +1279,7 @@ impl ESTree for AssignmentPattern<'_> { state.serialize_field("end", &self.span.end); state.serialize_field("left", &self.left); state.serialize_field("right", &self.right); + state.serialize_ts_field("decorators", &crate::serialize::TsEmptyArray(self)); state.end(); } } diff --git a/napi/parser/deserialize-ts.js b/napi/parser/deserialize-ts.js index bb26b16c48f20..314ec7fe8f6bf 100644 --- a/napi/parser/deserialize-ts.js +++ b/napi/parser/deserialize-ts.js @@ -720,6 +720,7 @@ function deserializeAssignmentPattern(pos) { end: deserializeU32(pos + 4), left: deserializeBindingPattern(pos + 8), right: deserializeExpression(pos + 40), + decorators: [], }; } diff --git a/npm/oxc-types/types.d.ts b/npm/oxc-types/types.d.ts index 60296d2c07b9a..a7fde01f4b628 100644 --- a/npm/oxc-types/types.d.ts +++ b/npm/oxc-types/types.d.ts @@ -516,6 +516,7 @@ export interface AssignmentPattern extends Span { type: 'AssignmentPattern'; left: BindingPattern; right: Expression; + decorators?: []; } export interface ObjectPattern extends Span { diff --git a/tasks/coverage/snapshots/estree_typescript.snap b/tasks/coverage/snapshots/estree_typescript.snap index 23bf6b45e21b4..4bc9c86b49e77 100644 --- a/tasks/coverage/snapshots/estree_typescript.snap +++ b/tasks/coverage/snapshots/estree_typescript.snap @@ -2,7 +2,7 @@ commit: 15392346 estree_typescript Summary: AST Parsed : 10623/10725 (99.05%) -Positive Passed: 1979/10725 (18.45%) +Positive Passed: 1983/10725 (18.49%) Mismatch: tasks/coverage/typescript/tests/cases/compiler/APILibCheck.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/APISample_Watch.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/APISample_WatchWithDefaults.ts @@ -2738,7 +2738,6 @@ Mismatch: tasks/coverage/typescript/tests/cases/compiler/inheritedOverloadedSpec Mismatch: tasks/coverage/typescript/tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/inheritedStringIndexersFromDifferentBaseTypes2.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/initializePropertiesWithRenamedLet.ts -Mismatch: tasks/coverage/typescript/tests/cases/compiler/initializedDestructuringAssignmentTypes.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/initializedParameterBeforeNonoptionalNotOptional.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/initializerWithThisPropertyAccess.ts Mismatch: tasks/coverage/typescript/tests/cases/compiler/initializersInAmbientEnums.ts @@ -8767,15 +8766,12 @@ Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofSta Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of19.ts Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts Missing initializer in const declaration -Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of26.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of27.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of28.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of29.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of31.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of34.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of35.ts -Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of36.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of37.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of8.ts Mismatch: tasks/coverage/typescript/tests/cases/conformance/statements/for-ofStatements/ES5For-of9.ts