| Summary: | Annotate properties that start with "new" so they'll work under ARC | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Anders Carlsson <andersca> | ||||
| Component: | New Bugs | Assignee: | Anders Carlsson <andersca> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | ggaren | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Anders Carlsson
2015-01-07 14:46:08 PST
Created attachment 244206 [details]
Patch
Comment on attachment 244206 [details]
Patch
r=me
Does this require an update to some bindings test expectations or a new bindings test? Committed r178057: <http://trac.webkit.org/changeset/178057> Comment on attachment 244206 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=244206&action=review > Source/WebCore/bindings/scripts/CodeGeneratorObjC.pm:899 > + my $needsReturnsRetainedAnnotation = $attributeName =~ /new([A-Z].*)?/; http://clang.llvm.org/docs/AutomaticReferenceCounting.html#method-families says that we also need to check for alloc, copy, mutableCopy, and new. And maybe even init. I also was considering whether __attribute__((objc_method_family(none))) might not be better than NS_RETURNS_NOT_RETAINED, but I guess not. Given that documentation, I’m thinking this regular expression should be: /_*(alloc|copy|mutableCopy|new)([^a-z].*)?/ That wouldn’t address the init family, but it would cover the copy cases, which I think could easily happen in practice. |