Permalink
Browse files

First run at ARC support

  • Loading branch information...
ccgus committed Aug 3, 2012
1 parent 2b168a1 commit b273270fe413fefe721842573310f32f4a3f0b0f
Showing with 1,607 additions and 1,601 deletions.
  1. +0 −6 bin/jstcopyinmocha.sh
  2. +65 −47 jstalk.xcodeproj/project.pbxproj
  3. +43 −51 mocha/BridgeSupport/MOBridgeSupportController.m
  4. +21 −29 mocha/BridgeSupport/MOBridgeSupportLibrary.m
  5. +253 −256 mocha/BridgeSupport/MOBridgeSupportParser.m
  6. +94 −137 mocha/BridgeSupport/MOBridgeSupportSymbol.m
  7. +8 −1 mocha/MochaDefines.h
  8. +1 −1 mocha/MochaRuntime.h
  9. +247 −261 mocha/MochaRuntime.m
  10. +43 −0 mocha/Objects/MOAllocator.h
  11. +33 −0 mocha/Objects/MOAllocator.m
  12. +2 −2 mocha/Objects/MOClassDescription.h
  13. +17 −12 mocha/Objects/MOClassDescription.m
  14. +3 −8 mocha/Objects/MOClosure.m
  15. +1 −6 mocha/Objects/MOInstanceVariableDescription.m
  16. +1 −2 mocha/Objects/MOJavaScriptObject.m
  17. +1 −1 mocha/Objects/MOMethod.h
  18. +2 −7 mocha/Objects/MOMethod.m
  19. +1 −5 mocha/Objects/MOMethodDescription.m
  20. +1 −1 mocha/Objects/MOMethod_Private.h
  21. +2 −2 mocha/Objects/MOObjCRuntime.h
  22. +2 −28 mocha/Objects/MOObjCRuntime.m
  23. +19 −0 mocha/Objects/MOPointer.h
  24. +43 −0 mocha/Objects/MOPointer.m
  25. +0 −7 mocha/Objects/MOPropertyDescription.m
  26. +4 −4 mocha/Objects/MOProtocolDescription.m
  27. +1 −1 mocha/Objects/MOProtocolDescription_Private.h
  28. +1 −8 mocha/Objects/MOStruct.m
  29. +1 −27 mocha/Objects/MOUndefined.m
  30. +3 −5 mocha/Utilities/MOFunctionArgument.h
  31. +566 −535 mocha/Utilities/MOFunctionArgument.m
  32. +86 −83 mocha/Utilities/MOUtilities.m
  33. +6 −4 src/JSTExtras.m
  34. +1 −1 src/JSTListener.h
  35. +0 −1 src/JSTListener.m
  36. +4 −6 src/JSTPreprocessor.m
  37. +0 −1 src/JSTTextView.h
  38. +4 −9 src/JSTTextView.m
  39. +2 −2 src/JSTalk.h
  40. +1 −7 src/JSTalk.m
  41. +1 −5 src/MarkerLineNumberView.m
  42. +20 −26 src/NoodleLineNumberView.m
  43. +3 −6 src/TETextUtils.m
View
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-SRC_DIR=`cd ${0%/*}/..; pwd`
-
-
-cp $SRC_DIR/jscocoa/JSCocoa/*.m $SRC_DIR/jscocoa/JSCocoa/*.h $SRC_DIR/../jscocoafork/JSCocoa/.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -15,72 +15,64 @@
@implementation MOBridgeSupportController {
- NSMutableArray *_loadedURLs;
- NSMutableArray *_loadedLibraries;
- NSMutableDictionary *_symbols;
- MOBridgeSupportParser *_parser;
+ NSMutableArray *_loadedURLs;
+ NSMutableArray *_loadedLibraries;
+ NSMutableDictionary *_symbols;
+ MOBridgeSupportParser *_parser;
}
+ (MOBridgeSupportController *)sharedController {
- static MOBridgeSupportController *sharedController = nil;
- static dispatch_once_t onceToken;
- dispatch_once(&onceToken, ^{
- sharedController = [[self alloc] init];
- });
- return sharedController;
+ static MOBridgeSupportController *sharedController = nil;
+ static dispatch_once_t onceToken;
+ dispatch_once(&onceToken, ^{
+ sharedController = [[self alloc] init];
+ });
+ return sharedController;
}
- (id)init {
- self = [super init];
- if (self) {
- _loadedURLs = [[NSMutableArray alloc] init];
- _loadedLibraries = [[NSMutableArray alloc] init];
- _symbols = [[NSMutableDictionary alloc] init];
- _parser = [[MOBridgeSupportParser alloc] init];
- }
- return self;
-}
-
-- (void)dealloc {
- [_loadedURLs release];
- [_loadedLibraries release];
- [_symbols release];
- [_parser release];
- [super dealloc];
+ self = [super init];
+ if (self) {
+ _loadedURLs = [[NSMutableArray alloc] init];
+ _loadedLibraries = [[NSMutableArray alloc] init];
+ _symbols = [[NSMutableDictionary alloc] init];
+ _parser = [[MOBridgeSupportParser alloc] init];
+ }
+ return self;
}
#pragma mark -
#pragma mark Loading
- (BOOL)isBridgeSupportLoadedForURL:(NSURL *)aURL {
- return [_loadedURLs containsObject:aURL];
+ return [_loadedURLs containsObject:aURL];
}
- (BOOL)loadBridgeSupportAtURL:(NSURL *)aURL error:(NSError **)outError {
- if ([self isBridgeSupportLoadedForURL:aURL]) {
- return YES;
- }
-
- MOBridgeSupportLibrary *library = [_parser libraryWithBridgeSupportURL:aURL error:outError];
- if (library == nil) {
- return NO;
- }
-
- [_loadedURLs addObject:aURL];
- [_loadedLibraries addObject:library];
-
- for (NSString *name in library.symbols) {
- MOBridgeSupportSymbol *symbol = [library.symbols objectForKey:name];
- if ([_symbols objectForKey:name] == nil) {
- [_symbols setObject:symbol forKey:name];
- }
- else {
- //NSLog(@"Symbol with name \"%@\" is already loaded.", name);
- }
- }
-
- return YES;
+ if ([self isBridgeSupportLoadedForURL:aURL]) {
+ return YES;
+ }
+
+ MOBridgeSupportLibrary *library = [_parser libraryWithBridgeSupportURL:aURL error:outError];
+ if (library == nil) {
+ return NO;
+ }
+
+ [_loadedURLs addObject:aURL];
+ [_loadedLibraries addObject:library];
+
+ for (NSString *name in library.symbols) {
+ MOBridgeSupportSymbol *symbol = [library.symbols objectForKey:name];
+ if ([_symbols objectForKey:name] == nil) {
+ [_symbols setObject:symbol forKey:name];
+ }
+ else {
+ //NSLog(@"Symbol with name \"%@\" is already loaded.", name);
+ }
+ }
+
+ return YES;
}
@@ -105,7 +97,7 @@ - (NSDictionary *)performQueryForSymbolsOfType:(NSArray *)classes {
}
- (id)performQueryForSymbolName:(NSString *)name {
- return [_symbols objectForKey:name];
+ return [_symbols objectForKey:name];
}
- (id)performQueryForSymbolName:(NSString *)name ofType:(Class)klass {
@@ -10,76 +10,68 @@
@implementation MOBridgeSupportLibrary {
- NSMutableArray *_dependencies;
- NSMutableDictionary *_symbols;
+ NSMutableArray *_dependencies;
+ NSMutableDictionary *_symbols;
}
@synthesize name=_name;
@synthesize URL=_URL;
- (id)init {
- self = [super init];
- if (self) {
- _dependencies = [[NSMutableArray alloc] init];
- _symbols = [[NSMutableDictionary alloc] init];
- }
- return self;
-}
-
-- (void)dealloc {
- [_name release];
- [_URL release];
- [_dependencies release];
- [_symbols release];
- [super dealloc];
+ self = [super init];
+ if (self) {
+ _dependencies = [[NSMutableArray alloc] init];
+ _symbols = [[NSMutableDictionary alloc] init];
+ }
+ return self;
}
#pragma mark -
#pragma mark Dependencies
- (NSArray *)dependencies {
- return _dependencies;
+ return _dependencies;
}
- (void)setDependencies:(NSArray *)dependencies {
- [_dependencies setArray:dependencies];
+ [_dependencies setArray:dependencies];
}
- (void)addDependency:(NSString *)dependency {
- if (![_dependencies containsObject:dependency]) {
- [_dependencies addObject:dependency];
- }
+ if (![_dependencies containsObject:dependency]) {
+ [_dependencies addObject:dependency];
+ }
}
- (void)removeDependency:(NSString *)dependency {
- if ([_dependencies containsObject:dependency]) {
- [_dependencies removeObject:dependency];
- }
+ if ([_dependencies containsObject:dependency]) {
+ [_dependencies removeObject:dependency];
+ }
}
#pragma mark -
#pragma mark Symbols
- (NSDictionary *)symbols {
- return _symbols;
+ return _symbols;
}
- (void)setSymbols:(NSDictionary *)symbols {
- [_symbols setDictionary:symbols];
+ [_symbols setDictionary:symbols];
}
- (MOBridgeSupportSymbol *)symbolWithName:(NSString *)name {
- return [_symbols objectForKey:name];
+ return [_symbols objectForKey:name];
}
- (void)setSymbol:(MOBridgeSupportSymbol *)symbol forName:(NSString *)name {
- [_symbols setObject:symbol forKey:name];
+ [_symbols setObject:symbol forKey:name];
}
- (void)removeSymbolForName:(NSString *)name {
- [_symbols removeObjectForKey:name];
+ [_symbols removeObjectForKey:name];
}
@end
Oops, something went wrong.

0 comments on commit b273270

Please sign in to comment.