1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-06 02:15:48 +03:00
Not inheriting from the prototype is a BC
This commit is contained in:
Ruben Bridgewater
2016-05-25 22:52:31 +03:00
parent fe00bf271d
commit 55528d8b1b
5 changed files with 10 additions and 18 deletions

View File

@@ -22,12 +22,10 @@ describe("The 'hgetall' method", function () {
});
it('handles simple keys and values', function (done) {
client.hmset(['hosts', '__proto__', '1', 'another', '23', 'home', '1234'], helper.isString('OK'));
client.hmset(['hosts', 'hasOwnProperty', '1', 'another', '23', 'home', '1234'], helper.isString('OK'));
client.HGETALL(['hosts'], function (err, obj) {
if (!/^v0\.10/.test(process.version)) {
assert.strictEqual(3, Object.keys(obj).length);
assert.strictEqual('1', obj.__proto__.toString()); // eslint-disable-line no-proto
}
assert.strictEqual(3, Object.keys(obj).length);
assert.strictEqual('1', obj.hasOwnProperty.toString());
assert.strictEqual('23', obj.another.toString());
assert.strictEqual('1234', obj.home.toString());
done(err);