@@ -632,7 +632,7 @@ func (b *nodeBuilderImpl) createExpressionFromSymbolChain(chain []*ast.Symbol, i
632632 return b .f .NewStringLiteral (b .getSpecifierForModuleSymbol (symbol , core .ResolutionModeNone ))
633633 }
634634
635- if index == 0 || canUsePropertyAccess (symbolName , b . ch . languageVersion ) {
635+ if index == 0 || canUsePropertyAccess (symbolName ) {
636636 identifier := b .f .NewIdentifier (symbolName )
637637 b .e .AddEmitFlags (identifier , printer .EFNoAsciiEscaping )
638638 // !!! TODO: smuggle type arguments out
@@ -667,16 +667,16 @@ func (b *nodeBuilderImpl) createExpressionFromSymbolChain(chain []*ast.Symbol, i
667667 return b .f .NewElementAccessExpression (b .createExpressionFromSymbolChain (chain , index - 1 ), nil , expression , ast .NodeFlagsNone )
668668}
669669
670- func canUsePropertyAccess (name string , languageVersion core. ScriptTarget ) bool {
670+ func canUsePropertyAccess (name string ) bool {
671671 if len (name ) == 0 {
672672 return false
673673 }
674674 // TODO: in strada, this only used `isIdentifierStart` on the first character, while this checks the whole string for validity
675675 // - possible strada bug?
676676 if strings .HasPrefix (name , "#" ) {
677- return len (name ) > 1 && scanner .IsIdentifierText (name [1 :], languageVersion , core .LanguageVariantStandard )
677+ return len (name ) > 1 && scanner .IsIdentifierText (name [1 :], core .LanguageVariantStandard )
678678 }
679- return scanner .IsIdentifierText (name , languageVersion , core .LanguageVariantStandard )
679+ return scanner .IsIdentifierText (name , core .LanguageVariantStandard )
680680}
681681
682682func startsWithSingleOrDoubleQuote (str string ) bool {
@@ -705,7 +705,7 @@ func (b *nodeBuilderImpl) getNameOfSymbolFromNameType(symbol *ast.Symbol) string
705705 case jsnum.Number :
706706 name = v .String ()
707707 }
708- if ! scanner .IsIdentifierText (name , b . ch . compilerOptions . GetEmitScriptTarget (), core .LanguageVariantStandard ) && ! isNumericLiteralName (name ) {
708+ if ! scanner .IsIdentifierText (name , core .LanguageVariantStandard ) && ! isNumericLiteralName (name ) {
709709 return b .ch .valueToString (nameType .AsLiteralType ().value )
710710 }
711711 if isNumericLiteralName (name ) && strings .HasPrefix (name , "-" ) {
@@ -1976,9 +1976,9 @@ func (b *nodeBuilderImpl) trackComputedName(accessExpression *ast.Node, enclosin
19761976 }
19771977}
19781978
1979- func (b * nodeBuilderImpl ) createPropertyNameNodeForIdentifierOrLiteral (name string , target core. ScriptTarget , _singleQuote bool , stringNamed bool , isMethod bool ) * ast.Node {
1979+ func (b * nodeBuilderImpl ) createPropertyNameNodeForIdentifierOrLiteral (name string , _singleQuote bool , stringNamed bool , isMethod bool ) * ast.Node {
19801980 isMethodNamedNew := isMethod && name == "new"
1981- if ! isMethodNamedNew && scanner .IsIdentifierText (name , target , core .LanguageVariantStandard ) {
1981+ if ! isMethodNamedNew && scanner .IsIdentifierText (name , core .LanguageVariantStandard ) {
19821982 return b .f .NewIdentifier (name )
19831983 }
19841984 if ! stringNamed && ! isMethodNamedNew && isNumericLiteralName (name ) && jsnum .FromString (name ) >= 0 {
@@ -2020,7 +2020,7 @@ func (b *nodeBuilderImpl) getPropertyNameNodeForSymbol(symbol *ast.Symbol) *ast.
20202020 if fromNameType != nil {
20212021 return fromNameType
20222022 }
2023- return b .createPropertyNameNodeForIdentifierOrLiteral (symbol .Name , b . ch . compilerOptions . GetEmitScriptTarget (), singleQuote , stringNamed , isMethod )
2023+ return b .createPropertyNameNodeForIdentifierOrLiteral (symbol .Name , singleQuote , stringNamed , isMethod )
20242024}
20252025
20262026// See getNameForSymbolFromNameType for a stringy equivalent
@@ -2040,14 +2040,14 @@ func (b *nodeBuilderImpl) getPropertyNameNodeForSymbolFromNameType(symbol *ast.S
20402040 case string :
20412041 name = nameType .AsLiteralType ().value .(string )
20422042 }
2043- if ! scanner .IsIdentifierText (name , b . ch . compilerOptions . GetEmitScriptTarget (), core .LanguageVariantStandard ) && (stringNamed || ! isNumericLiteralName (name )) {
2043+ if ! scanner .IsIdentifierText (name , core .LanguageVariantStandard ) && (stringNamed || ! isNumericLiteralName (name )) {
20442044 // !!! TODO: set singleQuote
20452045 return b .f .NewStringLiteral (name )
20462046 }
20472047 if isNumericLiteralName (name ) && name [0 ] == '-' {
20482048 return b .f .NewComputedPropertyName (b .f .NewPrefixUnaryExpression (ast .KindMinusToken , b .f .NewNumericLiteral (name [1 :])))
20492049 }
2050- return b .createPropertyNameNodeForIdentifierOrLiteral (name , b . ch . compilerOptions . GetEmitScriptTarget (), singleQuote , stringNamed , isMethod )
2050+ return b .createPropertyNameNodeForIdentifierOrLiteral (name , singleQuote , stringNamed , isMethod )
20512051 }
20522052 if nameType .flags & TypeFlagsUniqueESSymbol != 0 {
20532053 return b .f .NewComputedPropertyName (b .symbolToExpression (nameType .AsUniqueESSymbolType ().symbol , ast .SymbolFlagsValue ))
@@ -2737,7 +2737,7 @@ func (b *nodeBuilderImpl) typeToTypeNode(t *Type) *ast.TypeNode {
27372737 return parentName
27382738 }
27392739 memberName := ast .SymbolName (t .symbol )
2740- if scanner .IsIdentifierText (memberName , core .ScriptTargetES5 , core . LanguageVariantStandard ) {
2740+ if scanner .IsIdentifierText (memberName , core .LanguageVariantStandard ) {
27412741 return b .appendReferenceToType (parentName /* as TypeReferenceNode | ImportTypeNode */ , b .f .NewTypeReferenceNode (b .f .NewIdentifier (memberName ), nil /*typeArguments*/ ))
27422742 }
27432743 if ast .IsImportTypeNode (parentName ) {
0 commit comments