Skip to content

arguments variable in arrow function in standard function #2665

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

Closed
saschanaz opened this issue Apr 8, 2015 · 2 comments
Closed

arguments variable in arrow function in standard function #2665

saschanaz opened this issue Apr 8, 2015 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@saschanaz
Copy link
Contributor

(function () { () => { arguments; } })
// Error: The 'arguments' object cannot be referenced in an arrow function. Consider using a standard function expression.

This currently gives error in master branch, but I think the arguments here should reference the variable in the outer "standard" function. What do you think?

@mhegazy
Copy link
Contributor

mhegazy commented Apr 8, 2015

For the complete discussion and background, please see #2430.

With #2430 fixed, arguments will reference the outer arguments to correctly align with ES6 semantics. It will still be an error however, as this will change the meaning of previously authored typescript code. We probably will relax this restriction in a release or two, just to make sure that there is no silent change in behavior when migrating to 1.5.

@mhegazy mhegazy added the Duplicate An existing issue was already created label Apr 8, 2015
@saschanaz
Copy link
Contributor Author

I didn't know that thread, thanks :D

@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
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants