mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1176800 part 2. Add a ToJSValue overload for owning unions. r=peterv
This commit is contained in:
parent
e0a63ff0a1
commit
9c534d67df
@ -281,6 +281,18 @@ ToJSValue(JSContext* aCx,
|
||||
ErrorResult& aArgument,
|
||||
JS::MutableHandle<JS::Value> aValue);
|
||||
|
||||
// Accept owning WebIDL unions.
|
||||
template <typename T>
|
||||
MOZ_WARN_UNUSED_RESULT
|
||||
typename EnableIf<IsBaseOf<AllOwningUnionBase, T>::value, bool>::Type
|
||||
ToJSValue(JSContext* aCx,
|
||||
const T& aArgument,
|
||||
JS::MutableHandle<JS::Value> aValue)
|
||||
{
|
||||
JS::Rooted<JSObject*> global(aCx, JS::CurrentGlobalOrNull(aCx));
|
||||
return aArgument.ToJSVal(aCx, global, aValue);
|
||||
}
|
||||
|
||||
// Accept pointers to other things we accept
|
||||
template <typename T>
|
||||
MOZ_WARN_UNUSED_RESULT
|
||||
|
Loading…
Reference in New Issue
Block a user