Closed Bug 927735 Opened 11 years ago Closed 11 years ago

The URL constructor and the URL.href setter shouldn't throw XPathException

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: emk, Assigned: baku)

References

Details

Attachments

(1 file, 1 obsolete file)

They should use aRv.ThrowTypeError().
If some C++ callers use URL::Constructor or URL::SetHref, they will have to call rv.ClearMessage() on failure. See nsContentUtils::ConvertStringFromCharset for an example.
Attached patch exceptions2.patch (obsolete) — Splinter Review
Attachment #818245 - Flags: review?(ehsan)
Attachment #818245 - Flags: feedback?(VYV03354)
Comment on attachment 818245 [details] [diff] [review]
exceptions2.patch

>+    is(e.name, 'TypeError', "error: typeError");

|e instanceof TypeError| would be better to make sure that e is not a DOMException.
Attachment #818245 - Flags: feedback?(VYV03354) → feedback+
Summary: The URL constructor and the URL.href setter throws XPathException → The URL constructor and the URL.href setter shouldn't throw XPathException
Attachment #818245 - Attachment is obsolete: true
Attachment #818245 - Flags: review?(ehsan)
Attachment #818250 - Flags: review?(ehsan)
Attachment #818250 - Flags: review?(ehsan) → review+
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/9475a3189256
Assignee: nobody → amarchesini
Flags: in-testsuite+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/9475a3189256
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
> They will have to call rv.ClearMessage() on failure.

That seems really annoying.  I filed bug 933378 to make this more safe.
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: