Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OOJSSpecialFunctions.h File Reference
+ Include dependency graph for OOJSSpecialFunctions.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void InitOOJSSpecialFunctions (JSContext *context, JSObject *global)
 
OOJSValueJSSpecialFunctionsObjectWrapper (JSContext *context)
 

Function Documentation

◆ InitOOJSSpecialFunctions()

void InitOOJSSpecialFunctions ( JSContext * context,
JSObject * global )

Definition at line 47 of file OOJSSpecialFunctions.m.

48{
49}

◆ JSSpecialFunctionsObjectWrapper()

OOJSValue * JSSpecialFunctionsObjectWrapper ( JSContext * context)

Definition at line 52 of file OOJSSpecialFunctions.m.

53{
54 /*
55 Special object is created on the fly so it can be GCed (the debug
56 console script keeps a reference to its copy, but the prefix script
57 doesn't) and so we don't need to clean up a root on JS engine reset.
58 -- Ahruman 2011-03-30
59 */
60
61 JSObject *special = NULL;
62 OOJSAddGCObjectRoot(context, &special, "OOJSSpecialFunctions");
63
64 special = JS_NewObject(context, NULL, NULL, NULL);
65 JS_DefineFunctions(context, special, sSpecialFunctionsMethods);
66 JS_FreezeObject(context, special);
67
68 OOJSValue *result = [OOJSValue valueWithJSObject:special inContext:context];
69
70 JS_RemoveObjectRoot(context, &special);
71
72 return result;
73}
static JSFunctionSpec sSpecialFunctionsMethods[]
#define OOJSAddGCObjectRoot(context, root, name)

References OOJSAddGCObjectRoot, sSpecialFunctionsMethods, and OOJSValue::valueWithJSObject:inContext:.

+ Here is the call graph for this function: