Remove Cocoa exception handling support since it no longer works

db4
Slava Pestov 2010-07-06 17:48:37 -04:00
parent 1106c03318
commit bc87b269c5
4 changed files with 2 additions and 33 deletions

View File

@ -36,9 +36,6 @@ HELP: install-delegate
{ $values { "receiver" "an " { $snippet "NSObject" } } { "delegate" "an Objective C class" } } { $values { "receiver" "an " { $snippet "NSObject" } } { "delegate" "an Objective C class" } }
{ $description "Sets the receiver's delegate to a new instance of the delegate class." } ; { $description "Sets the receiver's delegate to a new instance of the delegate class." } ;
HELP: objc-error
{ $error-description "Thrown by the Objective C runtime when an error occurs, for example, sending a message to an object with an unrecognized selector." } ;
ARTICLE: "cocoa-application-utils" "Cocoa application utilities" ARTICLE: "cocoa-application-utils" "Cocoa application utilities"
"Utilities:" "Utilities:"
{ $subsections { $subsections

View File

@ -1,4 +1,4 @@
! Copyright (C) 2006, 2008 Slava Pestov ! Copyright (C) 2006, 2010 Slava Pestov
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: alien alien.syntax io kernel namespaces core-foundation USING: alien alien.syntax io kernel namespaces core-foundation
core-foundation.strings cocoa.messages cocoa cocoa.classes core-foundation.strings cocoa.messages cocoa cocoa.classes
@ -40,16 +40,6 @@ FUNCTION: void NSBeep ( ) ;
: install-delegate ( receiver delegate -- ) : install-delegate ( receiver delegate -- )
-> alloc -> init -> setDelegate: ; -> alloc -> init -> setDelegate: ;
TUPLE: objc-error alien reason ;
: objc-error ( alien -- * )
dup -> reason CF>string \ objc-error boa throw ;
M: objc-error summary ( error -- )
drop "Objective C exception" ;
[ [ objc-error ] 19 set-special-object ] "cocoa.application" add-startup-hook
: running.app? ( -- ? ) : running.app? ( -- ? )
#! Test if we're running a .app. #! Test if we're running a .app.
".app" ".app"

View File

@ -26,8 +26,6 @@ enum special_object {
OBJ_YIELD_CALLBACK, /* used when Factor is embedded in a C app */ OBJ_YIELD_CALLBACK, /* used when Factor is embedded in a C app */
OBJ_SLEEP_CALLBACK, /* used when Factor is embedded in a C app */ OBJ_SLEEP_CALLBACK, /* used when Factor is embedded in a C app */
OBJ_COCOA_EXCEPTION = 19, /* Cocoa exception handler quotation */
OBJ_STARTUP_QUOT = 20, /* startup quotation */ OBJ_STARTUP_QUOT = 20, /* startup quotation */
OBJ_GLOBAL, /* global namespace */ OBJ_GLOBAL, /* global namespace */
OBJ_SHUTDOWN_QUOT, /* shutdown quotation */ OBJ_SHUTDOWN_QUOT, /* shutdown quotation */

View File

@ -8,23 +8,7 @@ namespace factor
void factor_vm::c_to_factor_toplevel(cell quot) void factor_vm::c_to_factor_toplevel(cell quot)
{ {
for(;;) c_to_factor(quot);
{
NS_DURING
c_to_factor(quot);
NS_VOIDRETURN;
NS_HANDLER
ctx->push(allot_alien(false_object,(cell)localException));
quot = special_objects[OBJ_COCOA_EXCEPTION];
if(!tagged<object>(quot).type_p(QUOTATION_TYPE))
{
/* No Cocoa exception handler was registered, so
basis/cocoa/ is not loaded. So we pass the exception
along. */
[localException raise];
}
NS_ENDHANDLER
}
} }
void early_init(void) void early_init(void)