| Summary: | Obj-C API: JSExport doesn't work for methods that contain protocols in their type signature | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Mark Hahnenberg <mhahnenberg> | ||||||
| Component: | JavaScriptCore | Assignee: | Mark Hahnenberg <mhahnenberg> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | barraclough, commit-queue, ggaren, sam | ||||||
| Priority: | P2 | ||||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Mark Hahnenberg
2014-02-10 09:49:22 PST
Created attachment 223728 [details]
Patch
Comment on attachment 223728 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=223728&action=review > Source/JavaScriptCore/API/ObjcRuntimeExtras.h:198 > + position = index(++position, '"') + 1; This feels at first like something that would give you victory at the IOCCC. I eventually figured it. But maybe you an come up with a better idiom for this at some point? (In reply to comment #3) > (From update of attachment 223728 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=223728&action=review > > > Source/JavaScriptCore/API/ObjcRuntimeExtras.h:198 > > + position = index(++position, '"') + 1; > > This feels at first like something that would give you victory at the IOCCC. I eventually figured it. But maybe you an come up with a better idiom for this at some point? I guess at this point, begin == position and we don't need to increment anything because we already know we're not pointing at a '"', so i can just change it to: position = index(begin, '"') + 1; Copy, paste, modify...not even once. > This feels at first like something that would give you victory at the IOCCC.
Probably only second place, if Gavin also entered.
Created attachment 223729 [details]
Patch
(In reply to comment #6) > Created an attachment (id=223729) [details] > Patch I decided to take Phil's advice to heart and actually write this code in a more understandable fashion. Comment on attachment 223729 [details] Patch Clearing flags on attachment: 223729 Committed r163876: <http://trac.webkit.org/changeset/163876> All reviewed patches have been landed. Closing bug. Comment on attachment 223729 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=223729&action=review > Source/JavaScriptCore/API/ObjcRuntimeExtras.h:197 > + const char* protocolPosition = index(begin, '<'); > + const char* endOfType = index(begin, '"'); It’s a little strange that we use index() here instead of strchr(). I think that index() is an archaic, pre-standardization, name for the same thing. (In reply to comment #10) > (From update of attachment 223729 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=223729&action=review > > > Source/JavaScriptCore/API/ObjcRuntimeExtras.h:197 > > + const char* protocolPosition = index(begin, '<'); > > + const char* endOfType = index(begin, '"'); > > It’s a little strange that we use index() here instead of strchr(). I think that index() is an archaic, pre-standardization, name for the same thing. index() does look like it's been deprecated in favor of strchr(). I filed bug 128610 to get rid index() in ObjcRuntimeExtras.h |