Closed Bug 345542 Opened 18 years ago Closed 18 years ago

Use of let in let-scoped for loops shows assertion

Categories

(Core :: JavaScript Engine, defect, P1)

defect

Tracking

()

VERIFIED FIXED
mozilla1.8.1beta2

People

(Reporter: nanto, Assigned: mrbkap)

Details

(Keywords: verified1.8.1)

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; ja; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4

An assertion is shown when using let statements/expressions/declarations in let-scoped for/for...in/for-each...in loops and repeating more than one time.

Reproducible: Always

Steps to Reproduce:
js> var f = [];
js> for (let i = 0; i < 1; i++) f[i] = let (n = i) function () { return n; };
function () {
    return n;
}
js> for (let i = 0; i < 2; i++) f[i] = let (n = i) function () { return n; };


Actual Results:  
Assertion failure: OBJ_GET_PARENT(cx, obj) == fp->blockChain, at jsinterp.c:5959

Expected Results:  
No assetion is shown.
Yes, quite. Patch forthcoming.

Nanto, so you know, we've given you canconfirm bugzilla privileges so you can start filing these bugs as NEW instead of UNCONFIRMED. These reports are really appreciated.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → mozilla1.8.1beta2
Attached patch FixSplinter Review
The first time we went around the while loop, we captured the scope chain, so blockChain was null'd out. Brendan and I went through all of the uses of fp->blockChain and determined that this was actually the right "fix".
Assignee: general → mrbkap
Status: NEW → ASSIGNED
Attachment #230222 - Flags: review?(brendan)
Attachment #230222 - Flags: review?(brendan) → review+
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Comment on attachment 230222 [details] [diff] [review]
Fix

Assertion-only fix, should be automatically approved.

/be
Attachment #230222 - Flags: approval1.8.1?
Checking in regress-345542.js;
/cvsroot/mozilla/js/tests/js1_7/block/regress-345542.js,v  <--  regress-345542.js
initial revision: 1.1
Flags: in-testsuite+
Comment on attachment 230222 [details] [diff] [review]
Fix

a=drivers. Automatic approval given. :)
Attachment #230222 - Flags: approval1.8.1? → approval1.8.1+
verified fixed trunk 20060723 win/mac*/linux

mrbkap: Can you check this into 1.8 today? Thanks.
Status: RESOLVED → VERIFIED
Fix checked into the 1.8 branch.
Keywords: fixed1.8.1
verified fixed 1.8.1 windows/mac(ppc|tel)/linux 20060728
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: