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

Editorial: Added more missing cases for ExpectedArgumentCount for FormalParameters and FormalParameterList #1662

Closed
wants to merge 1 commit into from

Conversation

jhnaldo
Copy link
Contributor

@jhnaldo jhnaldo commented Aug 9, 2019

FormalParameterList is either 1) “FormalParamer" or 2) "FormalParameterList , FormalParameter”.
However, for ExpectedArgumentCount, only "FormalParameterList , FormalParameter” is defined
but “FormalParameter” is not defined. According to the NOTE, it might be 0 if it has initializer.
Otherwise, it might be 0. I think it also should be formally defined like other semantics.

In a similar way, there is no semantics of ExpectedArgumentCount for "FormalParameters : FormalRestParameter” and “FormalParameters : FormalParameterList , “. Thus, I changed the spec to cover all cases I mentioned above.

PastedGraphic-2

@anba
Copy link
Contributor

anba commented Aug 9, 2019

The addition of FormalParameters : FormalParameterList ',' is not necessary, because of the chain production rule. The other additions seem correct and actually where already present in the ECMAScript 6 spec. Somehow they got removed in 6a06509...

Copy link
Collaborator

@jmdyck jmdyck left a comment

Choose a reason for hiding this comment

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

@jhnaldo is correct that there are missing cases. However, I've already proposed (pretty much the same) fixes for them in 72c24dd (PR #1301).

@bakkot
Copy link
Contributor

bakkot commented May 10, 2020

Subsumed by #1301.

@bakkot bakkot closed this May 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants