Skip to content

Commit af59d72

Browse files
committed
Ignore attributes while generating js.
ValueAttribute is now public.
1 parent cdb82d5 commit af59d72

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

CSharpToJavaScript/Utils/Attributes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public IgnoreAttribute() { }
1010
}
1111

1212
[AttributeUsage(AttributeTargets.All)]
13-
internal class ValueAttribute : Attribute
13+
public class ValueAttribute : Attribute
1414
{
1515
public string Value { get; init; }
1616
public ValueAttribute(string value)

CSharpToJavaScript/Walker.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ public override void VisitClassDeclaration(ClassDeclarationSyntax node)
230230

231231
switch (kind)
232232
{
233+
case SyntaxKind.AttributeList:
234+
break;
233235
case SyntaxKind.TypeParameterList:
234236
{
235237
SyntaxTriviaList _syntaxTrivias = asNode.GetTrailingTrivia();
@@ -296,6 +298,8 @@ public override void VisitConstructorDeclaration(ConstructorDeclarationSyntax no
296298

297299
switch (kind)
298300
{
301+
case SyntaxKind.AttributeList:
302+
break;
299303
case SyntaxKind.BaseConstructorInitializer:
300304
_BaseConstructorInitializerNode = asNode;
301305
SyntaxTriviaList _syntaxTrivias = asNode.GetTrailingTrivia();
@@ -917,6 +921,7 @@ public override void VisitMethodDeclaration(MethodDeclarationSyntax node)
917921

918922
switch (kind)
919923
{
924+
case SyntaxKind.AttributeList:
920925
case SyntaxKind.GenericName:
921926
case SyntaxKind.PredefinedType:
922927
break;
@@ -970,6 +975,8 @@ public override void VisitFieldDeclaration(FieldDeclarationSyntax node)
970975

971976
switch (kind)
972977
{
978+
case SyntaxKind.AttributeList:
979+
break;
973980
case SyntaxKind.VariableDeclaration:
974981
Visit(asNode);
975982
break;
@@ -1111,6 +1118,7 @@ where n.AsNode().IsKind(SyntaxKind.GenericName)
11111118
{
11121119
//TODO "EqualsValueClause" default value
11131120
case SyntaxKind.EqualsValueClause:
1121+
case SyntaxKind.AttributeList:
11141122
case SyntaxKind.PredefinedType:
11151123
case SyntaxKind.IdentifierName:
11161124
case SyntaxKind.GenericName:

0 commit comments

Comments
 (0)