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
12 changes: 8 additions & 4 deletions crates/oxc_ast/src/serialize/js.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ use super::{EmptyArray, Null};
type: 'RestElement',
start: DESER[u32]( POS_OFFSET<BindingRestElement>.span.start ),
end: DESER[u32]( POS_OFFSET<BindingRestElement>.span.end ),
argument: DESER[BindingPatternKind]( POS_OFFSET<BindingRestElement>.argument.kind ),
/* IF_TS */
decorators: [],
/* END_IF_TS */
argument: DESER[BindingPatternKind]( POS_OFFSET<BindingRestElement>.argument.kind ),
/* IF_TS */
optional: DESER[bool]( POS_OFFSET<BindingRestElement>.argument.optional ),
typeAnnotation: DESER[Option<Box<TSTypeAnnotation>>](
POS_OFFSET<BindingRestElement>.argument.type_annotation
Expand Down Expand Up @@ -69,8 +71,8 @@ impl ESTree for FormalParametersRest<'_, '_> {
state.serialize_field("type", &JsonSafeString("RestElement"));
state.serialize_field("start", &rest.span.start);
state.serialize_field("end", &rest.span.end);
state.serialize_field("argument", &rest.argument.kind);
state.serialize_ts_field("decorators", &EmptyArray(()));
state.serialize_field("argument", &rest.argument.kind);
state.serialize_ts_field("optional", &rest.argument.optional);
state.serialize_ts_field("typeAnnotation", &rest.argument.type_annotation);
state.serialize_ts_field("value", &Null(()));
Expand Down Expand Up @@ -364,10 +366,12 @@ impl ESTree for ArrowFunctionExpressionBody<'_> {
type: 'AssignmentPattern',
start: THIS.start,
end: THIS.end,
/* IF_TS */
decorators: [],
/* END_IF_TS */
left: keyCopy,
right: init,
/* IF_TS */
decorators: [],
optional: false,
typeAnnotation: null,
/* END_IF_TS */
Expand All @@ -386,9 +390,9 @@ impl ESTree for AssignmentTargetPropertyIdentifierInit<'_> {
state.serialize_field("type", &JsonSafeString("AssignmentPattern"));
state.serialize_field("start", &self.0.span.start);
state.serialize_field("end", &self.0.span.end);
state.serialize_ts_field("decorators", &EmptyArray(()));
state.serialize_field("left", &self.0.binding);
state.serialize_field("right", init);
state.serialize_ts_field("decorators", &EmptyArray(()));
state.serialize_ts_field("optional", &false);
state.serialize_ts_field("typeAnnotation", &Null(()));
state.end();
Expand Down
6 changes: 3 additions & 3 deletions crates/oxc_ast/src/serialize/ts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,8 +301,8 @@ impl ESTree for TSTypeNameIdentifierReference<'_, '_> {
end: expression.end,
object: expression.left,
property: expression.right,
computed: false,
optional: false,
computed: false,
};

while (parent.object.type === 'TSQualifiedName') {
Expand All @@ -313,8 +313,8 @@ impl ESTree for TSTypeNameIdentifierReference<'_, '_> {
end: object.end,
object: object.left,
property: object.right,
computed: false,
optional: false,
computed: false,
};
}
}
Expand Down Expand Up @@ -347,8 +347,8 @@ impl ESTree for TSTypeNameAsMemberExpression<'_, '_> {
state.serialize_field("end", &name.span.end);
state.serialize_field("object", &TSTypeNameAsMemberExpression(&name.left));
state.serialize_field("property", &name.right);
state.serialize_field("computed", &false);
state.serialize_field("optional", &false);
state.serialize_field("computed", &false);
state.end();
}
}
Expand Down
4 changes: 2 additions & 2 deletions napi/parser/generated/deserialize/js.js
Original file line number Diff line number Diff line change
Expand Up @@ -1633,8 +1633,8 @@ function deserializeTSClassImplements(pos) {
end: expression.end,
object: expression.left,
property: expression.right,
computed: false,
optional: false,
computed: false,
};

while (parent.object.type === 'TSQualifiedName') {
Expand All @@ -1645,8 +1645,8 @@ function deserializeTSClassImplements(pos) {
end: object.end,
object: object.left,
property: object.right,
computed: false,
optional: false,
computed: false,
};
}
}
Expand Down
8 changes: 4 additions & 4 deletions napi/parser/generated/deserialize/ts.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,9 +424,9 @@ function deserializeAssignmentTargetPropertyIdentifier(pos) {
type: 'AssignmentPattern',
start: start,
end: end,
decorators: [],
left: keyCopy,
right: init,
decorators: [],
optional: false,
typeAnnotation: null,
};
Expand Down Expand Up @@ -857,8 +857,8 @@ function deserializeFormalParameters(pos) {
type: 'RestElement',
start: deserializeU32(pos),
end: deserializeU32(pos + 4),
argument: deserializeBindingPatternKind(pos + 8),
decorators: [],
argument: deserializeBindingPatternKind(pos + 8),
optional: deserializeBool(pos + 32),
typeAnnotation: deserializeOptionBoxTSTypeAnnotation(
pos + 24,
Expand Down Expand Up @@ -1785,8 +1785,8 @@ function deserializeTSClassImplements(pos) {
end: expression.end,
object: expression.left,
property: expression.right,
computed: false,
optional: false,
computed: false,
};

while (parent.object.type === 'TSQualifiedName') {
Expand All @@ -1797,8 +1797,8 @@ function deserializeTSClassImplements(pos) {
end: object.end,
object: object.left,
property: object.right,
computed: false,
optional: false,
computed: false,
};
}
}
Expand Down
Loading