es-shims/Object.entries

too complex

Closed this issue · 3 comments

why not simply

Object.prototype.entries || Object.defineProperty(Object.prototype, 'entries', { // shim
    enumerable: false,
    value: function() { return Object.keys(this).map(k=>[k,this[k]]); }
});

Because then it would violate the spec. Every single line of code in the implementation is absolutely required for spec compliance.

If you try it out locally, you’ll see how many tests fail.

This is also a duplicate of #13.