Skip to content

Commit

Permalink
Address PR feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
kg committed Apr 4, 2024
1 parent 1401aa3 commit 77f918b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private static NamespaceDeclarationSyntax GenerateRegSource(
const string generatedNamespace = "System.Runtime.InteropServices.JavaScript";
const string initializerClass = "__GeneratedInitializer";
const string initializerName = "__Register_";
const string selfInitName = "__Net7SelfInit_";
const string trimmingPreserveName = "__TrimmingPreserve_";

if (methods.IsEmpty) return NamespaceDeclaration(IdentifierName(generatedNamespace));

Expand All @@ -242,7 +242,7 @@ private static NamespaceDeclarationSyntax GenerateRegSource(
.WithBody(Block(registerStatements));

// HACK: protect the code from trimming with DynamicDependency attached to a ModuleInitializer
MemberDeclarationSyntax initializerMethod = MethodDeclaration(PredefinedType(Token(SyntaxKind.VoidKeyword)), Identifier(selfInitName))
MemberDeclarationSyntax initializerMethod = MethodDeclaration(PredefinedType(Token(SyntaxKind.VoidKeyword)), Identifier(trimmingPreserveName))
.WithAttributeLists(
SingletonList<AttributeListSyntax>(
AttributeList(
Expand Down

0 comments on commit 77f918b

Please sign in to comment.