Skip to content

Commit a6a0177

Browse files
committed
Hotfix for the "this" expression.
1 parent 9e70abf commit a6a0177

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

CSharpToJavaScript/Walker.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4126,8 +4126,8 @@ public override void VisitBinaryExpression(BinaryExpressionSyntax node)
41264126
{
41274127
if (ignoreNext)
41284128
{
4129-
//TODO! Ignore trailing trivia if second token is 'as' keyword.
4130-
//removing whitespace before 'as' keyword
4129+
//TODO! Ignore trailing trivia if the second token is the 'as' keyword.
4130+
//removing whitespace before the 'as' keyword
41314131
JSSB.Remove(JSSB.Length - 1, 1);
41324132

41334133
ignoreNext = false;
@@ -6508,7 +6508,7 @@ public bool IdentifierToken(SyntaxNode node)
65086508

65096509
if (!iSymbol.IsStatic &&
65106510
((_reciverType.EndsWith(_CurrentClassStr) ||
6511-
(_reciverType.EndsWith(_CurrentClassInheritanceStr)))))
6511+
((_reciverType.EndsWith(_CurrentClassInheritanceStr) && _CurrentClassInheritanceStr != string.Empty)))))
65126512
{
65136513
VisitLeadingTrivia(identifier);
65146514

@@ -6533,9 +6533,10 @@ public bool IdentifierToken(SyntaxNode node)
65336533
return false;
65346534
}
65356535
string? _type = iSymbol.ContainingType.ToString();
6536+
65366537
if (_type != null &&
65376538
(_type.EndsWith(_CurrentClassStr) ||
6538-
_type.EndsWith(_CurrentClassInheritanceStr)))
6539+
(_type.EndsWith(_CurrentClassInheritanceStr) && _CurrentClassInheritanceStr != string.Empty)))
65396540
{
65406541
VisitLeadingTrivia(identifier);
65416542

0 commit comments

Comments
 (0)