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

typeof regex literal #657

Closed
stoyan opened this issue Sep 20, 2012 · 1 comment
Closed

typeof regex literal #657

stoyan opened this issue Sep 20, 2012 · 1 comment
Milestone

Comments

@stoyan
Copy link

stoyan commented Sep 20, 2012

var a = typeof /[a-z]/;

is an error:
Expected an identifier and instead saw '/'.

@kangax
Copy link
Contributor

kangax commented Oct 13, 2012

Might be related:

var x;
if (x /= 2) { }

produces:

Expected ')' to match '(' from line 2 and instead saw '/='.

and bunch of other errors related to parsing error.

@valueof valueof closed this as completed in df3337d Dec 7, 2012
jugglinmike pushed a commit to jugglinmike/jshint that referenced this issue Oct 21, 2014
This commit fixes two things:

 1. We can now parse regular expressions preceded by 'typeof'.
 2. You can use *=, +=, etc. punctuators as conditions (you still
    need option 'boss' to turn off the warning though).

Closes jshintGH-657.
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

No branches or pull requests

3 participants