Showing posts with label propertydescriptor. Show all posts
Showing posts with label propertydescriptor. Show all posts

Thursday, May 10, 2012

Why does a function declaration override non-writable properties of the global object?


Setting a property descriptor like this:




Object.defineProperty(window, 'someFunction', {
value: function() { alert('safe'); },
writable: false,
enumerable: false,
configurable: false
});