console.log(
(Object.getOwnPropertyDescriptor(Document.prototype, 'cookie') || Object.getOwnPropertyDescriptor(HTMLDocument.prototype, 'cookie')).get.call(document)
);
var f = obj => Object.getOwnPropertyDescriptor(obj.prototype, 'cookie');
console.log( (f(Document) || f(HTMLDocument)).get.call(document) );