54 context:(JSContext *)context
55 function:(jsval)function
56 this:(JSObject *)jsThis
57{
58 self = [super initWithNextTime:[UNIVERSE getTime] + delay interval:interval];
60 {
61 NSAssert(
OOJSValueIsFunction(context,
function),
@"Attempt to init OOJSTimer with a function that isn't.");
62
63 _jsThis = jsThis;
65
66 _function = function;
68
70 if (_jsSelf != NULL)
71 {
72 if (!JS_SetPrivate(context, _jsSelf, [self retain])) _jsSelf = NULL;
73 }
74 if (_jsSelf == NULL)
75 {
76 [self release];
78 }
79
81
82 [[NSNotificationCenter defaultCenter] addObserver:self
83 selector:@selector(deleteJSPointers)
84 name:kOOJavaScriptEngineWillResetNotification
86 }
87
88 return self;
89}
static JSObject * sTimerPrototype
static JSClass sTimerClass
OOINLINE BOOL OOJSValueIsFunction(JSContext *context, jsval value)
#define OOJSAddGCObjectRoot(context, root, name)
#define OOJSAddGCValueRoot(context, root, name)
OOJSScript * currentlyRunningScript()
OOJavaScriptEngine * sharedEngine()