Don't load class.js, it's the craziest code I've ever seen.

If we need stuff out of it, we can move it to a separate file.
This commit is contained in:
Corey Johnson
2011-08-29 11:02:58 -07:00
parent cda771594d
commit 57ac833533

View File

@@ -262,18 +262,20 @@ const JSClassDefinition kJSClassDefinitionEmpty = { 0, 0,
// Load class kit
BOOL b;
useJSLint = NO;
id lintPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"jslint-jscocoa" ofType:@"js"];
if ([[NSFileManager defaultManager] fileExistsAtPath:lintPath]) {
b = [self evalJSFile:lintPath];
if (!b)
NSLog(@"[JSCocoa initWithGlobalContext:] JSLint not loaded");
}
id classKitPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"class" ofType:@"js"];
if ([[NSFileManager defaultManager] fileExistsAtPath:classKitPath]) {
b = [self evalJSFile:classKitPath];
if (!b)
NSLog(@"[JSCocoa initWithGlobalContext:] class.js not loaded");
if (!ctx) {
useJSLint = NO;
id lintPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"jslint-jscocoa" ofType:@"js"];
if ([[NSFileManager defaultManager] fileExistsAtPath:lintPath]) {
b = [self evalJSFile:lintPath];
if (!b)
NSLog(@"[JSCocoa initWithGlobalContext:] JSLint not loaded");
}
id classKitPath = [[NSBundle bundleForClass:[self class]] pathForResource:@"class" ofType:@"js"];
if ([[NSFileManager defaultManager] fileExistsAtPath:classKitPath]) {
b = [self evalJSFile:classKitPath];
if (!b)
NSLog(@"[JSCocoa initWithGlobalContext:] class.js not loaded");
}
}
// Objects can use their own dealloc, normally used up by JSCocoa