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

arguments and eval should be allowed in the return position in strict functions #1598

Closed
raskad opened this issue Sep 29, 2021 · 4 comments
Closed
Assignees
Labels
bug Something isn't working good first issue Good for newcomers Hacktoberfest Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com parser Issues surrounding the parser

Comments

@raskad
Copy link
Member

raskad commented Sep 29, 2021

In strict mode arguments and eval are mostly treated as keywords. For example they cannot be assigned to. But they should be allowed as return values from a strict function.

The following code examples currently fail, but should work:

let eval = 1;

function a(){
    "use strict";
    return eval;
}

a() // returns 1
function a(){
    "use strict";
    return arguments;
}

a(1,2) // returns [Arguments] { '0': 1, '1': 2 }

Based on the error message a good starting point would be here:

"using future reserved keyword '{}' not allowed in strict mode",

@raskad raskad added bug Something isn't working good first issue Good for newcomers Hacktoberfest Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com parser Issues surrounding the parser labels Sep 29, 2021
@am-a-man
Copy link
Contributor

am-a-man commented Oct 1, 2021

hey,
I would like to work on this, could you assign me this issue?

@Razican
Copy link
Member

Razican commented Jan 31, 2022

@am-a-man Do you have any updates on the progress of this?

@am-a-man
Copy link
Contributor

am-a-man commented Feb 1, 2022

@Razican sorry for the long delay, will try to complete it by the end of this week

@raskad
Copy link
Member Author

raskad commented Jun 27, 2022

Fixed by #2069

@raskad raskad closed this as completed Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers Hacktoberfest Hacktoberfest 2021 - https://hacktoberfest.digitalocean.com parser Issues surrounding the parser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants