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

should non-simple parameter lists be allowed to mix with these new directives? #45

Open
michaelficarra opened this issue May 9, 2020 · 2 comments
Labels
question Further information is requested

Comments

@michaelficarra
Copy link
Member

We disallow the "use strict" directive in functions with non-simple parameter lists because it complicates the parsing of the parameter list. While the directives introduced by this proposal do not affect parsing, they do affect "earlier" code, e.g. functions defined in the parameter list. Is that a significant enough inconvenience for implementers that we want to disallow the commingling of these two features?

/cc @bakkot who raised this question

@michaelficarra michaelficarra added the question Further information is requested label May 9, 2020
@ljharb
Copy link
Member

ljharb commented May 9, 2020

It seems reasonable to apply the same restriction for the same reasons.

@michaelficarra
Copy link
Member Author

@ljharb It's not quite the same reasons though. An implementation wouldn't have to re-parse the parameter list, they would just need to track the functions that they parsed in the parameter list until they've passed the directive prologue. This is a significantly smaller implementation burden.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants