Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
deepEqual: Remove instanceof Object check (#529)
This is useful when the Object constructor might differ from object to object. This has been true for me when hacking on Gecko -- the objects that make it to the deepEqual function are instances of Object (from the kinto-http-client scope), but the reference Object points to Object (from the kinto-offline-client scope). We might also expect this sort of thing to come up when someone uses Kinto in a WebExtension; the scope of the WebExtension will be different from the scope of the code running on the page. Instead of using the "instanceof Object" check, use the "typeof" check. Unfortunately, because JavaScript, null and undefined also have typeof "object", so try to rule out falsy things explicitly.
- Loading branch information