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
SyntaxError: unknown: Binding 'arguments' in strict mode (2:6) #11385
Comments
Hey @RichardHoOoOo! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite." |
You can pass |
Thanks for your answer! It works! However, it seems the semantic of the program got changed. For example, if the input is like this:
The output is
Then the output in console is different. Could you give me some more advise? Thanks! |
The second one is a bug! |
@RichardHoOoOo If you are interested in fixing this issue you are welcome to help, otherwise it's open for anyone who wants to work on it! The problem is in the utility we have to convert arrow functions to ES5 function expressions. In the function f() {
var g = () => console.log(arguments);
g();
}
f(1, 2, 3); // should log 1, 2, 3 However, when there is a Note that we also need to check A few test cases: var foo = () => {
var arguments = 1;
return arguments;
}; var foo = () => {
var arguments = 1;
return () => arguments;
}; function fn() {
var arguments = 1;
var foo = () => {
return arguments;
};
} var arguments = 1;
function fn() {
var foo = () => {
return arguments;
};
} If it is the first time that you contribute to Babel, follow these steps: (you need to have
|
@nicolo-ribaudo Very appreciate your help for finding the root cause! Let me take a look and see if I can fix it. |
@RichardHoOoOo Are you still working on this? @Yokubjon-J If Richard doesn't respond in 3-4 days and if you are interested, you can take this issue. Otherwise we'll need to find another one! |
@nicolo-ribaudo Hello! Sorry for late reply! OK I will take on the issue! |
I have started working on the issue! |
When I am at the 6th step, after running
Up till this part, many files will have been compiled (it generates a really long list of those files), everything seem to work perfectly, but at |
That's expected (I should have been clearer): |
Here I have stopped the process manually but it didn't give |
It's expected that it doesn't stop: it's waiting for you to change some files. I suggest leaving it in the background and opening a new terminal. |
@nicolo-ribaudo @JLHwung Can I work on this issue? |
@snitin315 Sure. It's yours. |
Thanks. Work in progress. I will sen a PR soon. |
I wonder if there's any progress on this issue. Can I take it? |
Hi I follow the instructions in this doc to transform arrow functions.
I find an error
SyntaxError: unknown: Binding 'arguments' in strict mode (2:5)
is thrown every time when a variable is named "arguments". For example,The instruction I use is
require('@babel/core').transform(code, {plugins: ['@babel/plugin-transform-arrow-functions']})
wherecode
is the input program like the above example.So how can I fix it? Is there any options I miss to set?
The text was updated successfully, but these errors were encountered: