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

getUsageOfPattern behaves inconsistently #245

Closed
RunDevelopment opened this issue Jun 13, 2021 · 1 comment · Fixed by #249
Closed

getUsageOfPattern behaves inconsistently #245

RunDevelopment opened this issue Jun 13, 2021 · 1 comment · Fixed by #249
Labels
bug Something isn't working
Milestone

Comments

@RunDevelopment
Copy link
Collaborator

While writing tests, I found that getUsageOfPattern behaves strangely around unknown functions.

The following test cases pass.

{
    code: `foo(/[a-zA-Z]\\w*/)`,
    results: [UsageOfPattern.whole],
},
{
    code: `foo({ pattern: /[a-zA-Z]\\w*/ })`,
    results: [UsageOfPattern.unknown],
},

Both should have the same result: unknown. We do not know how foo is implemented. It might use the regex as is or it might return its source.

@RunDevelopment RunDevelopment added the bug Something isn't working label Jun 13, 2021
@RunDevelopment RunDevelopment added this to the v1.0 milestone Jun 13, 2021
@ota-meshi
Copy link
Owner

I made an incorrect change when I changed from isPartialPattern to getUsageOfPattern. I will fix this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants