0.1.0 • Published 10 years ago
property-lolscriptors v0.1.0
property lolscriptors
patches property descriptor functions so you can configure "non-configurable" properties of objects
Install
npm install property-lolscriptors
Use
var patchPropertyDescriptors = require('property-lolscriptors');
var redefine = patchPropertyDescriptors();
var x = {};
Object.defineProperty(x, 'y', {
value: 5
});
// x.y => 5
// throws TypeError:
Object.defineProperty(x, 'y', {
value: 5
});
// x.y => 5
// will not throw TypeError
redefine(x, 'y', {
value: 10
});
// x.y => 10
license
MIT