Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement NSProxy #2499

Merged
merged 2 commits into from
Apr 13, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions Frameworks/Foundation/NSObject.mm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
#import "NSInvocationInternal.h"

static void _NSObjCEnumerationMutation(id object) {
[NSException raise:NSInternalInconsistencyException format:@"Collection <%s %p> mutated while being enumerated!", object_getClassName(object), object];
[NSException raise:NSInternalInconsistencyException
format:@"Collection <%s %p> mutated while being enumerated!", object_getClassName(object), object];
}

static BOOL _NSSelectorNotFoundIsNonFatal;
Expand Down Expand Up @@ -258,28 +259,28 @@ - (BOOL)conformsToProtocol:(Protocol*)protocol {
@Status Interoperable
*/
- (id)performSelector:(SEL)selector {
return ((id (*)(id, SEL))objc_msgSend)(self, selector);
return ((id(*)(id, SEL))objc_msgSend)(self, selector);
}

/**
@Status Interoperable
*/
- (id)performSelector:(SEL)selector withObject:(id)obj1 {
return ((id (*)(id, SEL, id))objc_msgSend)(self, selector, obj1);
return ((id(*)(id, SEL, id))objc_msgSend)(self, selector, obj1);
}

/**
@Status Interoperable
*/
- (id)performSelector:(SEL)selector withObject:(id)obj1 withObject:(id)obj2 {
return ((id (*)(id, SEL, id, id))objc_msgSend)(self, selector, obj1, obj2);
return ((id(*)(id, SEL, id, id))objc_msgSend)(self, selector, obj1, obj2);
}

/**
@Status Interoperable
*/
- (id)performSelector:(SEL)selector withObject:(id)obj1 withObject:(id)obj2 withObject:(id)obj3 {
return ((id (*)(id, SEL, id, id, id))objc_msgSend)(self, selector, obj1, obj2, obj3);
return ((id(*)(id, SEL, id, id, id))objc_msgSend)(self, selector, obj1, obj2, obj3);
}

/**
Expand Down Expand Up @@ -504,7 +505,6 @@ static IMP _NSIMPForward(id object, SEL selector) {
return _NSSlotForward(object, selector)->method;
}


/**
@Status Interoperable
*/
Expand Down Expand Up @@ -677,12 +677,11 @@ + (void)cancelPreviousPerformRequestsWithTarget:(id)aTarget selector:(SEL)aSelec
}

/**
@Status Stub
@Status Interoperable
@Notes
*/
- (BOOL)isProxy {
UNIMPLEMENTED();
return StubReturn();
return NO;
}

- (id)autoContentAccessingProxy {
Expand All @@ -708,7 +707,8 @@ void WinObjC_SetMissingSelectorFatal(BOOL fatal) {
}
@end

static void _dealloc_zombify(id self, SEL _cmd); // forward declaration
static void

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I'd prefer not having the format changes in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll fix this one and leave the rest, if that's ok

_dealloc_zombify(id self, SEL _cmd); // forward declaration

static void _NSCFZombifyHook(id object) {
_dealloc_zombify(object, nullptr);
Expand Down Expand Up @@ -737,7 +737,7 @@ + (BOOL)isSubclassOfClass:(Class)classRef {
/**
@Status Interoperable
*/
- (void)doesNotRecognizeSelector: (SEL)selector {
- (void)doesNotRecognizeSelector:(SEL)selector {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then again, some of them are good ..

// NSZombie subclasses store the original class as a class variable. Retrieve it here.
Class oldIsa = reinterpret_cast<Class*>(object_getIndexedIvars(isa))[0];
THROW_NS_HR_MSG(HRESULT_FROM_WIN32(ERROR_INVALID_HANDLE),
Expand All @@ -748,8 +748,7 @@ - (void)doesNotRecognizeSelector: (SEL)selector {
}
@end

static void
_dealloc_dispose(id self, SEL _cmd) {
static void _dealloc_dispose(id self, SEL _cmd) {
object_dispose(self);
}

Expand Down
Loading