/* Bridge: CYJSObject {{{ */
@interface CYJSObject : NSMutableDictionary {
JSObjectRef object_;
- JSContextRef context_;
+ JSGlobalContextRef context_;
}
- (id) initWithJSObject:(JSObjectRef)object inContext:(JSContextRef)context;
/* Bridge: CYJSArray {{{ */
@interface CYJSArray : NSMutableArray {
JSObjectRef object_;
- JSContextRef context_;
+ JSGlobalContextRef context_;
}
- (id) initWithJSObject:(JSObjectRef)object inContext:(JSContextRef)context;
if ((self = [super init]) != nil) {
object_ = object;
context_ = CYGetJSContext(context);
- //XXX:JSGlobalContextRetain(context_);
+ JSGlobalContextRetain(context_);
JSValueProtect(context_, object_);
} return self;
} CYObjectiveCatch }
- (void) dealloc { CYObjectiveTry {
JSValueUnprotect(context_, object_);
- //XXX:JSGlobalContextRelease(context_);
+ JSGlobalContextRelease(context_);
[super dealloc];
} CYObjectiveCatch }
if ((self = [super init]) != nil) {
object_ = object;
context_ = CYGetJSContext(context);
- //XXX:JSGlobalContextRetain(context_);
+ JSGlobalContextRetain(context_);
JSValueProtect(context_, object_);
} return self;
} CYObjectiveCatch }
- (void) dealloc { CYObjectiveTry {
JSValueUnprotect(context_, object_);
- //XXX:JSGlobalContextRelease(context_);
+ JSGlobalContextRelease(context_);
[super dealloc];
} CYObjectiveCatch }
// XXX: inherit from or replace with CYJSObject
@interface CYInternal : NSObject {
- JSContextRef context_;
+ JSGlobalContextRef context_;
JSObjectRef object_;
}
- (void) dealloc {
JSValueUnprotect(context_, object_);
- //XXX:JSGlobalContextRelease(context_);
+ JSGlobalContextRelease(context_);
[super dealloc];
}
- (id) initInContext:(JSContextRef)context {
if ((self = [super init]) != nil) {
context_ = CYGetJSContext(context);
- //XXX:JSGlobalContextRetain(context_);
+ JSGlobalContextRetain(context_);
} return self;
}