diff
diff copied to clipboard
Feature request: report differences in prototype
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.