@@ -517,7 +517,7 @@ export class LuaTransformer {
517517 }
518518
519519 public transformQualifiedName ( qualifiedName : ts . QualifiedName ) : ExpressionVisitResult {
520- const right = tstl . createStringLiteral ( this . getIdentifierText ( qualifiedName . right ) , qualifiedName . right ) ;
520+ const right = tstl . createStringLiteral ( qualifiedName . right . text , qualifiedName . right ) ;
521521 const left = this . transformEntityName ( qualifiedName . left ) ;
522522
523523 return tstl . createTableIndexExpression ( left , right , qualifiedName ) ;
@@ -4045,7 +4045,7 @@ export class LuaTransformer {
40454045 }
40464046
40474047 public transformPropertyAccessExpression ( expression : ts . PropertyAccessExpression ) : ExpressionVisitResult {
4048- const property = this . getIdentifierText ( expression . name ) ;
4048+ const property = expression . name . text ;
40494049
40504050 const constEnumValue = this . tryGetConstEnumValue ( expression ) ;
40514051 if ( constEnumValue ) {
@@ -4884,14 +4884,10 @@ export class LuaTransformer {
48844884 const value = Number ( propertyName . text ) ;
48854885 return tstl . createNumericLiteral ( value , propertyName ) ;
48864886 } else {
4887- return tstl . createStringLiteral ( this . getIdentifierText ( propertyName ) ) ;
4887+ return tstl . createStringLiteral ( propertyName . text ) ;
48884888 }
48894889 }
48904890
4891- protected getIdentifierText ( identifier : ts . Identifier ) : string {
4892- return ts . idText ( identifier ) ;
4893- }
4894-
48954891 public transformIdentifier ( identifier : ts . Identifier ) : tstl . Identifier {
48964892 if ( tsHelper . isForRangeType ( identifier , this . checker ) ) {
48974893 const callExpression = tsHelper . findFirstNodeAbove ( identifier , ts . isCallExpression ) ;
@@ -4904,11 +4900,11 @@ export class LuaTransformer {
49044900 }
49054901
49064902 const text = this . hasUnsafeIdentifierName ( identifier )
4907- ? this . createSafeName ( this . getIdentifierText ( identifier ) )
4908- : this . getIdentifierText ( identifier ) ;
4903+ ? this . createSafeName ( identifier . text )
4904+ : identifier . text ;
49094905
49104906 const symbolId = this . getIdentifierSymbolId ( identifier ) ;
4911- return tstl . createIdentifier ( text , identifier , symbolId , this . getIdentifierText ( identifier ) ) ;
4907+ return tstl . createIdentifier ( text , identifier , symbolId , identifier . text ) ;
49124908 }
49134909
49144910 protected transformIdentifierExpression ( expression : ts . Identifier ) : tstl . Expression {
@@ -4923,7 +4919,7 @@ export class LuaTransformer {
49234919 return tstl . createNilLiteral ( ) ;
49244920 }
49254921
4926- switch ( this . getIdentifierText ( expression ) ) {
4922+ switch ( expression . text ) {
49274923 case "NaN" :
49284924 return tstl . createParenthesizedExpression (
49294925 tstl . createBinaryExpression (
@@ -5420,7 +5416,7 @@ export class LuaTransformer {
54205416 ? this . createSafeName ( valueSymbol . name )
54215417 : valueSymbol . name ;
54225418 } else {
5423- const propertyName = this . getIdentifierText ( propertyIdentifier ) ;
5419+ const propertyName = propertyIdentifier . text ;
54245420 if ( luaKeywords . has ( propertyName ) || ! tsHelper . isValidLuaIdentifier ( propertyName ) ) {
54255421 // Catch ambient declarations of identifiers with bad names
54265422 throw TSTLErrors . InvalidAmbientIdentifierName ( propertyIdentifier ) ;
0 commit comments