oops, I left in a bug 

I noticed a bug with `{key: function ...}`, this PR adds test coverage and a fix.
the change is a patch.