Skip to content
Merged
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
14 changes: 7 additions & 7 deletions crates/oxc_codegen/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,20 @@ impl Gen for Directive<'_> {
// See https://github.com/babel/babel/blob/v7.26.2/packages/babel-generator/src/generators/base.ts#L64
let directive = self.directive.as_str();

let mut chars = directive.chars();
let mut bytes = directive.as_bytes().iter();
let mut quote = p.quote;
while let Some(c) = chars.next() {
match c {
'"' => {
while let Some(&b) = bytes.next() {
match b {
b'"' => {
quote = Quote::Single;
break;
}
'\'' => {
b'\'' => {
quote = Quote::Double;
break;
}
'\\' => {
chars.next();
b'\\' => {
bytes.next();
}
_ => {}
}
Expand Down
Loading