JSObject* object = jsCast<JSObject*>(thisValue.toThis(exec, NotStrictMode));
if (exec->hadException())
return JSValue::encode(jsNull());
-
+
+ JSValue timeValue = object->toPrimitive(exec, PreferNumber);
+ if (exec->hadException())
+ return JSValue::encode(jsNull());
+ if (timeValue.isNumber() && !(timeValue.isInt32() || std::isfinite(timeValue.asDouble())))
+ return JSValue::encode(jsNull());
+
JSValue toISOValue = object->get(exec, exec->vm().propertyNames->toISOString);
if (exec->hadException())
return JSValue::encode(jsNull());