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

this for ... in loop is for object, use for ... of intead #5

Open
awesomeYG opened this issue Feb 1, 2024 · 1 comment
Open

this for ... in loop is for object, use for ... of intead #5

awesomeYG opened this issue Feb 1, 2024 · 1 comment
Assignees

Comments

@awesomeYG
Copy link

https://github.com/sormy/flex-js/blob/951836b221e535e61ddf01738458bd74969a7e2c/src/Lexer.js#L536C1-L537C1

image
image

use for ... in loop would always get the object property like: any,select, where。 I think this is should not be there

@sormy
Copy link
Owner

sormy commented Feb 1, 2024

We can add guard as hasOwnProperty to avoid these methods do be picked, however, there should be a good reason to do that. These any(), select(), where() look like being injected by some polyfills with imperfect implementations that is causing polyfills to pop up in for(). It is best to create unit test that fails, make a fix in the code and make failing unit test to pass.

@sormy sormy self-assigned this Feb 1, 2024
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

2 participants