Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
migrate from broken jscocoa git submodule to working git fake submodule
- Loading branch information
Showing
290 changed files
with
95,137 additions
and
5 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
// | |||
// ApplicationController.h | |||
// GC ObjC JSCocoa | |||
// | |||
// Created by Patrick Geiller on 22/12/08. | |||
// Copyright 2008 __MyCompanyName__. All rights reserved. | |||
// | |||
|
|||
#import <Cocoa/Cocoa.h> | |||
|
|||
|
|||
@interface ApplicationController : NSObject { | |||
|
|||
} | |||
|
|||
- (IBAction)runJSTests:(id)sender; | |||
- (IBAction)collect:(id)sender; | |||
- (IBAction)dumpMemory:(id)sender; | |||
|
|||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,92 @@ | |||
// | |||
// ApplicationController.m | |||
// GC ObjC JSCocoa | |||
// | |||
// Created by Patrick Geiller on 22/12/08. | |||
// Copyright 2008 __MyCompanyName__. All rights reserved. | |||
// | |||
|
|||
#import "ApplicationController.h" | |||
#import "JSCocoa.h" | |||
|
|||
@implementation ApplicationController | |||
|
|||
- (void)applicationDidFinishLaunching:(id)notif | |||
{ | |||
NSLog(@"DONE"); | |||
/* | |||
id c = [JSCocoaController sharedController]; | |||
[[JSCocoa sharedController] setUseAutoCall:NO]; | |||
id mainJSFile = [NSString stringWithFormat:@"%@/Contents/Resources/main.js", [[NSBundle mainBundle] bundlePath]]; | |||
[c evalJSFile:mainJSFile]; | |||
[[JSCocoa sharedController] setUseAutoCall:YES]; | |||
*/ | |||
|
|||
|
|||
[self performSelector:@selector(runJSTests:) withObject:nil afterDelay:0]; | |||
// objc_assignIvar(); | |||
} | |||
|
|||
- (void)test | |||
{ | |||
NSLog(@"test"); | |||
} | |||
|
|||
int runCount; | |||
- (IBAction)runJSTests:(id)sender | |||
{ | |||
[[NSGarbageCollector defaultCollector] disable]; | |||
NSLog(@"RUN TESTS"); | |||
id path = [[NSBundle mainBundle] bundlePath]; | |||
path = [NSString stringWithFormat:@"%@/Contents/Resources/Tests", path]; | |||
// NSLog(@"Run %d from %@", runCount, path); | |||
BOOL b = [[JSCocoaController sharedController] runTests:path]; | |||
[[JSCocoaController sharedController] garbageCollect]; | |||
if (!b) { NSLog(@"!!!!!!!!!!!FAIL %d from %@", runCount, path); return; } | |||
runCount++; | |||
NSLog(@">>>>Ran %d", runCount); | |||
|
|||
|
|||
/* | |||
[[NSGarbageCollector defaultCollector] collectExhaustively]; | |||
objc_collect(OBJC_FULL_COLLECTION); | |||
objc_collect(OBJC_EXHAUSTIVE_COLLECTION); | |||
objc_collect(OBJC_WAIT_UNTIL_DONE); | |||
NSLog(@"GC enabled=%d", [[NSGarbageCollector defaultCollector] isEnabled]); | |||
*/ | |||
} | |||
|
|||
- (IBAction)collect:(id)sender | |||
{ | |||
// [JSCocoaController garbageCollect]; | |||
[[JSCocoaController sharedController] garbageCollect]; | |||
[[NSGarbageCollector defaultCollector] collectExhaustively]; | |||
objc_collect(OBJC_FULL_COLLECTION); | |||
objc_collect(OBJC_EXHAUSTIVE_COLLECTION); | |||
objc_collect(OBJC_WAIT_UNTIL_DONE); | |||
} | |||
|
|||
- (IBAction)dumpMemory:(id)sender | |||
{ | |||
unsigned int i; | |||
id v = [sender stringValue]; | |||
BOOL scanned = [[NSScanner scannerWithString:v] scanHexInt:&i]; | |||
|
|||
if (!scanned) | |||
{ | |||
NSLog(@"couldn't scan %@", v); | |||
return; | |||
} | |||
|
|||
char buf[17]; | |||
char* source = *(char**)i; | |||
memcpy(buf, source, 16); | |||
buf[17]; | |||
NSLog(@"raw=%s", buf); | |||
NSLog(@"raw=%@", (NSString*)source); | |||
|
|||
// NSLog(@"%@-%@ %d=%d", sender, [sender stringValue], scanned, i); | |||
} | |||
|
|||
|
|||
@end |
Binary file not shown.
Oops, something went wrong.