Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: report differences in prototype #112

Open
cpcallen opened this issue Jul 12, 2017 · 0 comments
Open

Feature request: report differences in prototype #112

cpcallen opened this issue Jul 12, 2017 · 0 comments

Comments

@cpcallen
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant