Skip to content

Commit 0acd860

Browse files
committed
Merge pull request #8172 from YuichiNukiyama/fix8117
fix 8117
2 parents 6e812e5 + d48f617 commit 0acd860

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

src/compiler/emitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7879,7 +7879,7 @@ const _super = (function (geti, seti) {
78797879
node.parent &&
78807880
node.parent.kind === SyntaxKind.ArrowFunction &&
78817881
(<ArrowFunction>node.parent).body === node &&
7882-
compilerOptions.target <= ScriptTarget.ES5) {
7882+
languageVersion <= ScriptTarget.ES5) {
78837883

78847884
return false;
78857885
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//// [singleLineCommentInConciseArrowFunctionES3.ts]
2+
function test() {
3+
return () =>
4+
// some comments here;
5+
123;
6+
}
7+
8+
//// [singleLineCommentInConciseArrowFunctionES3.js]
9+
function test() {
10+
return function () {
11+
// some comments here;
12+
return 123;
13+
};
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
=== tests/cases/compiler/singleLineCommentInConciseArrowFunctionES3.ts ===
2+
function test() {
3+
>test : Symbol(test, Decl(singleLineCommentInConciseArrowFunctionES3.ts, 0, 0))
4+
5+
return () =>
6+
// some comments here;
7+
123;
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
=== tests/cases/compiler/singleLineCommentInConciseArrowFunctionES3.ts ===
2+
function test() {
3+
>test : () => () => number
4+
5+
return () =>
6+
>() => // some comments here; 123 : () => number
7+
8+
// some comments here;
9+
123;
10+
>123 : number
11+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
function test() {
2+
return () =>
3+
// some comments here;
4+
123;
5+
}

0 commit comments

Comments
 (0)