Merged
Conversation
- also added noSelf directive to add `this: void` namespace/class-wide - rewrote function assignment tests to be more thorough and maintainable - fixed bug in generators where parameters were being hidden
- fixed bad definition in one of the assign test functions - performing diagnostics on invalif function assignment tests - added check in transpileString to ensure ignoreDiagnostics command line flag is respected
Perryvw
reviewed
Mar 3, 2019
src/TSHelper.ts
Outdated
| return ContextType.Void; | ||
|
|
||
| let scopeDeclaration: ts.Declaration = signatureDeclaration; | ||
| while (true) { |
Member
There was a problem hiding this comment.
Probably nice to refactor this loop into its own TSHelper.hasNoSelfAncestor
| this: void, | ||
| arr: T[], | ||
| callbackFn: (this: void, element: T, index?: number, array?: T[]) => boolean | ||
| callbackFn: (element: T, index?: number, array?: T[]) => boolean |
Member
There was a problem hiding this comment.
So this callback inherits the void context from the function definition? Maybe it's me, but this doesn't seem very intuitive to me.
Collaborator
Author
There was a problem hiding this comment.
No, it's not inherited. I set the callback to take as self, so regularly defined functions can be passed in here. Otherwise any non-expression functions used as callbacks would need the this: void which would get annoying.
…duce overall amount of testing required. I beleive this should still catch all the known edge-cases.
…eftover FocusTest reference
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 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.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
-all functions default to having a
selfparameter-
@noSelfcan be added to namespace or class to set the default within that scope (recursive)-function assignment tests re-written in a more 'procedural' way, making them more thorough, but more numerous
-fixed an issue in generators where parameters were being hidden by redundant definitions