[WebIDL] Factor out IsExceptionOr check from toJS/toJSNewlyCreated signature
Created attachment 321727 [details] Patch
Comment on attachment 321727 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=321727&action=review > Source/WebCore/bindings/js/JSDOMConvertBase.h:91 > +struct IsExceptionOr : public std::integral_constant<bool, WTF::IsTemplate<std::decay_t<T>, ExceptionOr>::value> { }; Would the following work? template<typename T> using IsExceptionOr = std::integral_constant...
Comment on attachment 321727 [details] Patch Clearing flags on attachment: 321727 Committed r222480: <http://trac.webkit.org/changeset/222480>
All reviewed patches have been landed. Closing bug.
Created attachment 321767 [details] This also works...
(In reply to youenn fablet from comment #2) > Comment on attachment 321727 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=321727&action=review > > > Source/WebCore/bindings/js/JSDOMConvertBase.h:91 > > +struct IsExceptionOr : public std::integral_constant<bool, WTF::IsTemplate<std::decay_t<T>, ExceptionOr>::value> { }; > > Would the following work? > template<typename T> using IsExceptionOr = std::integral_constant... That would work too (posted a patch with it above). I have not found a good feel for when to use using vs. inheritance in situations like these. Is there a reason to prefer one over the other here?
'using' seems a bit more readable/closer to the intent than 'struct' as we probably do not want to specialize the struct or add any method to it. Mostly a style thingy I guess
<rdar://problem/34692938>