35static JSBool
OoliteGetProperty(JSContext *context, JSObject *
this, jsid propID, jsval *value);
51 JS_StrictPropertyStub,
99static JSBool
OoliteGetProperty(JSContext *context, JSObject *
this, jsid propID, jsval *value)
101 if (!JSID_IS_INT(propID))
return YES;
107 switch (JSID_TO_INT(propID))
118 *value = INT_TO_JSVAL(JS_GetVersion(context));
122 *value = STRING_TO_JSVAL(JS_NewStringCopyZ(context, JS_VersionToString(JS_GetVersion(context))));
126 result = [UNIVERSE gameSettings];
147 return [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"];
169 NSEnumerator *componentEnum =
nil;
175 if ([components isKindOfClass:[NSArray
class]])
178 for (componentEnum = [components objectEnumerator]; (component = [componentEnum nextObject]); )
180 if (![component isKindOfClass:[NSNumber
class]])
187 else if ([components isKindOfClass:[NSString
class]])
191 else components =
nil;
193 if (components !=
nil)
#define OOJS_NATIVE_ENTER(cx)
static JSBool OoliteGetProperty(JSContext *context, JSObject *this, jsid propID, jsval *value)
static JSFunctionSpec sOoliteMethods[]
static JSPropertySpec sOoliteProperties[]
static JSClass sOoliteClass
static JSBool OoliteCompareVersion(JSContext *context, uintN argc, jsval *vp)
void InitOOJSOolite(JSContext *context, JSObject *global)
@ kOolite_jsVersionString
static NSString * VersionString(void)
static NSArray * VersionComponents(void)
id OOJSNativeObjectFromJSValue(JSContext *context, jsval value)
OOINLINE jsval OOJSValueFromNativeObject(JSContext *context, id object)
void OOJSReportBadPropertySelector(JSContext *context, JSObject *thisObj, jsid propID, JSPropertySpec *propertySpec)
JSBool OOJSUnconstructableConstruct(JSContext *context, uintN argc, jsval *vp)
#define OOJS_PROP_READONLY
#define OOJS_PROP_READONLY_CB
#define OOJS_RETURN_INT(v)
NSArray * ComponentsFromVersionString(NSString *string)
NSComparisonResult CompareVersions(NSArray *version1, NSArray *version2)