Backout c19edad3d359 (bug 814026) for Android bustage

This commit is contained in:
Ed Morley 2012-11-21 19:02:18 +00:00
parent bf7072426a
commit b62ff67228

View File

@ -331,7 +331,8 @@ EventListenerManager::DispatchEvent(JSContext* aCx, const EventTarget& aTarget,
return false;
}
js::AutoValueVector listeners(aCx);
ContextAllocPolicy ap(aCx);
js::Vector<JSObject*, 10, ContextAllocPolicy> listeners(ap);
for (PRCList* elem = PR_NEXT_LINK(&collection->mListenerHead);
elem != &collection->mListenerHead;
@ -341,7 +342,7 @@ EventListenerManager::DispatchEvent(JSContext* aCx, const EventTarget& aTarget,
// Listeners that don't want untrusted events will be skipped if this is an
// untrusted event.
if ((eventIsTrusted || listenerData->mWantsUntrusted) &&
!listeners.append(OBJECT_TO_JSVAL(listenerData->mListener))) {
!listeners.append(listenerData->mListener)) {
aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
return false;
}
@ -364,7 +365,7 @@ EventListenerManager::DispatchEvent(JSContext* aCx, const EventTarget& aTarget,
// out of memory or the operation callback has indicated that we should
// stop running.
jsval listenerVal = listeners[index];
jsval listenerVal = OBJECT_TO_JSVAL(listeners[index]);
JSObject* listenerObj;
if (!JS_ValueToObject(aCx, listenerVal, &listenerObj)) {