diff --git a/AppKit/CPApplication.j b/AppKit/CPApplication.j index e5663c7f8..01132ecd4 100644 --- a/AppKit/CPApplication.j +++ b/AppKit/CPApplication.j @@ -1358,7 +1358,7 @@ var _CPAppBootstrapperActions = nil; if (mainCibFile) { [mainBundle loadCibFile:mainCibFile - externalNameTable:[CPDictionary dictionaryWithObject:CPApp forKey:CPCibOwner] + externalNameTable:@{ CPCibOwner: CPApp } loadDelegate:self]; return YES; diff --git a/AppKit/CPBrowser.j b/AppKit/CPBrowser.j index fcd0c9075..ac827d890 100644 --- a/AppKit/CPBrowser.j +++ b/AppKit/CPBrowser.j @@ -73,11 +73,11 @@ + (id)themeAttributes { - return [CPDictionary dictionaryWithJSObject:{ + return @{ @"image-control-resize": [CPNull null], @"image-control-leaf": [CPNull null], @"image-control-leaf-pressed": [CPNull null] - }]; + }; } - (id)initWithFrame:(CGRect)aFrame diff --git a/AppKit/CPDocument.j b/AppKit/CPDocument.j index e8dfaed6c..5c316f801 100644 --- a/AppKit/CPDocument.j +++ b/AppKit/CPDocument.j @@ -129,7 +129,7 @@ var CPDocumentUntitledCount = 0; if (self) { _windowControllers = []; - _viewControllersForWindowControllers = [CPDictionary dictionary]; + _viewControllersForWindowControllers = @{}; _hasUndoManager = YES; _changeCount = 0; diff --git a/AppKit/CPDocumentController.j b/AppKit/CPDocumentController.j index f85574fe7..a36e96e4c 100644 --- a/AppKit/CPDocumentController.j +++ b/AppKit/CPDocumentController.j @@ -148,7 +148,7 @@ var CPSharedDocumentController = nil; { var type = [self typeForContentsOfURL:anAbsoluteURL error:anError]; - result = [self makeDocumentWithContentsOfURL:anAbsoluteURL ofType:type delegate:self didReadSelector:@selector(document:didRead:contextInfo:) contextInfo:[CPDictionary dictionaryWithObject:shouldDisplay forKey:@"shouldDisplay"]]; + result = [self makeDocumentWithContentsOfURL:anAbsoluteURL ofType:type delegate:self didReadSelector:@selector(document:didRead:contextInfo:) contextInfo:@{ @"shouldDisplay": shouldDisplay }]; [self addDocument:result]; diff --git a/AppKit/CPDragServer.j b/AppKit/CPDragServer.j index 54ad7cb54..e96bd56aa 100644 --- a/AppKit/CPDragServer.j +++ b/AppKit/CPDragServer.j @@ -248,7 +248,7 @@ var CPDraggingSource_draggedImage_movedTo_ = 1 << 0, _draggingUpdateTimer = [CPTimer scheduledTimerWithTimeInterval:CPDragServerPeriodicUpdateInterval target:self selector:@selector(_sendPeriodicDraggingUpdate:) - userInfo:[CPDictionary dictionaryWithJSObject:{platformWindow:aPlatformWindow, location:aLocation}] + userInfo:@{ "platformWindow":aPlatformWindow, "location":aLocation } repeats:NO]; var scrollView = [_draggingDestination isKindOfClass:[CPView class]] ? [_draggingDestination enclosingScrollView] : nil; diff --git a/AppKit/CPFlashView.j b/AppKit/CPFlashView.j index c9505b8e9..071ad0ee2 100644 --- a/AppKit/CPFlashView.j +++ b/AppKit/CPFlashView.j @@ -107,7 +107,7 @@ var IEFlashCLSID = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; varString = [varString stringByAppendingFormat:@"&%@=%@", key, [aDictionary objectForKey:key]]; if (!_params) - _params = [CPDictionary dictionary]; + _params = @{}; [_params setObject:varString forKey:@"flashvars"]; [self setParameters:_params]; @@ -137,7 +137,7 @@ var IEFlashCLSID = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"; #if PLATFORM(DOM) if (!CPBrowserIsEngine(CPInternetExplorerBrowserEngine)) { - _paramElements = [CPDictionary dictionary]; + _paramElements = @{}; var enumerator = [_params keyEnumerator], key; diff --git a/AppKit/CPFontManager.j b/AppKit/CPFontManager.j index fc352bf0b..e7375b318 100644 --- a/AppKit/CPFontManager.j +++ b/AppKit/CPFontManager.j @@ -208,7 +208,7 @@ var CPSharedFontManager = nil, - (@action)addFontTrait:(id)sender { - _activeChange = [CPDictionary dictionaryWithObject:[sender tag] forKey:@"addTraits"]; + _activeChange = @{ @"addTraits": [sender tag] }; [self sendAction]; } diff --git a/AppKit/CPKeyValueBinding.j b/AppKit/CPKeyValueBinding.j index 2444ed8dd..0e206d8d2 100644 --- a/AppKit/CPKeyValueBinding.j +++ b/AppKit/CPKeyValueBinding.j @@ -32,8 +32,8 @@ @class CPButton -var exposedBindingsMap = [CPDictionary new], - bindingsMap = [CPDictionary new]; +var exposedBindingsMap = @{}, + bindingsMap = @{}; var CPBindingOperationAnd = 0, CPBindingOperationOr = 1; @@ -145,7 +145,7 @@ var CPBindingOperationAnd = 0, if (!bindings) { - bindings = [CPDictionary new]; + bindings = @{}; [bindingsMap setObject:bindings forKey:[_source UID]]; } diff --git a/AppKit/CPMenu/CPMenu.j b/AppKit/CPMenu/CPMenu.j index 1037a6f1d..3884fbebc 100644 --- a/AppKit/CPMenu/CPMenu.j +++ b/AppKit/CPMenu/CPMenu.j @@ -77,7 +77,7 @@ var _CPMenuBarVisible = NO, if (self !== [CPMenu class]) return; - [[self class] setMenuBarAttributes:[CPDictionary dictionary]]; + [[self class] setMenuBarAttributes:@{}]; } + (BOOL)menuBarVisible diff --git a/AppKit/CPObjectController.j b/AppKit/CPObjectController.j index 30eb73c55..825a38a1e 100644 --- a/AppKit/CPObjectController.j +++ b/AppKit/CPObjectController.j @@ -667,7 +667,7 @@ var CPObjectControllerContentKey = @"CPObjectControllerCo { if (self = [super init]) { - _cachedValues = [CPDictionary dictionary]; + _cachedValues = @{}; _observationProxies = [CPArray array]; _controller = aController; _observedObjectsByKeyPath = {}; diff --git a/AppKit/CPOutlineView.j b/AppKit/CPOutlineView.j index b2d671203..de0c83f33 100644 --- a/AppKit/CPOutlineView.j +++ b/AppKit/CPOutlineView.j @@ -1441,7 +1441,7 @@ var CPOutlineViewCoalesceSelectionNotificationStateOff = 0, [[CPNotificationCenter defaultCenter] postNotificationName:CPOutlineViewItemWillExpandNotification object:self - userInfo:[CPDictionary dictionaryWithObject:item forKey:"CPObject"]]; + userInfo:@{ "CPObject": item }]; } /*! diff --git a/AppKit/CPPasteboard.j b/AppKit/CPPasteboard.j index 5554d9cfd..0e943dbaa 100644 --- a/AppKit/CPPasteboard.j +++ b/AppKit/CPPasteboard.j @@ -79,7 +79,7 @@ var CPPasteboards = nil, [self setVersion:1.0]; - CPPasteboards = [CPDictionary dictionary]; + CPPasteboards = @{}; if (typeof window.cpPasteboardWithName !== "undefined") supportsNativePasteboard = YES; @@ -121,8 +121,8 @@ var CPPasteboards = nil, // _name = aName; _types = []; - _owners = [CPDictionary dictionary]; - _provided = [CPDictionary dictionary]; + _owners = @{}; + _provided = @{}; _changeCount = 0; @@ -188,8 +188,8 @@ var CPPasteboards = nil, { [_types setArray:types]; - _owners = [CPDictionary dictionary]; - _provided = [CPDictionary dictionary]; + _owners = @{}; + _provided = @{}; var count = _types.length; diff --git a/AppKit/CPRuleEditor/CPRuleEditor.j b/AppKit/CPRuleEditor/CPRuleEditor.j index d9ea81ba7..433f9a71a 100644 --- a/AppKit/CPRuleEditor/CPRuleEditor.j +++ b/AppKit/CPRuleEditor/CPRuleEditor.j @@ -791,7 +791,7 @@ TODO: implement */ - (CPPredicate)predicateForRow:(CPInteger)aRow { - var predicateParts = [CPDictionary dictionary], + var predicateParts = @{}, items = [self criteriaForRow:aRow], count = [items count], predicate, @@ -1771,7 +1771,7 @@ TODO: implement if (animate) { - var animation = [CPDictionary dictionary]; + var animation = @{}; [animation setObject:aslice forKey:CPViewAnimationTargetKey]; [animation setObject:startRect forKey:CPViewAnimationStartFrameKey]; [animation setObject:targetRect forKey:CPViewAnimationEndFrameKey]; diff --git a/AppKit/CPRuleEditor/_CPRuleEditorLocalizer.j b/AppKit/CPRuleEditor/_CPRuleEditorLocalizer.j index f1530dacd..a9c5d7da9 100644 --- a/AppKit/CPRuleEditor/_CPRuleEditorLocalizer.j +++ b/AppKit/CPRuleEditor/_CPRuleEditorLocalizer.j @@ -59,7 +59,7 @@ var LocalizerStringsRegex = new RegExp("\"(.+)\"\\s*=\\s*\"(.+)\"\\s*;\\s*(//.+) - (void)loadContent:(CPString)aContent { - var dict = [CPDictionary dictionary], + var dict = @{}, lines = [aContent componentsSeparatedByString:"\n"], count = [lines count]; diff --git a/AppKit/CPTheme.j b/AppKit/CPTheme.j index a50ec2502..b0541e563 100644 --- a/AppKit/CPTheme.j +++ b/AppKit/CPTheme.j @@ -85,7 +85,7 @@ var CPThemesByName = { }, if (self) { _name = aName; - _attributes = [CPDictionary dictionary]; + _attributes = @{}; CPThemesByName[_name] = self; } @@ -270,7 +270,7 @@ var CPThemesByName = { }, if (!attributes) { - attributes = [CPDictionary dictionary]; + attributes = @{}; [_attributes setObject:attributes forKey:aClass]; } @@ -443,7 +443,7 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow"); _cache = { }; _name = aName; _defaultValue = aDefaultValue; - _values = [CPDictionary dictionary]; + _values = @{}; } return self; @@ -474,7 +474,7 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow"); _cache = {}; if (aValue === undefined || aValue === nil) - _values = [CPDictionary dictionary]; + _values = @{}; else _values = [CPDictionary dictionaryWithObject:aValue forKey:String(CPThemeStateNormal)]; } @@ -585,7 +585,7 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow"); _name = [aCoder decodeObjectForKey:@"name"]; _defaultValue = [aCoder decodeObjectForKey:@"defaultValue"]; - _values = [CPDictionary dictionary]; + _values = @{}; if ([aCoder containsValueForKey:@"value"]) { @@ -633,7 +633,7 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow"); } else { - var encodedValues = [CPDictionary dictionary]; + var encodedValues = @{}; while (count--) { diff --git a/AppKit/CPToolbar.j b/AppKit/CPToolbar.j index f81ee1d77..1bc21c3e5 100644 --- a/AppKit/CPToolbar.j +++ b/AppKit/CPToolbar.j @@ -118,8 +118,8 @@ var CPToolbarsByIdentifier = nil, if (self !== [CPToolbar class]) return; - CPToolbarsByIdentifier = [CPDictionary dictionary]; - CPToolbarConfigurationsByIdentifier = [CPDictionary dictionary]; + CPToolbarsByIdentifier = @{}; + CPToolbarConfigurationsByIdentifier = @{}; } /* @ignore */ diff --git a/AppKit/CPView.j b/AppKit/CPView.j index e012e26e2..cd9c863d0 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -2821,7 +2821,7 @@ setBoundsOrigin: - (CPDictionary)_themeAttributeDictionary { - var dictionary = [CPDictionary dictionary]; + var dictionary = @{}; if (_themeAttributes) { diff --git a/AppKit/CPViewController.j b/AppKit/CPViewController.j index b47d118d1..0d0e81425 100644 --- a/AppKit/CPViewController.j +++ b/AppKit/CPViewController.j @@ -85,7 +85,7 @@ var CPViewControllerCachedCibs; if (self !== [CPViewController class]) return; - CPViewControllerCachedCibs = [CPDictionary dictionary]; + CPViewControllerCachedCibs = @{}; } /*! diff --git a/AppKit/CoreAnimation/CAMediaTimingFunction.j b/AppKit/CoreAnimation/CAMediaTimingFunction.j index 80c891d79..77d953921 100644 --- a/AppKit/CoreAnimation/CAMediaTimingFunction.j +++ b/AppKit/CoreAnimation/CAMediaTimingFunction.j @@ -44,7 +44,7 @@ var CAMediaNamedTimingFunctions = nil; { if (!CAMediaNamedTimingFunctions) { - CAMediaNamedTimingFunctions = [CPDictionary dictionary]; + CAMediaNamedTimingFunctions = @{}; [CAMediaNamedTimingFunctions setObject:[CAMediaTimingFunction functionWithControlPoints:0.0 :0.0 :1.0 :1.0] forKey:kCAMediaTimingFunctionLinear]; [CAMediaNamedTimingFunctions setObject:[CAMediaTimingFunction functionWithControlPoints:0.42 :0.0 :1.0 :1.0] forKey:kCAMediaTimingFunctionEaseIn]; diff --git a/AppKit/Platform/CPPlatformWindow.j b/AppKit/Platform/CPPlatformWindow.j index c53a50500..d5988787c 100644 --- a/AppKit/Platform/CPPlatformWindow.j +++ b/AppKit/Platform/CPPlatformWindow.j @@ -110,7 +110,7 @@ var PrimaryPlatformWindow = NULL; #if PLATFORM(DOM) _windowLevels = []; - _windowLayers = [CPDictionary dictionary]; + _windowLayers = @{}; _charCodes = {}; #endif diff --git a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j index 0e1b250ad..b4af9d0de 100644 --- a/AppKit/Platform/DOM/CPPlatformWindow+DOM.j +++ b/AppKit/Platform/DOM/CPPlatformWindow+DOM.j @@ -213,7 +213,7 @@ var resizeTimer = nil; _contentRect = _CGRectMakeZero(); _windowLevels = []; - _windowLayers = [CPDictionary dictionary]; + _windowLayers = @{}; [self registerDOMWindow]; [self updateFromNativeContentRect]; diff --git a/AppKit/_CPCornerView.j b/AppKit/_CPCornerView.j index 27df6c25c..da7dd48fe 100644 --- a/AppKit/_CPCornerView.j +++ b/AppKit/_CPCornerView.j @@ -33,8 +33,10 @@ + (id)themeAttributes { - return [CPDictionary dictionaryWithObjects:[[CPNull null], [CPNull null]] - forKeys:[@"background-color", @"divider-color"]]; + return @{ + @"background-color": [CPNull null], + @"divider-color": [CPNull null], + }; } - (void)drawRect:(CGRect)aRect diff --git a/Foundation/CPAttributedString.j b/Foundation/CPAttributedString.j index 546ca4f30..fe010f004 100644 --- a/Foundation/CPAttributedString.j +++ b/Foundation/CPAttributedString.j @@ -89,7 +89,7 @@ if (self) { if (!attributes) - attributes = [CPDictionary dictionary]; + attributes = @{}; _string = ""+aString; _rangeEntries = [makeRangeEntry(CPMakeRange(0, _string.length), attributes)]; diff --git a/Foundation/CPKeyValueCoding.j b/Foundation/CPKeyValueCoding.j index 30e48f951..09773e7a2 100644 --- a/Foundation/CPKeyValueCoding.j +++ b/Foundation/CPKeyValueCoding.j @@ -144,7 +144,7 @@ var CPObjectAccessorsForClassKey = @"$CPObjectAccessorsForClassKey", { var index = 0, count = keys.length, - dictionary = [CPDictionary dictionary]; + dictionary = @{}; for (; index < count; ++index) { diff --git a/Foundation/CPKeyValueObserving.j b/Foundation/CPKeyValueObserving.j index 4a25f4d40..b97664e34 100644 --- a/Foundation/CPKeyValueObserving.j +++ b/Foundation/CPKeyValueObserving.j @@ -755,7 +755,7 @@ var kvoNewAndOld = CPKeyValueObservingOptionNew | CPKeyValueObservingOpti if (!observers) { - observers = [CPDictionary dictionary]; + observers = @{}; _observersForKey[aPath] = observers; _observersForKeyLength++; } diff --git a/Foundation/CPKeyedArchiver.j b/Foundation/CPKeyedArchiver.j index a039edd9d..437ef110a 100644 --- a/Foundation/CPKeyedArchiver.j +++ b/Foundation/CPKeyedArchiver.j @@ -172,12 +172,12 @@ var _CPKeyedArchiverStringClass = Nil, _objects = []; - _UIDs = [CPDictionary dictionary]; - _conditionalUIDs = [CPDictionary dictionary]; + _UIDs = @{}; + _conditionalUIDs = @{}; - _replacementObjects = [CPDictionary dictionary]; + _replacementObjects = @{}; - _plistObject = [CPDictionary dictionary]; + _plistObject = @{}; _plistObjects = [CPArray arrayWithObject:_CPKeyedArchiverNullString]; } @@ -212,7 +212,7 @@ var _CPKeyedArchiverStringClass = Nil, [_delegate archiver:self didEncodeObject:object]; } - _plistObject = [CPDictionary dictionary]; + _plistObject = @{}; [_plistObject setObject:topObject forKey:_CPKeyedArchiverTopKey]; [_plistObject setObject:_plistObjects forKey:_CPKeyedArchiverObjectsKey]; @@ -395,7 +395,7 @@ var _CPKeyedArchiverStringClass = Nil, { var key, keys = [aDictionary keyEnumerator], - references = [CPDictionary dictionary]; + references = @{}; while ((key = [keys nextObject]) !== nil) [references setObject:_CPKeyedArchiverEncodeObject(self, [aDictionary objectForKey:key], NO) forKey:key]; @@ -414,7 +414,7 @@ var _CPKeyedArchiverStringClass = Nil, + (void)setClassName:(CPString)aClassName forClass:(Class)aClass { if (!CPArchiverReplacementClassNames) - CPArchiverReplacementClassNames = [CPDictionary dictionary]; + CPArchiverReplacementClassNames = @{}; [CPArchiverReplacementClassNames setObject:aClassName forKey:CPStringFromClass(aClass)]; } @@ -446,7 +446,7 @@ var _CPKeyedArchiverStringClass = Nil, - (void)setClassName:(CPString)aClassName forClass:(Class)aClass { if (!_replacementClassNames) - _replacementClassNames = [CPDictionary dictionary]; + _replacementClassNames = @{}; [_replacementClassNames setObject:aClassName forKey:CPStringFromClass(aClass)]; } @@ -541,7 +541,7 @@ var _CPKeyedArchiverEncodeObject = function(self, anObject, isConditional) else { // Only actually encode the object and create a plist representation if it is not a simple type. - plistObject = [CPDictionary dictionary]; + plistObject = @{}; [self._objects addObject:object]; @@ -559,7 +559,7 @@ var _CPKeyedArchiverEncodeObject = function(self, anObject, isConditional) if (!classUID) { - var plistClass = [CPDictionary dictionary], + var plistClass = @{}, hierarchy = []; [plistClass setObject:className forKey:_CPKeyedArchiverClassNameKey]; diff --git a/Foundation/CPNotificationCenter.j b/Foundation/CPNotificationCenter.j index 25107027f..99ab18183 100644 --- a/Foundation/CPNotificationCenter.j +++ b/Foundation/CPNotificationCenter.j @@ -65,7 +65,7 @@ var CPNotificationDefaultCenter = nil; if (self) { - _namedRegistries = [CPDictionary dictionary]; + _namedRegistries = @{}; _unnamedRegistry = [[_CPNotificationRegistry alloc] init]; } return self; @@ -189,7 +189,7 @@ var _CPNotificationCenterPostNotification = function(/* CPNotificationCenter */ if (self) { - _objectObservers = [CPDictionary dictionary]; + _objectObservers = @{}; } return self; diff --git a/Foundation/CPURLRequest.j b/Foundation/CPURLRequest.j index f7fcf7439..703c81bcc 100644 --- a/Foundation/CPURLRequest.j +++ b/Foundation/CPURLRequest.j @@ -77,7 +77,7 @@ _HTTPBody = @""; _HTTPMethod = @"GET"; - _HTTPHeaderFields = [CPDictionary dictionary]; + _HTTPHeaderFields = @{}; [self setValue:"Thu, 01 Jan 1970 00:00:00 GMT" forHTTPHeaderField:"If-Modified-Since"]; [self setValue:"no-cache" forHTTPHeaderField:"Cache-Control"]; diff --git a/Foundation/CPUserDefaults.j b/Foundation/CPUserDefaults.j index 4805aca51..967ae83a7 100644 --- a/Foundation/CPUserDefaults.j +++ b/Foundation/CPUserDefaults.j @@ -105,12 +105,12 @@ var StandardUserDefaults; if (self) { - _domains = [CPDictionary dictionary]; + _domains = @{}; [self _setupArgumentsDomain]; var defaultStore = [CPUserDefaultsLocalStore supportsLocalStorage] ? CPUserDefaultsLocalStore : CPUserDefaultsCookieStore; - _stores = [CPDictionary dictionary]; + _stores = @{}; [self setPersistentStoreClass:defaultStore forDomain:CPGlobalDomain reloadData:YES]; [self setPersistentStoreClass:defaultStore forDomain:CPApplicationDomain reloadData:YES]; } @@ -182,7 +182,7 @@ var StandardUserDefaults; var domain = [_domains objectForKey:aDomain]; if (!domain) { - domain = [CPDictionary dictionary]; + domain = @{}; [_domains setObject:domain forKey:aDomain]; } @@ -264,7 +264,7 @@ var StandardUserDefaults; count = [dicts count], i = 0; - _searchList = [CPDictionary dictionary]; + _searchList = @{}; for (; i < count; i++) { diff --git a/Foundation/CPValueTransformer.j b/Foundation/CPValueTransformer.j index 65b208a01..f8fb3d187 100644 --- a/Foundation/CPValueTransformer.j +++ b/Foundation/CPValueTransformer.j @@ -31,7 +31,7 @@ @import "CPNumber.j" @import "CPObject.j" -var transformerMap = [CPDictionary dictionary]; +var transformerMap = @{}; @implementation CPValueTransformer : CPObject { diff --git a/Foundation/CPWebDAVManager.j b/Foundation/CPWebDAVManager.j index 87cc5cd82..1e2c11177 100644 --- a/Foundation/CPWebDAVManager.j +++ b/Foundation/CPWebDAVManager.j @@ -65,7 +65,7 @@ CPWebDAVManagerNonCollectionResourceType = 0; self = [super init]; if (self) - _blocksForConnections = [CPDictionary dictionary]; + _blocksForConnections = @{}; return self; } @@ -198,7 +198,7 @@ var parsePROPFINDResponse = function(anXMLString) responses = XMLDocument.getElementsByTagNameNS("*", "response"), responseIndex = 0, responseCount = responses.length, - propertiesForURLs = [CPDictionary dictionary]; + propertiesForURLs = @{}; for (; responseIndex < responseCount; ++responseIndex) { @@ -206,7 +206,7 @@ var parsePROPFINDResponse = function(anXMLString) elements = response.getElementsByTagNameNS("*", "prop").item(0).childNodes, index = 0, count = elements.length, - properties = [CPDictionary dictionary]; + properties = @{}; for (; index < count; ++index) { diff --git a/Tests/AppKit/CPKeyValueBindingTest.j b/Tests/AppKit/CPKeyValueBindingTest.j index 065e1d6dc..3d8e65ce2 100644 --- a/Tests/AppKit/CPKeyValueBindingTest.j +++ b/Tests/AppKit/CPKeyValueBindingTest.j @@ -49,7 +49,7 @@ var bindTesterA = [BindingTestWithBool new], bindTesterB = [BindingTestWithBool new]; - [bindTesterB bind:@"stringValue" toObject:bindTesterA withKeyPath:@"stringValue" options:[CPDictionary dictionary]]; + [bindTesterB bind:@"stringValue" toObject:bindTesterA withKeyPath:@"stringValue" options:@{}]; [self assert:nil equals:[bindTesterA stringValue] message:"initial A value unchanged"]; [self assert:nil equals:[bindTesterB stringValue] message:"initial B value unchanged"]; diff --git a/Tests/AppKit/CPPopUpButtonTest.j b/Tests/AppKit/CPPopUpButtonTest.j index b31366a42..9e07b8366 100644 --- a/Tests/AppKit/CPPopUpButtonTest.j +++ b/Tests/AppKit/CPPopUpButtonTest.j @@ -165,7 +165,7 @@ - (void)testBindingSelectedTag { - var dict = [CPDictionary dictionary], + var dict = @{}, item = nil; item = [[CPMenuItem alloc] initWithTitle:@"Mouse" action:nil keyEquivalent:nil]; @@ -412,7 +412,7 @@ [arrayController setContent:menuObjects]; [button bind:CPContentBinding toObject:arrayController withKeyPath:@"arrangedObjects" options:nil]; - var options = [CPDictionary dictionary]; + var options = @{}; [options setObject:[ContentValuesTransformer new] forKey:CPValueTransformerBindingOption]; [button bind:CPContentValuesBinding toObject:arrayController withKeyPath:@"arrangedObjects.name" options:options]; diff --git a/Tests/Foundation/CPAttributedStringTest.j b/Tests/Foundation/CPAttributedStringTest.j index 0a88f8e06..64bb4d4de 100644 --- a/Tests/Foundation/CPAttributedStringTest.j +++ b/Tests/Foundation/CPAttributedStringTest.j @@ -55,7 +55,7 @@ var sharedObject = [CPObject new]; - (void)testIinitWithString_attributes { - var string = [[CPAttributedString alloc] initWithString:@"hi there" attributes:[CPDictionary dictionary]]; + var string = [[CPAttributedString alloc] initWithString:@"hi there" attributes:@{}]; [self assertTrue:([string string] === @"hi there") message:"testIinitWithString_attributes: expected:" + @"hi there" + " actual:" + [string string]]; @@ -370,7 +370,7 @@ var sharedObject = [CPObject new]; { var string = [self stringForTesting]; - [string setAttributes:[CPDictionary dictionary] range:CPMakeRange(0, [string length])]; + [string setAttributes:@{} range:CPMakeRange(0, [string length])]; testAttributesAtIndexWithValues(string, 10, {a:undefined, b:undefined, c:undefined, d:undefined, e:undefined, f:undefined}, self); diff --git a/Tests/Foundation/CPDictionaryTest.j b/Tests/Foundation/CPDictionaryTest.j index f8682ffa0..51cca5b50 100644 --- a/Tests/Foundation/CPDictionaryTest.j +++ b/Tests/Foundation/CPDictionaryTest.j @@ -352,7 +352,7 @@ - (void)testEnumerateKeysAndObjectsUsingBlock_ { - var input0 = [CPDictionary dictionary], + var input0 = @{}, input1 = [CPDictionary dictionaryWithJSObject:{a: 1, b: 3, c: "b"}], output = [CPMutableDictionary dictionary], outputFunction = function(aKey, anObject) diff --git a/Tests/Foundation/CPKeyValueCodingTest.j b/Tests/Foundation/CPKeyValueCodingTest.j index d45f1f096..f750857a1 100644 --- a/Tests/Foundation/CPKeyValueCodingTest.j +++ b/Tests/Foundation/CPKeyValueCodingTest.j @@ -454,14 +454,14 @@ var accessIVARS = YES; - (void)testIfValueForKeyAccessesObjectForKey { - var testDictionary = [CPDictionary dictionary]; + var testDictionary = @{}; [testDictionary setObject:kvcTestObject forKey:@"testKey"]; [self assert: kvcTestObject same: [testDictionary valueForKey: @"testKey"]]; } - (void)testIfSetValueForKeyModifiesObjectForKey { - var testDictionary = [CPDictionary dictionary]; + var testDictionary = @{}; [testDictionary setValue:kvcTestObject forKey:@"testKey"]; [self assert: kvcTestObject same: [testDictionary objectForKey: @"testKey"]]; } diff --git a/Tests/Manual/ArrayController1/AppController.j b/Tests/Manual/ArrayController1/AppController.j index 680310150..056641151 100644 --- a/Tests/Manual/ArrayController1/AppController.j +++ b/Tests/Manual/ArrayController1/AppController.j @@ -96,14 +96,14 @@ CPLogRegister(CPLogConsole); [totalCountField bind:CPValueBinding toObject:arrayController withKeyPath:@"selectedObjects.@sum.price" options:nil]; - var bindingOptions = [CPDictionary dictionary]; + var bindingOptions = @{}; //[bindingOptions setObject:@"No Name" forKey:@"NSNullPlaceholder"]; [selectedNameField bind:CPValueBinding toObject:arrayController withKeyPath:@"selection.name" options:bindingOptions]; // binding for "name" column var tableColumn = [tableView tableColumnWithIdentifier:@"name"], - bindingOptions = [CPDictionary dictionary]; + bindingOptions = @{}; [tableColumn bind:CPValueBinding toObject:arrayController withKeyPath:@"arrangedObjects.name" options:bindingOptions]; @@ -111,7 +111,7 @@ CPLogRegister(CPLogConsole); // binding options for "price" // no need for placeholder as overridden by formatters - bindingOptions = [CPDictionary dictionary]; + bindingOptions = @{}; //[bindingOptions removeObjectForKey:@"NSNullPlaceholder"]; //[bindingOptions setObject:YES // forKey:CPValidatesImmediatelyBindingOption]; @@ -120,7 +120,7 @@ CPLogRegister(CPLogConsole); // binding for "price" column tableColumn = [tableView tableColumnWithIdentifier:@"price"]; - bindingOptions = [CPDictionary dictionary]; + bindingOptions = @{}; [tableColumn bind:CPValueBinding toObject:arrayController withKeyPath:@"arrangedObjects.price" options:bindingOptions]; diff --git a/Tests/Manual/CPFlashviewTest/AppController.j b/Tests/Manual/CPFlashviewTest/AppController.j index 28000bc5d..5a8745788 100644 --- a/Tests/Manual/CPFlashviewTest/AppController.j +++ b/Tests/Manual/CPFlashviewTest/AppController.j @@ -25,11 +25,11 @@ // note: // if both flashParams and flashVars are used flashParams must be setup first - var flashParameters = [CPDictionary dictionary]; + var flashParameters = @{}; [flashVars setObject:@"SampleParam" forKey:"SampleParamKey"]; [flashView setParameters:flashParameters]; - var flashVars = [CPDictionary dictionary]; + var flashVars = @{}; [flashVars setObject:@"SampleVar" forKey:"SampleVarKey"]; [flashView setFlashVars:flashVars]; diff --git a/Tests/Manual/CPRuleEditorCibTest/RuleDelegate.j b/Tests/Manual/CPRuleEditorCibTest/RuleDelegate.j index a74e5813c..3573e9822 100644 --- a/Tests/Manual/CPRuleEditorCibTest/RuleDelegate.j +++ b/Tests/Manual/CPRuleEditorCibTest/RuleDelegate.j @@ -91,8 +91,8 @@ var CPRuleEditorCustomControlClass = @"CPRuleEditorCustomControlClass"; control = [[custom_class alloc] initWithFrame:CGRectMake(0, 0, 100, 18)]; [criterion setObject:control forKey:("control_"+row)]; } - - return control; + + return control; } return [criterion objectForKey:@"valeur"]; @@ -100,7 +100,7 @@ var CPRuleEditorCustomControlClass = @"CPRuleEditorCustomControlClass"; - (CPDictionary)ruleEditor:(CPRuleEditor)editor predicatePartsForCriterion:(id)criterion withDisplayValue:(id)value inRow:(int)row { - var predicatePartsForCriterion = [CPDictionary dictionary]; + var predicatePartsForCriterion = @{}; if ([editor rowTypeForRow:row] == CPRuleEditorRowTypeCompound) { diff --git a/Tests/Manual/ThemeBrowser/SCString.j b/Tests/Manual/ThemeBrowser/SCString.j index 1e5aeb1e1..67fc71965 100644 --- a/Tests/Manual/ThemeBrowser/SCString.j +++ b/Tests/Manual/ThemeBrowser/SCString.j @@ -494,7 +494,7 @@ SCKit = (function() { if (argsArray.length === 0) return template; - argsDict = [CPDictionary dictionary]; + argsDict = @{}; for (var i = 0; i < argsArray.length; ++i) [argsDict setObject:argsArray[i] forKey:String(i, 10)]; diff --git a/Tools/capp/Configuration.j b/Tools/capp/Configuration.j index bd00efebf..c8070f7c9 100644 --- a/Tools/capp/Configuration.j +++ b/Tools/capp/Configuration.j @@ -24,7 +24,7 @@ var DefaultDictionary = nil, if (self !== [Configuration class]) return; - DefaultDictionary = [CPDictionary dictionary]; + DefaultDictionary = @{}; [DefaultDictionary setObject:@"You" forKey:@"user.name"]; [DefaultDictionary setObject:@"you@yourcompany.com" forKey:@"user.email"]; @@ -63,14 +63,14 @@ var DefaultDictionary = nil, if (self) { path = aPath; - temporaryDictionary = [CPDictionary dictionary]; + temporaryDictionary = @{}; if (path && FILE.isReadable(path)) dictionary = CFPropertyList.readPropertyListFromFile(path); // readPlist will return nil if the file is empty if (!dictionary) - dictionary = [CPDictionary dictionary]; + dictionary = @{}; } return self; diff --git a/Tools/nib2cib/NSNibConnector.j b/Tools/nib2cib/NSNibConnector.j index fe78a84e2..a5fd47b85 100644 --- a/Tools/nib2cib/NSNibConnector.j +++ b/Tools/nib2cib/NSNibConnector.j @@ -132,7 +132,7 @@ var NSTransformers = [CPSet setWithObjects: _binding = [aCoder decodeObjectForKey:@"NSBinding"]; _keyPath = [aCoder decodeObjectForKey:@"NSKeyPath"]; - _options = [CPDictionary dictionary]; + _options = @{}; var NSOptions = [aCoder decodeObjectForKey:@"NSOptions"], keyEnumerator = [NSOptions keyEnumerator], diff --git a/Tools/nib2cib/Nib2Cib.j b/Tools/nib2cib/Nib2Cib.j index 74a91490e..fa0887f01 100644 --- a/Tools/nib2cib/Nib2Cib.j +++ b/Tools/nib2cib/Nib2Cib.j @@ -67,7 +67,7 @@ var FILE = require("file"), nibInfo = {}; appDirectory = @""; resourcesDirectory = @""; - infoPlist = [CPDictionary dictionary]; + infoPlist = @{}; userNSClasses = []; } @@ -139,7 +139,7 @@ var FILE = require("file"), [CPFont setSystemFontSize:parseFloat(systemFontSize, 10)]; } else - infoPlist = [CPDictionary dictionary]; + infoPlist = @{}; var themeList = [self getThemeList:options], themes = [self loadThemesFromList:themeList];