Repository navigation
Fix missing parens when function expressions is tag - #5193
Merged
Merged
Conversation
existentialism
commented
Jan 23, 2017
Member
| Q | A |
|---|---|
| Patch: Bug Fix? | yes |
| Major: Breaking Change? | no |
| Minor: New Feature? | no |
| Deprecations? | no |
| Spec Compliancy? | no |
| Tests Added/Pass? | yes |
| Fixed Tickets | Fixes #5192 |
| License | MIT |
| Doc PR | |
| Dependency Changes |
|
@existentialism, thanks for your PR! By analyzing the history of the files in this pull request, we identified @hzoo, @loganfsmyth and @bjouhier to be potential reviewers. |
Current coverage is 89.22% (diff: 100%)@@ master #5193 diff @@
==========================================
Files 203 203
Lines 9835 9838 +3
Methods 1071 1071
Messages 0 0
Branches 2620 2624 +4
==========================================
+ Hits 8775 8778 +3
Misses 1060 1060
Partials 0 0
|
loganfsmyth
reviewed
Jan 23, 2017
| export function ArrowFunctionExpression(node: Object, parent: Object): boolean { | ||
| // export default (function () {}); | ||
| if (t.isExportDeclaration(parent)) { | ||
| if (t.isTaggedTemplateExpression(parent)) { |
Member
There was a problem hiding this comment.
I think the function expression case is fine, it's only the arrow function that needs fixing.
Member
There was a problem hiding this comment.
Oh wait, I see why you added this.
function(){}`foo`
is fine as long as it is in an expression context, so I'd be in favor of expanding isFirstInStatement to handle functions in tagged templates, are you up for that? So your test output would be
(() => {})``;
(function(){}``);
existentialism
force-pushed
the
issue5192
branch
from
January 23, 2017 02:57
74b9375 to
f0ba77e
Compare
danez
approved these changes
Jan 23, 2017
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.