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

Accept unlabelled function statements outside of top level for strict functions #2213

Merged
merged 3 commits into from
Dec 9, 2019

Conversation

svaarala
Copy link
Owner

@svaarala svaarala commented Dec 9, 2019

Accept unlabelled function statements outside of top level for strict functions (using hoist semantics), previously they were rejected with a SyntaxError. This improves compatibility with some real world code.

Allow unlabelled function declarations outside of top level also in strict
mode, and treat them as in non-strict mode (i.e., hoist).  Previously they
were rejected with SyntaxError in strict mode.  The lenient behavior is
better because it accepts more real world code.  Ideally function
declarations in strict mode would have block visibility, but that's
not yet implementable.
@svaarala svaarala added this to the v3.0.0 milestone Dec 9, 2019
@svaarala svaarala mentioned this pull request Dec 9, 2019
21 tasks
@svaarala svaarala merged commit f03abf3 into master Dec 9, 2019
@svaarala svaarala deleted the func-stmt-strict-mode branch June 11, 2020 21:38
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.

1 participant