Bug 1331434 is on inbound, and it adds a new static analysis and an
attribute called MOZ_MUST_RETURN_FROM_CALLER. This attribute is currently
attached to ErrorResult::Throw.
This analysis is intended to help catch buggy code which performs logic
like:
if (!foo) {
aRv.Throw(NS_ERROR_FAILURE);
}
foo->Bar();
Where the intended behavior is to return immediately after calling Throw.
If you find yourself having to perform additional cleanup after your calls
to Throw, you can instead use ThrowWithCustomCleanup, which does not have
the annotation.
If there are other methods like Throw which callers should usually return
immediately after calling, consider adding the MOZ_MUST_RETURN_FROM_CALLER
attribute. :)
_______________________________________________
dev-platform mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-platform