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
4 changes: 1 addition & 3 deletions crates/oxc_estree/src/serialize/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,7 @@ impl<'s, C: Config, F: Formatter> Serializer for &'s mut ESTreeSerializer<C, F>
}
match *part {
TracePathPart::Key(key) => {
self.fixes_buffer.print_ascii_byte(b'"');
self.fixes_buffer.print_str(key);
self.fixes_buffer.print_ascii_byte(b'"');
self.fixes_buffer.print_strs_array(["\"", key, "\""]);
}
TracePathPart::Index(index) => {
let mut buffer = ItoaBuffer::new();
Expand Down
5 changes: 1 addition & 4 deletions crates/oxc_estree/src/serialize/strings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ pub struct JsonSafeString<'s>(pub &'s str);
impl ESTree for JsonSafeString<'_> {
#[inline(always)]
fn serialize<S: Serializer>(&self, mut serializer: S) {
let buffer = serializer.buffer_mut();
buffer.print_ascii_byte(b'"');
buffer.print_str(self.0);
buffer.print_ascii_byte(b'"');
serializer.buffer_mut().print_strs_array(["\"", self.0, "\""]);
}
}

Expand Down
4 changes: 1 addition & 3 deletions crates/oxc_estree/src/serialize/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,7 @@ impl<C: Config, F: Formatter> StructSerializer for ESTreeStructSerializer<'_, C,
formatter.before_later_element(buffer);
}

buffer.print_ascii_byte(b'"');
buffer.print_str(key);
buffer.print_str("\":");
buffer.print_strs_array(["\"", key, "\":"]);
formatter.before_field_value(buffer);
value.serialize(&mut *self.serializer);
}
Expand Down
Loading