Hello all,

We just made some more changes to Web IDL exception messages:

1) When calling ErrorResult::ThrowTypeError/ThrowRangeError, you now pass regular string literals or nsACString, not u"" or nsAString. Not only is this more convenient for the literal cases, but the JS engine was converting the input string into UTF-8 anyway, so this reduces the amount of converting going on (though only in error cases). See bug 1619112 for details.

2) Exceptions thrown from binding methods now have the prefixes described in https://groups.google.com/d/msg/mozilla.dev.platform/WhTA0AmJyU8/WNcgp38cBAAJ not only for things thrown via ErrorResult but also for things thrown from the bindings themselves. See bug 1618011.

3) If you manually initialize dictionaries from a JS::Value in your code, you can now pass them a BindingCallContext with a description that will be used as the prefix for exceptions thrown from the dictionary initialization. See documentation in BindingCallContext.h.

4) More readable and informative descriptions for failures involving unions, for [EnforceRange] failures, and for ByteString failures. See https://bug1618011.bmoattachments.org/attachment.cgi?id=9129754 for a bunch of testcases with before/after strings.

At this point, almost bindings stuff consistently prefixes the exception with the name of the interface and method involved. The one case where this does not happen is when a binding method/getter/setter has the wrong type of object as "this". I just filed bug 1620720 on this.

There's still the open question of what the label should looks like to disambiguate instance and static methods; that's tracked in bug 1614471.

-Boris
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to