[Webkit-unassigned] [Bug 34170] [Qt] Javascript undefined > 0 returns true on Symbian

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 27 04:34:06 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=34170





--- Comment #4 from Kent Hansen <kent.hansen at nokia.com>  2010-01-27 04:34:05 PST ---
(In reply to comment #3)
> Kent, any idea of this affects QtScript, too?

Yes.
The comparison should be semantically equivalent to NaN > 0, since the >
operator will try to convert its operands to numbers if they aren't already -->
ToNumber(undefined) -> NaN. A quick (in)sanity check would be to see if
replacing undefined by NaN in the test case gives the same result.

It looks like this is the same as what's causing
http://bugreports.qt.nokia.com/browse/QTBUG-4621, then. For undefined,
JSValue::getPrimitiveNumber() will get here:

        ASSERT(isUndefined());
        number = nonInlineNaN();
        value = *this;
        return true;
    }

>From JSValue.cpp:

NEVER_INLINE double nonInlineNaN()
{
    return std::numeric_limits<double>::quiet_NaN();
}

Again, see Janne's comment @ http://bugreports.qt.nokia.com/browse/QTBUG-4621.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list