diff icon indicating copy to clipboard operation
diff copied to clipboard

Feature request: report differences in prototype

Open cpcallen opened this issue 8 years ago • 0 comments
trafficstars

These comparisons should all report some difference, but in fact do not:

diff({}, Object.create(null))  // === undefined

diff({}, Object.create({}))  // === undefined

var F = function(){};
diff({}, new F);  // === undefined

(I'm pleased to see that you do correctly return a non-empty diff for diff([], Object.create(Array.prototype)), though.)

For most objects it would be reasonable to report different prototypes using __proto__ notation, but for objects created using Object.create(null) or which have had an Object.defineProperty(o, '__proto__') done to them some other notation will be necessary.

cpcallen avatar Jul 12 '17 10:07 cpcallen