jashkenas / underscore

JavaScript's utility _ belt
https://underscorejs.org
MIT License
27.3k stars 5.53k forks source link

Fix bug in function emulatedSet #2928

Closed anfengchen closed 3 years ago

anfengchen commented 3 years ago

The old code for contains: when we check 'toString' inherited from Object.prototype, the contains return Object.prototype.toString;In this case, it prevent us to add obj's own 'toString' to its keys.

coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 95.217% when pulling f5c02bcdaf1b54663bce08b6af5230aaafa8060a on anfengchen:my-commit into 943977e34e2279503528a71ddcc2dd5f96483945 on jashkenas:master.

jgonggrijp commented 3 years ago

Looks good to me. Thanks for the fix!