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

Implements ES2016 check for "use strict" #424

Closed
wants to merge 1 commit into from

Conversation

nzakas
Copy link
Contributor

@nzakas nzakas commented Jun 15, 2016

In ES2016, you can no longer have "use strict" in the body of a function
that has complex parameters (destructured or using default values).

Fixes #423

In ES2016, you can no longer have "use strict" in the body of a function
that has complex parameters (destructured or using default values).

Fixes acornjs#423
@@ -9150,6 +9150,98 @@ test("function f([x] = [1]) {}", {
locations: true
});

test("function f([x] = [1]) { 'use strict' }", {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this test to make sure it still parses okay for ES6.

@nzakas
Copy link
Contributor Author

nzakas commented Jun 29, 2016

Is there anything else I need to do to land this?

marijnh added a commit that referenced this pull request Jun 30, 2016
@marijnh
Copy link
Member

marijnh commented Jun 30, 2016

Nope, it looks good. I've merged it as a062434 and followed up with a small patch to remove the ref prefix and reorder a conditional to make it slightly cheaper.

@marijnh marijnh closed this Jun 30, 2016
@nzakas nzakas deleted the issue423 branch June 30, 2016 16:06
@nzakas
Copy link
Contributor Author

nzakas commented Jun 30, 2016

Thanks!

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.

3 participants