mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
fix(codegen): print indentation before directive (#3512)
This commit is contained in:
parent
c00598b9d4
commit
affb2c864e
3 changed files with 6 additions and 7 deletions
|
|
@ -469,9 +469,10 @@ impl<'a, const MINIFY: bool> Codegen<'a, MINIFY> {
|
|||
}
|
||||
} else {
|
||||
for directive in directives {
|
||||
self.print_indent();
|
||||
directive.gen(self, ctx);
|
||||
self.print_soft_newline();
|
||||
}
|
||||
self.print_soft_newline();
|
||||
}
|
||||
}
|
||||
for stmt in statements {
|
||||
|
|
|
|||
|
|
@ -85,5 +85,3 @@ null-Number(1);
|
|||
|
||||
=================================== MINIFIED ===================================
|
||||
2.0000001000000003;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -424,8 +424,8 @@ Invalid Character `[`
|
|||
(11:43-12:2) " {\n " --> (1:43-2:0) " {"
|
||||
(12:2-12:3) " " --> (2:0-2:1) "\n"
|
||||
(12:3-12:14) "(function()" --> (2:1-2:13) "\t(function()"
|
||||
(12:14-13:0) " {" --> (2:13-3:0) " {"
|
||||
(13:0-15:0) "\n'use strict';\n" --> (3:0-4:2) "\n'use strict';\n\t"
|
||||
(12:14-13:0) " {" --> (2:13-3:2) " {\n\t"
|
||||
(13:0-15:0) "\n'use strict';\n" --> (3:2-4:2) "\t'use strict';\n\t"
|
||||
(15:0-15:4) "\nvar" --> (4:2-4:6) "\tvar"
|
||||
(15:4-15:14) " _assign =" --> (4:6-4:16) " _assign ="
|
||||
(15:14-15:22) " require" --> (4:16-4:24) " require"
|
||||
|
|
@ -5257,8 +5257,8 @@ Invalid Character `[`
|
|||
|
||||
|
||||
- string-literal-newline/input.js
|
||||
(0:0-3:0) "\"before\\\nafter\";\n" --> (0:0-1:7) "'before\\\nafter'"
|
||||
(3:0-6:1) "\n\"before\\\n\\\nafter\";\n" --> (1:7-4:1) ";'before\\\n\\\nafter';\n"
|
||||
(0:0-3:0) "\"before\\\nafter\";\n" --> (0:0-2:0) "'before\\\nafter';"
|
||||
(3:0-6:1) "\n\"before\\\n\\\nafter\";\n" --> (2:0-5:1) "\n'before\\\n\\\nafter';\n"
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue