Handle NaN / undefined values
As per the arg refactor we may end up using JS::ToNumber to convert
undefined values, unfortunately this has the side effect of causing the returned value to be set to
NaN and leading to issue #379 (closed).
To keep the behavior with JS/C expectations, let's handle an
undefined value consistently as 0 when converting to an Integer type, while keep considering it a
NaN when converting to a floating point value (as it'd happen when using