Skip to content

Default Object keys result in false positives #323

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

Open
ThomasRinsma opened this issue Mar 16, 2025 · 0 comments
Open

Default Object keys result in false positives #323

ThomasRinsma opened this issue Mar 16, 2025 · 0 comments

Comments

@ThomasRinsma
Copy link

Encodings are kept track of in a regular JavaScript Object. This causes problems when keys are requested, which exist in the default JavaScript Object prototype. For example:

> il = require("iconv-lite");
> il.encodingExists("constructor");
true

A fix would be to initialize such look-up objects as Object.create(null) (i.e. a null-prototype object).

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

1 participant