Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions crates/oxc_transformer/src/typescript/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ impl<'a> TypeScript<'a, '_> {
let mut computed_key_assignments = Vec::new();
for element in &mut class.body.body {
match element {
ClassElement::PropertyDefinition(prop) => {
// `set_public_class_fields: true` only needs to transform non-private class fields.
ClassElement::PropertyDefinition(prop) if !prop.key.is_private_identifier() => {
if let Some(value) = prop.value.take() {
let assignment = self.convert_property_definition(
&mut prop.key,
Expand Down Expand Up @@ -277,8 +278,7 @@ impl<'a> TypeScript<'a, '_> {
create_this_property_access(SPAN, ident.name, ctx)
}
PropertyKey::PrivateIdentifier(_) => {
// Handled in `convert_instance_property` and `convert_static_property`
unreachable!();
unreachable!("PrivateIdentifier is skipped in transform_class_fields");
}
key @ match_expression!(PropertyKey) => {
let key = key.to_expression_mut();
Expand Down
6 changes: 3 additions & 3 deletions tasks/transform_conformance/snapshots/oxc.snap.md
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,9 @@ rebuilt : ScopeId(19): Some(ScopeId(15))
Scope parent mismatch:
after transform: ScopeId(20): Some(ScopeId(0))
rebuilt : ScopeId(20): Some(ScopeId(15))
Unresolved references mismatch:
after transform: ["a", "b", "c", "console", "dce", "e", "x", "y", "z"]
rebuilt : ["a", "b", "c", "console", "e", "x", "y", "z"]
Unresolved reference IDs mismatch for "dce":
after transform: [ReferenceId(0), ReferenceId(1), ReferenceId(4), ReferenceId(9), ReferenceId(12), ReferenceId(14), ReferenceId(17)]
rebuilt : [ReferenceId(5)]


# babel-plugin-transform-react-jsx (42/45)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ class Cls {
@dce
z;

#x: number;
#y = 1;
@dce
#z;

[x]: number;
[y] = 1;
@dce
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ class Cls {
static {
x, _y = y, z;
}
#x;
#y = 1;
@dce #z;
}

class ClsWithConstructor extends Cls {
Expand Down
Loading