Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upfix(ivy): wrap functions from "providers" in parentheses in Closure mode #33609
+251
−50
Conversation
623ba11
to
face365
LTGM
|
} | ||
return visited; | ||
}; | ||
return (node: ts.Expression) => ts.visitEachChild(node, visitor, context); |
This comment has been minimized.
This comment has been minimized.
petebacondarwin
Nov 6, 2019
Member
Suggested change
return (node: ts.Expression) => ts.visitEachChild(node, visitor, context); | |
return node => ts.visitEachChild(node, visitor, context); |
e7a7f9e
to
4f6b3ca
This comment has been minimized.
This comment has been minimized.
@petebacondarwin @alxhub thanks for the review! I've updated this PR based on the comments:
Could you please have a quick look again and let me know if you have additional feedback? Thank you. |
Due to the fact that Tsickle runs between analyze and transform phases in Angular, Tsickle may transform nodes (add comments with type annotations for Closure) that we captured during the analyze phase. As a result, some patterns where a function is returned from another function may trigger automatic semicolon insertion, which breaks the code (makes functions return `undefined` instead of a function). In order to avoid the problem, this commit updates the code to wrap all functions in some expression ("privders" and "viewProviders") in parentheses. More info can be found in Tsickle source code here: https://github.com/angular/tsickle/blob/d7974262571c8a17d684e5ba07680e1b1993afdd/src/jsdoc_transformer.ts#L1021
…osure mode
4f6b3ca
to
4de646c
This comment has been minimized.
This comment has been minimized.
alxhub
added a commit
that referenced
this pull request
Nov 20, 2019
…ode (#33609) Due to the fact that Tsickle runs between analyze and transform phases in Angular, Tsickle may transform nodes (add comments with type annotations for Closure) that we captured during the analyze phase. As a result, some patterns where a function is returned from another function may trigger automatic semicolon insertion, which breaks the code (makes functions return `undefined` instead of a function). In order to avoid the problem, this commit updates the code to wrap all functions in some expression ("privders" and "viewProviders") in parentheses. More info can be found in Tsickle source code here: https://github.com/angular/tsickle/blob/d7974262571c8a17d684e5ba07680e1b1993afdd/src/jsdoc_transformer.ts#L1021 PR Close #33609
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
AndrewKushnir commentedNov 6, 2019
Due to the fact that Tsickle runs between analyze and transform phases in Angular, Tsickle may transform nodes (add comments with type annotations for Closure) that we captured during the analyze phase. As a result, some patterns where a function is returned from another function may trigger automatic semicolon insertion, which breaks the code (makes functions return
undefined
instead of a function). In order to avoid the problem, this commit updates the code to wrap all functions in some expression ("privders" and "viewProviders") in parentheses. More info can be found in Tsickle source code here: https://github.com/angular/tsickle/blob/d7974262571c8a17d684e5ba07680e1b1993afdd/src/jsdoc_transformer.ts#L1021PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?