Skip to content

Commit 127a30e

Browse files
committed
Fix the sourcemap emit of lambda expression without return on another line
Handles #5122
1 parent 986d884 commit 127a30e

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

src/compiler/emitter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5003,8 +5003,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
50035003
increaseIndent();
50045004
writeLine();
50055005
emitLeadingComments(node.body);
5006+
emitStart(body);
50065007
write("return ");
50075008
emit(body);
5009+
emitEnd(body);
50085010
write(";");
50095011
emitTrailingComments(node.body);
50105012

tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/sourceMapValidationLambdaSpanningMultipleLines.sourcemap.txt

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,16 @@ sourceFile:sourceMapValidationLambdaSpanningMultipleLines.ts
2424
4 >Emitted(1, 16) Source(1, 15) + SourceIndex(0)
2525
---
2626
>>> return item;
27-
1->^^^^^^^^^^^
28-
2 > ^^^^
27+
1->^^^^
28+
2 > ^^^^^^^
29+
3 > ^^^^
2930
1->) =>
3031
>
31-
2 > item
32-
1->Emitted(2, 12) Source(2, 5) + SourceIndex(0)
33-
2 >Emitted(2, 16) Source(2, 9) + SourceIndex(0)
32+
2 >
33+
3 > item
34+
1->Emitted(2, 5) Source(2, 5) + SourceIndex(0)
35+
2 >Emitted(2, 12) Source(2, 5) + SourceIndex(0)
36+
3 >Emitted(2, 16) Source(2, 9) + SourceIndex(0)
3437
---
3538
>>>});
3639
1 >

0 commit comments

Comments
 (0)