Closed jfparadis closed 6 years ago
In the getter created by the tamperProof function:
function setter(newValue) { if (obj === this) { throw new TypeError('Cannot set virtually frozen property: ' + name); } if (!!gopd(this, name)) { this[name] = newValue; } // TODO(erights): Do all the inherited property checks defProp(this, name, { value: newValue, writable: true, enumerable: true, configurable: true }); }
Currently, an attempt is made to redefine the property every time setter is invoked.
The definition of the property apparently needs to move to the else block of the check to see if the property exists.
if (!!gopd(this, name)) { // assign } else { // define }
In the getter created by the tamperProof function:
Currently, an attempt is made to redefine the property every time setter is invoked.
The definition of the property apparently needs to move to the else block of the check to see if the property exists.