mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
fix(transformer/typescript): remove accessibility from AccessorProperty (#5292)
Regression by #5290
This commit is contained in:
parent
550574982f
commit
5754c89b5e
5 changed files with 18 additions and 5 deletions
|
|
@ -262,6 +262,14 @@ impl<'a> Traverse<'a> for Transformer<'a> {
|
|||
self.x0_typescript.transform_property_definition(def);
|
||||
}
|
||||
|
||||
fn enter_accessor_property(
|
||||
&mut self,
|
||||
node: &mut AccessorProperty<'a>,
|
||||
_ctx: &mut TraverseCtx<'a>,
|
||||
) {
|
||||
self.x0_typescript.transform_accessor_property(node);
|
||||
}
|
||||
|
||||
fn enter_statements(&mut self, stmts: &mut Vec<'a, Statement<'a>>, ctx: &mut TraverseCtx<'a>) {
|
||||
self.x0_typescript.transform_statements(stmts);
|
||||
self.x1_react.transform_statements(stmts, ctx);
|
||||
|
|
|
|||
|
|
@ -353,6 +353,12 @@ impl<'a> TypeScriptAnnotations<'a> {
|
|||
def.type_annotation = None;
|
||||
}
|
||||
|
||||
pub fn transform_accessor_property(&mut self, def: &mut AccessorProperty<'a>) {
|
||||
def.accessibility = None;
|
||||
def.definite = false;
|
||||
def.type_annotation = None;
|
||||
}
|
||||
|
||||
pub fn transform_statements(&mut self, stmts: &mut ArenaVec<'a, Statement<'a>>) {
|
||||
// Remove declare declaration
|
||||
stmts.retain(
|
||||
|
|
|
|||
|
|
@ -147,6 +147,10 @@ impl<'a> TypeScript<'a> {
|
|||
self.annotations.transform_property_definition(def);
|
||||
}
|
||||
|
||||
pub fn transform_accessor_property(&mut self, def: &mut AccessorProperty<'a>) {
|
||||
self.annotations.transform_accessor_property(def);
|
||||
}
|
||||
|
||||
pub fn transform_statements(&mut self, stmts: &mut Vec<'a, Statement<'a>>) {
|
||||
self.annotations.transform_statements(stmts);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -163,9 +163,6 @@ tasks/coverage/misc/pass/oxc-5177.ts
|
|||
semantic error: Bindings mismatch:
|
||||
after transform: ScopeId(0): ["Bang", "Foo"]
|
||||
rebuilt : ScopeId(0): ["Bang"]
|
||||
Unresolved references mismatch:
|
||||
after transform: []
|
||||
rebuilt : ["Foo"]
|
||||
|
||||
tasks/coverage/misc/pass/swc-7187.ts
|
||||
semantic error: Bindings mismatch:
|
||||
|
|
|
|||
|
|
@ -1979,7 +1979,6 @@ failed to resolve query: failed to parse the rest of input: ...''
|
|||
|
||||
|
||||
* class/accessor-allowDeclareFields-false/input.ts
|
||||
x Output mismatch
|
||||
x TS(18010): An accessibility modifier cannot be used with a private
|
||||
| identifier.
|
||||
,-[tasks/coverage/babel/packages/babel-plugin-transform-typescript/test/fixtures/class/accessor-allowDeclareFields-false/input.ts:8:3]
|
||||
|
|
@ -1991,7 +1990,6 @@ failed to resolve query: failed to parse the rest of input: ...''
|
|||
|
||||
|
||||
* class/accessor-allowDeclareFields-true/input.ts
|
||||
x Output mismatch
|
||||
x TS(18010): An accessibility modifier cannot be used with a private
|
||||
| identifier.
|
||||
,-[tasks/coverage/babel/packages/babel-plugin-transform-typescript/test/fixtures/class/accessor-allowDeclareFields-true/input.ts:8:3]
|
||||
|
|
|
|||
Loading…
Reference in a new issue