Skip to content

Commit b5bcba3

Browse files
committed
File additional bugs against TypeScript and Polymer for the workarounds
in transformer mode. Closes #529
1 parent cc0e059 commit b5bcba3

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/transformer_util.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ function resetNodeTextRangeToPreventDuplicateComments<T extends ts.Node>(node: T
332332
* Reads in the leading comment text ranges of the given node,
333333
* converts them into `ts.SyntheticComment`s and stores them on the node.
334334
*
335+
* Note: This would be greatly simplified with https://github.com/Microsoft/TypeScript/issues/17615.
336+
*
335337
* @param lastCommentEnd The end of the last comment
336338
* @return The end of the last found comment, -1 if no comment was found.
337339
*/
@@ -357,6 +359,8 @@ function synthesizeLeadingComments(
357359
* Reads in the trailing comment text ranges of the given node,
358360
* converts them into `ts.SyntheticComment`s and stores them on the node.
359361
*
362+
* Note: This would be greatly simplified with https://github.com/Microsoft/TypeScript/issues/17615.
363+
*
360364
* @return The end of the last found comment, -1 if no comment was found.
361365
*/
362366
function synthesizeTrailingComments(sourceFile: ts.SourceFile, node: ts.Node): number {
@@ -418,6 +422,8 @@ function visitNodeStatementsWithSynthesizedComments<T extends ts.Node>(
418422
*
419423
* A Detached leading comment is the first comment in a SourceFile / Block
420424
* that is separated with a newline from the first statement.
425+
*
426+
* Note: This would be greatly simplified with https://github.com/Microsoft/TypeScript/issues/17615.
421427
*/
422428
function synthesizeDetachedLeadingComments(
423429
sourceFile: ts.SourceFile, node: ts.Node, statements: ts.NodeArray<ts.Statement>):
@@ -445,6 +451,8 @@ function synthesizeDetachedLeadingComments(
445451
*
446452
* A Detached trailing comment are all comments after the first newline
447453
* the follows the last statement in a SourceFile / Block.
454+
*
455+
* Note: This would be greatly simplified with https://github.com/Microsoft/TypeScript/issues/17615.
448456
*/
449457
function synthesizeDetachedTrailingComments(
450458
sourceFile: ts.SourceFile, node: ts.Node, statements: ts.NodeArray<ts.Statement>):

src/tsickle.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,7 @@ class Annotator extends ClosureRewriter {
718718
// for annotating binding patterns. See issue #128.
719719
// Don't emit type annotation when the variable statement is a @polymerBehavior,
720720
// as otherwise the polymer closure checker will fail.
721-
// TODO(tbosch): file an issue with Polymer, tracked in
722-
// https://github.com/angular/tsickle/issues/529.
721+
// See b/64389806
723722
if (this.polymerBehaviorStackCount === 0 &&
724723
varDecl.name.kind === ts.SyntaxKind.Identifier) {
725724
this.emitJSDocType(varDecl);
@@ -790,11 +789,10 @@ class Annotator extends ClosureRewriter {
790789
// Don't emit type casts for Polymer behaviors that are declared
791790
// by calling the Polymer function
792791
// as the Polymer closure plugin does not work when emitting them.
792+
// See b/64389806.
793793
// Note: This only matters in the transformer version of tsickle,
794794
// as the non transformer version never emitted type casts due to
795795
// https://github.com/Microsoft/TypeScript/issues/9873 (see below).
796-
// TODO(tbosch): file an issue with Polymer, tracked in
797-
// https://github.com/angular/tsickle/issues/529.
798796
return false;
799797
}
800798
// When using a type casts in template expressions,

0 commit comments

Comments
 (0)