preserve function length for spy #154

Closed
Raynos opened this Issue Jul 8, 2012 · 6 comments

Comments

Projects
None yet
4 participants
Contributor

Raynos commented Jul 8, 2012

spy(function (a) {}).length === 0

It should be 1

Contributor

domenic commented Jul 8, 2012

The only way I can think of doing this is with eval?

Contributor

Raynos commented Jul 8, 2012

@domenic Yes or Function

Owner

mantoni commented Jul 10, 2012

Or by having 5 functions with 0, 1, 2, 3 and 4 parameters that all delegate to the actual spy.

+1: good use case for Function.

Owner

mantoni commented Aug 16, 2013

This was implemented in PR #181 quite some time ago.
Closing the issue.

@mantoni mantoni closed this Aug 16, 2013

Excellent. Thanks.

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