From 57ac833533bb431167bd816066b37efaa8a8a01c Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Mon, 29 Aug 2011 11:02:58 -0700 Subject: [PATCH] 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. --- Cocoa/JSCocoa/JSCocoaController.m | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/Cocoa/JSCocoa/JSCocoaController.m b/Cocoa/JSCocoa/JSCocoaController.m index 614f58e07..7fe5a6341 100644 --- a/Cocoa/JSCocoa/JSCocoaController.m +++ b/Cocoa/JSCocoa/JSCocoaController.m @@ -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