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

Fix: no-unused-vars had been crashed at /*global $*/ #3715

Merged

Conversation

mysticatea
Copy link
Member

Fixes #3714.

\b (word boundary) could not be used to check boundaries if a variable name includes $ at the edge.
So I make checking manually with espree.

@mysticatea mysticatea force-pushed the no-unused-vars/fix-crash-on-global-comment branch from faa57da to cd5ce15 Compare September 10, 2015 02:53
@ilyavolodin
Copy link
Member

Wouldn't it be easier to replace regEx with something like:

"[\n,\s]*(" + escape(variable.name) + ")[\n,\s]*"

@mysticatea
Copy link
Member Author

Hmm...
I want to get an index here, so ...

I will think it more.

@mysticatea mysticatea force-pushed the no-unused-vars/fix-crash-on-global-comment branch from cd5ce15 to c4660d3 Compare September 10, 2015 03:33
@mysticatea
Copy link
Member Author

I updated!

@ilyavolodin
Copy link
Member

Yeah, that looks much better to me. Would want a second set of eyes on this though.

@nzakas
Copy link
Member

nzakas commented Sep 10, 2015

LGTM

nzakas added a commit that referenced this pull request Sep 10, 2015
…global-comment

Fix: `no-unused-vars` had been crashed at `/*global $*/`
@nzakas nzakas merged commit bb2135e into eslint:master Sep 10, 2015
@mysticatea mysticatea deleted the no-unused-vars/fix-crash-on-global-comment branch September 11, 2015 03:01
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants