bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

Rhino treatment of |for(i in undefined)|, |for(i in null)|

VERIFIED FIXED in 1.5R4

Status

Rhino
Core
VERIFIED FIXED
17 years ago
15 years ago

People

(Reporter: Phil Schwartau, Assigned: Norris Boyd)

Tracking

Details

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
This issue grows out of:

bug 121744 SpiderMonkey should error on |for(i in undefined)|, |for(i in null)|
bug 131348 |var obj; for (item in obj) {}| causes error


Before these bugs were filed, SpiderMonkey did NOT error on these statements;
Rhino does. Since ECMA-262 Edition 3 requires ECMAScript to error on them,
bug 121744 was filed and SpiderMonkey corrected its behavior to match the 
standard.

But many complaints ensued because we had changed the behavior of JS,
and were no longer in agreement with the behavior of NN4.7 and IE6.
So bug 131348 was filed, and it was decided to undo the 121744 fix.

In addition, Waldemar reports in bug 131348 that the ECMA committee is
leaning toward treating this as a bug in the standard, and changing it
in Edition 4. So: how does Rhino want to behave on these statements? 

We currently have two testcases, for the two SpiderMonkey bugs:

        mozilla/js/tests/ecma_3/Statements/regress-121744.js
        mozilla/js/tests/ecma_3/Statements/regress-131348.js

The two tests expect contrary things. I retain both of them because
at present, SpiderMonkey and Rhino do contrary things on these statements.
Once this bug is resolved, I will adjust the testcases accordingly.
(Reporter)

Comment 1

16 years ago
*** Bug 156510 has been marked as a duplicate of this bug. ***

Comment 2

16 years ago
Created attachment 90654 [details] [diff] [review]
Return in ScriptRuntime.initEnum empty enum for null and undefined

Comment 3

16 years ago
With the patch above Rhino passes ecma_3/Statements/regress-131348.js and
naturally fails at ecma_3/Statements/regress-121744.js to follow SM. I can
commit it if it is OK (it passes the rest of test suite).

(And sory for that bug 156510, next time I will try to do the search in bugzilla
...)

Comment 4

16 years ago
I commited the fix, so now mozilla/js/tests/ecma_3/Statements/regress-121744.js
can be removed
(Reporter)

Comment 5

16 years ago
Igor: thanks. Do you want to mark this bug as Fixed, then?

I have modified both tests above now that Rhino and SpiderMonkey
are in synch on this issue.

    mozilla/js/tests/ecma_3/Statements/regress-121744.js
    mozilla/js/tests/ecma_3/Statements/regress-131348.js

The two tests expect contrary things. I've put an early return on the
former test, so that it no longer runs in either SpiderMonkey or Rhino.
I decided to retain it as a record of the issue, rather than CVS-deleting it. 

Meanwhile, I have removed the early Rhino return on the latter test, 
so that it tests both SpiderMonkey and Rhino on this issue now.
It now passes in both the interpreted and compiled Rhino shells -

Comment 6

16 years ago
Fixed, as Rhino passes the modified tests.
Status: NEW → RESOLVED
Last Resolved: 16 years ago
Resolution: --- → FIXED
(Reporter)

Comment 7

16 years ago
Thanks - marking Verified.
Status: RESOLVED → VERIFIED

Comment 8

15 years ago
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.