Skip to content

Commit c49f506

Browse files
committed
Further improvement to "this.".
1 parent 8dfd544 commit c49f506

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

CSharpToJavaScript/Walker.cs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,6 @@ public override void VisitArgument(ArgumentSyntax node)
489489
case SyntaxKind.ThisExpression:
490490
case SyntaxKind.ParenthesizedLambdaExpression:
491491
case SyntaxKind.NumericLiteralExpression:
492-
case SyntaxKind.ElementAccessExpression:
493492
case SyntaxKind.FalseLiteralExpression:
494493
case SyntaxKind.TrueLiteralExpression:
495494
case SyntaxKind.StringLiteralExpression:
@@ -499,6 +498,7 @@ public override void VisitArgument(ArgumentSyntax node)
499498
Visit(asNode);
500499
break;
501500
}
501+
case SyntaxKind.ElementAccessExpression:
502502
case SyntaxKind.IdentifierName:
503503
case SyntaxKind.SimpleMemberAccessExpression:
504504
{
@@ -1373,6 +1373,8 @@ public override void VisitParenthesizedExpression(ParenthesizedExpressionSyntax
13731373
Visit(asNode);
13741374
break;
13751375
case SyntaxKind.AsExpression:
1376+
1377+
//Todo double/multiply asExpression?? How?
13761378
_SNOriginal = (asNode as BinaryExpressionSyntax).Left;
13771379

13781380
Visit(_SNOriginal.WithoutTrailingTrivia());
@@ -1866,18 +1868,18 @@ where e.IsKind(SyntaxKind.IdentifierName)
18661868
SyntaxToken _sT = default;
18671869
if (item is MethodDeclarationSyntax m)
18681870
{
1871+
/*
18691872
IEnumerable<SyntaxToken> d3 = from e in m.ChildTokens()
18701873
where e.IsKind(SyntaxKind.IdentifierToken)
18711874
select e;
1872-
_sT = d3.First();
1875+
_sT = d3.First();*/
1876+
1877+
_sT = m.Identifier;
18731878
}
18741879

18751880
if (item is PropertyDeclarationSyntax p)
18761881
{
1877-
IEnumerable<SyntaxToken> d3 = from e in p.DescendantTokens()
1878-
where e.IsKind(SyntaxKind.IdentifierToken)
1879-
select e;
1880-
_sT = d3.Last();
1882+
_sT = p.Identifier;
18811883
}
18821884

18831885
if (item is FieldDeclarationSyntax f)

0 commit comments

Comments
 (0)