unsigned long Converter::toULong(const JSValueRef& arg)
{
- return static_cast<unsigned long>(toLong(arg));
+ double tmp = toNumber_(arg);
+ return (isNan(tmp) ? 0 : static_cast<unsigned long>(tmp));
}
std::size_t Converter::toSizeT(const JSValueRef& arg)
JSValueRef Converter::toJSValueRef(const time_t arg)
{
- struct tm *tminfo = NULL;
- tminfo = localtime_r(&arg, tminfo);
- return toJSValueRef(*tminfo);
+ struct tm tminfo;
+ memset(&tminfo,0,sizeof(tminfo));
+ localtime_r(&arg, &tminfo);
+ return toJSValueRef(tminfo);
}
JSValueRef Converter::toJSValueRef(const std::vector<std::string>& arg)