Closed Bug 156510 Opened 22 years ago Closed 22 years ago

for (i in undefined) {} should not throw TypeError

Categories

(Rhino Graveyard :: Core, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 136893

People

(Reporter: igor, Assigned: norrisboyd)

Details

According to the bug 131348, ECMA specs that require to throw TypeError in for (var i in undefined) {} for (var i in null) {} does not reflect a common usage that assumes that such statements behave exactly as for (var i in {}) { ... } and there is a proposal to fix this in the ECMA standard. Rhino should follow SM, Netscape 4.* and Internet Explorer and treat null and undefined values in such for loops as objects with no enumeratable properties.
Igor: you raise a good point! But this has already been filed as bug 136893, "Rhino treatment of |for(i in undefined)|, |for(i in null)|" You will be cc'ed on that bug so you can follow its progress - *** This bug has been marked as a duplicate of 136893 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Verified Duplicate -
Status: RESOLVED → VERIFIED
Targeting as resolved against 1.5R4
Target Milestone: --- → 1.5R4
You need to log in before you can comment on or make changes to this bug.