Closed Bug 483610 Opened 17 years ago Closed 15 years ago

if clause will be entered when condition is comparing with false

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
major

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: darko.ostricki, Unassigned)

Details

(Whiteboard: [CLOSEME 2010-11-01])

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7 var tocompare=false; if(tocompare){ /*this code will be executed in 3.0.7 / not in 3.1. Beta 2*/ } if(tocompare==true){ /*this code will also be executed in 3.0.7 / not in 3.1. Beta 2*/ } Reproducible: Always Steps to Reproduce: 1.assign false to a variable or return value of a function 2.write an if clause to be executed if is true 3.assert that the if clause will be entered even if the condition is false Actual Results: if clause is executed Expected Results: if clause shouldn't be executed the else block should have been executed or nothing if no else is defined
Retested - the bug seems to be a bit more complex the previously explained. simple boolean values are evaluated normally -> var tmp=false; what's not working is the evaluation of boolean return values of a function @See example below ->when window.opener is null and the isDefined function returns false the if clause is entered anyway. ... Sample code: function isDefined(obj){ if(obj==null || typeof(obj) == "undefined")return false; else return true; } if(isDefined(window.opener)){ //will be entered even if isDefined delivers false }
This is a mass search for bugs which are in the Firefox General component, are UNCO, have not been changed for 500 days and have an unspecified version. Reporter, can you please update to Firefox 3.6.10 or later, create a fresh profile, http://support.mozilla.com/en-US/kb/managing+profiles, and test again. If you still see the issue, please update this bug. If the issue is gone, please set the status to RESOLVED > WORKSFORME.
Whiteboard: [CLOSEME 2010-11-01]
No reply from reporter, INCOMPLETE. Please retest with Firefox 3.6.12 or later and a new profile (http://support.mozilla.com/kb/Managing+profiles). If you continue to see this issue with the newest firefox and a new profile, then please comment on this bug.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.