Im trying to set the property called offsetWidth, i know that field isn't writeable (read only) by default but if i make a setter it will be writeable, rigth ?
If with a setter it stores the value, why it isn't store ?
If for example i debug in this.offsetWidth = v;
(inside of defined setter) this.offsetWidth
for example is 565 and v
is 666, after make next step in debug the value isn't change, my question is why ?
var nativeOffsetWidth4 = Object.getOwnPropertyDescriptor(HTMLElement.prototype,'offsetWidth');
nativeOffsetWidth4.get= function(){
console.log(this.offsetWidth);
}
nativeOffsetWidth4.set= function(v){
this.offsetWidth = v;
}
nativeOffsetWidth4.get.call(document.body);
nativeOffsetWidth4.value = 666; //Don't stores the value.
nativeOffsetWidth4.get.call(document.body);
nativeOffsetWidth4.set.call(document.body, 666); //Don't stores the value.
nativeOffsetWidth4.get.call(document.body);