[webkit-reviews] review granted: [Bug 105892] Objective-C API: Objective-C functions exposed to JavaScript have the wrong type (object instead of function) : [Attachment 192606] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Mar 12 09:03:37 PDT 2013


Geoffrey Garen <ggaren at apple.com> has granted Mark Hahnenberg
<mhahnenberg at apple.com>'s request for review:
Bug 105892: Objective-C API: Objective-C functions exposed to JavaScript have
the wrong type (object instead of function)
https://bugs.webkit.org/show_bug.cgi?id=105892

Attachment 192606: Patch
https://bugs.webkit.org/attachment.cgi?id=192606&action=review

------- Additional Comments from Geoffrey Garen <ggaren at apple.com>
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".


More information about the webkit-reviews mailing list