ObjFW  Check-in [0389649320]

Overview
Comment:-[performSelector:]: Never call NULL.

When the selector is not recognized, call -[doesNotRecognizeSelector:].

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 0389649320ec0266eb363ecfc3c000587afd01e02b7d0144446570d1d8e470ac
User & Date: js on 2012-12-30 00:19:56
Other Links: manifest | tags
Context
2012-12-30
00:22
Fix -[initWithUTF8StringNoCopy:freeWhenDone:]. check-in: c16e6aca56 user: js tags: trunk
00:19
-[performSelector:]: Never call NULL. check-in: 0389649320 user: js tags: trunk
2012-12-29
17:56
OFString: Improve API for Unicode strings. check-in: 640b225ba7 user: js tags: trunk
Changes

Modified src/OFObject.m from [6afd10fb87] to [2afc930247].

543
544
545
546
547
548
549



550
551
552
553
554
555
556
557
558



559
560
561
562
563
564
565
566
567
568



569
570
571
572
573
574
575
	return class_getMethodImplementation(object_getClass(self), selector);
}

- (id)performSelector: (SEL)selector
{
	id (*imp)(id, SEL) = (id(*)(id, SEL))[self methodForSelector: selector];




	return imp(self, selector);
}

- (id)performSelector: (SEL)selector
	   withObject: (id)object
{
	id (*imp)(id, SEL, id) =
	    (id(*)(id, SEL, id))[self methodForSelector: selector];




	return imp(self, selector, object);
}

- (id)performSelector: (SEL)selector
	   withObject: (id)object1
	   withObject: (id)object2
{
	id (*imp)(id, SEL, id, id) =
	    (id(*)(id, SEL, id, id))[self methodForSelector: selector];




	return imp(self, selector, object1, object2);
}

- (void)performSelector: (SEL)selector
	     afterDelay: (double)delay
{
	void *pool = objc_autoreleasePoolPush();







>
>
>









>
>
>










>
>
>







543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
	return class_getMethodImplementation(object_getClass(self), selector);
}

- (id)performSelector: (SEL)selector
{
	id (*imp)(id, SEL) = (id(*)(id, SEL))[self methodForSelector: selector];

	if OF_UNLIKELY (imp == NULL)
		[self doesNotRecognizeSelector: selector];

	return imp(self, selector);
}

- (id)performSelector: (SEL)selector
	   withObject: (id)object
{
	id (*imp)(id, SEL, id) =
	    (id(*)(id, SEL, id))[self methodForSelector: selector];

	if OF_UNLIKELY (imp == NULL)
		[self doesNotRecognizeSelector: selector];

	return imp(self, selector, object);
}

- (id)performSelector: (SEL)selector
	   withObject: (id)object1
	   withObject: (id)object2
{
	id (*imp)(id, SEL, id, id) =
	    (id(*)(id, SEL, id, id))[self methodForSelector: selector];

	if OF_UNLIKELY (imp == NULL)
		[self doesNotRecognizeSelector: selector];

	return imp(self, selector, object1, object2);
}

- (void)performSelector: (SEL)selector
	     afterDelay: (double)delay
{
	void *pool = objc_autoreleasePoolPush();