}
static bool All_hasProperty(JSContextRef context, JSObjectRef object, JSStringRef property) {
+ if (JSStringIsEqualToUTF8CString(property, "errno"))
+ return true;
+
JSObjectRef global(CYGetGlobalObject(context));
JSObjectRef cycript(CYCastJSObject(context, CYGetProperty(context, global, CYJSString("Cycript"))));
JSObjectRef alls(CYCastJSObject(context, CYGetProperty(context, cycript, CYJSString("alls"))));
}
static JSValueRef All_getProperty(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) { CYTry {
+ if (JSStringIsEqualToUTF8CString(property, "errno"))
+ return CYCastJSValue(context, errno);
+
JSObjectRef global(CYGetGlobalObject(context));
JSObjectRef cycript(CYCastJSObject(context, CYGetProperty(context, global, CYJSString("Cycript"))));
JSObjectRef alls(CYCastJSObject(context, CYGetProperty(context, cycript, CYJSString("alls"))));
var _syscall = function(value) {
if (value == -1)
- throw new Error("system call failed");
+ throw new Error(strerror(errno));
};
var info = *new (struct stat);