-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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: improve proto checking for hgetall [skip ci] #1418
Conversation
As mentioned in #1417
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, documentation of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/in#parameters in
operator is what I'd expect it to be
expect(ret[CUSTOM_PROPERTY]).to.eql("world"); | ||
expect(Object.keys(ret).sort()).to.eql( | ||
["__proto__", CUSTOM_PROPERTY].sort() | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unrelated to this change: Could also check that expect(Object.getPrototypeOf(ret)).to.eql(Object.prototype);
to confirm the original prototype isn't overridden, though the Object.keys() check pretty much implies that
🎉 This PR is included in version 4.27.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [4.27.9](redis/ioredis@v4.27.8...v4.27.9) (2021-08-30) ### Bug Fixes * Fix undefined property warning in executeAutoPipeline ([#1425](redis/ioredis#1425)) ([f898672](redis/ioredis@f898672)) * improve proto checking for hgetall [skip ci] ([#1418](redis/ioredis#1418)) ([cba83cb](redis/ioredis@cba83cb))
As mentioned in #1417