#include <OOJSTimer.h>
Definition at line 33 of file OOJSTimer.h.
◆ dealloc
◆ deleteJSPointers
- (void) deleteJSPointers |
|
|
|
|
implementation |
Definition at line 444 of file OOJSTimer.m.
93{
94 [self unscheduleTimer];
95
97 {
100
102 JS_RemoveObjectRoot(context, &
_jsThis);
105
106 [[NSNotificationCenter defaultCenter] removeObserver:self
107 name:kOOJavaScriptEngineWillResetNotification
109 }
110}
OOINLINE JSContext * OOJSAcquireContext(void)
OOINLINE void OOJSRelinquishContext(JSContext *context)
OOJavaScriptEngine * sharedEngine()
◆ descriptionComponents
- (NSString *) descriptionComponents |
|
|
|
|
implementation |
Reimplemented from OOScriptTimer.
Definition at line 444 of file OOJSTimer.m.
124{
125 NSString *funcName =
nil;
126 JSContext *context = NULL;
127
129 {
130 return @"invalid";
131 }
132
136
138 {
139 funcName = @"anonymous";
140 }
141
142 return [NSString stringWithFormat:@"%@, function: %@", [super descriptionComponents], funcName];
143}
NSString * OOStringFromJSString(JSContext *context, JSString *string)
◆ initWithDelay:interval:context:function:this:
- (id) initWithDelay: |
|
(OOTimeAbsolute) | delay |
interval: |
|
(OOTimeDelta) | interval |
context: |
|
(JSContext *) | context |
function: |
|
(jsval) | function |
this: |
|
(JSObject *) | jsThis |
|
implementation |
Provided by category OOJSTimer(Private).
Definition at line 444 of file OOJSTimer.m.
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
65
68
71 {
72 if (!JS_SetPrivate(context,
_jsSelf, [
self retain]))
_jsSelf = NULL;
73 }
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()
OOJSScript * _owningScript
◆ oo_jsClassName
- (NSString *) oo_jsClassName |
|
|
|
|
implementation |
Definition at line 444 of file OOJSTimer.m.
147{
148 return @"Timer";
149}
◆ oo_jsValueInContext:
- (jsval) oo_jsValueInContext: |
|
(JSContext *) | context |
|
|
implementation |
Definition at line 444 of file OOJSTimer.m.
187 :(JSContext *)context
188{
189 return OBJECT_TO_JSVAL(
_jsSelf);
190}
◆ timerFired
Reimplemented from OOScriptTimer.
Definition at line 444 of file OOJSTimer.m.
153{
154 jsval rval = JSVAL_VOID;
155 NSString *description =
nil;
156
159
160
163 {
164 description = [object oo_jsDescription];
165 if (description ==
nil) description = [object description];
166 }
167
168 if (description ==
nil)
169 {
170 [self unscheduleTimer];
172 return;
173 }
174
182
184}
id OOJSNativeObjectFromJSObject(JSContext *context, JSObject *object)
void pushScript:(OOJSScript *script)
void popScript:(OOJSScript *script)
BOOL callJSFunction:forObject:argc:argv:result:(jsval function,[forObject] JSObject *jsThis,[argc] uintN argc,[argv] jsval *argv,[result] jsval *outResult)
◆ _function
◆ _jsSelf
◆ _jsThis
◆ _owningScript
The documentation for this class was generated from the following files: