mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1176800 part 2. Add a ToJSValue overload for owning unions. r=peterv
This commit is contained in:
parent
cf4b97758b
commit
f87bcd3914
@ -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