diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 6840f079972..cbf5cf290eb 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -179,110 +179,111 @@ declare module "typescript" { NumberKeyword = 117, SetKeyword = 118, StringKeyword = 119, - TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + SymbolKeyword = 120, + TypeKeyword = 121, + QualifiedName = 122, + ComputedPropertyName = 123, + TypeParameter = 124, + Parameter = 125, + PropertySignature = 126, + PropertyDeclaration = 127, + MethodSignature = 128, + MethodDeclaration = 129, + Constructor = 130, + GetAccessor = 131, + SetAccessor = 132, + CallSignature = 133, + ConstructSignature = 134, + IndexSignature = 135, + TypeReference = 136, + FunctionType = 137, + ConstructorType = 138, + TypeQuery = 139, + TypeLiteral = 140, + ArrayType = 141, + TupleType = 142, + UnionType = 143, + ParenthesizedType = 144, + ObjectBindingPattern = 145, + ArrayBindingPattern = 146, + BindingElement = 147, + ArrayLiteralExpression = 148, + ObjectLiteralExpression = 149, + PropertyAccessExpression = 150, + ElementAccessExpression = 151, + CallExpression = 152, + NewExpression = 153, + TaggedTemplateExpression = 154, + TypeAssertionExpression = 155, + ParenthesizedExpression = 156, + FunctionExpression = 157, + ArrowFunction = 158, + DeleteExpression = 159, + TypeOfExpression = 160, + VoidExpression = 161, + PrefixUnaryExpression = 162, + PostfixUnaryExpression = 163, + BinaryExpression = 164, + ConditionalExpression = 165, + TemplateExpression = 166, + YieldExpression = 167, + SpreadElementExpression = 168, + OmittedExpression = 169, + TemplateSpan = 170, + Block = 171, + VariableStatement = 172, + EmptyStatement = 173, + ExpressionStatement = 174, + IfStatement = 175, + DoStatement = 176, + WhileStatement = 177, + ForStatement = 178, + ForInStatement = 179, + ContinueStatement = 180, + BreakStatement = 181, + ReturnStatement = 182, + WithStatement = 183, + SwitchStatement = 184, + LabeledStatement = 185, + ThrowStatement = 186, + TryStatement = 187, + DebuggerStatement = 188, + VariableDeclaration = 189, + VariableDeclarationList = 190, + FunctionDeclaration = 191, + ClassDeclaration = 192, + InterfaceDeclaration = 193, + TypeAliasDeclaration = 194, + EnumDeclaration = 195, + ModuleDeclaration = 196, + ModuleBlock = 197, + ImportDeclaration = 198, + ExportAssignment = 199, + ExternalModuleReference = 200, + CaseClause = 201, + DefaultClause = 202, + HeritageClause = 203, + CatchClause = 204, + PropertyAssignment = 205, + ShorthandPropertyAssignment = 206, + EnumMember = 207, + SourceFile = 208, + SyntaxList = 209, + Count = 210, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, + LastKeyword = 121, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + FirstTypeNode = 136, + LastTypeNode = 144, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, - LastToken = 120, + LastToken = 121, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -291,7 +292,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 122, } const enum NodeFlags { Export = 1, diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index d70172377ca..7eff464a746 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -553,274 +553,277 @@ declare module "typescript" { StringKeyword = 119, >StringKeyword : SyntaxKind - TypeKeyword = 120, + SymbolKeyword = 120, +>SymbolKeyword : SyntaxKind + + TypeKeyword = 121, >TypeKeyword : SyntaxKind - QualifiedName = 121, + QualifiedName = 122, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 123, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 124, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 125, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 126, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 127, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 128, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 129, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 130, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 131, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 132, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 133, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 134, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 135, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 136, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 137, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 138, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 139, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 140, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 141, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 142, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 143, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 144, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 145, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 146, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 147, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 148, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 149, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 150, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 151, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 152, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 153, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 154, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 155, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 156, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 157, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 158, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 159, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 160, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 161, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 162, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 163, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 164, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 165, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 166, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 167, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 168, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 169, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 170, >TemplateSpan : SyntaxKind - Block = 170, + Block = 171, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 172, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 173, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 174, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 175, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 176, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 177, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 178, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 179, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ContinueStatement = 180, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 181, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 182, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 183, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 184, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 185, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 186, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 187, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 188, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 189, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 190, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 191, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 192, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 193, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 194, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 195, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 196, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 197, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, + ImportDeclaration = 198, >ImportDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 199, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ExternalModuleReference = 200, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 201, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 202, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 203, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 204, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 205, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 206, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 207, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 208, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 209, >SyntaxList : SyntaxKind - Count = 209, + Count = 210, >Count : SyntaxKind FirstAssignment = 52, @@ -838,7 +841,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 121, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -847,10 +850,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 136, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 144, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -862,7 +865,7 @@ declare module "typescript" { FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 120, + LastToken = 121, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -889,7 +892,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 122, >FirstNode : SyntaxKind } const enum NodeFlags { diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index c8bec722309..eab931162ad 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -210,110 +210,111 @@ declare module "typescript" { NumberKeyword = 117, SetKeyword = 118, StringKeyword = 119, - TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + SymbolKeyword = 120, + TypeKeyword = 121, + QualifiedName = 122, + ComputedPropertyName = 123, + TypeParameter = 124, + Parameter = 125, + PropertySignature = 126, + PropertyDeclaration = 127, + MethodSignature = 128, + MethodDeclaration = 129, + Constructor = 130, + GetAccessor = 131, + SetAccessor = 132, + CallSignature = 133, + ConstructSignature = 134, + IndexSignature = 135, + TypeReference = 136, + FunctionType = 137, + ConstructorType = 138, + TypeQuery = 139, + TypeLiteral = 140, + ArrayType = 141, + TupleType = 142, + UnionType = 143, + ParenthesizedType = 144, + ObjectBindingPattern = 145, + ArrayBindingPattern = 146, + BindingElement = 147, + ArrayLiteralExpression = 148, + ObjectLiteralExpression = 149, + PropertyAccessExpression = 150, + ElementAccessExpression = 151, + CallExpression = 152, + NewExpression = 153, + TaggedTemplateExpression = 154, + TypeAssertionExpression = 155, + ParenthesizedExpression = 156, + FunctionExpression = 157, + ArrowFunction = 158, + DeleteExpression = 159, + TypeOfExpression = 160, + VoidExpression = 161, + PrefixUnaryExpression = 162, + PostfixUnaryExpression = 163, + BinaryExpression = 164, + ConditionalExpression = 165, + TemplateExpression = 166, + YieldExpression = 167, + SpreadElementExpression = 168, + OmittedExpression = 169, + TemplateSpan = 170, + Block = 171, + VariableStatement = 172, + EmptyStatement = 173, + ExpressionStatement = 174, + IfStatement = 175, + DoStatement = 176, + WhileStatement = 177, + ForStatement = 178, + ForInStatement = 179, + ContinueStatement = 180, + BreakStatement = 181, + ReturnStatement = 182, + WithStatement = 183, + SwitchStatement = 184, + LabeledStatement = 185, + ThrowStatement = 186, + TryStatement = 187, + DebuggerStatement = 188, + VariableDeclaration = 189, + VariableDeclarationList = 190, + FunctionDeclaration = 191, + ClassDeclaration = 192, + InterfaceDeclaration = 193, + TypeAliasDeclaration = 194, + EnumDeclaration = 195, + ModuleDeclaration = 196, + ModuleBlock = 197, + ImportDeclaration = 198, + ExportAssignment = 199, + ExternalModuleReference = 200, + CaseClause = 201, + DefaultClause = 202, + HeritageClause = 203, + CatchClause = 204, + PropertyAssignment = 205, + ShorthandPropertyAssignment = 206, + EnumMember = 207, + SourceFile = 208, + SyntaxList = 209, + Count = 210, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, + LastKeyword = 121, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + FirstTypeNode = 136, + LastTypeNode = 144, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, - LastToken = 120, + LastToken = 121, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -322,7 +323,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 122, } const enum NodeFlags { Export = 1, @@ -1951,24 +1952,24 @@ function delint(sourceFile) { delintNode(sourceFile); function delintNode(node) { switch (node.kind) { - case 177 /* ForStatement */: - case 178 /* ForInStatement */: - case 176 /* WhileStatement */: - case 175 /* DoStatement */: - if (node.statement.kind !== 170 /* Block */) { + case 178 /* ForStatement */: + case 179 /* ForInStatement */: + case 177 /* WhileStatement */: + case 176 /* DoStatement */: + if (node.statement.kind !== 171 /* Block */) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; - case 174 /* IfStatement */: + case 175 /* IfStatement */: var ifStatement = node; - if (ifStatement.thenStatement.kind !== 170 /* Block */) { + if (ifStatement.thenStatement.kind !== 171 /* Block */) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } - if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 170 /* Block */ && ifStatement.elseStatement.kind !== 174 /* IfStatement */) { + if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 171 /* Block */ && ifStatement.elseStatement.kind !== 175 /* IfStatement */) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; - case 163 /* BinaryExpression */: + case 164 /* BinaryExpression */: var op = node.operator; if (op === 28 /* EqualsEqualsToken */ || op === 29 /* ExclamationEqualsToken */) { report(node, "Use '===' and '!=='."); diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 26254c69d54..fcdbb57add6 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -697,274 +697,277 @@ declare module "typescript" { StringKeyword = 119, >StringKeyword : SyntaxKind - TypeKeyword = 120, + SymbolKeyword = 120, +>SymbolKeyword : SyntaxKind + + TypeKeyword = 121, >TypeKeyword : SyntaxKind - QualifiedName = 121, + QualifiedName = 122, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 123, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 124, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 125, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 126, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 127, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 128, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 129, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 130, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 131, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 132, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 133, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 134, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 135, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 136, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 137, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 138, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 139, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 140, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 141, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 142, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 143, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 144, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 145, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 146, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 147, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 148, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 149, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 150, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 151, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 152, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 153, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 154, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 155, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 156, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 157, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 158, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 159, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 160, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 161, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 162, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 163, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 164, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 165, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 166, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 167, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 168, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 169, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 170, >TemplateSpan : SyntaxKind - Block = 170, + Block = 171, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 172, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 173, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 174, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 175, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 176, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 177, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 178, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 179, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ContinueStatement = 180, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 181, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 182, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 183, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 184, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 185, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 186, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 187, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 188, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 189, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 190, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 191, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 192, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 193, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 194, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 195, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 196, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 197, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, + ImportDeclaration = 198, >ImportDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 199, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ExternalModuleReference = 200, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 201, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 202, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 203, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 204, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 205, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 206, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 207, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 208, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 209, >SyntaxList : SyntaxKind - Count = 209, + Count = 210, >Count : SyntaxKind FirstAssignment = 52, @@ -982,7 +985,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 121, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -991,10 +994,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 136, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 144, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -1006,7 +1009,7 @@ declare module "typescript" { FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 120, + LastToken = 121, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -1033,7 +1036,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 122, >FirstNode : SyntaxKind } const enum NodeFlags { diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index ad66d289eb7..e9c8d6fc0fd 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -211,110 +211,111 @@ declare module "typescript" { NumberKeyword = 117, SetKeyword = 118, StringKeyword = 119, - TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + SymbolKeyword = 120, + TypeKeyword = 121, + QualifiedName = 122, + ComputedPropertyName = 123, + TypeParameter = 124, + Parameter = 125, + PropertySignature = 126, + PropertyDeclaration = 127, + MethodSignature = 128, + MethodDeclaration = 129, + Constructor = 130, + GetAccessor = 131, + SetAccessor = 132, + CallSignature = 133, + ConstructSignature = 134, + IndexSignature = 135, + TypeReference = 136, + FunctionType = 137, + ConstructorType = 138, + TypeQuery = 139, + TypeLiteral = 140, + ArrayType = 141, + TupleType = 142, + UnionType = 143, + ParenthesizedType = 144, + ObjectBindingPattern = 145, + ArrayBindingPattern = 146, + BindingElement = 147, + ArrayLiteralExpression = 148, + ObjectLiteralExpression = 149, + PropertyAccessExpression = 150, + ElementAccessExpression = 151, + CallExpression = 152, + NewExpression = 153, + TaggedTemplateExpression = 154, + TypeAssertionExpression = 155, + ParenthesizedExpression = 156, + FunctionExpression = 157, + ArrowFunction = 158, + DeleteExpression = 159, + TypeOfExpression = 160, + VoidExpression = 161, + PrefixUnaryExpression = 162, + PostfixUnaryExpression = 163, + BinaryExpression = 164, + ConditionalExpression = 165, + TemplateExpression = 166, + YieldExpression = 167, + SpreadElementExpression = 168, + OmittedExpression = 169, + TemplateSpan = 170, + Block = 171, + VariableStatement = 172, + EmptyStatement = 173, + ExpressionStatement = 174, + IfStatement = 175, + DoStatement = 176, + WhileStatement = 177, + ForStatement = 178, + ForInStatement = 179, + ContinueStatement = 180, + BreakStatement = 181, + ReturnStatement = 182, + WithStatement = 183, + SwitchStatement = 184, + LabeledStatement = 185, + ThrowStatement = 186, + TryStatement = 187, + DebuggerStatement = 188, + VariableDeclaration = 189, + VariableDeclarationList = 190, + FunctionDeclaration = 191, + ClassDeclaration = 192, + InterfaceDeclaration = 193, + TypeAliasDeclaration = 194, + EnumDeclaration = 195, + ModuleDeclaration = 196, + ModuleBlock = 197, + ImportDeclaration = 198, + ExportAssignment = 199, + ExternalModuleReference = 200, + CaseClause = 201, + DefaultClause = 202, + HeritageClause = 203, + CatchClause = 204, + PropertyAssignment = 205, + ShorthandPropertyAssignment = 206, + EnumMember = 207, + SourceFile = 208, + SyntaxList = 209, + Count = 210, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, + LastKeyword = 121, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + FirstTypeNode = 136, + LastTypeNode = 144, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, - LastToken = 120, + LastToken = 121, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -323,7 +324,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 122, } const enum NodeFlags { Export = 1, diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index c6d74cc811d..2a9c7902528 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -649,274 +649,277 @@ declare module "typescript" { StringKeyword = 119, >StringKeyword : SyntaxKind - TypeKeyword = 120, + SymbolKeyword = 120, +>SymbolKeyword : SyntaxKind + + TypeKeyword = 121, >TypeKeyword : SyntaxKind - QualifiedName = 121, + QualifiedName = 122, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 123, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 124, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 125, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 126, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 127, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 128, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 129, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 130, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 131, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 132, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 133, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 134, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 135, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 136, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 137, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 138, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 139, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 140, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 141, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 142, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 143, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 144, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 145, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 146, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 147, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 148, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 149, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 150, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 151, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 152, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 153, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 154, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 155, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 156, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 157, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 158, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 159, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 160, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 161, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 162, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 163, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 164, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 165, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 166, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 167, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 168, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 169, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 170, >TemplateSpan : SyntaxKind - Block = 170, + Block = 171, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 172, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 173, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 174, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 175, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 176, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 177, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 178, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 179, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ContinueStatement = 180, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 181, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 182, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 183, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 184, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 185, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 186, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 187, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 188, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 189, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 190, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 191, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 192, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 193, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 194, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 195, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 196, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 197, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, + ImportDeclaration = 198, >ImportDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 199, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ExternalModuleReference = 200, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 201, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 202, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 203, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 204, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 205, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 206, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 207, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 208, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 209, >SyntaxList : SyntaxKind - Count = 209, + Count = 210, >Count : SyntaxKind FirstAssignment = 52, @@ -934,7 +937,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 121, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -943,10 +946,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 136, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 144, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -958,7 +961,7 @@ declare module "typescript" { FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 120, + LastToken = 121, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -985,7 +988,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 122, >FirstNode : SyntaxKind } const enum NodeFlags { diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index 2add8dfd45e..dae4936f7b0 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -248,110 +248,111 @@ declare module "typescript" { NumberKeyword = 117, SetKeyword = 118, StringKeyword = 119, - TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + SymbolKeyword = 120, + TypeKeyword = 121, + QualifiedName = 122, + ComputedPropertyName = 123, + TypeParameter = 124, + Parameter = 125, + PropertySignature = 126, + PropertyDeclaration = 127, + MethodSignature = 128, + MethodDeclaration = 129, + Constructor = 130, + GetAccessor = 131, + SetAccessor = 132, + CallSignature = 133, + ConstructSignature = 134, + IndexSignature = 135, + TypeReference = 136, + FunctionType = 137, + ConstructorType = 138, + TypeQuery = 139, + TypeLiteral = 140, + ArrayType = 141, + TupleType = 142, + UnionType = 143, + ParenthesizedType = 144, + ObjectBindingPattern = 145, + ArrayBindingPattern = 146, + BindingElement = 147, + ArrayLiteralExpression = 148, + ObjectLiteralExpression = 149, + PropertyAccessExpression = 150, + ElementAccessExpression = 151, + CallExpression = 152, + NewExpression = 153, + TaggedTemplateExpression = 154, + TypeAssertionExpression = 155, + ParenthesizedExpression = 156, + FunctionExpression = 157, + ArrowFunction = 158, + DeleteExpression = 159, + TypeOfExpression = 160, + VoidExpression = 161, + PrefixUnaryExpression = 162, + PostfixUnaryExpression = 163, + BinaryExpression = 164, + ConditionalExpression = 165, + TemplateExpression = 166, + YieldExpression = 167, + SpreadElementExpression = 168, + OmittedExpression = 169, + TemplateSpan = 170, + Block = 171, + VariableStatement = 172, + EmptyStatement = 173, + ExpressionStatement = 174, + IfStatement = 175, + DoStatement = 176, + WhileStatement = 177, + ForStatement = 178, + ForInStatement = 179, + ContinueStatement = 180, + BreakStatement = 181, + ReturnStatement = 182, + WithStatement = 183, + SwitchStatement = 184, + LabeledStatement = 185, + ThrowStatement = 186, + TryStatement = 187, + DebuggerStatement = 188, + VariableDeclaration = 189, + VariableDeclarationList = 190, + FunctionDeclaration = 191, + ClassDeclaration = 192, + InterfaceDeclaration = 193, + TypeAliasDeclaration = 194, + EnumDeclaration = 195, + ModuleDeclaration = 196, + ModuleBlock = 197, + ImportDeclaration = 198, + ExportAssignment = 199, + ExternalModuleReference = 200, + CaseClause = 201, + DefaultClause = 202, + HeritageClause = 203, + CatchClause = 204, + PropertyAssignment = 205, + ShorthandPropertyAssignment = 206, + EnumMember = 207, + SourceFile = 208, + SyntaxList = 209, + Count = 210, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, + LastKeyword = 121, FirstFutureReservedWord = 101, LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + FirstTypeNode = 136, + LastTypeNode = 144, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, - LastToken = 120, + LastToken = 121, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -360,7 +361,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 122, } const enum NodeFlags { Export = 1, diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index 3af8537fdb7..a8d9197f753 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -822,274 +822,277 @@ declare module "typescript" { StringKeyword = 119, >StringKeyword : SyntaxKind - TypeKeyword = 120, + SymbolKeyword = 120, +>SymbolKeyword : SyntaxKind + + TypeKeyword = 121, >TypeKeyword : SyntaxKind - QualifiedName = 121, + QualifiedName = 122, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 123, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 124, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 125, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 126, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 127, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 128, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 129, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 130, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 131, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 132, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 133, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 134, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 135, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 136, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 137, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 138, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 139, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 140, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 141, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 142, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 143, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 144, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 145, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 146, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 147, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 148, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 149, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 150, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 151, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 152, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 153, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 154, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 155, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 156, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 157, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 158, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 159, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 160, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 161, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 162, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 163, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 164, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 165, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 166, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 167, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 168, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 169, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 170, >TemplateSpan : SyntaxKind - Block = 170, + Block = 171, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 172, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 173, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 174, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 175, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 176, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 177, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 178, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 179, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ContinueStatement = 180, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 181, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 182, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 183, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 184, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 185, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 186, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 187, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 188, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 189, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 190, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 191, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 192, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 193, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 194, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 195, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 196, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 197, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, + ImportDeclaration = 198, >ImportDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 199, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ExternalModuleReference = 200, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 201, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 202, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 203, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 204, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 205, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 206, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 207, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 208, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 209, >SyntaxList : SyntaxKind - Count = 209, + Count = 210, >Count : SyntaxKind FirstAssignment = 52, @@ -1107,7 +1110,7 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 121, >LastKeyword : SyntaxKind FirstFutureReservedWord = 101, @@ -1116,10 +1119,10 @@ declare module "typescript" { LastFutureReservedWord = 109, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 136, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 144, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -1131,7 +1134,7 @@ declare module "typescript" { FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 120, + LastToken = 121, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -1158,7 +1161,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 122, >FirstNode : SyntaxKind } const enum NodeFlags { diff --git a/tests/baselines/reference/parserES5SymbolIndexer1.errors.txt b/tests/baselines/reference/parserES5SymbolIndexer1.errors.txt index 8128f95d3b6..a5ff176db61 100644 --- a/tests/baselines/reference/parserES5SymbolIndexer1.errors.txt +++ b/tests/baselines/reference/parserES5SymbolIndexer1.errors.txt @@ -1,12 +1,9 @@ tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer1.ts(2,9): error TS1188: 'Symbol' indexers are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer1.ts(2,9): error TS2304: Cannot find name 'Symbol'. -==== tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer1.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer1.ts (1 errors) ==== interface I { - [s: Symbol]: string; + [s: symbol]: string; ~~~~~~ !!! error TS1188: 'Symbol' indexers are only available when targeting ECMAScript 6 and higher. - ~~~~~~ -!!! error TS2304: Cannot find name 'Symbol'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5SymbolIndexer1.js b/tests/baselines/reference/parserES5SymbolIndexer1.js new file mode 100644 index 00000000000..641d93b1170 --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolIndexer1.js @@ -0,0 +1,6 @@ +//// [parserES5SymbolIndexer1.ts] +interface I { + [s: symbol]: string; +} + +//// [parserES5SymbolIndexer1.js] diff --git a/tests/baselines/reference/parserES5SymbolIndexer2.errors.txt b/tests/baselines/reference/parserES5SymbolIndexer2.errors.txt index b1904d0fe53..de4c97aae29 100644 --- a/tests/baselines/reference/parserES5SymbolIndexer2.errors.txt +++ b/tests/baselines/reference/parserES5SymbolIndexer2.errors.txt @@ -1,12 +1,9 @@ tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer2.ts(2,9): error TS1188: 'Symbol' indexers are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer2.ts(2,9): error TS2304: Cannot find name 'Symbol'. -==== tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer2.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer2.ts (1 errors) ==== class C { - [s: Symbol]: string; + [s: symbol]: string; ~~~~~~ !!! error TS1188: 'Symbol' indexers are only available when targeting ECMAScript 6 and higher. - ~~~~~~ -!!! error TS2304: Cannot find name 'Symbol'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5SymbolIndexer2.js b/tests/baselines/reference/parserES5SymbolIndexer2.js new file mode 100644 index 00000000000..c511b6acafa --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolIndexer2.js @@ -0,0 +1,11 @@ +//// [parserES5SymbolIndexer2.ts] +class C { + [s: symbol]: string; +} + +//// [parserES5SymbolIndexer2.js] +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/parserES5SymbolIndexer3.errors.txt b/tests/baselines/reference/parserES5SymbolIndexer3.errors.txt index bc1bc64aeda..e839338e772 100644 --- a/tests/baselines/reference/parserES5SymbolIndexer3.errors.txt +++ b/tests/baselines/reference/parserES5SymbolIndexer3.errors.txt @@ -1,12 +1,9 @@ tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer3.ts(2,9): error TS1188: 'Symbol' indexers are only available when targeting ECMAScript 6 and higher. -tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer3.ts(2,9): error TS2304: Cannot find name 'Symbol'. -==== tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer3.ts (2 errors) ==== +==== tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer3.ts (1 errors) ==== var x: { - [s: Symbol]: string; + [s: symbol]: string; ~~~~~~ !!! error TS1188: 'Symbol' indexers are only available when targeting ECMAScript 6 and higher. - ~~~~~~ -!!! error TS2304: Cannot find name 'Symbol'. } \ No newline at end of file diff --git a/tests/baselines/reference/parserES5SymbolIndexer3.js b/tests/baselines/reference/parserES5SymbolIndexer3.js new file mode 100644 index 00000000000..daffb51a6d7 --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolIndexer3.js @@ -0,0 +1,7 @@ +//// [parserES5SymbolIndexer3.ts] +var x: { + [s: symbol]: string; +} + +//// [parserES5SymbolIndexer3.js] +var x; diff --git a/tests/baselines/reference/parserES5SymbolProperty1.js b/tests/baselines/reference/parserES5SymbolProperty1.js new file mode 100644 index 00000000000..36030aec105 --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolProperty1.js @@ -0,0 +1,6 @@ +//// [parserES5SymbolProperty1.ts] +interface I { + [Symbol.iterator]: string; +} + +//// [parserES5SymbolProperty1.js] diff --git a/tests/baselines/reference/parserES5SymbolProperty2.js b/tests/baselines/reference/parserES5SymbolProperty2.js new file mode 100644 index 00000000000..d600b05ea52 --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolProperty2.js @@ -0,0 +1,6 @@ +//// [parserES5SymbolProperty2.ts] +interface I { + [Symbol.unscopables](): string; +} + +//// [parserES5SymbolProperty2.js] diff --git a/tests/baselines/reference/parserES5SymbolProperty3.js b/tests/baselines/reference/parserES5SymbolProperty3.js new file mode 100644 index 00000000000..0d0fb18313f --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolProperty3.js @@ -0,0 +1,6 @@ +//// [parserES5SymbolProperty3.ts] +declare class C { + [Symbol.unscopables](): string; +} + +//// [parserES5SymbolProperty3.js] diff --git a/tests/baselines/reference/parserES5SymbolProperty4.js b/tests/baselines/reference/parserES5SymbolProperty4.js new file mode 100644 index 00000000000..d8f55358e73 --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolProperty4.js @@ -0,0 +1,6 @@ +//// [parserES5SymbolProperty4.ts] +declare class C { + [Symbol.isRegExp]: string; +} + +//// [parserES5SymbolProperty4.js] diff --git a/tests/baselines/reference/parserES5SymbolProperty5.js b/tests/baselines/reference/parserES5SymbolProperty5.js new file mode 100644 index 00000000000..e2448432542 --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolProperty5.js @@ -0,0 +1,11 @@ +//// [parserES5SymbolProperty5.ts] +class C { + [Symbol.isRegExp]: string; +} + +//// [parserES5SymbolProperty5.js] +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/parserES5SymbolProperty6.js b/tests/baselines/reference/parserES5SymbolProperty6.js new file mode 100644 index 00000000000..ce2050688c3 --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolProperty6.js @@ -0,0 +1,12 @@ +//// [parserES5SymbolProperty6.ts] +class C { + [Symbol.toStringTag]: string = ""; +} + +//// [parserES5SymbolProperty6.js] +var C = (function () { + function C() { + this[Symbol.toStringTag] = ""; + } + return C; +})(); diff --git a/tests/baselines/reference/parserES5SymbolProperty7.js b/tests/baselines/reference/parserES5SymbolProperty7.js new file mode 100644 index 00000000000..b6096b798df --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolProperty7.js @@ -0,0 +1,13 @@ +//// [parserES5SymbolProperty7.ts] +class C { + [Symbol.toStringTag](): void { } +} + +//// [parserES5SymbolProperty7.js] +var C = (function () { + function C() { + } + C.prototype[Symbol.toStringTag] = function () { + }; + return C; +})(); diff --git a/tests/baselines/reference/parserES5SymbolProperty8.js b/tests/baselines/reference/parserES5SymbolProperty8.js new file mode 100644 index 00000000000..ed3a55db0f2 --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolProperty8.js @@ -0,0 +1,7 @@ +//// [parserES5SymbolProperty8.ts] +var x: { + [Symbol.toPrimitive](): string +} + +//// [parserES5SymbolProperty8.js] +var x; diff --git a/tests/baselines/reference/parserES5SymbolProperty9.js b/tests/baselines/reference/parserES5SymbolProperty9.js new file mode 100644 index 00000000000..4728765e553 --- /dev/null +++ b/tests/baselines/reference/parserES5SymbolProperty9.js @@ -0,0 +1,7 @@ +//// [parserES5SymbolProperty9.ts] +var x: { + [Symbol.toPrimitive]: string +} + +//// [parserES5SymbolProperty9.js] +var x; diff --git a/tests/baselines/reference/parserSymbolIndexer1.js b/tests/baselines/reference/parserSymbolIndexer1.js index 4c99edda168..752391dad53 100644 --- a/tests/baselines/reference/parserSymbolIndexer1.js +++ b/tests/baselines/reference/parserSymbolIndexer1.js @@ -1,6 +1,6 @@ //// [parserSymbolIndexer1.ts] interface I { - [s: Symbol]: string; + [s: symbol]: string; } //// [parserSymbolIndexer1.js] diff --git a/tests/baselines/reference/parserSymbolIndexer2.js b/tests/baselines/reference/parserSymbolIndexer2.js index 1acae44ae2a..563614e1c8c 100644 --- a/tests/baselines/reference/parserSymbolIndexer2.js +++ b/tests/baselines/reference/parserSymbolIndexer2.js @@ -1,6 +1,6 @@ //// [parserSymbolIndexer2.ts] class C { - [s: Symbol]: string; + [s: symbol]: string; } //// [parserSymbolIndexer2.js] diff --git a/tests/baselines/reference/parserSymbolIndexer3.errors.txt b/tests/baselines/reference/parserSymbolIndexer3.errors.txt index f5066a09ee9..df3b9596f79 100644 --- a/tests/baselines/reference/parserSymbolIndexer3.errors.txt +++ b/tests/baselines/reference/parserSymbolIndexer3.errors.txt @@ -3,7 +3,7 @@ tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer3.ts(2,5): ==== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer3.ts (1 errors) ==== class C { - static [s: Symbol]: string; + static [s: symbol]: string; ~~~~~~ !!! error TS1145: Modifiers not permitted on index signature members. } \ No newline at end of file diff --git a/tests/baselines/reference/parserSymbolIndexer3.js b/tests/baselines/reference/parserSymbolIndexer3.js new file mode 100644 index 00000000000..917945193ae --- /dev/null +++ b/tests/baselines/reference/parserSymbolIndexer3.js @@ -0,0 +1,11 @@ +//// [parserSymbolIndexer3.ts] +class C { + static [s: symbol]: string; +} + +//// [parserSymbolIndexer3.js] +var C = (function () { + function C() { + } + return C; +})(); diff --git a/tests/baselines/reference/parserSymbolIndexer4.js b/tests/baselines/reference/parserSymbolIndexer4.js index 607b1ada481..21367ca5969 100644 --- a/tests/baselines/reference/parserSymbolIndexer4.js +++ b/tests/baselines/reference/parserSymbolIndexer4.js @@ -1,6 +1,6 @@ //// [parserSymbolIndexer4.ts] var x: { - [s: Symbol]: string; + [s: symbol]: string; } //// [parserSymbolIndexer4.js] diff --git a/tests/baselines/reference/parserSymbolIndexer5.errors.txt b/tests/baselines/reference/parserSymbolIndexer5.errors.txt index 611ad109a34..a8c19338e01 100644 --- a/tests/baselines/reference/parserSymbolIndexer5.errors.txt +++ b/tests/baselines/reference/parserSymbolIndexer5.errors.txt @@ -1,17 +1,20 @@ tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts(2,6): error TS2304: Cannot find name 's'. tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts(2,7): error TS1005: ']' expected. +tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts(2,9): error TS2304: Cannot find name 'symbol'. tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts(2,15): error TS1005: ',' expected. tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts(2,16): error TS1136: Property assignment expected. tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts(3,1): error TS1005: ':' expected. -==== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts (5 errors) ==== +==== tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts (6 errors) ==== var x = { - [s: Symbol]: "" + [s: symbol]: "" ~ !!! error TS2304: Cannot find name 's'. ~ !!! error TS1005: ']' expected. + ~~~~~~ +!!! error TS2304: Cannot find name 'symbol'. ~ !!! error TS1005: ',' expected. ~ diff --git a/tests/baselines/reference/parserSymbolIndexer5.js b/tests/baselines/reference/parserSymbolIndexer5.js new file mode 100644 index 00000000000..43c456b64aa --- /dev/null +++ b/tests/baselines/reference/parserSymbolIndexer5.js @@ -0,0 +1,10 @@ +//// [parserSymbolIndexer5.ts] +var x = { + [s: symbol]: "" +} + +//// [parserSymbolIndexer5.js] +var x = { + [s]: symbol, + "": +}; diff --git a/tests/baselines/reference/symbolProperty1.js b/tests/baselines/reference/symbolProperty1.js index e5189d0c88f..1537883f4ec 100644 --- a/tests/baselines/reference/symbolProperty1.js +++ b/tests/baselines/reference/symbolProperty1.js @@ -1,5 +1,5 @@ //// [symbolProperty1.ts] -var s: Symbol; +var s: symbol; var x = { [s]: 0, [s]() { }, diff --git a/tests/baselines/reference/symbolProperty17.js b/tests/baselines/reference/symbolProperty17.js index 9aa603910cd..549577c8d6c 100644 --- a/tests/baselines/reference/symbolProperty17.js +++ b/tests/baselines/reference/symbolProperty17.js @@ -1,7 +1,7 @@ //// [symbolProperty17.ts] interface I { [Symbol.iterator]: number; - [s: Symbol]: string; + [s: symbol]: string; "__@iterator": string; } diff --git a/tests/baselines/reference/symbolProperty29.js b/tests/baselines/reference/symbolProperty29.js index 87088daa0a4..f7fee99f6a1 100644 --- a/tests/baselines/reference/symbolProperty29.js +++ b/tests/baselines/reference/symbolProperty29.js @@ -3,7 +3,7 @@ class C1 { [Symbol.toStringTag]() { return { x: "" }; } - [s: Symbol]: () => { x: string }; + [s: symbol]: () => { x: string }; } //// [symbolProperty29.js] diff --git a/tests/baselines/reference/symbolProperty30.js b/tests/baselines/reference/symbolProperty30.js index daa08c51af1..bdb108015cf 100644 --- a/tests/baselines/reference/symbolProperty30.js +++ b/tests/baselines/reference/symbolProperty30.js @@ -3,7 +3,7 @@ class C1 { [Symbol.toStringTag]() { return { x: "" }; } - [s: Symbol]: () => { x: number }; + [s: symbol]: () => { x: number }; } //// [symbolProperty30.js] diff --git a/tests/baselines/reference/symbolProperty31.js b/tests/baselines/reference/symbolProperty31.js index 986f49ad6ff..cf532774652 100644 --- a/tests/baselines/reference/symbolProperty31.js +++ b/tests/baselines/reference/symbolProperty31.js @@ -5,7 +5,7 @@ class C1 { } } class C2 extends C1 { - [s: Symbol]: () => { x: string }; + [s: symbol]: () => { x: string }; } //// [symbolProperty31.js] diff --git a/tests/baselines/reference/symbolProperty32.js b/tests/baselines/reference/symbolProperty32.js index 260a88b41dd..73e4bffdc01 100644 --- a/tests/baselines/reference/symbolProperty32.js +++ b/tests/baselines/reference/symbolProperty32.js @@ -5,7 +5,7 @@ class C1 { } } class C2 extends C1 { - [s: Symbol]: () => { x: number }; + [s: symbol]: () => { x: number }; } //// [symbolProperty32.js] diff --git a/tests/baselines/reference/symbolProperty33.js b/tests/baselines/reference/symbolProperty33.js index f891ba271d1..f5a08010338 100644 --- a/tests/baselines/reference/symbolProperty33.js +++ b/tests/baselines/reference/symbolProperty33.js @@ -5,7 +5,7 @@ class C1 extends C2 { } } class C2 { - [s: Symbol]: () => { x: string }; + [s: symbol]: () => { x: string }; } //// [symbolProperty33.js] diff --git a/tests/baselines/reference/symbolProperty34.js b/tests/baselines/reference/symbolProperty34.js index 9a35db2c20f..5b25f487fbf 100644 --- a/tests/baselines/reference/symbolProperty34.js +++ b/tests/baselines/reference/symbolProperty34.js @@ -5,7 +5,7 @@ class C1 extends C2 { } } class C2 { - [s: Symbol]: () => { x: number }; + [s: symbol]: () => { x: number }; } //// [symbolProperty34.js] diff --git a/tests/baselines/reference/symbolProperty7.js b/tests/baselines/reference/symbolProperty7.js new file mode 100644 index 00000000000..42d19616ce3 --- /dev/null +++ b/tests/baselines/reference/symbolProperty7.js @@ -0,0 +1,26 @@ +//// [symbolProperty7.ts] +class C { + [Symbol()] = 0; + [Symbol()]: number; + [Symbol()]() { } + get [Symbol()]() { + return 0; + } +} + +//// [symbolProperty7.js] +var C = (function () { + function C() { + this[Symbol()] = 0; + } + C.prototype[Symbol()] = function () { + }; + Object.defineProperty(C.prototype, Symbol(), { + get: function () { + return 0; + }, + enumerable: true, + configurable: true + }); + return C; +})(); diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty1.ts b/tests/cases/conformance/es6/Symbols/symbolProperty1.ts index 033f1b5cbda..0e008511be3 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty1.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty1.ts @@ -1,5 +1,5 @@ //@target: ES6 -var s: Symbol; +var s: symbol; var x = { [s]: 0, [s]() { }, diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty17.ts b/tests/cases/conformance/es6/Symbols/symbolProperty17.ts index 450fbb70dd6..737059d0e3b 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty17.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty17.ts @@ -1,7 +1,7 @@ //@target: ES6 interface I { [Symbol.iterator]: number; - [s: Symbol]: string; + [s: symbol]: string; "__@iterator": string; } diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty29.ts b/tests/cases/conformance/es6/Symbols/symbolProperty29.ts index 43701b715f9..8d1b8491d37 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty29.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty29.ts @@ -3,5 +3,5 @@ class C1 { [Symbol.toStringTag]() { return { x: "" }; } - [s: Symbol]: () => { x: string }; + [s: symbol]: () => { x: string }; } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty30.ts b/tests/cases/conformance/es6/Symbols/symbolProperty30.ts index e2460604a87..a75f77d6056 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty30.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty30.ts @@ -3,5 +3,5 @@ class C1 { [Symbol.toStringTag]() { return { x: "" }; } - [s: Symbol]: () => { x: number }; + [s: symbol]: () => { x: number }; } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty31.ts b/tests/cases/conformance/es6/Symbols/symbolProperty31.ts index 6d39675bf52..d41f5d6b0fe 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty31.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty31.ts @@ -5,5 +5,5 @@ class C1 { } } class C2 extends C1 { - [s: Symbol]: () => { x: string }; + [s: symbol]: () => { x: string }; } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty32.ts b/tests/cases/conformance/es6/Symbols/symbolProperty32.ts index 873187ff614..52da68fc57c 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty32.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty32.ts @@ -5,5 +5,5 @@ class C1 { } } class C2 extends C1 { - [s: Symbol]: () => { x: number }; + [s: symbol]: () => { x: number }; } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty33.ts b/tests/cases/conformance/es6/Symbols/symbolProperty33.ts index 12669f89d6f..8c7a4d274f3 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty33.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty33.ts @@ -5,5 +5,5 @@ class C1 extends C2 { } } class C2 { - [s: Symbol]: () => { x: string }; + [s: symbol]: () => { x: string }; } \ No newline at end of file diff --git a/tests/cases/conformance/es6/Symbols/symbolProperty34.ts b/tests/cases/conformance/es6/Symbols/symbolProperty34.ts index 5d41b87002d..6e8bb521f0a 100644 --- a/tests/cases/conformance/es6/Symbols/symbolProperty34.ts +++ b/tests/cases/conformance/es6/Symbols/symbolProperty34.ts @@ -5,5 +5,5 @@ class C1 extends C2 { } } class C2 { - [s: Symbol]: () => { x: number }; + [s: symbol]: () => { x: number }; } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer1.ts b/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer1.ts index f90f804a615..5c10e2d487b 100644 --- a/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer1.ts +++ b/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer1.ts @@ -1,4 +1,4 @@ //@target: ES5 interface I { - [s: Symbol]: string; + [s: symbol]: string; } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer2.ts b/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer2.ts index 1f13320f5d1..e5d29c08f7d 100644 --- a/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer2.ts +++ b/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer2.ts @@ -1,4 +1,4 @@ //@target: ES5 class C { - [s: Symbol]: string; + [s: symbol]: string; } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer3.ts b/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer3.ts index 1e3829f9e40..d4bd13aa1d6 100644 --- a/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer3.ts +++ b/tests/cases/conformance/parser/ecmascript5/Symbols/parserES5SymbolIndexer3.ts @@ -1,4 +1,4 @@ //@target: ES5 var x: { - [s: Symbol]: string; + [s: symbol]: string; } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer1.ts b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer1.ts index 668ebb496f4..805584ef078 100644 --- a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer1.ts +++ b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer1.ts @@ -1,4 +1,4 @@ //@target: ES6 interface I { - [s: Symbol]: string; + [s: symbol]: string; } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer2.ts b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer2.ts index cf4ee50974e..c593d0a4b0a 100644 --- a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer2.ts +++ b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer2.ts @@ -1,4 +1,4 @@ //@target: ES6 class C { - [s: Symbol]: string; + [s: symbol]: string; } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer3.ts b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer3.ts index f7f7154af35..183ecea6e63 100644 --- a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer3.ts +++ b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer3.ts @@ -1,4 +1,4 @@ //@target: ES6 class C { - static [s: Symbol]: string; + static [s: symbol]: string; } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer4.ts b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer4.ts index 99e8112ce55..c6f9077f648 100644 --- a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer4.ts +++ b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer4.ts @@ -1,4 +1,4 @@ //@target: ES6 var x: { - [s: Symbol]: string; + [s: symbol]: string; } \ No newline at end of file diff --git a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts index 8c468043a8f..a028a3b6488 100644 --- a/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts +++ b/tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts @@ -1,4 +1,4 @@ //@target: ES6 var x = { - [s: Symbol]: "" + [s: symbol]: "" } \ No newline at end of file