mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 09:31:22 -05:00
fix(emit): regression - keep comments in emit (#23815)
Closes https://github.com/denoland/deno/discussions/23814
This commit is contained in:
parent
dda8979cb1
commit
4ddc85e1da
6 changed files with 35 additions and 4 deletions
|
@ -194,7 +194,7 @@ pub fn ts_config_to_transpile_and_emit_options(
|
|||
},
|
||||
deno_ast::EmitOptions {
|
||||
inline_sources: options.inline_sources,
|
||||
keep_comments: false,
|
||||
keep_comments: true,
|
||||
source_map,
|
||||
source_map_file: None,
|
||||
},
|
||||
|
|
4
tests/specs/run/keep_comments_ts/__test__.jsonc
Normal file
4
tests/specs/run/keep_comments_ts/__test__.jsonc
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"args": "run main.ts",
|
||||
"output": "main.out"
|
||||
}
|
4
tests/specs/run/keep_comments_ts/main.out
Normal file
4
tests/specs/run/keep_comments_ts/main.out
Normal file
|
@ -0,0 +1,4 @@
|
|||
function test() {
|
||||
// this comment should be in output
|
||||
return 1 + 1;
|
||||
}
|
7
tests/specs/run/keep_comments_ts/main.ts
Normal file
7
tests/specs/run/keep_comments_ts/main.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
function test() {
|
||||
// this comment should be in output
|
||||
return 1 + 1;
|
||||
}
|
||||
|
||||
// should include the comments because people rely on this behavior
|
||||
console.log(test.toString());
|
20
tests/testdata/coverage/complex_expected.lcov
vendored
20
tests/testdata/coverage/complex_expected.lcov
vendored
|
@ -11,6 +11,11 @@ FNF:4
|
|||
FNH:2
|
||||
BRF:0
|
||||
BRH:0
|
||||
DA:1,1
|
||||
DA:13,1
|
||||
DA:14,1
|
||||
DA:15,1
|
||||
DA:16,1
|
||||
DA:17,2
|
||||
DA:18,2
|
||||
DA:19,2
|
||||
|
@ -21,6 +26,9 @@ DA:24,2
|
|||
DA:25,2
|
||||
DA:26,2
|
||||
DA:27,2
|
||||
DA:29,1
|
||||
DA:30,1
|
||||
DA:31,1
|
||||
DA:32,1
|
||||
DA:33,1
|
||||
DA:34,1
|
||||
|
@ -30,6 +38,8 @@ DA:38,2
|
|||
DA:39,2
|
||||
DA:40,2
|
||||
DA:42,2
|
||||
DA:44,1
|
||||
DA:45,1
|
||||
DA:46,0
|
||||
DA:47,0
|
||||
DA:48,0
|
||||
|
@ -39,13 +49,19 @@ DA:52,0
|
|||
DA:53,0
|
||||
DA:54,0
|
||||
DA:56,0
|
||||
DA:58,1
|
||||
DA:59,1
|
||||
DA:60,1
|
||||
DA:62,1
|
||||
DA:63,1
|
||||
DA:64,0
|
||||
DA:65,0
|
||||
DA:66,0
|
||||
DA:68,0
|
||||
DA:70,1
|
||||
DA:71,0
|
||||
DA:73,1
|
||||
DA:74,1
|
||||
LH:21
|
||||
LF:35
|
||||
LH:37
|
||||
LF:51
|
||||
end_of_record
|
||||
|
|
2
tests/testdata/coverage/complex_expected.out
vendored
2
tests/testdata/coverage/complex_expected.out
vendored
|
@ -1,4 +1,4 @@
|
|||
cover [WILDCARD]/coverage/complex.ts ... 60.000% (21/35)
|
||||
cover [WILDCARD]/coverage/complex.ts ... 72.549% (37/51)
|
||||
46 | export function unused(
|
||||
47 | foo: string,
|
||||
48 | bar: string,
|
||||
|
|
Loading…
Add table
Reference in a new issue