Closed
Bug 873684
Opened 11 years ago
Closed 11 years ago
WebIDL: Improve error reporting when we expect a Sequence or a Date and a value that is not an object is passed
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla24
People
(Reporter: reuben, Assigned: reuben)
Details
Attachments
(1 file)
3.96 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
Right now we report "TypeError: Value not an object", not very helpful. We really should be saying that the value is not a sequence/date/interface/etc.
Assignee | ||
Comment 1•11 years ago
|
||
This reports "Value does not implement interface Foo" instead of "Value not an object" for Dates, Sequences and objects within Sequences.
Assignee: nobody → reuben.bmo
Attachment #751262 -
Flags: review?(bzbarsky)
Assignee | ||
Comment 2•11 years ago
|
||
How hard would it be to include file and line number in these error messages?
Comment 3•11 years ago
|
||
Hmm. I guess "not an object" is more informative than just "not a Node" or whatnot in the sense that it tells you that you're not even in the right ballpark, but does make it hard to tell which argument is involved... As for line and file, those should be present in the exception already, no? Certainly I see them in the web console when I test one of these exceptions being thrown.
Comment 4•11 years ago
|
||
Comment on attachment 751262 [details] [diff] [review] Improve error reporting r=me. Thank you!
Attachment #751262 -
Flags: review?(bzbarsky) → review+
Comment 5•11 years ago
|
||
Actually, given these changes, would you mind changing the actual message for MSG_NOT_SEQUENCE to "Value can not be converted to a sequence", so as not to imply that we have an object? Or we could have different messages for the "know is an object and it's not a sequence" (which will say "Object can not...") and "it's not even an object" (which will say "Value can not...."). Maybe it doesn't matter too much in practice and it's fine to just always have it say "Value can not ...".
Assignee | ||
Comment 6•11 years ago
|
||
Thanks! https://hg.mozilla.org/integration/mozilla-inbound/rev/17a16c7e9870
Comment 7•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/17a16c7e9870
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•