From 4ddc85e1daa88ef96a2fe730ccfd159c7f1dbb38 Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 14 May 2024 18:01:31 -0400 Subject: fix(emit): regression - keep comments in emit (#23815) Closes https://github.com/denoland/deno/discussions/23814 --- tests/specs/run/keep_comments_ts/__test__.jsonc | 4 ++++ tests/specs/run/keep_comments_ts/main.out | 4 ++++ tests/specs/run/keep_comments_ts/main.ts | 7 +++++++ 3 files changed, 15 insertions(+) create mode 100644 tests/specs/run/keep_comments_ts/__test__.jsonc create mode 100644 tests/specs/run/keep_comments_ts/main.out create mode 100644 tests/specs/run/keep_comments_ts/main.ts (limited to 'tests/specs/run/keep_comments_ts') diff --git a/tests/specs/run/keep_comments_ts/__test__.jsonc b/tests/specs/run/keep_comments_ts/__test__.jsonc new file mode 100644 index 000000000..5517e693d --- /dev/null +++ b/tests/specs/run/keep_comments_ts/__test__.jsonc @@ -0,0 +1,4 @@ +{ + "args": "run main.ts", + "output": "main.out" +} diff --git a/tests/specs/run/keep_comments_ts/main.out b/tests/specs/run/keep_comments_ts/main.out new file mode 100644 index 000000000..8cf85ee71 --- /dev/null +++ b/tests/specs/run/keep_comments_ts/main.out @@ -0,0 +1,4 @@ +function test() { + // this comment should be in output + return 1 + 1; +} diff --git a/tests/specs/run/keep_comments_ts/main.ts b/tests/specs/run/keep_comments_ts/main.ts new file mode 100644 index 000000000..ff58eff2e --- /dev/null +++ b/tests/specs/run/keep_comments_ts/main.ts @@ -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()); -- cgit v1.2.3