Bug 978042 - Part 1: AutoPushJSContext in nsEventListenerManager::CompileEventHandlerInternal. r=bholley

This commit is contained in:
Bob Owen 2014-03-19 11:08:13 +00:00
parent 8f8a05d68e
commit 54871d21fd
2 changed files with 11 additions and 1 deletions

View File

@ -811,7 +811,7 @@ EventListenerManager::CompileEventHandlerInternal(Listener* aListener,
NS_ENSURE_STATE(context);
// Push a context to make sure exceptions are reported in the right place.
AutoPushJSContext cx(context->GetNativeContext());
AutoPushJSContextForErrorReporting cx(context->GetNativeContext());
JS::Rooted<JSObject*> handler(cx);
JS::Rooted<JSObject*> scope(cx, jsListener->GetEventScope());

View File

@ -174,6 +174,16 @@ public:
operator JSContext*() { return mCx; }
};
/**
* AutoPushJSContextForErrorReporting has been defined for work being carried
* out for bug 951991. It is to be used where an AutoPushJSContext is only
* being used to make sure errors are reported using the error reporter for the
* appropriate DOM Window and we don't want to replace it with AutoEntryScript.
* This will make it easy to find these cases once the JSContext is no longer
* required for error reporting.
*/
typedef AutoPushJSContext AutoPushJSContextForErrorReporting;
} // namespace mozilla
#endif /* nsCxPusher_h */