summaryrefslogtreecommitdiff
path: root/MLKDynamicContext.m
diff options
context:
space:
mode:
Diffstat (limited to 'MLKDynamicContext.m')
-rw-r--r--MLKDynamicContext.m20
1 files changed, 5 insertions, 15 deletions
diff --git a/MLKDynamicContext.m b/MLKDynamicContext.m
index 55d6c4e..593f4a7 100644
--- a/MLKDynamicContext.m
+++ b/MLKDynamicContext.m
@@ -257,7 +257,7 @@ static MLKDynamicContext *global_context;
variables:(NSDictionary *)vars
handlers:(NSDictionary *)handlers
restarts:(NSDictionary *)restarts
- catchTags:(NSDictionary *)catchTags
+ catchTags:(NSSet *)catchTags
activeHandlerEnvironment:(MLKEnvironment *)handlerEnv;
{
self = [super init];
@@ -267,7 +267,7 @@ static MLKDynamicContext *global_context;
_parent,
_parent->_conditionHandlers);
_restarts = MAKE_ENVIRONMENT(restarts, _parent, _parent->_restarts);
- _catchTags = MAKE_ENVIRONMENT(catchTags, _parent, _parent->_catchTags);
+ _catchTags = [[NSSet alloc] initWithSet:catchTags];
ASSIGN (_activeHandlerEnvironment,
handlerEnv
? (id) handlerEnv
@@ -347,20 +347,10 @@ static MLKDynamicContext *global_context;
return nil;
}
--(id) findCatchTag:(MLKSymbol *)symbol
+-(BOOL) catchTagIsEstablished:(id)tag
{
- NS_DURING
- {
- NS_VALUERETURN ([_catchTags valueForSymbol:symbol], id);
- }
- NS_HANDLER
- {
- if (![[localException name] isEqualToString: @"MLKUnboundVariableError"])
- [localException raise];
- }
- NS_ENDHANDLER;
-
- return nil;
+ return ([_catchTags containsObject:tag] ||
+ (_parent && [_parent catchTagIsEstablished:tag]));
}
-(id) valueForSymbol:(MLKSymbol *)symbol