|
1 |
| -/// <reference path="checker.ts" /> |
| 1 | +/// <reference path="checker.ts" /> |
2 | 2 | /// <reference path="transformer.ts" />
|
3 | 3 | /// <reference path="declarationEmitter.ts" />
|
4 | 4 | /// <reference path="sourcemap.ts" />
|
@@ -211,7 +211,7 @@ namespace ts {
|
211 | 211 | emitNodeWithComments,
|
212 | 212 | emitBodyWithDetachedComments,
|
213 | 213 | emitTrailingCommentsOfPosition,
|
214 |
| - emitLeadingComments, |
| 214 | + emitLeadingCommentsOfPosition, |
215 | 215 | } = comments;
|
216 | 216 |
|
217 | 217 | let currentSourceFile: SourceFile;
|
@@ -1348,7 +1348,7 @@ namespace ts {
|
1348 | 1348 | writeToken(SyntaxKind.OpenBraceToken, node.pos, /*contextNode*/ node);
|
1349 | 1349 | emitBlockStatements(node);
|
1350 | 1350 | // We have to call emitLeadingComments explicitly here because otherwise leading comments of the close brace token will not be emitted
|
1351 |
| - emitLeadingComments(node.statements.end, /*isEmittedNode*/true); |
| 1351 | + emitLeadingCommentsOfPosition(node.statements.end); |
1352 | 1352 | writeToken(SyntaxKind.CloseBraceToken, node.statements.end, /*contextNode*/ node);
|
1353 | 1353 | }
|
1354 | 1354 | }
|
@@ -2235,10 +2235,10 @@ namespace ts {
|
2235 | 2235 | // function commentedParameters(
|
2236 | 2236 | // /* Parameter a */
|
2237 | 2237 | // a
|
2238 |
| - // /* End of parameter a */ -> this comment doesn't consider to be trailing comment of parameter "a" due to newline |
| 2238 | + // /* End of parameter a */ -> this comment isn't considered to be trailing comment of parameter "a" due to newline |
2239 | 2239 | // ,
|
2240 |
| - if (emitLeadingComments && delimiter && previousSibling.end !== parentNode.end) { |
2241 |
| - emitLeadingComments(previousSibling.end, /*isEmittedNode*/ previousSibling.kind !== SyntaxKind.NotEmittedStatement); |
| 2240 | + if (emitLeadingCommentsOfPosition && delimiter && previousSibling.end !== parentNode.end) { |
| 2241 | + emitLeadingCommentsOfPosition(previousSibling.end); |
2242 | 2242 | }
|
2243 | 2243 | write(delimiter);
|
2244 | 2244 |
|
@@ -2294,10 +2294,7 @@ namespace ts {
|
2294 | 2294 | // /* end of element 2 */
|
2295 | 2295 | // ];
|
2296 | 2296 | if (previousSibling && delimiter && previousSibling.end !== parentNode.end) {
|
2297 |
| - emitLeadingComments(previousSibling.end, /*isEmittedNode*/ previousSibling.kind !== SyntaxKind.NotEmittedStatement); |
2298 |
| - if (hasTrailingComma) { |
2299 |
| - emitLeadingComments(previousSibling.end, /*isEmittedNode*/ previousSibling.kind !== SyntaxKind.NotEmittedStatement); |
2300 |
| - } |
| 2297 | + emitLeadingCommentsOfPosition(previousSibling.end); |
2301 | 2298 | }
|
2302 | 2299 |
|
2303 | 2300 | // Decrease the indent, if requested.
|
|
0 commit comments