'use strict';
(function () {
let element = { name: '', dom: '' };
Object.defineProperties(element, {
get: () => { return this.dom; },
set: (dom) => { this.dom = dom; this.name = this.dom.nodeName.toLowerCase(); }
});
element = document.body;
alert(element.name);
}());
Так тоже не работает.