diff options
author | 2023-06-04 18:07:38 -0700 | |
---|---|---|
committer | 2023-06-04 18:07:38 -0700 | |
commit | 1f3da24fe02ab5a8a03211182f402722536c2c72 (patch) | |
tree | b1e120bbcf2e80a86562a5097f4b6830b3bc208e | |
parent | c4e31551f349c3ab0b15ef5adc4407848d109dd9 (diff) | |
download | bun-1f3da24fe02ab5a8a03211182f402722536c2c72.tar.gz bun-1f3da24fe02ab5a8a03211182f402722536c2c72.tar.zst bun-1f3da24fe02ab5a8a03211182f402722536c2c72.zip |
[Transpiler] Fix normalizing \r\n in template string literals (#3209)
-rw-r--r-- | src/js_lexer.zig | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/js_lexer.zig b/src/js_lexer.zig index 4e262003b..c4ed7216c 100644 --- a/src/js_lexer.zig +++ b/src/js_lexer.zig @@ -2640,7 +2640,7 @@ fn NewLexer_( // them. <CR><LF> and <CR> LineTerminatorSequences are normalized to // <LF> for both TV and TRV. An explicit EscapeSequence is needed to // include a <CR> or <CR><LF> sequence. - var bytes = MutableString.init(lexer.allocator, text.len) catch unreachable; + var bytes = MutableString.initCopy(lexer.allocator, text) catch @panic("Out of memory"); var end: usize = 0; var i: usize = 0; var c: u8 = '0'; |