-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
initial revision of reachability checks #4788
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
b62ef0d
initial revision of reachability checks in binder
vladima beb1aa3
addressed PR feedback
vladima 9aeb0f8
merge with master
vladima 682c14c
addressed PR feedback
vladima 69321a0
merge with master
vladima 4711f0e
merge with master
vladima 98ac805
Merge branch 'master' into reachabilityChecks
vladima ae175d0
merge with master
vladima 9d24e0f
Merge branch 'master' into reachabilityChecks
vladima ca0d580
merge with master, fix linter issues
vladima f0f5a0d
updated command line options, accepted baselines
vladima eb04f32
Merge branch 'master' into reachabilityChecks
vladima ebfcd25
merge with master
vladima 938dd74
Merge branch 'master' into reachabilityChecks
vladima 17716fb
accepted baselines
vladima bc02341
addressed PR feedback, updated tests to suppress reachability errors …
vladima 238e1c6
partially suppress reachability errors in tests
vladima 5532778
suppress reachability errors in remaining tests
vladima 7b12617
Merge branch 'master' into reachabilityChecks
vladima f9eaed7
Merge branch 'master' into reachabilityChecks
vladima f96980d
merge with master
vladima 2779352
make binder singleton, inline bindWithReachabilityChecks
vladima 7d09f26
defer allocation of error message text in binder
vladima d2a11b5
merge with master
vladima 3f11c0b
merge with master
vladima File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -622,25 +622,26 @@ namespace ts { | |
} | ||
|
||
export function isFunctionLike(node: Node): node is FunctionLikeDeclaration { | ||
if (node) { | ||
switch (node.kind) { | ||
case SyntaxKind.Constructor: | ||
case SyntaxKind.FunctionExpression: | ||
case SyntaxKind.FunctionDeclaration: | ||
case SyntaxKind.ArrowFunction: | ||
case SyntaxKind.MethodDeclaration: | ||
case SyntaxKind.MethodSignature: | ||
case SyntaxKind.GetAccessor: | ||
case SyntaxKind.SetAccessor: | ||
case SyntaxKind.CallSignature: | ||
case SyntaxKind.ConstructSignature: | ||
case SyntaxKind.IndexSignature: | ||
case SyntaxKind.FunctionType: | ||
case SyntaxKind.ConstructorType: | ||
return true; | ||
} | ||
return node && isFunctionLikeKind(node.kind); | ||
} | ||
|
||
export function isFunctionLikeKind(kind: SyntaxKind): boolean { | ||
switch (kind) { | ||
case SyntaxKind.Constructor: | ||
case SyntaxKind.FunctionExpression: | ||
case SyntaxKind.FunctionDeclaration: | ||
case SyntaxKind.ArrowFunction: | ||
case SyntaxKind.MethodDeclaration: | ||
case SyntaxKind.MethodSignature: | ||
case SyntaxKind.GetAccessor: | ||
case SyntaxKind.SetAccessor: | ||
case SyntaxKind.CallSignature: | ||
case SyntaxKind.ConstructSignature: | ||
case SyntaxKind.IndexSignature: | ||
case SyntaxKind.FunctionType: | ||
case SyntaxKind.ConstructorType: | ||
return true; | ||
} | ||
return false; | ||
} | ||
|
||
export function introducesArgumentsExoticObject(node: Node) { | ||
|
@@ -1228,7 +1229,7 @@ namespace ts { | |
case SyntaxKind.LabeledStatement: | ||
case SyntaxKind.ReturnStatement: | ||
case SyntaxKind.SwitchStatement: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops! |
||
case SyntaxKind.ThrowKeyword: | ||
case SyntaxKind.ThrowStatement: | ||
case SyntaxKind.TryStatement: | ||
case SyntaxKind.VariableStatement: | ||
case SyntaxKind.WhileStatement: | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -446,7 +446,7 @@ namespace ts.BreakpointResolver { | |
// fall through. | ||
|
||
case SyntaxKind.CatchClause: | ||
return spanInNode(lastOrUndefined((<Block>node.parent).statements));; | ||
return spanInNode(lastOrUndefined((<Block>node.parent).statements)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hah! Was this reported as unreachable? Awesome. |
||
|
||
case SyntaxKind.CaseBlock: | ||
// breakpoint in last statement of the last clause | ||
|
@@ -493,9 +493,6 @@ namespace ts.BreakpointResolver { | |
default: | ||
return spanInNode(node.parent); | ||
} | ||
|
||
// Default to parent node | ||
return spanInNode(node.parent); | ||
} | ||
|
||
function spanInColonToken(node: Node): TextSpan { | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -360,7 +360,6 @@ namespace ts.formatting { | |
return node; | ||
} | ||
} | ||
return node; | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit : Report_errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't have a consistent style here. My understanding of phrasing is: 'use this option to do...' but not 'this option does...' so I'd prefer to keep existing version. Probably @JsonFreeman has different opinion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yuit's comment was about singular vs plural, rather than the mood, if I understood correctly. The mood inconsistency is a different issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JsonFreeman @vladima yep, it is more about the consistency on plural or singular on the word "error". I will be ok either one but I think it is nice to keep them consistent