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]] Don't warn when RegExp() is used without 'new'. #3529

Merged
merged 1 commit into from Feb 6, 2021

Conversation

@lauriro
Copy link
Contributor

@lauriro lauriro commented Feb 3, 2021

https://262.ecma-international.org/#sec-regexp-constructor
...
function call RegExp(…) is equivalent
to the object creation expression new RegExp(…)
with the same arguments
...

https://262.ecma-international.org/#sec-regexp-constructor
...
function call RegExp(…) is equivalent
to the object creation expression new RegExp(…)
with the same arguments
...
@coveralls
Copy link

@coveralls coveralls commented Feb 3, 2021

Coverage Status

Coverage remained the same at 100.0% when pulling df7d2c1 on lauriro:fix-regexp-warn into 2d4a3d1 on jshint:master.

@jugglinmike
Copy link
Member

@jugglinmike jugglinmike commented Feb 6, 2021

Thanks for the patch--this is a good idea!

It's a bit more refactoring than I'd typically like to see in a bug fix, but I'm not particularly fond of how the code is currently written, so I'll take it :)

@jugglinmike jugglinmike merged commit c18a6e4 into jshint:master Feb 6, 2021
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 100.0%
Details
@lauriro
Copy link
Contributor Author

@lauriro lauriro commented Feb 8, 2021

It was a bit more refactoring than I would liked to do but just extending the string triggered line length error.

.. and string.indexOf would give false-positives for Arr(), Boo(), and so on.

After pull request I found that Function is also missing.

@lauriro lauriro deleted the lauriro:fix-regexp-warn branch Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants