IdeIntf: Replace a test + exception with an assertion in PropEdits.

git-svn-id: trunk@56027 -
This commit is contained in:
juha 2017-10-11 14:04:35 +00:00
parent 7aac35e702
commit cf2c1e8b43

View File

@ -4626,15 +4626,13 @@ begin
{$IFDEF VerboseMethodPropEdit}
debugln(['TMethodPropertyEditor.Edit NewValue="',NewMethodName,'"']);
{$ENDIF}
if not IsValidIdent(NewMethodName) then
raise EPropertyError.Create('Method name "'+NewMethodName+'" must be an identifier');
Assert(IsValidIdent(NewMethodName),'Method name "'+NewMethodName+'" must be an identifier');
NewMethodName:=PropertyHook.LookupRoot.ClassName+'.'+NewMethodName;
{$IFDEF VerboseMethodPropEdit}
debugln(['TMethodPropertyEditor.Edit CreateMethod "',NewMethodName,'"...']);
{$ENDIF}
SetMethodValue(
PropertyHook.CreateMethod(NewMethodName, GetPropType,
GetComponent(0), GetPropertyPath(0)));
SetMethodValue(PropertyHook.CreateMethod(NewMethodName, GetPropType,
GetComponent(0), GetPropertyPath(0)));
{$IFDEF VerboseMethodPropEdit}
debugln(['TMethodPropertyEditor.Edit CHANGED new method=',GetValue]);
{$ENDIF}