WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
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
Summary
Objective-C API: Objective-C functions exposed to JavaScript have the wrong t...
Gavin Barraclough
Reported
2012-12-31 23:45:40 PST
The current implementation ttys to implement a JavaScript Function object via the C-API - it does so imperfectly.
Attachments
Patch
(20.80 KB, patch)
2013-03-11 16:26 PDT
,
Mark Hahnenberg
no flags
Details
Formatted Diff
Diff
Patch
(22.34 KB, patch)
2013-03-11 16:42 PDT
,
Mark Hahnenberg
no flags
Details
Formatted Diff
Diff
Patch
(22.38 KB, patch)
2013-03-11 16:59 PDT
,
Mark Hahnenberg
no flags
Details
Formatted Diff
Diff
Patch
(22.37 KB, patch)
2013-03-11 17:36 PDT
,
Mark Hahnenberg
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Geoffrey Garen
Comment 1
2013-01-03 15:58:51 PST
ObjCCallbackFunction should subclass JSFunction or InternalFunction.
Mark Hahnenberg
Comment 2
2013-03-11 16:26:20 PDT
Created
attachment 192590
[details]
Patch
Early Warning System Bot
Comment 3
2013-03-11 16:36:28 PDT
Comment on
attachment 192590
[details]
Patch
Attachment 192590
[details]
did not pass qt-ews (qt): Output:
http://webkit-commit-queue.appspot.com/results/17121421
Early Warning System Bot
Comment 4
2013-03-11 16:38:44 PDT
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
Mark Hahnenberg
Comment 5
2013-03-11 16:42:18 PDT
Created
attachment 192592
[details]
Patch
Early Warning System Bot
Comment 6
2013-03-11 16:53:27 PDT
Comment on
attachment 192592
[details]
Patch
Attachment 192592
[details]
did not pass qt-ews (qt): Output:
http://webkit-commit-queue.appspot.com/results/17013883
Early Warning System Bot
Comment 7
2013-03-11 16:54:14 PDT
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
Mark Hahnenberg
Comment 8
2013-03-11 16:59:10 PDT
Created
attachment 192596
[details]
Patch
Early Warning System Bot
Comment 9
2013-03-11 17:13:14 PDT
Comment on
attachment 192596
[details]
Patch
Attachment 192596
[details]
did not pass qt-ews (qt): Output:
http://webkit-commit-queue.appspot.com/results/17149383
Early Warning System Bot
Comment 10
2013-03-11 17:18:38 PDT
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
Mark Hahnenberg
Comment 11
2013-03-11 17:36:00 PDT
Created
attachment 192606
[details]
Patch
Mark Hahnenberg
Comment 12
2013-03-11 18:05:16 PDT
<
rdar://problem/12954243
>
Geoffrey Garen
Comment 13
2013-03-12 09:06:03 PDT
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".
Mark Hahnenberg
Comment 14
2013-03-14 14:16:14 PDT
Committed
r145848
: <
http://trac.webkit.org/changeset/145848
>
Mark Hahnenberg
Comment 15
2013-03-14 14:40:09 PDT
Comment on
attachment 192606
[details]
Patch Clearing flags.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug