The default bug view has changed. See this FAQ.

Inconsistent error message for uncaught JS exception in Console

RESOLVED FIXED in mozilla14

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: emk, Assigned: emk)

Tracking

Trunk
mozilla14
Points:
---
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Assignee)

Description

5 years ago
new xxx -> "xxx is not defined"
throw new ReferenceError("xxx is not defined") -> "ReferenceError: xxx is not defined"
(Assignee)

Comment 1

5 years ago
Created attachment 612724 [details] [diff] [review]
Part 1: Add a friend API to get an error type name from a number
(Assignee)

Comment 2

5 years ago
Created attachment 612725 [details] [diff] [review]
Part 2: Use the new API from NS_ScriptErrorReporter to get a error type name
(Assignee)

Updated

5 years ago
Whiteboard: [autoland-try:-b do -p all -u all -t none]
(Assignee)

Updated

5 years ago
Whiteboard: [autoland-try:-b do -p all -u all -t none]
(Assignee)

Updated

5 years ago
Component: XPConnect → DOM
QA Contact: xpconnect → general
Comment on attachment 612725 [details] [diff] [review]
Part 2: Use the new API from NS_ScriptErrorReporter to get a error type name

Review of attachment 612725 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/base/nsJSEnvironment.cpp
@@ +489,5 @@
>  
>        const PRUnichar *m = reinterpret_cast<const PRUnichar*>
>                                               (report->ucmessage);
>        if (m) {
> +        const PRUnichar *n = reinterpret_cast<const PRUnichar*>

static_cast, and * on the left, please.
(Assignee)

Updated

5 years ago
Attachment #612724 - Flags: review?(luke)
(Assignee)

Comment 4

5 years ago
Created attachment 613069 [details] [diff] [review]
Part 2: Use the new API from NS_ScriptErrorReporter to get a error type name, v2

Fixed failing tests and added a test.
Attachment #612725 - Attachment is obsolete: true
Attachment #613069 - Flags: review?(jst)

Comment 5

5 years ago
Comment on attachment 612724 [details] [diff] [review]
Part 1: Add a friend API to get an error type name from a number

It wasn't immediately clear why JSEXN_INTERNALERR returned null; could you an include a comment explaining why?
Attachment #612724 - Flags: review?(luke) → review+
(Assignee)

Comment 6

5 years ago
I added the check to prevent "InternalError: " is prepended before "uncaught exception: ".
Is it better to test |errorNumber == JSMSG_UNCAUGHT_EXCEPTION|?

Updated

5 years ago
Attachment #613069 - Flags: review?(jst) → review+
(Assignee)

Comment 7

5 years ago
Created attachment 614050 [details] [diff] [review]
Bug 743049 -Part 1: Add a friend API to get an error type name from a number

Patch for checkin
Attachment #612724 - Attachment is obsolete: true
Attachment #614050 - Flags: review+
(Assignee)

Updated

5 years ago
Keywords: checkin-needed

Updated

5 years ago
Assignee: nobody → VYV03354
https://hg.mozilla.org/integration/mozilla-inbound/rev/b1e86ae73fc5
https://hg.mozilla.org/integration/mozilla-inbound/rev/9dbeef29e1cf
Flags: in-testsuite+
Keywords: checkin-needed
Target Milestone: --- → mozilla14
Backed out whole merge for bustage per Yoric (Bug 743574):

https://hg.mozilla.org/integration/mozilla-inbound/rev/12e42fb8e321
Target Milestone: mozilla14 → ---
Keywords: checkin-needed
Disregard that; PEBKAC. Did not get backed out. I misread TBPL.
Status: NEW → ASSIGNED
Keywords: checkin-needed
Target Milestone: --- → mozilla14
https://hg.mozilla.org/mozilla-central/rev/b1e86ae73fc5
https://hg.mozilla.org/mozilla-central/rev/9dbeef29e1cf
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.