Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 161e9565 authored by Andrea Iacovitti's avatar Andrea Iacovitti

Fixes for Number isSafeInteger:

- use the double version of abs
- MAX_SAFE_INTEGER is included
parent 7d4ca9a4
......@@ -576,7 +576,7 @@ JSValue* NumberFuncImp::callAsFunction(ExecState* exec, JSObject* /*thisObj*/, c
double num = args[0]->toInteger(exec);
if (num != arg)
return jsBoolean(false);
return jsBoolean(abs(num) < MAX_SAFE_INTEGER);
return jsBoolean(fabs(num) <= MAX_SAFE_INTEGER);
}
case NumberObjectImp::ParseInt:
return jsNumber(KJS::parseInt(args[0]->toString(exec), args[1]->toInt32(exec)));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment