Repository navigation
Minor cleanup in bindNamespaceExportDeclaration - #27367
Merged
2 commits merged intoOct 1, 2018
Merged
2 commits merged into
2 commits merged into
Conversation
ghost
requested a review
from Nathan Shively-Sanders (sandersn)
September 26, 2018 18:56
| file.bindDiagnostics.push(createDiagnosticForNode(node, Diagnostics.Global_module_exports_may_only_appear_at_top_level)); | ||
| return; | ||
| const diag = !isSourceFile(node.parent) | ||
| ? Diagnostics.Global_module_exports_may_only_appear_at_top_level |
There was a problem hiding this comment.
Since this is a cleanup, can you instead use the syntax
preducate1 ? result1 :
predicate2 ? result2 :
undefinedI think that's a lot easier to read.
Nathan Shively-Sanders (sandersn)
requested changes
Sep 28, 2018
Nathan Shively-Sanders (sandersn)
left a comment
Member
There was a problem hiding this comment.
Formatting change request
Author
|
Nathan Shively-Sanders (@sandersn) good to merge? |
Nathan Shively-Sanders (sandersn)
approved these changes
Oct 1, 2018
This pull request was closed.
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.
Broken out from #27281
if-elseand also early returns. This makes the three cases look different, but they're actually all the same -- file a diagnostic and return.