Status

()

RESOLVED INVALID
7 years ago
7 years ago

People

(Reporter: dkived, Unassigned)

Tracking

11 Branch
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
Created attachment 615406 [details]
js-null-bug.png

User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:11.0) Gecko/20100101 Firefox/11.0
Build ID: 20120310010316

Steps to reproduce:

While debugging an issue in some of my JS code, I found an odd behavior when performing tests on a null value. Apparently null values are not equal to zero, and are not greater than zero, yet somehow ARE greater than or equal to zero.

The problem first presented itself in my JS code; I investigated further using Firebug.


Actual results:

null == 0
(false)
null > 0
(false)
null >= 0
(true !!!!!!)


Expected results:

null == 0
(false)
null > 0
(false)
null >= 0
(false)
(Reporter)

Comment 1

7 years ago
Forgot to mention, but this also applies to 'null <= 0'.
Bugzilla is not there to answer questions.
A good start is it to compare different Javascript Engines in the differen browsers  (IE, Opera, webkit, gecko)
Different results in different Engines are usually a bug and filing a bug in that case is good idea.

http://stackoverflow.com/questions/2910495/why-null-0-but-not-null-0 should explain this is no bug.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.