Bug 6895 - include exception names in JavaScript form of DOM exception
Summary: include exception names in JavaScript form of DOM exception
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Enhancement
Assignee: Darin Adler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-28 18:21 PST by Darin Adler
Modified: 2006-01-29 10:09 PST (History)
1 user (show)

See Also:


Attachments
include exception name in message in JavaScript exception object (3.72 KB, patch)
2006-01-28 18:23 PST, Darin Adler
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Darin Adler 2006-01-28 18:21:28 PST
We should include the exception names in the JavaScript exceptions created for DOM exceptions. This will make the JavaScript console much nicer for cases where it's reporting a DOM exception.
Comment 1 Darin Adler 2006-01-28 18:23:26 PST
Created attachment 6058 [details]
include exception name in message in JavaScript exception object
Comment 2 Maciej Stachowiak 2006-01-28 19:43:29 PST
Comment on attachment 6058 [details]
include exception name in message in JavaScript exception object

r=me

Should we consider adding human readable messages to the exception as well?
Comment 3 Darin Adler 2006-01-28 20:27:07 PST
Yes, I was thinking that would be a nice next step.
Comment 4 Alexey Proskuryakov 2006-01-29 02:07:00 PST
Shouldn't rangeExceptionNames should also start with a zero, like exceptionNames? 
+static const char * const rangeExceptionNames[] = {
+    "BAD_BOUNDARYPOINTS_ERR", "INVALID_NODE_TYPE_ERR"
+};

There is an extra semicolon in one line:
+  int nameTableSize;;

There already was a bug requesting such an improvement (bug 6745) - should it be marked as a duplicate now, or can rather be used to tracking further enchancements?
Comment 5 Darin Adler 2006-01-29 08:56:36 PST
(In reply to comment #4)
> Shouldn't rangeExceptionNames should also start with a zero, like
> exceptionNames? 
> +static const char * const rangeExceptionNames[] = {
> +    "BAD_BOUNDARYPOINTS_ERR", "INVALID_NODE_TYPE_ERR"
> +};

Yes, good catch!

> There already was a bug requesting such an improvement (bug 6745) - should it
> be marked as a duplicate now, or can rather be used to tracking further
> enchancements?

I think we should use that one to track further enhancement.