Skip to content

Commit 77f918b

Browse files
committed
Address PR feedback
1 parent 1401aa3 commit 77f918b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libraries/System.Runtime.InteropServices.JavaScript/gen/JSImportGenerator/JSExportGenerator.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ private static NamespaceDeclarationSyntax GenerateRegSource(
215215
const string generatedNamespace = "System.Runtime.InteropServices.JavaScript";
216216
const string initializerClass = "__GeneratedInitializer";
217217
const string initializerName = "__Register_";
218-
const string selfInitName = "__Net7SelfInit_";
218+
const string trimmingPreserveName = "__TrimmingPreserve_";
219219

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

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

244244
// HACK: protect the code from trimming with DynamicDependency attached to a ModuleInitializer
245-
MemberDeclarationSyntax initializerMethod = MethodDeclaration(PredefinedType(Token(SyntaxKind.VoidKeyword)), Identifier(selfInitName))
245+
MemberDeclarationSyntax initializerMethod = MethodDeclaration(PredefinedType(Token(SyntaxKind.VoidKeyword)), Identifier(trimmingPreserveName))
246246
.WithAttributeLists(
247247
SingletonList<AttributeListSyntax>(
248248
AttributeList(

0 commit comments

Comments
 (0)