@@ -829,25 +829,6 @@ bool MCScriptEnsureModuleIsUsable(MCScriptModuleRef self)
829829
830830// //////////////////////////////////////////////////////////////////////////////
831831
832- static bool
833- __MCScriptThrowModuleNotUsableError (MCScriptModuleRef self)
834- {
835- return MCErrorThrowGenericWithMessage (MCSTR (" %{name} not usable" ),
836- " name" , self -> name,
837- nil);
838- }
839-
840- static bool
841- __MCScriptThrowDefinitionNotFoundInModuleError (MCScriptModuleRef self,
842- MCScriptDefinitionKind p_kind,
843- MCNameRef p_name)
844- {
845- return MCErrorThrowGenericWithMessage (MCSTR (" %{kind} definition %{name} not found in %{module}" ),
846- " kind" , __MCScriptDefinitionKindToString (p_kind),
847- " name" , p_name,
848- " module" , self->name );
849- }
850-
851832static bool
852833__MCScriptCopyDefinitionsOfModule (MCScriptModuleRef self,
853834 MCScriptDefinitionKind p_kind,
@@ -915,15 +896,13 @@ bool MCScriptQueryConstantOfModule(MCScriptModuleRef self, MCNameRef p_constant,
915896 MCScriptConstantDefinition *t_constant_def = nil;
916897
917898 if (!self -> is_usable)
918- return __MCScriptThrowModuleNotUsableError (self) ;
899+ return false ;
919900
920901 if (!MCScriptLookupConstantDefinitionInModule (self,
921902 p_constant,
922903 t_constant_def))
923904 {
924- return __MCScriptThrowDefinitionNotFoundInModuleError (self,
925- kMCScriptDefinitionKindConstant ,
926- p_constant);
905+ return false ;
927906 }
928907
929908 r_constant_value = self->values [t_constant_def->value ];
@@ -943,10 +922,10 @@ bool MCScriptQueryPropertyOfModule(MCScriptModuleRef self, MCNameRef p_property,
943922 MCScriptPropertyDefinition *t_def;
944923
945924 if (!self -> is_usable)
946- return __MCScriptThrowModuleNotUsableError (self) ;
925+ return false ;
947926
948927 if (!MCScriptLookupPropertyDefinitionInModule (self, p_property, t_def))
949- return __MCScriptThrowDefinitionNotFoundInModuleError (self, kMCScriptDefinitionKindProperty , p_property) ;
928+ return false ;
950929
951930 MCScriptDefinition *t_getter;
952931 t_getter = t_def -> getter != 0 ? self -> definitions[t_def -> getter - 1 ] : nil;
@@ -989,10 +968,10 @@ bool MCScriptQueryEventOfModule(MCScriptModuleRef self, MCNameRef p_event, /* ge
989968 MCScriptEventDefinition *t_def;
990969
991970 if (!self -> is_usable)
992- return __MCScriptThrowModuleNotUsableError (self) ;
971+ return false ;
993972
994973 if (!MCScriptLookupEventDefinitionInModule (self, p_event, t_def))
995- return __MCScriptThrowDefinitionNotFoundInModuleError (self, kMCScriptDefinitionKindEvent , p_event) ;
974+ return false ;
996975
997976 r_signature = self -> types[t_def -> type] -> typeinfo;
998977
@@ -1011,10 +990,10 @@ bool MCScriptQueryHandlerSignatureOfModule(MCScriptModuleRef self, MCNameRef p_h
1011990 MCScriptHandlerDefinition *t_def;
1012991
1013992 if (!self -> is_usable)
1014- return __MCScriptThrowModuleNotUsableError (self) ;
993+ return false ;
1015994
1016995 if (!MCScriptLookupHandlerDefinitionInModule (self, p_handler, t_def))
1017- return __MCScriptThrowDefinitionNotFoundInModuleError (self, kMCScriptDefinitionKindProperty , p_handler) ;
996+ return false ;
1018997
1019998 r_signature = self -> types[t_def -> type] -> typeinfo;
1020999
@@ -1027,12 +1006,12 @@ bool MCScriptCopyHandlerParameterNamesOfModule(MCScriptModuleRef self, MCNameRef
10271006
10281007 if (!self -> is_usable)
10291008 {
1030- return __MCScriptThrowModuleNotUsableError (self) ;
1031- }
1009+ return false ;
1010+ }
10321011
10331012 if (!MCScriptLookupHandlerDefinitionInModule (self, p_handler, t_def))
10341013 {
1035- return __MCScriptThrowDefinitionNotFoundInModuleError (self, kMCScriptDefinitionKindHandler , p_handler) ;
1014+ return false ;
10361015 }
10371016
10381017 MCAutoProperListRef t_names;
0 commit comments