You've already forked node-redis
mirror of
https://github.com/redis/node-redis.git
synced 2025-08-06 02:15:48 +03:00
Support __proto__ and similar as object attribute in hgetall
This commit is contained in:
@@ -22,10 +22,10 @@ describe("The 'hgetall' method", function () {
|
||||
});
|
||||
|
||||
it('handles simple keys and values', function (done) {
|
||||
client.hmset(['hosts', 'mjr', '1', 'another', '23', 'home', '1234'], helper.isString('OK'));
|
||||
client.hmset(['hosts', '__proto__', '1', 'another', '23', 'home', '1234'], helper.isString('OK'));
|
||||
client.HGETALL(['hosts'], function (err, obj) {
|
||||
assert.strictEqual(3, Object.keys(obj).length);
|
||||
assert.strictEqual('1', obj.mjr.toString());
|
||||
assert.strictEqual('1', obj.__proto__.toString()); // eslint-disable-line no-proto
|
||||
assert.strictEqual('23', obj.another.toString());
|
||||
assert.strictEqual('1234', obj.home.toString());
|
||||
return done(err);
|
||||
|
Reference in New Issue
Block a user