From 985dec61b1898c9d8f730ece7049748dd0a9742b Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 17 Oct 2023 15:09:22 +0200 Subject: [PATCH] pastojs: do not add rtti for public constructor for class without rtti, related #37752 --- packages/pastojs/src/fppas2js.pp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/pastojs/src/fppas2js.pp b/packages/pastojs/src/fppas2js.pp index 6fe76bee18..6a65290b18 100644 --- a/packages/pastojs/src/fppas2js.pp +++ b/packages/pastojs/src/fppas2js.pp @@ -21240,7 +21240,15 @@ begin // check visibility case mt of mtClass: - if (P.Visibility<>visPublished) and (not P.InheritsFrom(TPasConstructor) or (P.Visibility <> visPublic)) then continue; + if (P.Visibility=visPublished) then + // published member + else if (P is TPasConstructor) and (P.Visibility = visPublic) + and (pcsfPublished in TPas2JSClassScope(El.CustomData).Flags) then + // this class supports published members -> add public constructor to RTTI + // workaround til extended RTTI + // see issue #37752 + else + continue; mtInterface: ; // all members of an interface are published mtRecord: // a published record publishes all non private members