Closed Bug 487209 Opened 16 years ago Closed 16 years ago

erroneous redeclaration of let ... with try {...} catch(e) {var e...}

Categories

(Core :: JavaScript Engine, defect, P1)

x86
All
defect

Tracking

()

RESOLVED FIXED
mozilla1.9.1b4

People

(Reporter: bc, Assigned: brendan)

References

Details

(Keywords: fixed1.9.1, regression, testcase, Whiteboard: fixed-in-tracemonkey)

Attachments

(5 files, 2 obsolete files)

ecma_3/ExecutionContexts/regress-448595-01.js and js1_5/Regress/regress-146596.js fail with redeclaration of let ... errors due to try {...} catch(e) { var e ...} regressed by upvar2 bug 452498
Flags: in-testsuite+
Flags: blocking1.9.1?
Dammit, can't restrict this case -- catch makes an implicit let, we must tolerate the oddly-hoisted var e. It's easier to handle because catch does not hoist. /be
Assignee: general → brendan
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → mozilla1.9.1b4
I think we should permit var-vs-let for FF3.5, since we made compatibility promises to extension authors as of b3. Is this change "merely" virtuous strictness, or is it required for something else in upvar2?
Flags: blocking1.9.1? → blocking1.9.1+
var vs. let is not only future-proofing, it helped avoid a conundrum in one-pass name binding judgments in upvar2. We don't have time to redo using two passes and doing so has risks for perf as well as correctness. Maybe a fresh look would find a way, but var vs. let is another bug than this one, which clearly must be fixed. Again the problem is hoisting. /be
Attached patch fix (obsolete) — Splinter Review
Attachment #371758 - Flags: review?(mrbkap)
Comment on attachment 371758 [details] [diff] [review] fix I worried to brendan in person than this will lead to inconsistent results with (function() { {let x; var x }}) vs. (function() { {let x; try{}catch(x){var x} }})
Attachment #371758 - Flags: review?(mrbkap)
Attached file testcase
Attached patch fix, v2 (obsolete) — Splinter Review
C++ optional parameters ftw. /be
Attachment #371758 - Attachment is obsolete: true
Testcases attached in case there's something I reconstructed that's not in the testsuite. /be
Attached patch fix, v3Splinter Review
Yeah, the testsuite definitely does not cover the last case. /be
Attachment #371774 - Attachment is obsolete: true
Attachment #371778 - Flags: review?(mrbkap)
Attachment #371778 - Flags: review?(mrbkap) → review+
Whiteboard: fixed-in-tracemonkey
Flags: in-testsuite+ → in-testsuite?
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
I botched the 1.9.1 checkin comment for this, but landed it correctly: http://hg.mozilla.org/releases/mozilla-1.9.1/rev/58633e0035ee
Keywords: fixed1.9.1
See Also: → 1231139
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: