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

Use deep equality in calledWith() to allow object/array arguments to match #38

Merged

Conversation

jessepinho
Copy link
Contributor

Closes #37.

I started down the road of copying Underscore's isEqual functionality into this library, but found that it was a bit more convoluted than expected. (For example, the recursive functions called by _.isEqual reference other Underscore functions.) I propose simply including Underscore in this project. You'll notice Underscore is not actually included in the built JS file; rather, Underscore is added to package.json and requireed in bond.coffee.

Thoughts?

@EndangeredMassa
Copy link
Owner

This general approach is fine with me. I don't think we really need to support globals anymore.

Can you remove the usage line from the README that says you can still use globals? <script src="bond.js"> -> window.bond(...)

@jessepinho
Copy link
Contributor Author

This shouldn't affect any behavior related to globals, though, right...? (Unless you want me to also remove the bond variable from window on this line?)

@EndangeredMassa
Copy link
Owner

Line 1 won't work with globals _ = require 'underscore' because require doesn't exist.

@jessepinho
Copy link
Contributor Author

@EndangeredMassa Ah, gotcha. Just removed that (as well as the window.bond line I referenced in my comment above) in 441cd38.

@@ -170,5 +164,4 @@ bond = (obj, property) ->
'restore': restore
}

window.bond = bond if window?
module.exports = bond if module?.exports
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we change this to the following?

module.exports = bond

@jessepinho
Copy link
Contributor Author

Done.

EndangeredMassa added a commit that referenced this pull request Aug 19, 2015
Use deep equality in calledWith() to allow object/array arguments to match
@EndangeredMassa EndangeredMassa merged commit 7f81b52 into EndangeredMassa:master Aug 19, 2015
@EndangeredMassa
Copy link
Owner

published in 2.0.0

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

Successfully merging this pull request may close these issues.

2 participants