Closed Bug 412467 Opened 14 years ago Closed 14 years ago

Iterator value escapes from array comprehension

Categories

(Rhino Graveyard :: Compiler, defect)

1.7R1
x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: norrisboyd, Unassigned)

Details

Attachments

(1 file)

The value of the iterand (is that a word?) in an array comprehension must be scoped to the array comprehension. This currently is not true in Rhino.

The attached test case demonstrates the problem.
Norris, I can make that into js1_7/iterable/testArrayComprehensionScope.js if you like. And "iterand" has some fairly common usage whether its a real word or not ;-)
(In reply to comment #1)
> Norris, I can make that into js1_7/iterable/testArrayComprehensionScope.js if
> you like.

That would be great, thanks!

> And "iterand" has some fairly common usage whether its a real word or
> not ;-)

I guess computer terms have never been constrained by any dictionary!

Fixed in CVS: 

Checking in src/org/mozilla/javascript/Node.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Node.java,v  <-- 
Node.java
new revision: 1.71; previous revision: 1.70
done
Checking in src/org/mozilla/javascript/NodeTransformer.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/NodeTransformer.java,v 
<--
  NodeTransformer.java
new revision: 1.80; previous revision: 1.79
done
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
I went ahead an renamed the test to match the existing pattern.
/cvsroot/mozilla/js/tests/js1_7/iterable/regress-412467.js
initial revision: 1.1
Flags: in-testsuite+
Flags: in-litmus-
I checked out and successfully ran the test. Thanks!
You need to log in before you can comment on or make changes to this bug.