Cleaned up JS exception wrapper stuff.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3588 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
parent
6f9f338732
commit
5ea3215c1c
@ -406,17 +406,14 @@ void JSRegisterObjectConverter(JSClass *theClass, JSClassConverterCallback conve
|
||||
OOJS_PROFILE_ENTER_FOR_NATIVE
|
||||
|
||||
#define OOJS_NATIVE_EXIT \
|
||||
} @catch(NSException *exception) { \
|
||||
} @catch(id exception) { \
|
||||
OOJSReportWrappedException(oojsProfileContext, exception); \
|
||||
return NO; \
|
||||
} @catch(...) { \
|
||||
OOJSReportWrappedException(oojsProfileContext, nil); \
|
||||
return NO; \
|
||||
OOJS_PROFILE_EXIT_VAL(NO) \
|
||||
}
|
||||
|
||||
|
||||
void OOJSReportWrappedException(JSContext *context, NSException *exception);
|
||||
void OOJSReportWrappedException(JSContext *context, id exception);
|
||||
|
||||
#ifndef NDEBUG
|
||||
void OOJSUnreachable(const char *function, const char *file, unsigned line) NO_RETURN_FUNC;
|
||||
|
@ -604,9 +604,9 @@ void OOReportJSErrorWithArguments(JSContext *context, NSString *format, va_list
|
||||
|
||||
#if OOLITE_NATIVE_EXCEPTIONS
|
||||
|
||||
void OOJSReportWrappedException(JSContext *context, NSException *exception)
|
||||
void OOJSReportWrappedException(JSContext *context, id exception)
|
||||
{
|
||||
if (exception != nil) OOReportJSError(context, @"Native exception: %@", [exception reason]);
|
||||
if ([exception isKindOfClass:[NSException class]]) OOReportJSError(context, @"Native exception: %@", [exception reason]);
|
||||
else OOReportJSError(context, @"Unidentified native exception");
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user