Object Rest Destructuring and Spread Properties (Re: September 25 2014 Meeting Notes)

# Andri Möll (11 years ago)

Sorry, but I don’t exactly get the outcome of the object destructuring discussion when it came to own vs enumerable properties. I see Allen Wirfs-Brock arguing against using only own properties, but then a few sentences later stating “ownness is clear”. Huh?

FWIW, to this day I don’t get the hatred of inheritance. As long as property access takes inheritance into account, people are screwed when they mess with Object.prototype. Try running your code on Node.js with Object.defineProperty(Object.prototype, “error”, {value: function() {}}) and see how well it silences almost all errors. Or do the same with any obj.property name you find in your code.

All such proposals make using prototypical inheritance for the rest of us complicated — there might be code that filters out valid [inherited] properties as a by-product of convenience.

Andri