Skip to content

Commit

Permalink
Fixed test 3 bug : new class DerivedTest2 was retained and caused a c…
Browse files Browse the repository at this point in the history
…rash if a test failed. set newClass = null in test
  • Loading branch information
parmanoir committed Aug 17, 2011
1 parent 3969f9f commit 9ec1173
Show file tree
Hide file tree
Showing 5 changed files with 7,579 additions and 24,751 deletions.
3 changes: 2 additions & 1 deletion JSCocoa/JSCocoaController.m
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1862,7 +1862,8 @@ - (id)classForJSFunction:(JSObjectRef)function
// //
+ (NSString*)formatJSException:(JSValueRef)exception inContext:(JSContextRef)context + (NSString*)formatJSException:(JSValueRef)exception inContext:(JSContextRef)context
{ {
if (!exception) return @"formatJSException:(null)"; if (!exception)
return @"formatJSException:(null)";
// Convert exception to string // Convert exception to string
JSStringRef resultStringJS = JSValueToStringCopy(context, exception, NULL); JSStringRef resultStringJS = JSValueToStringCopy(context, exception, NULL);
NSString* b = (NSString*)JSStringCopyCFString(kCFAllocatorDefault, resultStringJS); NSString* b = (NSString*)JSStringCopyCFString(kCFAllocatorDefault, resultStringJS);
Expand Down
3 changes: 3 additions & 0 deletions JSCocoa/JSCocoaPrivateObject.m
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ - (void)cleanUp
// if ([object isKindOfClass:[JSCocoaController class]]) // if ([object isKindOfClass:[JSCocoaController class]])
// [object autorelease]; // [object autorelease];
// else // else
NSLog(@"about to cleanup %p", object);
[object release]; [object release];
NSLog(@"cleaned %p", object);
} }
if (jsValue) if (jsValue)
{ {
Expand Down Expand Up @@ -96,6 +98,7 @@ - (void)setObject:(id)o
{ {
// if (object && retainObject) // if (object && retainObject)
// [object release]; // [object release];
NSLog(@"about to set %p (class=%@, object=%@)", o, [o class], o);
object = o; object = o;
if (object && [object retainCount] == -1) return; if (object && [object retainCount] == -1) return;
[object retain]; [object retain];
Expand Down
10 changes: 8 additions & 2 deletions JSCocoa/jslint-jscocoa.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ SOFTWARE.
// application itself. // application itself.


// http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/ // http://ejohn.org/blog/ecmascript-5-strict-mode-json-and-more/
//"use strict"; "use strict";


function JSLintWithLogs(logs) function JSLintWithLogs(logs)
{ {
Expand Down Expand Up @@ -5672,7 +5672,13 @@ members)?
}; };


itself.edition = '2009-05-06'; itself.edition = '2009-05-06';

/*
var JSLINTGLOBALS = {}
var _varstatement = varstatement
varstatement = function () {
return _varstatement.apply(JSLINTGLOBALS, arguments)
}
*/
return itself; return itself;


}); });
Expand Down
3 changes: 3 additions & 0 deletions Tests/3 derivation.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -74,3 +74,6 @@


o = null o = null
o2 = null o2 = null
newClass = null


Loading

0 comments on commit 9ec1173

Please sign in to comment.