Closed Bug 779364 Opened 12 years ago Closed 12 years ago

New DOM Bindings raises exception with incorrect exception usage warning "WARNING: Huh, someone is throwing non-DOM errors using the DOM module!"

Categories

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

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bsurender, Unassigned)

References

Details

"WARNING: Huh, someone is throwing non-DOM errors using the DOM module!" displayed when valid exception is raised in the NEW DOM bindings generated binding code file for the TextDecoder. The exception is correctly raised when unit test passes an invalid null JS object for an ArrayBufferView to TextDecode::Decode(...). The TextDecoder is a part of the String Encoding/Decoding API, bug 764234. Code snippet from dom/bindings/TextDecoderBinding.cpp: const Optional<ArrayBufferView> arg1; if (1 < argc) { if (argv[1].isObject()) { if (!JS_IsArrayBufferViewObject(&argv[1].toObject(), cx)) { return Throw<false>(cx, NS_ERROR_XPC_BAD_CONVERT_JS); }
https://mxr.mozilla.org/mozilla-central/source/dom/base/nsDOMException.cpp?rev=6e30103582c4#101 This warning should be moved into NS_NewDOMException. NS_GetNameAndMessageForDOMNSResult will be called bypassing the DOM module.
Based on the bug description, bug 776685 will fix this.
Depends on: 776685
This is hit if someone throws a non-DOMException nsresult from Workers, right? Might we worth avoiding the warning in that case regardless of bug 776685.
completed.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.