Skip to content

Commit 561104f

Browse files
committed
Remove custom source map emit for modules.
1 parent 5769398 commit 561104f

31 files changed

+91
-306
lines changed

src/compiler/emitter.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1651,17 +1651,7 @@ const _super = (function (geti, seti) {
16511651
}
16521652

16531653
function emitBlockFunctionBody(parentNode: Node, body: Block) {
1654-
// TODO(rbuckton): This should be removed once source maps are aligned with the old
1655-
// emitter and new baselines are taken. This exists solely to
1656-
// align with the old emitter.
1657-
if (body.emitFlags & NodeEmitFlags.SourceMapEmitOpenBraceAsToken) {
1658-
write(" ");
1659-
writeToken(SyntaxKind.OpenBraceToken, body.pos);
1660-
}
1661-
else {
1662-
write(" {");
1663-
}
1664-
1654+
write(" {");
16651655
increaseIndent();
16661656

16671657
emitBodyWithDetachedComments(body, body.statements,

src/compiler/transformers/ts.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2836,14 +2836,6 @@ namespace ts {
28362836
/*location*/ blockLocation,
28372837
/*multiLine*/ true
28382838
);
2839-
2840-
// TODO(rbuckton): This should be removed once source maps are aligned with the old
2841-
// emitter and new baselines are taken. This exists solely to
2842-
// align with the old emitter.
2843-
if (body.kind === SyntaxKind.ModuleBlock) {
2844-
setNodeEmitFlags(block, NodeEmitFlags.SourceMapEmitOpenBraceAsToken);
2845-
}
2846-
28472839
return block;
28482840
}
28492841

src/compiler/types.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3110,12 +3110,6 @@ namespace ts {
31103110
AsyncFunctionBody = 1 << 21,
31113111
ReuseTempVariableScope = 1 << 22, // Reuse the existing temp variable scope during emit.
31123112
CustomPrologue = 1 << 23, // Treat the statement as if it were a prologue directive (NOTE: Prologue directives are *not* transformed).
3113-
3114-
// SourceMap Specialization.
3115-
// TODO(rbuckton): These should be removed once source maps are aligned with the old
3116-
// emitter and new baselines are taken. This exists solely to
3117-
// align with the old emitter.
3118-
SourceMapEmitOpenBraceAsToken = 1 << 24, // Emits the open brace of a block function body as a source mapped token.
31193113
}
31203114

31213115
/** Additional context provided to `visitEachChild` */

tests/baselines/reference/contextualTyping.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/contextualTyping.sourcemap.txt

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -160,27 +160,21 @@ sourceFile:contextualTyping.ts
160160
1->
161161
2 >^^^^^^^^^^^
162162
3 > ^^^^
163-
4 > ^^
164-
5 > ^
165-
6 > ^^^^^^^^^^^^->
163+
4 > ^^^^^^^^^^^^^^^->
166164
1->
167165
2 >module
168166
3 > C2T5
169-
4 >
170-
5 > {
171167
1->Emitted(12, 1) Source(21, 1) + SourceIndex(0)
172168
2 >Emitted(12, 12) Source(21, 8) + SourceIndex(0)
173169
3 >Emitted(12, 16) Source(21, 12) + SourceIndex(0)
174-
4 >Emitted(12, 18) Source(21, 13) + SourceIndex(0)
175-
5 >Emitted(12, 19) Source(21, 14) + SourceIndex(0)
176170
---
177171
>>> C2T5.foo = function (i) {
178172
1->^^^^
179173
2 > ^^^^^^^^
180174
3 > ^^^
181175
4 > ^^^^^^^^^^
182176
5 > ^
183-
1->
177+
1-> {
184178
> export var
185179
2 > foo
186180
3 > : (i: number, s: string) => number =
@@ -1100,19 +1094,13 @@ sourceFile:contextualTyping.ts
11001094
1->
11011095
2 >^^^^^^^^^^^
11021096
3 > ^^^^
1103-
4 > ^^
1104-
5 > ^
1105-
6 > ^^^^^^^^^^^^^^^->
1097+
4 > ^^^^^^^^^^^^^^^^^^->
11061098
1->
11071099
2 >module
11081100
3 > C5T5
1109-
4 >
1110-
5 > {
11111101
1->Emitted(51, 1) Source(66, 1) + SourceIndex(0)
11121102
2 >Emitted(51, 12) Source(66, 8) + SourceIndex(0)
11131103
3 >Emitted(51, 16) Source(66, 12) + SourceIndex(0)
1114-
4 >Emitted(51, 18) Source(66, 13) + SourceIndex(0)
1115-
5 >Emitted(51, 19) Source(66, 14) + SourceIndex(0)
11161104
---
11171105
>>> C5T5.foo = function (i, s) {
11181106
1->^^^^
@@ -1123,7 +1111,7 @@ sourceFile:contextualTyping.ts
11231111
6 > ^
11241112
7 > ^^
11251113
8 > ^
1126-
1->
1114+
1-> {
11271115
> export var foo: (i: number, s: string) => string;
11281116
>
11291117
2 >

tests/baselines/reference/recursiveClassReferenceTest.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.

0 commit comments

Comments
 (0)