Last Comment Bug 743049 - Inconsistent error message for uncaught JS exception in Console
: Inconsistent error message for uncaught JS exception in Console
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla14
Assigned To: Masatoshi Kimura [:emk]
:
Mentors:
Depends on:
Blocks: 739659
  Show dependency treegraph
 
Reported: 2012-04-05 16:04 PDT by Masatoshi Kimura [:emk]
Modified: 2012-04-12 10:30 PDT (History)
5 users (show)
ryanvm: in‑testsuite+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Part 1: Add a friend API to get an error type name from a number (2.09 KB, patch)
2012-04-05 16:09 PDT, Masatoshi Kimura [:emk]
luke: review+
Details | Diff | Review
Part 2: Use the new API from NS_ScriptErrorReporter to get a error type name (1.09 KB, patch)
2012-04-05 16:09 PDT, Masatoshi Kimura [:emk]
no flags Details | Diff | Review
Part 2: Use the new API from NS_ScriptErrorReporter to get a error type name, v2 (9.71 KB, patch)
2012-04-06 21:42 PDT, Masatoshi Kimura [:emk]
jst: review+
Details | Diff | Review
Bug 743049 -Part 1: Add a friend API to get an error type name from a number (2.23 KB, patch)
2012-04-11 10:12 PDT, Masatoshi Kimura [:emk]
VYV03354: review+
Details | Diff | Review

Description Masatoshi Kimura [:emk] 2012-04-05 16:04:03 PDT
new xxx -> "xxx is not defined"
throw new ReferenceError("xxx is not defined") -> "ReferenceError: xxx is not defined"
Comment 1 Masatoshi Kimura [:emk] 2012-04-05 16:09:27 PDT
Created attachment 612724 [details] [diff] [review]
Part 1: Add a friend API to get an error type name from a number
Comment 2 Masatoshi Kimura [:emk] 2012-04-05 16:09:55 PDT
Created attachment 612725 [details] [diff] [review]
Part 2: Use the new API from NS_ScriptErrorReporter to get a error type name
Comment 3 :Ms2ger 2012-04-06 01:57:00 PDT
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.
Comment 4 Masatoshi Kimura [:emk] 2012-04-06 21:42:52 PDT
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.
Comment 5 Luke Wagner [:luke] 2012-04-07 04:20:21 PDT
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?
Comment 6 Masatoshi Kimura [:emk] 2012-04-07 05:08:05 PDT
I added the check to prevent "InternalError: " is prepended before "uncaught exception: ".
Is it better to test |errorNumber == JSMSG_UNCAUGHT_EXCEPTION|?
Comment 7 Masatoshi Kimura [:emk] 2012-04-11 10:12:45 PDT
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
Comment 9 Richard Newman [:rnewman] 2012-04-11 15:37:40 PDT
Backed out whole merge for bustage per Yoric (Bug 743574):

https://hg.mozilla.org/integration/mozilla-inbound/rev/12e42fb8e321
Comment 10 Richard Newman [:rnewman] 2012-04-11 17:53:37 PDT
Disregard that; PEBKAC. Did not get backed out. I misread TBPL.

Note You need to log in before you can comment on or make changes to this bug.