This would be useful in the WebCore bindings code. Also, rename asFunction to asJSFunction, since this only applies to JSFunctions.
Created attachment 133295 [details] Fix
Comment on attachment 133295 [details] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=133295&action=review r=me > Source/JavaScriptCore/runtime/JSFunction.h:159 > + inline JSFunction* asJSFunction(JSValue value) Over time, I'd like us to move to the jsCast function template instead of one-off casting functions. That would be a nice improvement here, but I won't hold up this patch for it. > Source/JavaScriptCore/runtime/JSFunction.h:167 > + return isObject() && (asObject(*this)->inherits(&JSFunction::s_info) || asObject(*this)->inherits(&InternalFunction::s_info)); I think isCell() is a better check here.
Comment on attachment 133295 [details] Fix Attachment 133295 [details] did not pass gtk-ews (gtk): Output: http://queues.webkit.org/results/12120103
Comment on attachment 133295 [details] Fix Attachment 133295 [details] did not pass qt-wk2-ews (qt): Output: http://queues.webkit.org/results/12123066
Comment on attachment 133295 [details] Fix Attachment 133295 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/12120102
Created attachment 133300 [details] More better.
Comment on attachment 133300 [details] More better. r=me
Comment on attachment 133300 [details] More better. Attachment 133300 [details] did not pass win-ews (win): Output: http://queues.webkit.org/results/12120115
Fixed in r111739
Comment on attachment 133300 [details] More better. Attachment 133300 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/12120122
Comment on attachment 133300 [details] More better. Attachment 133300 [details] did not pass qt-wk2-ews (qt): Output: http://queues.webkit.org/results/12113166
Comment on attachment 133300 [details] More better. Attachment 133300 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/12117157
Comment on attachment 133300 [details] More better. Attachment 133300 [details] did not pass gtk-ews (gtk): Output: http://queues.webkit.org/results/12114150