Merge remote-tracking branch 'cappuccino/master'

This commit is contained in:
Didier Korthoudt committed 2019-04-13 10:25:08 +02:00
commit 5e7f3dc24a
27 files changed
+153 -80

No files matched your search

+1 -1
View File
@@ -479,7 +479,7 @@ var CPApplicationDelegate_applicationShouldTerminate_ = 1 << 0,
[self _didResignActive];
}
- (void)isActive
- (BOOL)isActive
{
return _isActive;
}
-11
View File
@@ -219,17 +219,6 @@
_clearsFilterPredicateOnInsertion = aFlag;
}
/*!
Whether the receiver will always return the multiple values marker when multiple
items are selected, even if the items have the same value.
@return BOOL YES if the receiver always uses the multiple values marker
*/
- (BOOL)alwaysUsesMultipleValuesMarker
{
return _alwaysUsesMultipleValuesMarker;
}
/*!
Sets whether the receiver should always return the multiple values marker when multiple
items are selected, even if the items have the same value.
+2 -2
View File
@@ -231,7 +231,7 @@ var DefaultLineWidth = 1.0;
/*!
Cocoa compatibility.
*/
- (void)getLineDash:(CPArrayRef)patternRef count:(NSInteger)count phase:(CGFloatRef)phaseRef
- (void)getLineDash:(CPArrayRef)patternRef count:(CPInteger)count phase:(CGFloatRef)phaseRef
{
return [self getLineDash:patternRef phase:phaseRef];
}
@@ -250,7 +250,7 @@ var DefaultLineWidth = 1.0;
/*!
Cocoa compatibility.
*/
- (void)setLineDash:(CPArray)aPattern count:(NSInteger)count phase:(CGFloat)aPhase
- (void)setLineDash:(CPArray)aPattern count:(CPInteger)count phase:(CGFloat)aPhase
{
[self setLineDash:aPattern phase:aPhase];
}
+12 -17
View File
@@ -42,7 +42,6 @@
- (CPDragOperation)browser:(CPBrowser)browser validateDrop:(id)info proposedRow:(CPInteger)row column:(CPInteger)column dropOperation:(CPTableViewDropOperation)dropOperation;
- (CPImage)browser:(CPBrowser)browser imageValueForItem:(id)anItem;
- (CPImage)browser:(CPBrowser)browser draggingImageForRowsWithIndexes:(CPIndexSet)rowIndexes inColumn:(CPInteger)column withEvent:(CPEvent)event offset:(CGPoint)dragImageOffset;
- (CPImage)browser:(CPBrowser)browser imageValueForItem:(id)item;
- (CPIndexSet)browser:(CPBrowser)browser selectionIndexesForProposedSelection:(CPIndexSet)proposedSelectionIndexes inColumn:(CPInteger)column;
- (CPInteger)browser:(CPBrowser)browser numberOfChildrenOfItem:(id)item;
- (CPView)browser:(CPBrowser)browser draggingViewForRowsWithIndexes:(CPIndexSet)rowIndexes inColumn:(CPInteger)column withEvent:(CPEvent)event offset:(CGPoint)dragImageOffset;
@@ -62,19 +61,18 @@ var CPBrowserDelegate_browser_acceptDrop_atRow_column_dropOperation_
CPBrowserDelegate_browser_shouldSelectRowIndexes_inColumn_ = 1 << 4,
CPBrowserDelegate_browser_writeRowsWithIndexes_inColumn_toPasteboard_ = 1 << 5,
CPBrowserDelegate_browser_validateDrop_proposedRow_column_dropOperation_ = 1 << 6,
CPBrowserDelegate_browser_imageValueForItem_ = 1 << 7,
CPBrowserDelegate_browser_draggingImageForRowsWithIndexes_inColumn_withEvent_offset_ = 1 << 8,
CPBrowserDelegate_browser_imageValueForItem_ = 1 << 9,
CPBrowserDelegate_browser_selectionIndexesForProposedSelection_inColumn_ = 1 << 10,
CPBrowserDelegate_browser_numberOfChildrenOfItem_ = 1 << 11,
CPBrowserDelegate_browser_draggingViewForRowsWithIndexes_inColumn_withEvent_offset_ = 1 << 12,
CPBrowserDelegate_browser_child_ofItem_ = 1 << 13,
CPBrowserDelegate_browser_objectValueForItem_ = 1 << 14,
CPBrowserDelegate_rootItemForBrowser_ = 1 << 15,
CPBrowserDelegate_browser_didChangeLastColumn_toColumn_ = 1 << 16,
CPBrowserDelegate_browser_didResizeColumn_ = 1 << 17,
CPBrowserDelegate_browserSelectionIsChanging_ = 1 << 18,
CPBrowserDelegate_browserSelectionDidChange_ = 1 << 19;
CPBrowserDelegate_browser_draggingImageForRowsWithIndexes_inColumn_withEvent_offset_ = 1 << 7,
CPBrowserDelegate_browser_imageValueForItem_ = 1 << 8,
CPBrowserDelegate_browser_selectionIndexesForProposedSelection_inColumn_ = 1 << 9,
CPBrowserDelegate_browser_numberOfChildrenOfItem_ = 1 << 10,
CPBrowserDelegate_browser_draggingViewForRowsWithIndexes_inColumn_withEvent_offset_ = 1 << 11,
CPBrowserDelegate_browser_child_ofItem_ = 1 << 12,
CPBrowserDelegate_browser_objectValueForItem_ = 1 << 13,
CPBrowserDelegate_rootItemForBrowser_ = 1 << 14,
CPBrowserDelegate_browser_didChangeLastColumn_toColumn_ = 1 << 15,
CPBrowserDelegate_browser_didResizeColumn_ = 1 << 16,
CPBrowserDelegate_browserSelectionIsChanging_ = 1 << 17,
CPBrowserDelegate_browserSelectionDidChange_ = 1 << 18;
/*!
@ingroup appkit
@@ -211,9 +209,6 @@ var CPBrowserDelegate_browser_acceptDrop_atRow_column_dropOperation_
if ([_delegate respondsToSelector:@selector(browser:validateDrop:proposedRow:column:dropOperation:)])
_implementedDelegateMethods |= CPBrowserDelegate_browser_validateDrop_proposedRow_column_dropOperation_;
if ([_delegate respondsToSelector:@selector(browser:imageValueForItem:)])
_implementedDelegateMethods |= CPBrowserDelegate_browser_imageValueForItem_;
if ([_delegate respondsToSelector:@selector(browser:draggingImageForRowsWithIndexes:inColumn:withEvent:offset:)])
_implementedDelegateMethods |= CPBrowserDelegate_browser_draggingImageForRowsWithIndexes_inColumn_withEvent_offset_;
+1 -1
View File
@@ -267,7 +267,7 @@ var cachedBlackColor,
@return an initialized RGB color
*/
+ (CPColor)colorWithHexString:(string)hex
+ (CPColor)colorWithHexString:(CPString)hex
{
var rgba = hexToRGB(hex);
return rgba ? [[CPColor alloc] _initWithRGBA: rgba] : null;
+1 -1
View File
@@ -803,7 +803,7 @@ var CPControlBlackColor = [CPColor blackColor];
CPBottomVerticalTextAlignment
</pre>
*/
- (void)setVerticalAlignment:(CPTextVerticalAlignment)alignment
- (void)setVerticalAlignment:(CPVerticalTextAlignment)alignment
{
[self setValue:alignment forThemeAttribute:@"vertical-alignment"];
}
Executable → Regular
+2 -3
View File
@@ -193,9 +193,8 @@ CPCursorPlatformBoth = 3;
if (typeof cursor === "undefined")
{
var themeResourcePath = [[[CPApp themeBlend] bundle] resourcePath],
extension = CPBrowserIsOperatingSystem(CPWindowsOperatingSystem) ? @"cur" : @"png";
cssString = [CPString stringWithFormat:@"url(%@cursors/%@.%@), %@", themeResourcePath, cursorName, extension, aString];
extension = CPBrowserIsOperatingSystem(CPWindowsOperatingSystem) ? @"cur" : @"png",
cssString = [CPString stringWithFormat:@"url(%@cursors/%@.%@), %@", themeResourcePath, cursorName, extension, aString];
cursors[cursorName] = cursor = [[CPCursor alloc] initWithCSSString:cssString];
}
+1 -1
View File
@@ -695,7 +695,7 @@ var CPDatePickerModeKey = @"CPDatePickerModeKey",
[aCoder encodeInt:_datePickerElements forKey:CPDatePickerElementsKey];
[aCoder encodeObject:_minDate forKey:CPMinDateKey];
[aCoder encodeObject:_maxDate forKey:CPMaxDateKey];
[aCoder encodeObject:_dateValue forKey:CPDateValueKey];;
[aCoder encodeObject:_dateValue forKey:CPDateValueKey];
[aCoder encodeObject:_textFont forKey:CPTextFontKey];
[aCoder encodeObject:_locale forKey:CPLocaleKey];
[aCoder encodeObject:_backgroundColor forKey:CPBackgroundColorKey];
+1 -1
View File
@@ -92,7 +92,7 @@ var CPGraphicsContextCurrent = nil,
@param aGraphicsPort the graphics port to initialize with
@return the initialized context
*/
- (id)initWithGraphicsPort:(CPContext)aGraphicsPort
- (id)initWithGraphicsPort:(CGContext)aGraphicsPort
{
self = [super init];
+1 -1
View File
@@ -1131,7 +1131,7 @@ var _CPMenuBarVisible = NO,
}
}
- (void)_menuWithName:(CPString)aName
- (CPMenu)_menuWithName:(CPString)aName
{
if (aName === _name)
return self;
+1 -1
View File
@@ -350,7 +350,7 @@
- (CPFont)font
{
[CPFont systemFontOfSize:[CPFont systemFontSize]];
return [CPFont systemFontOfSize:[CPFont systemFontSize]];
}
- (void)tile
+1 -1
View File
@@ -208,7 +208,7 @@ CPThemeStateScrollerKnobDark = CPThemeState("scroller-knob-dark");
/*!
Returns the scroller's style
*/
- (void)style
- (int)style
{
return _style;
}
+1
View File
@@ -323,6 +323,7 @@ var CPStepperMinValue = @"CPStepperMinValue",
_autorepeat = [aCoder decodeBoolForKey:CPStepperAutorepeat];
[self _init];
[self setEnabled:[self isEnabled]];
}
return self;
+1 -1
View File
@@ -783,7 +783,7 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
element.style.zIndex = 1000;
element.style.top = topPoint;
element.style.lineHeight = ROUND(lineHeight) + "px";
element.style.height = isTextArea ? CGRectGetHeight(contentRect) + "px" : ROUND(lineHeight) + "px";;
element.style.height = isTextArea ? CGRectGetHeight(contentRect) + "px" : ROUND(lineHeight) + "px";
element.style.width = CGRectGetWidth(contentRect) + "px";
element.style.left = left + "px";
element.style.verticalAlign = "top";
+1 -1
View File
@@ -1277,7 +1277,7 @@ var _objectsInRange = function(aList, aRange)
}
}
- (void)backgroundColorForGlyphAtIndex:(unsigned)index
- (CPColor)backgroundColorForGlyphAtIndex:(unsigned)index
{
var run = _objectWithLocationInRange(_runs, index);
+2 -2
View File
@@ -122,7 +122,7 @@ var CPTextStorageDelegate_textStorageWillProcessEditing_ = 1 << 1,
- (void)addLayoutManager:(CPLayoutManager)aManager
{
if ([_layoutManagers containsObject:aManager])
return
return;
[aManager setTextStorage:self];
[_layoutManagers addObject:aManager];
@@ -131,7 +131,7 @@ var CPTextStorageDelegate_textStorageWillProcessEditing_ = 1 << 1,
- (void)removeLayoutManager:(CPLayoutManager)aManager
{
if (![_layoutManagers containsObject:aManager])
return
return;
[aManager setTextStorage:nil];
[_layoutManagers removeObject:aManager];
+41 -6
View File
@@ -37,6 +37,7 @@
@class CPClipView;
@class CPMenu;
@class _CPSelectionBox;
@class _CPCaret;
@class _CPNativeInputManager;
@@ -50,6 +51,7 @@
- (CPRange)textView:(CPTextView)aTextView willChangeSelectionFromCharacterRange:(CPRange)oldSelectedCharRange toCharacterRange:(CPRange)newSelectedCharRange;
- (void)textViewDidChangeSelection:(CPNotification)aNotification;
- (void)textViewDidChangeTypingAttributes:(CPNotification)aNotification;
- (CPMenu)textView:(CPTextView)view menu:(CPMenu)menu forEvent:(CPEvent)event atIndex:(unsigned)charIndex;
@end
@@ -105,6 +107,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
kDelegateRespondsTo_textView_didChangeTypingAttributes = 1 << 8,
kDelegateRespondsTo_textView_textDidBeginEditing = 1 << 9,
kDelegateRespondsTo_textView_textDidEndEditing = 1 << 10;
kDelegateRespondsTo_textView_menu_forEvent_atIndex = 1 << 11;
@class _CPCaret;
@@ -170,6 +173,20 @@ var kDelegateRespondsTo_textShouldBeginEditing
return [super _binderClassForBinding:aBinding];
}
+ (CPMenu)defaultMenu
{
var editMenu = [CPMenu new];
// FIXME I8N
[editMenu addItemWithTitle:@"Cut" action:@selector(cut:) keyEquivalent:@"x"];
[editMenu addItemWithTitle:@"Copy" action:@selector(copy:) keyEquivalent:@"c"];
[editMenu addItemWithTitle:@"Paste" action:@selector(paste:) keyEquivalent:@"v"];
[editMenu setAutoenablesItems:NO]
return editMenu;
}
#pragma mark -
#pragma mark Class methods
@@ -590,6 +607,9 @@ var kDelegateRespondsTo_textShouldBeginEditing
if ([_delegate respondsToSelector:@selector(textView:shouldChangeTypingAttributes:toAttributes:)])
_delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_shouldChangeTypingAttributes_toAttributes;
if ([_delegate respondsToSelector:@selector(textView:menu:forEvent:atIndex:)])
_delegateRespondsToSelectorMask |= kDelegateRespondsTo_textView_menu_forEvent_atIndex;
if (_superview)
[self _addDelegateObservers];
}
@@ -668,7 +688,7 @@ var kDelegateRespondsTo_textShouldBeginEditing
[self setString:aValue];
}
- (void)setString:(id)aString
- (void)setString:(CPString)aString
{
if ([aString isKindOfClass:[CPAttributedString class]])
{
@@ -982,7 +1002,7 @@ Sets the selection to a range of characters in response to user action.
// interface to the _CPNativeInputManager
- (void)_activateNativeInputElement:(DOMElemet)aNativeField
- (void)_activateNativeInputElement:(DOMElement)aNativeField
{
var attributes = [[self typingAttributes] copy];
@@ -1134,6 +1154,21 @@ Sets the selection to a range of characters in response to user action.
[self setSelectedRange:setRange affinity:0 stillSelecting:YES];
}
- (CPMenu)menuForEvent:(CPEvent)anEvent
{
var myMenu = [super menuForEvent:anEvent];
if (_selectionRange.length === 0)
{
[[myMenu itemAtIndex:0] setEnabled:NO];
[[myMenu itemAtIndex:1] setEnabled:NO];
}
if (_delegateRespondsToSelectorMask & kDelegateRespondsTo_textView_menu_forEvent_atIndex)
myMenu = [_delegate textView:self menu:myMenu forEvent:anEvent atIndex:_selectionRange.location];
return myMenu;
}
- (void)_supportScrolling:(CPTimer)aTimer
{
[self mouseDragged:[CPApp currentEvent]];
@@ -1297,7 +1332,7 @@ Sets the selection to a range of characters in response to user action.
_startTrackingLocation = _selectionRange.location;
}
- (unsigned)_calculateMoveSelectionFromRange:(CPRange)aRange intoDirection:(integer)move granularity:(CPSelectionGranularity)granularity
- (unsigned)_calculateMoveSelectionFromRange:(CPRange)aRange intoDirection:(int)move granularity:(CPSelectionGranularity)granularity
{
var inWord = [self _isCharacterAtIndex:(move > 0 ? CPMaxRange(aRange) : aRange.location) + move granularity:granularity],
aSel = [self selectionRangeForProposedRange:CPMakeRange((move > 0 ? CPMaxRange(aRange) : aRange.location) + move, 0) granularity:granularity],
@@ -1306,7 +1341,7 @@ Sets the selection to a range of characters in response to user action.
return move > 0 ? CPMaxRange(inWord? aSel:bSel) : (inWord? aSel:bSel).location;
}
- (void)_moveSelectionIntoDirection:(integer)move granularity:(CPSelectionGranularity)granularity
- (void)_moveSelectionIntoDirection:(int)move granularity:(CPSelectionGranularity)granularity
{
var pos = [self _calculateMoveSelectionFromRange:_selectionRange intoDirection:move granularity:granularity];
@@ -1314,7 +1349,7 @@ Sets the selection to a range of characters in response to user action.
_startTrackingLocation = _selectionRange.location;
}
- (void)_extendSelectionIntoDirection:(integer)move granularity:(CPSelectionGranularity)granularity
- (void)_extendSelectionIntoDirection:(int)move granularity:(CPSelectionGranularity)granularity
{
var aSel = CPMakeRangeCopy(_selectionRange);
@@ -2523,7 +2558,7 @@ var CPTextViewAllowsUndoKey = @"CPTextViewAllowsUndoKey",
_caretTimer = [CPTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(_blinkCaret:) userInfo:nil repeats:YES];
}
- (void)isBlinking
- (BOOL)isBlinking
{
return [_caretTimer isValid];
}
+2 -2
View File
@@ -1815,7 +1815,7 @@ CPTexturedBackgroundWindowMask
/*!
Returns \c YES if the window can be moved.
*/
- (void)isMovable
- (BOOL)isMovable
{
return _isMovable;
}
@@ -2390,7 +2390,7 @@ CPTexturedBackgroundWindowMask
/*!
Returns YES if the window is minimized.
*/
- (void)isMiniaturized
- (BOOL)isMiniaturized
{
return _isMiniaturized;
}
+1 -1
View File
@@ -156,7 +156,7 @@ var _CPStandardWindowViewDividerViewHeight = 1.0;
_headView = [[_CPTexturedWindowHeadView alloc] initWithFrame:CGRectMake(0.0, 0.0, CGRectGetWidth(bounds), [self valueForThemeAttribute:@"title-bar-height"]) windowView:self];
[_headView setAutoresizingMask:CPViewWidthSizable];;
[_headView setAutoresizingMask:CPViewWidthSizable];
[_headView setHitTests:NO];
[self addSubview:_headView positioned:CPWindowBelow relativeTo:_titleField];
+1 -1
View File
@@ -378,7 +378,7 @@
_viewControllerContainerView = aView;
}
- (void)viewControllerContainerView
- (CPView)viewControllerContainerView
{
return _viewControllerContainerView;
}
+1 -1
View File
@@ -31,7 +31,7 @@ var _CPCibClassSwapperClassNameKey = @"_CPCibClassSwapperClassNameKey",
{
}
+ (void)allocObjectWithCoder:(CPCoder)aCoder className:(CPString)aClassName
+ (id)allocObjectWithCoder:(CPCoder)aCoder className:(CPString)aClassName
{
// FIXME: Also check class classForClassName:
var theClass = [aCoder classForClassName:aClassName];
+2 -2
View File
@@ -61,7 +61,7 @@
Returns \c YES
@return \c YES
*/
- (void)shouldArchiveValueForKey:(CPString)aKey
- (BOOL)shouldArchiveValueForKey:(CPString)aKey
{
return YES;
}
@@ -131,4 +131,4 @@
[anObject addAnimation:self forKey:aKey];
}
@end
@end
+5 -5
View File
@@ -330,7 +330,7 @@ var hasEditableTarget = function(aDOMEvent)
[[CPRunLoop currentRunLoop] limitDateForMode:CPDefaultRunLoopMode];
}
- (boolean)beforePasteEvent:(DOMEvent)aDOMEvent
- (BOOL)beforePasteEvent:(DOMEvent)aDOMEvent
{
// Set up to capture the paste in a temporary input field. We'll send the event after capture.
if ([self _mayRequireDOMPasteboardElementHack:aDOMEvent flags:CPPlatformActionKeyMask])
@@ -348,7 +348,7 @@ var hasEditableTarget = function(aDOMEvent)
/*
Return true if the event may be a copy and paste event, but the target is not an input or text area.
*/
- (void)_mayRequireDOMPasteboardElementHack:(DOMEvent)aDOMEvent flags:(unsigned)modifierFlags
- (BOOL)_mayRequireDOMPasteboardElementHack:(DOMEvent)aDOMEvent flags:(unsigned)modifierFlags
{
return !hasEditableTarget(aDOMEvent) && (modifierFlags & CPPlatformActionKeyMask);
}
@@ -407,7 +407,7 @@ Return true if the event may be a copy and paste event, but the target is not an
_DOMPasteboardElement.blur();
}
- (boolean)nativeBeforeClipboardEvent:(DOMEvent)aDOMEvent
- (BOOL)nativeBeforeClipboardEvent:(DOMEvent)aDOMEvent
{
// Our job here is to return "false" if the given clipboard operation should be enabled even in a situation where
// the browser might normally grey the option out.
@@ -437,7 +437,7 @@ Return true if the event may be a copy and paste event, but the target is not an
return returnValue;
}
- (boolean)nativePasteEvent:(DOMEvent)aDOMEvent
- (BOOL)nativePasteEvent:(DOMEvent)aDOMEvent
{
// This shouldn't happen.
if (!supportsNativeCopyAndPaste)
@@ -481,7 +481,7 @@ Return true if the event may be a copy and paste event, but the target is not an
return false;
}
- (boolean)nativeCopyOrCutEvent:(DOMEvent)aDOMEvent
- (BOOL)nativeCopyOrCutEvent:(DOMEvent)aDOMEvent
{
// This shouldn't happen.
if (!supportsNativeCopyAndPaste)
+1 -1
View File
@@ -268,7 +268,7 @@ var _CPAutocompleteMenuMaximumHeight = 307;
return [contentArray count];
}
- (void)tableView:(CPTableView)tableView objectValueForTableColumn:(CPTableColumn)tableColumn row:(CPInteger)row
- (id)tableView:(CPTableView)tableView objectValueForTableColumn:(CPTableColumn)tableColumn row:(CPInteger)row
{
return [contentArray objectAtIndex:row];
}
+5 -3
View File
@@ -504,9 +504,11 @@ var _class_initialize = function(/*Class*/ aClass)
meta.objj_msgSend3 = objj_msgSendFast3;
aClass.method_msgSend = aClass.method_dtable;
meta.method_msgSend = meta.method_dtable;
var metaMethodDTable = meta.method_msgSend = meta.method_dtable,
initializeImp = metaMethodDTable["initialize"];
meta.objj_msgSend0(aClass, "initialize");
if (initializeImp)
initializeImp(aClass, "initialize");
CHANGEINFO(meta, CLS_INITIALIZED, CLS_INITIALIZING);
}
@@ -583,7 +585,7 @@ GLOBAL(_objj_forward) = function(self, _cmd)
if (implementation)
return implementation(self, SEL_doesNotRecognizeSelector_, _cmd);
throw class_getName(isa) + " does not implement doesNotRecognizeSelector:. Did you forget a superclass for " + class_getName(isa) + "?";
throw class_getName(isa) + " does not implement doesNotRecognizeSelector: when sending " + sel_getName(_cmd) + ". Did you forget a superclass for " + class_getName(isa) + "?";
};
// I think this forward:: may need to be a common method, instead of defined in CPObject.
+64 -13
View File
@@ -13,6 +13,38 @@
@end
@implementation RootClassWithInitialize
{
}
+ (id)alloc
{
return class_createInstance(self);
}
+ (void)initialize
{
throw "Initialize";
}
@end
@implementation RootClassWithInitialize2
{
}
+ (id)alloc
{
return class_createInstance(self);
}
+ (void)initialize
{
throw "Initialize";
}
@end
@implementation RootClassWithDoesNotRecognizeSelector
{
}
@@ -24,7 +56,7 @@
- (void)doesNotRecognizeSelector:(SEL)aSelector
{
throw "ERROR";
throw "ERROR: " + sel_getName(aSelector);
}
@end
@@ -40,10 +72,6 @@
Class isa;
}
+ (void)initialize
{
}
+ (id)alloc
{
return class_createInstance(self);
@@ -88,10 +116,6 @@
{
}
+ (void)initialize
{
}
+ (id)alloc
{
return class_createInstance(self);
@@ -176,7 +200,7 @@ var GlobalMethodDispatchTest;
}
catch (anException)
{
[self assert:anException equals:"RootClass does not implement doesNotRecognizeSelector:. Did you forget a superclass for RootClass?"];
[self assert:anException equals:"RootClass does not implement doesNotRecognizeSelector: when sending doesNotExist. Did you forget a superclass for RootClass?"];
}
}
@@ -190,7 +214,34 @@ var GlobalMethodDispatchTest;
}
catch (anException)
{
[self assert:anException equals:"RootClass does not implement doesNotRecognizeSelector:. Did you forget a superclass for RootClass?"];
[self assert:anException equals:"RootClass does not implement doesNotRecognizeSelector: when sending doesNotExist. Did you forget a superclass for RootClass?"];
}
}
- (void)test_RootClassWithInitialize_class_initialize
{
try
{
[RootClassWithInitialize doesNotExist];
}
catch (anException)
{
[self assert:anException equals:"Initialize"];
}
}
- (void)test_RootClassWithInitialize_instance_initialize
{
// Here we create a new instance with Runtime function to not trigger the +initialize method.
// We also have to use a fresh new class or the +initialize method would have already been triggered.
var object = class_createInstance(RootClassWithInitialize2);
try
{
[object doesNotExist];
}
catch (anException)
{
[self assert:anException equals:"Initialize"];
}
}
@@ -202,7 +253,7 @@ var GlobalMethodDispatchTest;
}
catch (anException)
{
[self assert:anException equals:"ERROR"];
[self assert:anException equals:"ERROR: doesNotExist"];
}
}
@@ -216,7 +267,7 @@ var GlobalMethodDispatchTest;
}
catch (anException)
{
[self assert:anException equals:"ERROR"];
[self assert:anException equals:"ERROR: doesNotExist"];
}
}
+1
View File
@@ -42,6 +42,7 @@
self._valueWraps = [cell valueWraps];
self._autorepeat = [cell autorepeat];
self._objectValue = [cell objectValue];
[self setEnabled:[cell isEnabled]];
}
@end