uint32_t usage in kjs

Darin Adler khtml-devel@kde.org
Mon, 24 Feb 2003 08:07:54 -0800


On Monday, February 24, 2003, at 07:35  AM, Harri Porten wrote:

> -  if (isNaN(d) || d != static_cast<uint32_t>(d)) {
> +  if (isNaN(d) || d != static_cast<int>(d)) {

This part of the change is incorrect. This now will allow values like 
-1, while the old code disallows them. You need to use unsigned int 
consistently. Further, I would rename this toUInt if you change it to 
return unsigned int.

But more importantly, looking at JavaScriptCore, I see no good reason 
to have added UString::toUInt32. The only place this function is used 
is in ArrayInstanceImp::deleteProperty and clearly UString::toULong 
would be fine instead.

I'm going to remove UString::toUInt32 from JavaScriptCore.

     -- Darin