The current implementation ttys to implement a JavaScript Function object via the C-API - it does so imperfectly.
ObjCCallbackFunction should subclass JSFunction or InternalFunction.
Created attachment 192590 [details] Patch
Comment on attachment 192590 [details] Patch Attachment 192590 [details] did not pass qt-ews (qt): Output: http://webkit-commit-queue.appspot.com/results/17121421
Comment on attachment 192590 [details] Patch Attachment 192590 [details] did not pass qt-wk2-ews (qt): Output: http://webkit-commit-queue.appspot.com/results/17178092
Created attachment 192592 [details] Patch
Comment on attachment 192592 [details] Patch Attachment 192592 [details] did not pass qt-ews (qt): Output: http://webkit-commit-queue.appspot.com/results/17013883
Comment on attachment 192592 [details] Patch Attachment 192592 [details] did not pass qt-wk2-ews (qt): Output: http://webkit-commit-queue.appspot.com/results/17177390
Created attachment 192596 [details] Patch
Comment on attachment 192596 [details] Patch Attachment 192596 [details] did not pass qt-ews (qt): Output: http://webkit-commit-queue.appspot.com/results/17149383
Comment on attachment 192596 [details] Patch Attachment 192596 [details] did not pass qt-wk2-ews (qt): Output: http://webkit-commit-queue.appspot.com/results/17024541
Created attachment 192606 [details] Patch
<rdar://problem/12954243>
Comment on attachment 192606 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=192606&action=review r=me > Source/JavaScriptCore/API/ObjCCallbackFunction.mm:586 > + return toRef(JSC::ObjCCallbackFunction::create(exec, exec->lexicalGlobalObject(), "Objective-C", impl.release())); Should we just leave the function anonymous, instead? I agree that at the JS-mangled selector name would be better, but I don't think "Objective-C" adds all that much. > Source/JavaScriptCore/API/tests/testapi.mm:526 > + JSValue *result = [context evaluateScript:@"Function.prototype.toString.call(testObject.callback)"]; > + checkResult(@"callback function typeof", !context.exception && ![result isUndefined]); This test doesn't actually test typeof. You should name this test "toString', and write a separate test line for typeof that shows it's "Function".
Committed r145848: <http://trac.webkit.org/changeset/145848>
Comment on attachment 192606 [details] Patch Clearing flags.