object(NaN, {foo: 42})(0.5) throws TypeError
mbostock opened this issue · 2 comments
mbostock commented
The starting value should be treated as an empty object if it is not an object. So, instead of:
> d3_interpolate.value(NaN, {foo: 42})(0.5)
TypeError: Cannot use 'in' operator to search for 'foo' in NaN
at object (/Users/mbostock/Development/d3-interpolate/build/d3-interpolate.js:44:18)
The input NaN
should be treated as {}
:
> d3_interpolate.value({}, {foo: 42})(0.5)
{foo: 42}
Related d3/d3#2688.