Closed
Bug 344959
Opened 19 years ago
Closed 19 years ago
Functions may lose part or all of their scope chain after an exception
Categories
(Core :: JavaScript Engine, defect, P1)
Tracking
()
VERIFIED
FIXED
mozilla1.8.1beta2
People
(Reporter: Seno.Aiko, Assigned: brendan)
References
Details
(Keywords: verified1.8.0.7, verified1.8.1)
Attachments
(4 files, 2 obsolete files)
|
322 bytes,
text/html
|
Details | |
|
7.93 KB,
patch
|
mrbkap
:
review+
mconnor
:
approval1.8.1+
|
Details | Diff | Splinter Review |
|
10.31 KB,
patch
|
mrbkap
:
review+
shaver
:
superreview+
dveditz
:
approval1.8.0.7+
|
Details | Diff | Splinter Review |
|
10.31 KB,
patch
|
brendan
:
review+
brendan
:
superreview+
|
Details | Diff | Splinter Review |
(Build identifier: latest CVS head JS shell)
If an exception happens during the execution of a function then the function cannot access the variables in its scope chain any longer.
As an example, this statement works as expected and yields "with":
with ({x:"with"}) (function() { try {} catch(exc) {}; return x })()
But this (same as above, just a |throw 1| added) produces a reference error (or the value of x in the global scope, if it exists):
with ({x:"with"}) (function() { try { throw 1 } catch(exc) {}; return x })()
This also happens if you use the new |let| statement instead of |with|, but it's not a regression from JS 1.7, I also see this in Firefox 1.5.0.4.
| Assignee | ||
Comment 3•19 years ago
|
||
This is an old bug, which goes back to a fix that shaver and I did -- it would be good to get shaver's sr. I didn't dress up the JS_SetPrivate calls with any kind of with-specific veneer, preferring to keep things concrete and avoid yet another layer.
/be
Attachment #229551 -
Flags: superreview?(shaver)
Attachment #229551 -
Flags: review?(mrbkap)
| Assignee | ||
Comment 4•19 years ago
|
||
Fairly significant standards-conformance bug, more severe in light of "let".
/be
Status: NEW → ASSIGNED
Flags: blocking1.8.1?
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → mozilla1.8.1beta2
Updated•19 years ago
|
Attachment #229551 -
Flags: review?(mrbkap) → review+
Comment 5•19 years ago
|
||
Comment on attachment 229551 [details] [diff] [review]
fix
sr=shaver.
Attachment #229551 -
Flags: superreview?(shaver) → superreview+
| Assignee | ||
Comment 6•19 years ago
|
||
Attachment #229551 -
Attachment is obsolete: true
Attachment #229566 -
Flags: superreview?(shaver)
Attachment #229566 -
Flags: review?(mrbkap)
| Assignee | ||
Comment 7•19 years ago
|
||
Nominating for 1.8.0.6/Firefox 1.5.0.6 since this regressed after Firefox 1.0, in February 2005 (rev 3.162 of jsinterp.c).
/be
Flags: blocking1.8.0.6?
| Assignee | ||
Updated•19 years ago
|
Summary: Functions lose their scope chain after an exception → Functions may lose part or all of their scope chain after an exception
Updated•19 years ago
|
Attachment #229566 -
Flags: review?(mrbkap) → review+
| Assignee | ||
Updated•19 years ago
|
Attachment #229566 -
Flags: approval1.8.1?
| Assignee | ||
Comment 8•19 years ago
|
||
Fixed on trunk.
/be
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 9•19 years ago
|
||
Checking in regress-344959.js;
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-344959.js,v <-- regress-344959.js
initial revision: 1.1
Flags: in-testsuite+
Updated•19 years ago
|
Attachment #229566 -
Flags: approval1.8.1? → approval1.8.1+
| Assignee | ||
Updated•19 years ago
|
Attachment #229525 -
Attachment description: tetcase → testcase
| Assignee | ||
Comment 11•19 years ago
|
||
Calling for code review just because 1.8.0 branch lacks let/block-scope.
/be
Attachment #229723 -
Flags: superreview?(shaver)
Attachment #229723 -
Flags: review?(mrbkap)
Attachment #229723 -
Flags: approval1.8.0.6?
Updated•19 years ago
|
Attachment #229723 -
Flags: review?(mrbkap) → review+
Comment 12•19 years ago
|
||
Comment on attachment 229723 [details] [diff] [review]
1.8.0 branch patch
sr=shaver.
Attachment #229723 -
Flags: superreview?(shaver) → superreview+
| Assignee | ||
Comment 13•19 years ago
|
||
*** Bug 345182 has been marked as a duplicate of this bug. ***
Comment 14•19 years ago
|
||
verified fixed 1.8.1, trunk 20060723 win/linux/mac(ppc|tel)
Status: RESOLVED → VERIFIED
Keywords: fixed1.8.1 → verified1.8.1
Updated•19 years ago
|
Flags: blocking1.8.0.7? → blocking1.8.0.7-
Comment 15•19 years ago
|
||
Comment on attachment 229723 [details] [diff] [review]
1.8.0 branch patch
Not blocking, but we'll take the patch if you get it in by the deadline. approved for 1.8.0 branch, a=dveditz for drivers
Attachment #229723 -
Flags: approval1.8.0.7? → approval1.8.0.7+
| Assignee | ||
Comment 16•19 years ago
|
||
I'm checking this in -- it would be wrong not to fix bug 347674, since the patch for this bug contains the regression (by way of bug 343765).
/be
Attachment #233115 -
Flags: superreview+
Attachment #233115 -
Flags: review+
| Assignee | ||
Comment 17•19 years ago
|
||
Oops, copied wrong patch to staging directory.
/be
Attachment #233115 -
Attachment is obsolete: true
Attachment #233116 -
Flags: superreview+
Attachment #233116 -
Flags: review+
| Assignee | ||
Updated•19 years ago
|
Flags: blocking1.8.1?
Comment 19•19 years ago
|
||
2006081103 1.8.0.7 appears to assert in shell windows/mactel/linux and browser windows/mac(ppc|tel)/linux on js1_5/Regress/regress-344959.js,
JSVAL_TO_OBJECT(v) == OBJ_GET_PARENT(cx, thisp), at jsinterp.c:506
Whiteboard: [not-fixed1.8.0.7]
Comment 20•19 years ago
|
||
(In reply to comment #19)
See bug 337378
Comment 21•19 years ago
|
||
verified fixed 1.8.0.7 20060818 windows/mac*/linux
Keywords: fixed1.8.0.7 → verified1.8.0.7
Comment 22•19 years ago
|
||
I'm removing the whiteboard "not-fixed1.8.0.7" comment on the assumption it was due to the assertion covered by bug 337378, since Bob later added the verified1.8.0.7 keyword.
Whiteboard: [not-fixed1.8.0.7]
Updated•19 years ago
|
Attachment #229566 -
Flags: superreview?(shaver)
You need to log in
before you can comment on or make changes to this bug.
Description
•