Closed Bug 166743 Opened 22 years ago Closed 22 years ago

Error.prototype.stack is still causing headaches

Categories

(Core :: JavaScript Engine, defect, P1)

x86
All
defect

Tracking

()

VERIFIED FIXED
mozilla1.2alpha

People

(Reporter: rginda, Assigned: brendan)

References

Details

(Keywords: js1.5)

Attachments

(1 file, 1 obsolete file)

toString()ing parameters for Error.prototype.stack is causing headaches again. See bug 166420 and bug 69850 for examples. Calling toString on arbitrary objects in an error condition just doesn't seem like a good thing. I'd suggest that the best we can do is append the string [Object] (or something like that) wherever we find an object parameter.
Target Milestone: --- → mozilla1.2alpha
Uh, that should have been bug 165179, not bug 69850.
This may be related to a bug I filed: bug 157474 "Error.stack no longer quotes string arguments to functions"
Attached patch hacked patch (obsolete) — Splinter Review
If I apply this patch I no longer see the long pause before reporting an error in Venkman. I assume this fixes the crash too, but seeing as how I couldn't crash in a debug build, I don't know for sure. I imagine we don't actually want to JS_NewStringCopyZ here (or maybe just for 1.2a.)
The fix to return false (meaning "please report this error, I can't make an exception object for it") from js_ErrorToException mirrors logic used in jsapi.c to call js_ReportUncaughtException when unwinding to an API caller when there are no active frames on cx. I rearranged the logic in rginda's patch to avoid redundant tests for primitive type values. /be
Attachment #98008 - Attachment is obsolete: true
Cc'ing more JS buddies and drivers. Rob, can you r= my patch? Phil, testing would be good -- this should get into the frozen 1.2alpha trunk by tomorrow. Thanks, /be
Status: NEW → ASSIGNED
Keywords: js1.5, mozilla1.2
Priority: -- → P1
Comment on attachment 98011 [details] [diff] [review] less hacked fix, plus a fix for failure to report no-such-file from the shell r=rginda
Attachment #98011 - Flags: review+
Blocks: 166420
Comment on attachment 98011 [details] [diff] [review] less hacked fix, plus a fix for failure to report no-such-file from the shell a=rjesup@wgate.com
Attachment #98011 - Flags: approval+
Fixed. /be
Blocks: 1.2a
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Marking Verified Fixed. Please also see bug 157474 and bug 166420. In particular, http://bugzilla.mozilla.org/show_bug.cgi?id=166420#c9 shows the effects of this fix. Rob: if the fix hasn't addressed your concerns, please reopen; thx -
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: