diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index 64d8d219f092..2bc3b586e2e6 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -579,6 +579,8 @@ TErrorResult::NoteJSContextException(JSContext* aCx) } template class TErrorResult; +template class TErrorResult; +template class TErrorResult; } // namespace binding_danger diff --git a/dom/bindings/ErrorResult.h b/dom/bindings/ErrorResult.h index aaa88382013c..37c99b9055f2 100644 --- a/dom/bindings/ErrorResult.h +++ b/dom/bindings/ErrorResult.h @@ -460,13 +460,24 @@ struct JustAssertCleanupPolicy { static const bool suppress = false; }; +struct AssertAndSuppressCleanupPolicy { + static const bool assertHandled = true; + static const bool suppress = true; +}; + +struct JustSuppressCleanupPolicy { + static const bool assertHandled = false; + static const bool suppress = true; +}; + } // namespace binding_danger // A class people should normally use on the stack when they plan to actually // do something with the exception. -class ErrorResult : public binding_danger::TErrorResult +class ErrorResult : + public binding_danger::TErrorResult { - typedef binding_danger::TErrorResult BaseErrorResult; + typedef binding_danger::TErrorResult BaseErrorResult; public: ErrorResult() @@ -503,17 +514,15 @@ template binding_danger::TErrorResult::operator ErrorResult&() { return *static_cast( - reinterpret_cast*>(this)); + reinterpret_cast*>(this)); } // A class for use when an ErrorResult should just automatically be ignored. -class IgnoredErrorResult : public ErrorResult +// This doesn't inherit from ErrorResult so we don't make two separate calls to +// SuppressException. +class IgnoredErrorResult : + public binding_danger::TErrorResult { -public: - ~IgnoredErrorResult() - { - SuppressException(); - } }; /******************************************************************************