[Webkit-unassigned] [Bug 39834] [Qt] JavaScript logical expressions

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 10 12:09:09 PDT 2010


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


Misha <Michael.Tyutyunik at nokia.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Michael.Tyutyunik at nokia.com




--- Comment #8 from Misha <Michael.Tyutyunik at nokia.com>  2010-06-10 12:09:07 PST ---
It looks like the actual comparison is happening in 
ALWAYS_INLINE bool JSValue::equalSlowCaseInline(ExecState* exec, JSValue v1, JSValue v2)

In the beginning of that function we are checking both operands if they are strings:

bool s1 = v1.isString();
bool s2 = v2.isString();

Then later we do following:
 if (s1 || s2) {
     double d1 = v1.toNumber(exec);
     double d2 = v2.toNumber(exec);
     return d1 == d2;
}

So v1 is the JSString and v1.toNumber(exec) returns NaN for "Hello!". V2 is false and v2.toNumber(exec) returns 0.0. 
So depending on how NaN is implemented we might get different results. On Symbian it defined as nanval(void ) while on the other platforms it's a quiet_NaN().

What I don't understand is that on emulator d1 (from the code snippet above) equals NaN which is 0.0 and so d2. So d1 ==d2 is true. 
But on emulator we are getting false.

-- 
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