mirror of
https://gitlab.com/freepascal.org/fpc/pas2js.git
synced 2025-08-24 01:09:15 +02:00
rtl: simplified TObject.MethodName
This commit is contained in:
parent
e95f3a7f26
commit
f50e3b21a8
@ -910,7 +910,6 @@ asm
|
|||||||
return (aClass!=null) && ((this==aClass) || aClass.isPrototypeOf(this));
|
return (aClass!=null) && ((this==aClass) || aClass.isPrototypeOf(this));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Class function TObject.MethodName(aCode : Pointer) : String;
|
Class function TObject.MethodName(aCode : Pointer) : String;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
@ -972,16 +971,13 @@ begin
|
|||||||
Result:=Nil;
|
Result:=Nil;
|
||||||
if aName='' then exit;
|
if aName='' then exit;
|
||||||
asm
|
asm
|
||||||
var aClass = null;
|
var aClass = this.$class;
|
||||||
var i = 0;
|
|
||||||
var ClassTI = null;
|
var ClassTI = null;
|
||||||
var myName = aName.toLowerCase();
|
var myName = aName.toLowerCase();
|
||||||
var MemberTI = null;
|
var MemberTI = null;
|
||||||
aClass = this.$class;
|
|
||||||
while (aClass !== null) {
|
while (aClass !== null) {
|
||||||
ClassTI = aClass.$rtti;
|
ClassTI = aClass.$rtti;
|
||||||
for (var $l1 = 0, $end2 = ClassTI.fields.length - 1; $l1 <= $end2; $l1++) {
|
for (var i = 0, $end2 = ClassTI.fields.length - 1; i <= $end2; i++) {
|
||||||
i = $l1;
|
|
||||||
MemberTI = ClassTI.getField(i);
|
MemberTI = ClassTI.getField(i);
|
||||||
if (MemberTI.name.toLowerCase() === myName) {
|
if (MemberTI.name.toLowerCase() === myName) {
|
||||||
return MemberTI;
|
return MemberTI;
|
||||||
|
Loading…
Reference in New Issue
Block a user