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
Capture 'arguments' in arrow functions in pre-ES6 targets #2764
Closed
Closed
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
a8605c5
Renamed 'LexicalThis' to 'LexicalThisOrArguments; added 'CaptureArgum…
DanielRosenwasser ace55aa
Report 'arguments' error in resolveName.
DanielRosenwasser d3e0f74
Change error message to reflect that we only error in targets below ES6.
DanielRosenwasser 7aa8892
Fixed test to emit to ES5.
DanielRosenwasser 3db3578
Only report an error for 'arguments' in an arrow function below ES6.
DanielRosenwasser 4b72353
Add CaptureArguments flag to resolved location or containing sourceFile.
DanielRosenwasser 53ccdfc
Added diagnostics.
DanielRosenwasser 93a383c
Tests for 'arguments' in arrow functions.
DanielRosenwasser c02dd3e
More tests.
DanielRosenwasser af06380
Destructuring tests for captured 'arguments'.
DanielRosenwasser a7ea5ae
Got basic renaming working. Should add more tests, give errors for '_…
DanielRosenwasser ca2d932
Added collision checks, new tests, fixed baselines.
DanielRosenwasser 9b0e6df
Merge branch 'master' into captureArguments
DanielRosenwasser a6012bc
Updated type baselines.
DanielRosenwasser 037c360
doesnt not -> does not
DanielRosenwasser 3ef397e
Use 'getThisContainer' again.
DanielRosenwasser fd0ff34
Comments.
DanielRosenwasser 9e60a4c
Refactoring error logic, renamed error messages.
DanielRosenwasser File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -331,7 +331,7 @@ module ts { | |
return node.kind === SyntaxKind.EnumDeclaration && isConst(node); | ||
} | ||
|
||
function walkUpBindingElementsAndPatterns(node: Node): Node { | ||
export function walkUpBindingElementsAndPatterns(node: Node): Node { | ||
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. I don't like this name. But you don't have to change it now. Just saying |
||
while (node && (node.kind === SyntaxKind.BindingElement || isBindingPattern(node))) { | ||
node = node.parent; | ||
} | ||
|
18 changes: 9 additions & 9 deletions
18
...rrowFunctionWhenUsingArguments.errors.txt → ...owFunctionWhenUsingArguments01.errors.txt
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
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.
Don't you need a LexicalArguments flag too?
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.
No, because unlike with
this
, you can't limit yourself to specific sites that need to be replaced with_arguments
- ifarguments
needs to be captured, then all lexicalarguments
need to be replaced.