Open Bug 1620720 Opened 5 years ago Updated 5 years ago

Consider having MSG_METHOD_THIS_DOES_NOT_IMPLEMENT_INTERFACE use the same prefix as most binding methods

Categories

(Core :: DOM: Bindings (WebIDL), task, P2)

task

Tracking

()

People

(Reporter: bzbarsky, Unassigned)

References

(Blocks 1 open bug)

Details

Right now it looks like this:

'getElementById' called on an object that does not implement interface Document.

And for the getter case:

'get URL' called on an object that does not implement interface Document.

If we want to do this, then in dom::ThrowInvalidThis we can:

  1. Check whether funcNameStr starts with "get " and if so strip it off and append " getter" instead.
  2. If not, do the same thing with "set " and " setter".
  3. Change the call to:
  JS_ReportErrorNumberUC(aCx, GetErrorMessage, nullptr,
                         static_cast<unsigned>(errorNumber), ifaceName.get(), funcNameStr.get(),
                         ifaceName.get());
  1. Change the string in Errors.msg to:
MSG_DEF(MSG_METHOD_THIS_DOES_NOT_IMPLEMENT_INTERFACE, 3, false, JSEXN_TYPEERR, "{0}.{1}: \"this\" value does not implement interface {1}.")

or so.

Type: defect → task
Priority: -- → P2
Severity: normal → N/A
You need to log in before you can comment on or make changes to this bug.