From 69d0a3ce9b39b965e81ee02daf7603b203c22b0e Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 6 Jul 2010 17:48:37 -0400 Subject: [PATCH] Remove Cocoa exception handling support since it no longer works --- .../cocoa/application/application-docs.factor | 3 --- basis/cocoa/application/application.factor | 12 +----------- vm/objects.hpp | 2 -- vm/os-macosx.mm | 18 +----------------- 4 files changed, 2 insertions(+), 33 deletions(-) diff --git a/basis/cocoa/application/application-docs.factor b/basis/cocoa/application/application-docs.factor index 337cff6f06..849983d00e 100644 --- a/basis/cocoa/application/application-docs.factor +++ b/basis/cocoa/application/application-docs.factor @@ -36,9 +36,6 @@ HELP: install-delegate { $values { "receiver" "an " { $snippet "NSObject" } } { "delegate" "an Objective C 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" "Utilities:" { $subsections diff --git a/basis/cocoa/application/application.factor b/basis/cocoa/application/application.factor index db1eefca14..b00f39fa1d 100644 --- a/basis/cocoa/application/application.factor +++ b/basis/cocoa/application/application.factor @@ -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. USING: alien alien.syntax io kernel namespaces core-foundation core-foundation.strings cocoa.messages cocoa cocoa.classes @@ -40,16 +40,6 @@ FUNCTION: void NSBeep ( ) ; : install-delegate ( receiver delegate -- ) -> 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? ( -- ? ) #! Test if we're running a .app. ".app" diff --git a/vm/objects.hpp b/vm/objects.hpp index 778df8642e..8d883ecdb7 100644 --- a/vm/objects.hpp +++ b/vm/objects.hpp @@ -26,8 +26,6 @@ enum special_object { 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_COCOA_EXCEPTION = 19, /* Cocoa exception handler quotation */ - OBJ_STARTUP_QUOT = 20, /* startup quotation */ OBJ_GLOBAL, /* global namespace */ OBJ_SHUTDOWN_QUOT, /* shutdown quotation */ diff --git a/vm/os-macosx.mm b/vm/os-macosx.mm index 05a9aef5c8..c5377be8ef 100644 --- a/vm/os-macosx.mm +++ b/vm/os-macosx.mm @@ -8,23 +8,7 @@ namespace factor void factor_vm::c_to_factor_toplevel(cell quot) { - for(;;) - { -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(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 - } + c_to_factor(quot); } void early_init(void)