Skip to content
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
wants to merge 18 commits into from

Conversation

DanielRosenwasser
Copy link
Member

This change should only apply to ES3 & ES5.

When an identifier named arguments is used in an arrow function, and can be resolved in some contained scope, we will capture arguments as _arguments if necessary and use _arguments at every use-site.

Resolves #2430.

I recommend just looking at the files-changed view. Quite a bit changed between commits.

@@ -1419,7 +1419,7 @@
"category": "Error",
"code": 2495
},
"The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.": {
"The 'arguments' object cannot be referenced in an arrow function below ES6. Consider using a standard function expression.": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just say "in ES3 or ES5"

@mhegazy
Copy link
Contributor

mhegazy commented Apr 23, 2015

@DanielRosenwasser we probably should close this now.

@DanielRosenwasser
Copy link
Member Author

Okay :(

@mhegazy mhegazy deleted the captureArguments branch April 23, 2015 23:07
@mhegazy
Copy link
Contributor

mhegazy commented Apr 23, 2015

🌷

@DanielRosenwasser DanielRosenwasser restored the captureArguments branch April 24, 2015 00:05
@mhegazy mhegazy deleted the captureArguments branch November 2, 2017 21:01
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

arguments reference in an arrow function in ES5/ES6
4 participants