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

LGTM.com - false positive #2621

Closed
ljharb opened this issue Jan 10, 2020 · 1 comment
Closed

LGTM.com - false positive #2621

ljharb opened this issue Jan 10, 2020 · 1 comment
Assignees

Comments

@ljharb
Copy link

@ljharb ljharb commented Jan 10, 2020

Description of the false positive

Strict mode can not use arguments.callee, this is true, but i'm using it inside a try/catch explicitly to trigger the exception.

https://lgtm.com/projects/g/ljharb/es-abstract/snapshot/a0800679d508ef15d31fe84283fc6a522277ca23/files/GetIntrinsic.js?sort=name&dir=ASC&mode=heatmap#xbd19a52cddeabb11:1

It's also marked as "has no effect", but it throws an exception in strict mode code, which is quite a strong effect.

https://lgtm.com/projects/g/ljharb/es-abstract/snapshot/a0800679d508ef15d31fe84283fc6a522277ca23/files/GetIntrinsic.js?sort=name&dir=ASC&mode=heatmap#xbd19a52cddeabb11:1

In other words, I think that both of these should never show up for arguments.callee. In sloppy mode, this is a noop expression; in strict mode, it has an effect (and ideally it should be permitted as a noop expression inside a try/catch)

@asgerf

This comment has been minimized.

Copy link
Contributor

@asgerf asgerf commented Jan 21, 2020

Hi ljharb,

Thanks for the report. #2627 and #2624 should fix the two spurious alerts. The alerts should go away next time LGTM.com updates.

@asgerf asgerf closed this Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.