Closed
Bug 126722
Opened 23 years ago
Closed 23 years ago
(undefined === null) evaluating to true in Rhino compiled mode
Categories
(Rhino Graveyard :: Core, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
1.5R4
People
(Reporter: pschwartau, Assigned: norrisboyd)
Details
I have a testcase which examines (undefined === null), expecting this
to be false. It passes in the SpiderMonkey shell and in Rhino interpreted
mode, but it's failing in Rhino compiled mode. I will check the testcase
into CVS and give the path for it below -
Reporter | ||
Comment 1•23 years ago
|
||
Testcase added to JS testsuite:
mozilla/js/tests/ecma_3/Expressions/11.9.6-1.js
It is named after Section 11.9.6 in the ECMA-262 Edition 3 Final:
11.9.6 The Strict Equality Comparison Algorithm
The comparison x === y, where x and y are values, produces true or false.
Such a comparison is performed as follows:
1. If Type(x) is different from Type(y), return false.
2. If Type(x) is Undefined, return true.
3. If Type(x) is Null, return true.
etc.
etc.
Since typeof undefined = 'undefined', and typeof null = 'object',
I would expect (undefined === null) to be false by Step 1.
Reporter | ||
Comment 2•23 years ago
|
||
Here are the command lines I'm using:
cd mozilla/js/tests
TEST PASSES:
perl jsDriver.pl -e rhinoi -f TEST.html -k -l ecma_3/Expressions/11.9.6-1.js
TEST FAILS:
perl jsDriver.pl -e rhino -f TEST.html -k -l ecma_3/Expressions/11.9.6-1.js
Engine command line: java org.mozilla.javascript.tools.shell.Main
OS type: WIN
java full version "1.3.0_01"
Failure Details
Testcase ecma_3/Expressions/11.9.6-1.js failed
Bug Number 126722
STATUS: Testing the comparison |undefined === null|
Failure messages were:
FAILED!: [reported from test()] Section 1 of test -
FAILED!: [reported from test()] Expected value 'false', Actual value 'true'
FAILED!: [reported from test()]
FAILED!: [reported from test()] Section 2 of test -
FAILED!: [reported from test()] Expected value 'false', Actual value 'true'
FAILED!: [reported from test()]
FAILED!: [reported from test()] Section 3 of test -
FAILED!: [reported from test()] Expected value 'false', Actual value 'true'
FAILED!: [reported from test()]
FAILED!: [reported from test()] Section 4 of test -
FAILED!: [reported from test()] Expected value 'false', Actual value 'true'
FAILED!: [reported from test()]
Assignee | ||
Comment 3•23 years ago
|
||
Fixed:
Checking in optimizer/Codegen.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/optimizer/Codegen.java,v <
-- Codegen.java
new revision: 1.53; previous revision: 1.52
done
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 4•23 years ago
|
||
Reopening. I'm still getting a failure on Section 1 of the testcase:
java -jar build/rhino1_5R4pre/js.jar
-f ../tests/ecma_3/shell.js
-f ../tests/ecma_3/Expressions/11.9.6-1.js
BUGNUMBER: 126722
STATUS: Testing the comparison |undefined === null|
FAILED!: [reported from test()] Section 1 of test -
FAILED!: [reported from test()] Expected value 'false', Actual value 'true'
Section 1 is as follows:
if (undefined === null)
actual = true;
else
actual = false;
expect = false;
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Assignee | ||
Comment 5•23 years ago
|
||
Thanks--missed one codepath.
Checking in Codegen.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/optimizer/Codegen.java,v <
-- Codegen.java
new revision: 1.54; previous revision: 1.53
done
Status: REOPENED → RESOLVED
Closed: 23 years ago → 23 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 6•23 years ago
|
||
Marking Verified FIXED.
The testcase now passes in both the rhino and rhinoi shells on WinNT -
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•