The default bug view has changed. See this FAQ.

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

RESOLVED FIXED

Status

()

Core
DOM
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: bsurender, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
"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.
(Reporter)

Comment 4

5 years ago
completed.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.