Skip to content

Commit

Permalink
Retrieve block signatures directly from block headers.
Browse files Browse the repository at this point in the history
The placeholder block has replaced its signature now and retrieving its signature can be done in the same way as the regular blocks.

PiperOrigin-RevId: 343912714
  • Loading branch information
wuhao5 authored and mobile-devx-github-bot committed Nov 23, 2020
1 parent 7a72382 commit 91c532d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions Service/Sources/NSBlock+EDOInvocation.m
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,7 @@ @implementation NSBlock (EDOInvocation)
}

IMP methodSignatureImp = imp_implementationWithBlock(^(id block, SEL selector) {
EDOBlockObject *blockObject = [EDOBlockObject EDOBlockObjectFromBlock:block];
if (blockObject) {
return [NSMethodSignature signatureWithObjCTypes:blockObject.signature.UTF8String];
} else {
return [NSMethodSignature signatureWithObjCTypes:[EDOBlockObject signatureFromBlock:block]];
}
return [NSMethodSignature signatureWithObjCTypes:[EDOBlockObject signatureFromBlock:block]];
});
BOOL methodSignatureAdded = class_addMethod(
[NSBlock class], @selector(methodSignatureForSelector:), methodSignatureImp, "v@::");
Expand Down

0 comments on commit 91c532d

Please sign in to comment.