Bug 847773 - Added override for GetWrapperCache with smart pointer argument to resolve ambiguity in templates. r=bz

This commit is contained in:
William Chen 2013-03-04 20:30:13 -08:00
parent 15dc264ece
commit 429899b456
2 changed files with 10 additions and 1 deletions

View File

@ -5059,7 +5059,7 @@ nsDocument::Register(JSContext* aCx, const nsAString& aName,
// Don't abort the upgrade algorithm if the callback throws an
// exception.
ErrorResult dummy;
aOptions.mLifecycle.mCreated->Call(newElement.get(), dummy);
aOptions.mLifecycle.mCreated->Call(newElement, dummy);
}
nsCOMPtr<nsIDOMElementReplaceEvent> ptEvent = do_QueryInterface(event);

View File

@ -696,6 +696,15 @@ GetWrapperCache(void* p)
return NULL;
}
// Helper template for smart pointers to resolve ambiguity between
// GetWrappeCache(void*) and GetWrapperCache(const ParentObject&).
template <template <typename> class SmartPtr, typename T>
inline nsWrapperCache*
GetWrapperCache(const SmartPtr<T>& aObject)
{
return GetWrapperCache(aObject.get());
}
/**
* A method to handle new-binding wrap failure, by possibly falling back to
* wrapping as a non-new-binding object.