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

Strict mode only reserved words in AssignmentExpressions do not cause parse errors #1171

Closed
conrad-watt opened this issue May 1, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@conrad-watt
Copy link

What steps will reproduce the problem?
Compare Esprima's behaviour when parsing the following two programs. Thanks to @edgemaster for the examples.

"use strict";
var public = 1;
"use strict";
public = 1;

What is the expected output?
A parse failure for both programs.

What do you see instead?
The first program results in a parse failure. The second program is parsed as though 'public' were not a ReservedWord in strict mode. Note that this behaviour does not occur if a non-strict mode only reserved word such as enum is substituted.

What version of the product are you using? On what operating system? Which browser?
Master. This bug can be seen on the online parser demo.

@conrad-watt conrad-watt changed the title Strict mode only reserved words in AssignmentExpressions do not cause early errors Strict mode only reserved words in AssignmentExpressions do not cause parse errors May 1, 2015
@ariya ariya added the defect label Aug 14, 2015
@ariya ariya self-assigned this Aug 14, 2015
ariya added a commit to ariya/esprima that referenced this issue Aug 14, 2015
@ariya ariya closed this as completed in b5c6313 Aug 16, 2015
@ariya ariya added this to the 2.6 milestone Aug 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants