DevHeads.net

Review Request: KJS: Extend strictEqual check for numbers by NaN and signbit check

Review request for kdelibs.

Description
In c++ NAN == NAN return false, true in javascript 9.12 Step 4.a
also +0 == -0 is true in c++, false in javascript 9.12 Step 4.b (same for -0 == +0 , Step 4c)

Diffs
kjs/operations.cpp d4c0066

Diff: <a href="http://git.reviewboard.kde.org/r/104358/diff/" title="http://git.reviewboard.kde.org/r/104358/diff/">http://git.reviewboard.kde.org/r/104358/diff/</a>

Testing
Tesed via ecmascript, fixes some tests that rely on +0 not beeing the same as -0

Thanks,

Bernd Buschinski

Comments

Re: Review Request: KJS: Extend strictEqual check for numbers by

By Bernd Buschinski at 03/21/2012 - 19:41

(Updated March 22, 2012, 12:41 a.m.)

Review request for kdelibs.

Changes
Whoops sorry, wrong/old version uploaded
- now really check for NaN using isNan

Description
In c++ NAN == NAN return false, true in javascript 9.12 Step 4.a
also +0 == -0 is true in c++, false in javascript 9.12 Step 4.b (same for -0 == +0 , Step 4c)

Diffs (updated)
kjs/operations.cpp d4c0066

Diff: <a href="http://git.reviewboard.kde.org/r/104358/diff/" title="http://git.reviewboard.kde.org/r/104358/diff/">http://git.reviewboard.kde.org/r/104358/diff/</a>

Testing
Tesed via ecmascript, fixes some tests that rely on +0 not beeing the same as -0

Thanks,

Bernd Buschinski

Re: Review Request: KJS: Extend strictEqual check for numbers by

By Maksim Orlovich at 03/22/2012 - 10:27

This looks wrong to me; strictEqual is used for ===, which is defined
in 11.9.6, and doesn't do any freaky deviations from IEEE FP. You'll
likely need a separate version for SameValue proper.

On 3/21/12, Bernd Buschinski <b. ... at googlemail dot com> wrote: