1
0
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:
Ruben Bridgewater
2016-04-13 03:48:33 +02:00
parent a11e0c5ff9
commit 228573b8d7
4 changed files with 25 additions and 37 deletions

View File

@@ -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);