diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index dd26ef281c4bb..005985b0d0cbf 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -162,6 +162,11 @@ module ts { Import_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_or_import_d_from_mod_instead: { code: 1202, category: DiagnosticCategory.Error, key: "Import assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'import * as ns from \"mod\"', 'import {a} from \"mod\"' or 'import d from \"mod\"' instead." }, Export_assignment_cannot_be_used_when_targeting_ECMAScript_6_or_higher_Consider_using_export_default_instead: { code: 1203, category: DiagnosticCategory.Error, key: "Export assignment cannot be used when targeting ECMAScript 6 or higher. Consider using 'export default' instead." }, Cannot_compile_external_modules_into_amd_or_commonjs_when_targeting_es6_or_higher: { code: 1204, category: DiagnosticCategory.Error, key: "Cannot compile external modules into amd or commonjs when targeting es6 or higher." }, + Decorators_are_only_supported_on_class_members_when_targeting_ECMAScript_5_or_higher: { code: 1205, category: DiagnosticCategory.Error, key: "Decorators are only supported on class members when targeting ECMAScript 5 or higher." }, + Decorators_are_not_valid_on_this_declaration_type: { code: 1206, category: DiagnosticCategory.Error, key: "Decorators are not valid on this declaration type." }, + Argument_to_ambient_decorator_must_be_constant_expression: { code: 1207, category: DiagnosticCategory.Error, key: "Argument to ambient decorator must be constant expression." }, + Decorators_may_not_change_the_type_of_a_member: { code: 1208, category: DiagnosticCategory.Error, key: "Decorators may not change the type of a member." }, + Decorators_may_not_change_the_type_of_a_class: { code: 1209, category: DiagnosticCategory.Error, key: "Decorators may not change the type of a class." }, Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." }, Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." }, Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e1767fe8de044..3dee5320eec4d 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -639,6 +639,26 @@ "category": "Error", "code": 1204 }, + "Decorators are only supported on class members when targeting ECMAScript 5 or higher.": { + "category": "Error", + "code": 1205 + }, + "Decorators are not valid on this declaration type.": { + "category": "Error", + "code": 1206 + }, + "Argument to ambient decorator must be constant expression.": { + "category": "Error", + "code": 1207 + }, + "Decorators may not change the type of a member.": { + "category": "Error", + "code": 1208 + }, + "Decorators may not change the type of a class.": { + "category": "Error", + "code": 1209 + }, "Duplicate identifier '{0}'.": { "category": "Error", diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 575c2bdaf36d1..12a0a7c077058 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -111,192 +111,195 @@ declare module "typescript" { BarBarToken = 49, QuestionToken = 50, ColonToken = 51, - EqualsToken = 52, - PlusEqualsToken = 53, - MinusEqualsToken = 54, - AsteriskEqualsToken = 55, - SlashEqualsToken = 56, - PercentEqualsToken = 57, - LessThanLessThanEqualsToken = 58, - GreaterThanGreaterThanEqualsToken = 59, - GreaterThanGreaterThanGreaterThanEqualsToken = 60, - AmpersandEqualsToken = 61, - BarEqualsToken = 62, - CaretEqualsToken = 63, - Identifier = 64, - BreakKeyword = 65, - CaseKeyword = 66, - CatchKeyword = 67, - ClassKeyword = 68, - ConstKeyword = 69, - ContinueKeyword = 70, - DebuggerKeyword = 71, - DefaultKeyword = 72, - DeleteKeyword = 73, - DoKeyword = 74, - ElseKeyword = 75, - EnumKeyword = 76, - ExportKeyword = 77, - ExtendsKeyword = 78, - FalseKeyword = 79, - FinallyKeyword = 80, - ForKeyword = 81, - FunctionKeyword = 82, - IfKeyword = 83, - ImportKeyword = 84, - InKeyword = 85, - InstanceOfKeyword = 86, - NewKeyword = 87, - NullKeyword = 88, - ReturnKeyword = 89, - SuperKeyword = 90, - SwitchKeyword = 91, - ThisKeyword = 92, - ThrowKeyword = 93, - TrueKeyword = 94, - TryKeyword = 95, - TypeOfKeyword = 96, - VarKeyword = 97, - VoidKeyword = 98, - WhileKeyword = 99, - WithKeyword = 100, - AsKeyword = 101, - ImplementsKeyword = 102, - InterfaceKeyword = 103, - LetKeyword = 104, - PackageKeyword = 105, - PrivateKeyword = 106, - ProtectedKeyword = 107, - PublicKeyword = 108, - StaticKeyword = 109, - YieldKeyword = 110, - AnyKeyword = 111, - BooleanKeyword = 112, - ConstructorKeyword = 113, - DeclareKeyword = 114, - GetKeyword = 115, - ModuleKeyword = 116, - RequireKeyword = 117, - NumberKeyword = 118, - SetKeyword = 119, - StringKeyword = 120, - SymbolKeyword = 121, - TypeKeyword = 122, - FromKeyword = 123, - OfKeyword = 124, - QualifiedName = 125, - ComputedPropertyName = 126, - TypeParameter = 127, - Parameter = 128, - PropertySignature = 129, - PropertyDeclaration = 130, - MethodSignature = 131, - MethodDeclaration = 132, - Constructor = 133, - GetAccessor = 134, - SetAccessor = 135, - CallSignature = 136, - ConstructSignature = 137, - IndexSignature = 138, - TypeReference = 139, - FunctionType = 140, - ConstructorType = 141, - TypeQuery = 142, - TypeLiteral = 143, - ArrayType = 144, - TupleType = 145, - UnionType = 146, - ParenthesizedType = 147, - ObjectBindingPattern = 148, - ArrayBindingPattern = 149, - BindingElement = 150, - ArrayLiteralExpression = 151, - ObjectLiteralExpression = 152, - PropertyAccessExpression = 153, - ElementAccessExpression = 154, - CallExpression = 155, - NewExpression = 156, - TaggedTemplateExpression = 157, - TypeAssertionExpression = 158, - ParenthesizedExpression = 159, - FunctionExpression = 160, - ArrowFunction = 161, - DeleteExpression = 162, - TypeOfExpression = 163, - VoidExpression = 164, - PrefixUnaryExpression = 165, - PostfixUnaryExpression = 166, - BinaryExpression = 167, - ConditionalExpression = 168, - TemplateExpression = 169, - YieldExpression = 170, - SpreadElementExpression = 171, - OmittedExpression = 172, - TemplateSpan = 173, - Block = 174, - VariableStatement = 175, - EmptyStatement = 176, - ExpressionStatement = 177, - IfStatement = 178, - DoStatement = 179, - WhileStatement = 180, - ForStatement = 181, - ForInStatement = 182, - ForOfStatement = 183, - ContinueStatement = 184, - BreakStatement = 185, - ReturnStatement = 186, - WithStatement = 187, - SwitchStatement = 188, - LabeledStatement = 189, - ThrowStatement = 190, - TryStatement = 191, - DebuggerStatement = 192, - VariableDeclaration = 193, - VariableDeclarationList = 194, - FunctionDeclaration = 195, - ClassDeclaration = 196, - InterfaceDeclaration = 197, - TypeAliasDeclaration = 198, - EnumDeclaration = 199, - ModuleDeclaration = 200, - ModuleBlock = 201, - CaseBlock = 202, - ImportEqualsDeclaration = 203, - ImportDeclaration = 204, - ImportClause = 205, - NamespaceImport = 206, - NamedImports = 207, - ImportSpecifier = 208, - ExportAssignment = 209, - ExportDeclaration = 210, - NamedExports = 211, - ExportSpecifier = 212, - ExternalModuleReference = 213, - CaseClause = 214, - DefaultClause = 215, - HeritageClause = 216, - CatchClause = 217, - PropertyAssignment = 218, - ShorthandPropertyAssignment = 219, - EnumMember = 220, - SourceFile = 221, - SyntaxList = 222, - Count = 223, - FirstAssignment = 52, - LastAssignment = 63, - FirstReservedWord = 65, - LastReservedWord = 100, - FirstKeyword = 65, - LastKeyword = 124, - FirstFutureReservedWord = 102, - LastFutureReservedWord = 110, - FirstTypeNode = 139, - LastTypeNode = 147, + AtToken = 52, + EqualsToken = 53, + PlusEqualsToken = 54, + MinusEqualsToken = 55, + AsteriskEqualsToken = 56, + SlashEqualsToken = 57, + PercentEqualsToken = 58, + LessThanLessThanEqualsToken = 59, + GreaterThanGreaterThanEqualsToken = 60, + GreaterThanGreaterThanGreaterThanEqualsToken = 61, + AmpersandEqualsToken = 62, + BarEqualsToken = 63, + CaretEqualsToken = 64, + Identifier = 65, + BreakKeyword = 66, + CaseKeyword = 67, + CatchKeyword = 68, + ClassKeyword = 69, + ConstKeyword = 70, + ContinueKeyword = 71, + DebuggerKeyword = 72, + DefaultKeyword = 73, + DeleteKeyword = 74, + DoKeyword = 75, + ElseKeyword = 76, + EnumKeyword = 77, + ExportKeyword = 78, + ExtendsKeyword = 79, + FalseKeyword = 80, + FinallyKeyword = 81, + ForKeyword = 82, + FunctionKeyword = 83, + IfKeyword = 84, + ImportKeyword = 85, + InKeyword = 86, + InstanceOfKeyword = 87, + NewKeyword = 88, + NullKeyword = 89, + ReturnKeyword = 90, + SuperKeyword = 91, + SwitchKeyword = 92, + ThisKeyword = 93, + ThrowKeyword = 94, + TrueKeyword = 95, + TryKeyword = 96, + TypeOfKeyword = 97, + VarKeyword = 98, + VoidKeyword = 99, + WhileKeyword = 100, + WithKeyword = 101, + AsKeyword = 102, + ImplementsKeyword = 103, + InterfaceKeyword = 104, + LetKeyword = 105, + PackageKeyword = 106, + PrivateKeyword = 107, + ProtectedKeyword = 108, + PublicKeyword = 109, + StaticKeyword = 110, + YieldKeyword = 111, + AnyKeyword = 112, + BooleanKeyword = 113, + ConstructorKeyword = 114, + DeclareKeyword = 115, + GetKeyword = 116, + ModuleKeyword = 117, + RequireKeyword = 118, + NumberKeyword = 119, + SetKeyword = 120, + StringKeyword = 121, + SymbolKeyword = 122, + TypeKeyword = 123, + FromKeyword = 124, + OfKeyword = 125, + QualifiedName = 126, + ComputedPropertyName = 127, + TypeParameter = 128, + Parameter = 129, + Decorator = 130, + PropertySignature = 131, + PropertyDeclaration = 132, + MethodSignature = 133, + MethodDeclaration = 134, + Constructor = 135, + GetAccessor = 136, + SetAccessor = 137, + CallSignature = 138, + ConstructSignature = 139, + IndexSignature = 140, + TypeReference = 141, + FunctionType = 142, + ConstructorType = 143, + TypeQuery = 144, + TypeLiteral = 145, + ArrayType = 146, + TupleType = 147, + UnionType = 148, + ParenthesizedType = 149, + ObjectBindingPattern = 150, + ArrayBindingPattern = 151, + BindingElement = 152, + ArrayLiteralExpression = 153, + ObjectLiteralExpression = 154, + PropertyAccessExpression = 155, + ElementAccessExpression = 156, + CallExpression = 157, + NewExpression = 158, + TaggedTemplateExpression = 159, + TypeAssertionExpression = 160, + ParenthesizedExpression = 161, + FunctionExpression = 162, + ArrowFunction = 163, + DeleteExpression = 164, + TypeOfExpression = 165, + VoidExpression = 166, + PrefixUnaryExpression = 167, + PostfixUnaryExpression = 168, + BinaryExpression = 169, + ConditionalExpression = 170, + TemplateExpression = 171, + YieldExpression = 172, + SpreadElementExpression = 173, + OmittedExpression = 174, + TemplateSpan = 175, + Block = 176, + VariableStatement = 177, + EmptyStatement = 178, + ExpressionStatement = 179, + IfStatement = 180, + DoStatement = 181, + WhileStatement = 182, + ForStatement = 183, + ForInStatement = 184, + ForOfStatement = 185, + ContinueStatement = 186, + BreakStatement = 187, + ReturnStatement = 188, + WithStatement = 189, + SwitchStatement = 190, + LabeledStatement = 191, + ThrowStatement = 192, + TryStatement = 193, + DebuggerStatement = 194, + VariableDeclaration = 195, + VariableDeclarationList = 196, + FunctionDeclaration = 197, + ClassDeclaration = 198, + InterfaceDeclaration = 199, + TypeAliasDeclaration = 200, + EnumDeclaration = 201, + ModuleDeclaration = 202, + ModuleBlock = 203, + CaseBlock = 204, + ImportEqualsDeclaration = 205, + ImportDeclaration = 206, + ImportClause = 207, + NamespaceImport = 208, + NamedImports = 209, + ImportSpecifier = 210, + ExportAssignment = 211, + ExportDeclaration = 212, + NamedExports = 213, + ExportSpecifier = 214, + IncompleteDeclaration = 215, + ExternalModuleReference = 216, + CaseClause = 217, + DefaultClause = 218, + HeritageClause = 219, + CatchClause = 220, + PropertyAssignment = 221, + ShorthandPropertyAssignment = 222, + EnumMember = 223, + SourceFile = 224, + SyntaxList = 225, + Count = 226, + FirstAssignment = 53, + LastAssignment = 64, + FirstReservedWord = 66, + LastReservedWord = 101, + FirstKeyword = 66, + LastKeyword = 125, + FirstFutureReservedWord = 103, + LastFutureReservedWord = 111, + FirstTypeNode = 141, + LastTypeNode = 149, FirstPunctuation = 14, - LastPunctuation = 63, + LastPunctuation = 64, FirstToken = 0, - LastToken = 124, + LastToken = 125, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -304,8 +307,8 @@ declare module "typescript" { FirstTemplateToken = 10, LastTemplateToken = 13, FirstBinaryOperator = 24, - LastBinaryOperator = 63, - FirstNode = 125, + LastBinaryOperator = 64, + FirstNode = 126, } const enum NodeFlags { Export = 1, @@ -330,10 +333,11 @@ declare module "typescript" { DisallowIn = 2, Yield = 4, GeneratorParameter = 8, - ThisNodeHasError = 16, - ParserGeneratedFlags = 31, - ThisNodeOrAnySubNodesHasError = 32, - HasAggregatedChildData = 64, + Decorator = 16, + ThisNodeHasError = 32, + ParserGeneratedFlags = 63, + ThisNodeOrAnySubNodesHasError = 64, + HasAggregatedChildData = 128, } const enum RelationComparisonResult { Succeeded = 1, @@ -344,6 +348,7 @@ declare module "typescript" { kind: SyntaxKind; flags: NodeFlags; parserContextFlags?: ParserContextFlags; + decorators?: NodeArray; modifiers?: ModifiersArray; id?: number; parent?: Node; @@ -374,6 +379,10 @@ declare module "typescript" { interface ComputedPropertyName extends Node { expression: Expression; } + interface Decorator extends Node { + atToken: Node; + expression: LeftHandSideExpression; + } interface TypeParameterDeclaration extends Declaration { name: Identifier; constraint?: TypeNode; @@ -576,7 +585,9 @@ declare module "typescript" { expression: Expression; } interface ArrayLiteralExpression extends PrimaryExpression { + openBracketToken: Node; elements: NodeArray; + closeBracketToken: Node; } interface SpreadElementExpression extends Expression { expression: Expression; @@ -591,7 +602,9 @@ declare module "typescript" { } interface ElementAccessExpression extends MemberExpression { expression: LeftHandSideExpression; + openBracketToken: Node; argumentExpression?: Expression; + closeBracketToken: Node; } interface CallExpression extends LeftHandSideExpression { expression: LeftHandSideExpression; diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index 336d70aa1a196..0b00bbc191c54 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -351,562 +351,571 @@ declare module "typescript" { ColonToken = 51, >ColonToken : SyntaxKind - EqualsToken = 52, + AtToken = 52, +>AtToken : SyntaxKind + + EqualsToken = 53, >EqualsToken : SyntaxKind - PlusEqualsToken = 53, + PlusEqualsToken = 54, >PlusEqualsToken : SyntaxKind - MinusEqualsToken = 54, + MinusEqualsToken = 55, >MinusEqualsToken : SyntaxKind - AsteriskEqualsToken = 55, + AsteriskEqualsToken = 56, >AsteriskEqualsToken : SyntaxKind - SlashEqualsToken = 56, + SlashEqualsToken = 57, >SlashEqualsToken : SyntaxKind - PercentEqualsToken = 57, + PercentEqualsToken = 58, >PercentEqualsToken : SyntaxKind - LessThanLessThanEqualsToken = 58, + LessThanLessThanEqualsToken = 59, >LessThanLessThanEqualsToken : SyntaxKind - GreaterThanGreaterThanEqualsToken = 59, + GreaterThanGreaterThanEqualsToken = 60, >GreaterThanGreaterThanEqualsToken : SyntaxKind - GreaterThanGreaterThanGreaterThanEqualsToken = 60, + GreaterThanGreaterThanGreaterThanEqualsToken = 61, >GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - AmpersandEqualsToken = 61, + AmpersandEqualsToken = 62, >AmpersandEqualsToken : SyntaxKind - BarEqualsToken = 62, + BarEqualsToken = 63, >BarEqualsToken : SyntaxKind - CaretEqualsToken = 63, + CaretEqualsToken = 64, >CaretEqualsToken : SyntaxKind - Identifier = 64, + Identifier = 65, >Identifier : SyntaxKind - BreakKeyword = 65, + BreakKeyword = 66, >BreakKeyword : SyntaxKind - CaseKeyword = 66, + CaseKeyword = 67, >CaseKeyword : SyntaxKind - CatchKeyword = 67, + CatchKeyword = 68, >CatchKeyword : SyntaxKind - ClassKeyword = 68, + ClassKeyword = 69, >ClassKeyword : SyntaxKind - ConstKeyword = 69, + ConstKeyword = 70, >ConstKeyword : SyntaxKind - ContinueKeyword = 70, + ContinueKeyword = 71, >ContinueKeyword : SyntaxKind - DebuggerKeyword = 71, + DebuggerKeyword = 72, >DebuggerKeyword : SyntaxKind - DefaultKeyword = 72, + DefaultKeyword = 73, >DefaultKeyword : SyntaxKind - DeleteKeyword = 73, + DeleteKeyword = 74, >DeleteKeyword : SyntaxKind - DoKeyword = 74, + DoKeyword = 75, >DoKeyword : SyntaxKind - ElseKeyword = 75, + ElseKeyword = 76, >ElseKeyword : SyntaxKind - EnumKeyword = 76, + EnumKeyword = 77, >EnumKeyword : SyntaxKind - ExportKeyword = 77, + ExportKeyword = 78, >ExportKeyword : SyntaxKind - ExtendsKeyword = 78, + ExtendsKeyword = 79, >ExtendsKeyword : SyntaxKind - FalseKeyword = 79, + FalseKeyword = 80, >FalseKeyword : SyntaxKind - FinallyKeyword = 80, + FinallyKeyword = 81, >FinallyKeyword : SyntaxKind - ForKeyword = 81, + ForKeyword = 82, >ForKeyword : SyntaxKind - FunctionKeyword = 82, + FunctionKeyword = 83, >FunctionKeyword : SyntaxKind - IfKeyword = 83, + IfKeyword = 84, >IfKeyword : SyntaxKind - ImportKeyword = 84, + ImportKeyword = 85, >ImportKeyword : SyntaxKind - InKeyword = 85, + InKeyword = 86, >InKeyword : SyntaxKind - InstanceOfKeyword = 86, + InstanceOfKeyword = 87, >InstanceOfKeyword : SyntaxKind - NewKeyword = 87, + NewKeyword = 88, >NewKeyword : SyntaxKind - NullKeyword = 88, + NullKeyword = 89, >NullKeyword : SyntaxKind - ReturnKeyword = 89, + ReturnKeyword = 90, >ReturnKeyword : SyntaxKind - SuperKeyword = 90, + SuperKeyword = 91, >SuperKeyword : SyntaxKind - SwitchKeyword = 91, + SwitchKeyword = 92, >SwitchKeyword : SyntaxKind - ThisKeyword = 92, + ThisKeyword = 93, >ThisKeyword : SyntaxKind - ThrowKeyword = 93, + ThrowKeyword = 94, >ThrowKeyword : SyntaxKind - TrueKeyword = 94, + TrueKeyword = 95, >TrueKeyword : SyntaxKind - TryKeyword = 95, + TryKeyword = 96, >TryKeyword : SyntaxKind - TypeOfKeyword = 96, + TypeOfKeyword = 97, >TypeOfKeyword : SyntaxKind - VarKeyword = 97, + VarKeyword = 98, >VarKeyword : SyntaxKind - VoidKeyword = 98, + VoidKeyword = 99, >VoidKeyword : SyntaxKind - WhileKeyword = 99, + WhileKeyword = 100, >WhileKeyword : SyntaxKind - WithKeyword = 100, + WithKeyword = 101, >WithKeyword : SyntaxKind - AsKeyword = 101, + AsKeyword = 102, >AsKeyword : SyntaxKind - ImplementsKeyword = 102, + ImplementsKeyword = 103, >ImplementsKeyword : SyntaxKind - InterfaceKeyword = 103, + InterfaceKeyword = 104, >InterfaceKeyword : SyntaxKind - LetKeyword = 104, + LetKeyword = 105, >LetKeyword : SyntaxKind - PackageKeyword = 105, + PackageKeyword = 106, >PackageKeyword : SyntaxKind - PrivateKeyword = 106, + PrivateKeyword = 107, >PrivateKeyword : SyntaxKind - ProtectedKeyword = 107, + ProtectedKeyword = 108, >ProtectedKeyword : SyntaxKind - PublicKeyword = 108, + PublicKeyword = 109, >PublicKeyword : SyntaxKind - StaticKeyword = 109, + StaticKeyword = 110, >StaticKeyword : SyntaxKind - YieldKeyword = 110, + YieldKeyword = 111, >YieldKeyword : SyntaxKind - AnyKeyword = 111, + AnyKeyword = 112, >AnyKeyword : SyntaxKind - BooleanKeyword = 112, + BooleanKeyword = 113, >BooleanKeyword : SyntaxKind - ConstructorKeyword = 113, + ConstructorKeyword = 114, >ConstructorKeyword : SyntaxKind - DeclareKeyword = 114, + DeclareKeyword = 115, >DeclareKeyword : SyntaxKind - GetKeyword = 115, + GetKeyword = 116, >GetKeyword : SyntaxKind - ModuleKeyword = 116, + ModuleKeyword = 117, >ModuleKeyword : SyntaxKind - RequireKeyword = 117, + RequireKeyword = 118, >RequireKeyword : SyntaxKind - NumberKeyword = 118, + NumberKeyword = 119, >NumberKeyword : SyntaxKind - SetKeyword = 119, + SetKeyword = 120, >SetKeyword : SyntaxKind - StringKeyword = 120, + StringKeyword = 121, >StringKeyword : SyntaxKind - SymbolKeyword = 121, + SymbolKeyword = 122, >SymbolKeyword : SyntaxKind - TypeKeyword = 122, + TypeKeyword = 123, >TypeKeyword : SyntaxKind - FromKeyword = 123, + FromKeyword = 124, >FromKeyword : SyntaxKind - OfKeyword = 124, + OfKeyword = 125, >OfKeyword : SyntaxKind - QualifiedName = 125, + QualifiedName = 126, >QualifiedName : SyntaxKind - ComputedPropertyName = 126, + ComputedPropertyName = 127, >ComputedPropertyName : SyntaxKind - TypeParameter = 127, + TypeParameter = 128, >TypeParameter : SyntaxKind - Parameter = 128, + Parameter = 129, >Parameter : SyntaxKind - PropertySignature = 129, + Decorator = 130, +>Decorator : SyntaxKind + + PropertySignature = 131, >PropertySignature : SyntaxKind - PropertyDeclaration = 130, + PropertyDeclaration = 132, >PropertyDeclaration : SyntaxKind - MethodSignature = 131, + MethodSignature = 133, >MethodSignature : SyntaxKind - MethodDeclaration = 132, + MethodDeclaration = 134, >MethodDeclaration : SyntaxKind - Constructor = 133, + Constructor = 135, >Constructor : SyntaxKind - GetAccessor = 134, + GetAccessor = 136, >GetAccessor : SyntaxKind - SetAccessor = 135, + SetAccessor = 137, >SetAccessor : SyntaxKind - CallSignature = 136, + CallSignature = 138, >CallSignature : SyntaxKind - ConstructSignature = 137, + ConstructSignature = 139, >ConstructSignature : SyntaxKind - IndexSignature = 138, + IndexSignature = 140, >IndexSignature : SyntaxKind - TypeReference = 139, + TypeReference = 141, >TypeReference : SyntaxKind - FunctionType = 140, + FunctionType = 142, >FunctionType : SyntaxKind - ConstructorType = 141, + ConstructorType = 143, >ConstructorType : SyntaxKind - TypeQuery = 142, + TypeQuery = 144, >TypeQuery : SyntaxKind - TypeLiteral = 143, + TypeLiteral = 145, >TypeLiteral : SyntaxKind - ArrayType = 144, + ArrayType = 146, >ArrayType : SyntaxKind - TupleType = 145, + TupleType = 147, >TupleType : SyntaxKind - UnionType = 146, + UnionType = 148, >UnionType : SyntaxKind - ParenthesizedType = 147, + ParenthesizedType = 149, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 148, + ObjectBindingPattern = 150, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 149, + ArrayBindingPattern = 151, >ArrayBindingPattern : SyntaxKind - BindingElement = 150, + BindingElement = 152, >BindingElement : SyntaxKind - ArrayLiteralExpression = 151, + ArrayLiteralExpression = 153, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 152, + ObjectLiteralExpression = 154, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 153, + PropertyAccessExpression = 155, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 154, + ElementAccessExpression = 156, >ElementAccessExpression : SyntaxKind - CallExpression = 155, + CallExpression = 157, >CallExpression : SyntaxKind - NewExpression = 156, + NewExpression = 158, >NewExpression : SyntaxKind - TaggedTemplateExpression = 157, + TaggedTemplateExpression = 159, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 158, + TypeAssertionExpression = 160, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 159, + ParenthesizedExpression = 161, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 160, + FunctionExpression = 162, >FunctionExpression : SyntaxKind - ArrowFunction = 161, + ArrowFunction = 163, >ArrowFunction : SyntaxKind - DeleteExpression = 162, + DeleteExpression = 164, >DeleteExpression : SyntaxKind - TypeOfExpression = 163, + TypeOfExpression = 165, >TypeOfExpression : SyntaxKind - VoidExpression = 164, + VoidExpression = 166, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 165, + PrefixUnaryExpression = 167, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 166, + PostfixUnaryExpression = 168, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 167, + BinaryExpression = 169, >BinaryExpression : SyntaxKind - ConditionalExpression = 168, + ConditionalExpression = 170, >ConditionalExpression : SyntaxKind - TemplateExpression = 169, + TemplateExpression = 171, >TemplateExpression : SyntaxKind - YieldExpression = 170, + YieldExpression = 172, >YieldExpression : SyntaxKind - SpreadElementExpression = 171, + SpreadElementExpression = 173, >SpreadElementExpression : SyntaxKind - OmittedExpression = 172, + OmittedExpression = 174, >OmittedExpression : SyntaxKind - TemplateSpan = 173, + TemplateSpan = 175, >TemplateSpan : SyntaxKind - Block = 174, + Block = 176, >Block : SyntaxKind - VariableStatement = 175, + VariableStatement = 177, >VariableStatement : SyntaxKind - EmptyStatement = 176, + EmptyStatement = 178, >EmptyStatement : SyntaxKind - ExpressionStatement = 177, + ExpressionStatement = 179, >ExpressionStatement : SyntaxKind - IfStatement = 178, + IfStatement = 180, >IfStatement : SyntaxKind - DoStatement = 179, + DoStatement = 181, >DoStatement : SyntaxKind - WhileStatement = 180, + WhileStatement = 182, >WhileStatement : SyntaxKind - ForStatement = 181, + ForStatement = 183, >ForStatement : SyntaxKind - ForInStatement = 182, + ForInStatement = 184, >ForInStatement : SyntaxKind - ForOfStatement = 183, + ForOfStatement = 185, >ForOfStatement : SyntaxKind - ContinueStatement = 184, + ContinueStatement = 186, >ContinueStatement : SyntaxKind - BreakStatement = 185, + BreakStatement = 187, >BreakStatement : SyntaxKind - ReturnStatement = 186, + ReturnStatement = 188, >ReturnStatement : SyntaxKind - WithStatement = 187, + WithStatement = 189, >WithStatement : SyntaxKind - SwitchStatement = 188, + SwitchStatement = 190, >SwitchStatement : SyntaxKind - LabeledStatement = 189, + LabeledStatement = 191, >LabeledStatement : SyntaxKind - ThrowStatement = 190, + ThrowStatement = 192, >ThrowStatement : SyntaxKind - TryStatement = 191, + TryStatement = 193, >TryStatement : SyntaxKind - DebuggerStatement = 192, + DebuggerStatement = 194, >DebuggerStatement : SyntaxKind - VariableDeclaration = 193, + VariableDeclaration = 195, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 194, + VariableDeclarationList = 196, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 195, + FunctionDeclaration = 197, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 196, + ClassDeclaration = 198, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 197, + InterfaceDeclaration = 199, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 198, + TypeAliasDeclaration = 200, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 199, + EnumDeclaration = 201, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 200, + ModuleDeclaration = 202, >ModuleDeclaration : SyntaxKind - ModuleBlock = 201, + ModuleBlock = 203, >ModuleBlock : SyntaxKind - CaseBlock = 202, + CaseBlock = 204, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 203, + ImportEqualsDeclaration = 205, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 204, + ImportDeclaration = 206, >ImportDeclaration : SyntaxKind - ImportClause = 205, + ImportClause = 207, >ImportClause : SyntaxKind - NamespaceImport = 206, + NamespaceImport = 208, >NamespaceImport : SyntaxKind - NamedImports = 207, + NamedImports = 209, >NamedImports : SyntaxKind - ImportSpecifier = 208, + ImportSpecifier = 210, >ImportSpecifier : SyntaxKind - ExportAssignment = 209, + ExportAssignment = 211, >ExportAssignment : SyntaxKind - ExportDeclaration = 210, + ExportDeclaration = 212, >ExportDeclaration : SyntaxKind - NamedExports = 211, + NamedExports = 213, >NamedExports : SyntaxKind - ExportSpecifier = 212, + ExportSpecifier = 214, >ExportSpecifier : SyntaxKind - ExternalModuleReference = 213, + IncompleteDeclaration = 215, +>IncompleteDeclaration : SyntaxKind + + ExternalModuleReference = 216, >ExternalModuleReference : SyntaxKind - CaseClause = 214, + CaseClause = 217, >CaseClause : SyntaxKind - DefaultClause = 215, + DefaultClause = 218, >DefaultClause : SyntaxKind - HeritageClause = 216, + HeritageClause = 219, >HeritageClause : SyntaxKind - CatchClause = 217, + CatchClause = 220, >CatchClause : SyntaxKind - PropertyAssignment = 218, + PropertyAssignment = 221, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 219, + ShorthandPropertyAssignment = 222, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 220, + EnumMember = 223, >EnumMember : SyntaxKind - SourceFile = 221, + SourceFile = 224, >SourceFile : SyntaxKind - SyntaxList = 222, + SyntaxList = 225, >SyntaxList : SyntaxKind - Count = 223, + Count = 226, >Count : SyntaxKind - FirstAssignment = 52, + FirstAssignment = 53, >FirstAssignment : SyntaxKind - LastAssignment = 63, + LastAssignment = 64, >LastAssignment : SyntaxKind - FirstReservedWord = 65, + FirstReservedWord = 66, >FirstReservedWord : SyntaxKind - LastReservedWord = 100, + LastReservedWord = 101, >LastReservedWord : SyntaxKind - FirstKeyword = 65, + FirstKeyword = 66, >FirstKeyword : SyntaxKind - LastKeyword = 124, + LastKeyword = 125, >LastKeyword : SyntaxKind - FirstFutureReservedWord = 102, + FirstFutureReservedWord = 103, >FirstFutureReservedWord : SyntaxKind - LastFutureReservedWord = 110, + LastFutureReservedWord = 111, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 139, + FirstTypeNode = 141, >FirstTypeNode : SyntaxKind - LastTypeNode = 147, + LastTypeNode = 149, >LastTypeNode : SyntaxKind FirstPunctuation = 14, >FirstPunctuation : SyntaxKind - LastPunctuation = 63, + LastPunctuation = 64, >LastPunctuation : SyntaxKind FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 124, + LastToken = 125, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -930,10 +939,10 @@ declare module "typescript" { FirstBinaryOperator = 24, >FirstBinaryOperator : SyntaxKind - LastBinaryOperator = 63, + LastBinaryOperator = 64, >LastBinaryOperator : SyntaxKind - FirstNode = 125, + FirstNode = 126, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -1002,16 +1011,19 @@ declare module "typescript" { GeneratorParameter = 8, >GeneratorParameter : ParserContextFlags - ThisNodeHasError = 16, + Decorator = 16, +>Decorator : ParserContextFlags + + ThisNodeHasError = 32, >ThisNodeHasError : ParserContextFlags - ParserGeneratedFlags = 31, + ParserGeneratedFlags = 63, >ParserGeneratedFlags : ParserContextFlags - ThisNodeOrAnySubNodesHasError = 32, + ThisNodeOrAnySubNodesHasError = 64, >ThisNodeOrAnySubNodesHasError : ParserContextFlags - HasAggregatedChildData = 64, + HasAggregatedChildData = 128, >HasAggregatedChildData : ParserContextFlags } const enum RelationComparisonResult { @@ -1042,6 +1054,11 @@ declare module "typescript" { >parserContextFlags : ParserContextFlags >ParserContextFlags : ParserContextFlags + decorators?: NodeArray; +>decorators : NodeArray +>NodeArray : NodeArray +>Decorator : Decorator + modifiers?: ModifiersArray; >modifiers : ModifiersArray >ModifiersArray : ModifiersArray @@ -1136,6 +1153,18 @@ declare module "typescript" { expression: Expression; >expression : Expression >Expression : Expression + } + interface Decorator extends Node { +>Decorator : Decorator +>Node : Node + + atToken: Node; +>atToken : Node +>Node : Node + + expression: LeftHandSideExpression; +>expression : LeftHandSideExpression +>LeftHandSideExpression : LeftHandSideExpression } interface TypeParameterDeclaration extends Declaration { >TypeParameterDeclaration : TypeParameterDeclaration @@ -1735,10 +1764,18 @@ declare module "typescript" { >ArrayLiteralExpression : ArrayLiteralExpression >PrimaryExpression : PrimaryExpression + openBracketToken: Node; +>openBracketToken : Node +>Node : Node + elements: NodeArray; >elements : NodeArray >NodeArray : NodeArray >Expression : Expression + + closeBracketToken: Node; +>closeBracketToken : Node +>Node : Node } interface SpreadElementExpression extends Expression { >SpreadElementExpression : SpreadElementExpression @@ -1782,9 +1819,17 @@ declare module "typescript" { >expression : LeftHandSideExpression >LeftHandSideExpression : LeftHandSideExpression + openBracketToken: Node; +>openBracketToken : Node +>Node : Node + argumentExpression?: Expression; >argumentExpression : Expression >Expression : Expression + + closeBracketToken: Node; +>closeBracketToken : Node +>Node : Node } interface CallExpression extends LeftHandSideExpression { >CallExpression : CallExpression diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index e7145e2407059..c819c0605677c 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -142,192 +142,195 @@ declare module "typescript" { BarBarToken = 49, QuestionToken = 50, ColonToken = 51, - EqualsToken = 52, - PlusEqualsToken = 53, - MinusEqualsToken = 54, - AsteriskEqualsToken = 55, - SlashEqualsToken = 56, - PercentEqualsToken = 57, - LessThanLessThanEqualsToken = 58, - GreaterThanGreaterThanEqualsToken = 59, - GreaterThanGreaterThanGreaterThanEqualsToken = 60, - AmpersandEqualsToken = 61, - BarEqualsToken = 62, - CaretEqualsToken = 63, - Identifier = 64, - BreakKeyword = 65, - CaseKeyword = 66, - CatchKeyword = 67, - ClassKeyword = 68, - ConstKeyword = 69, - ContinueKeyword = 70, - DebuggerKeyword = 71, - DefaultKeyword = 72, - DeleteKeyword = 73, - DoKeyword = 74, - ElseKeyword = 75, - EnumKeyword = 76, - ExportKeyword = 77, - ExtendsKeyword = 78, - FalseKeyword = 79, - FinallyKeyword = 80, - ForKeyword = 81, - FunctionKeyword = 82, - IfKeyword = 83, - ImportKeyword = 84, - InKeyword = 85, - InstanceOfKeyword = 86, - NewKeyword = 87, - NullKeyword = 88, - ReturnKeyword = 89, - SuperKeyword = 90, - SwitchKeyword = 91, - ThisKeyword = 92, - ThrowKeyword = 93, - TrueKeyword = 94, - TryKeyword = 95, - TypeOfKeyword = 96, - VarKeyword = 97, - VoidKeyword = 98, - WhileKeyword = 99, - WithKeyword = 100, - AsKeyword = 101, - ImplementsKeyword = 102, - InterfaceKeyword = 103, - LetKeyword = 104, - PackageKeyword = 105, - PrivateKeyword = 106, - ProtectedKeyword = 107, - PublicKeyword = 108, - StaticKeyword = 109, - YieldKeyword = 110, - AnyKeyword = 111, - BooleanKeyword = 112, - ConstructorKeyword = 113, - DeclareKeyword = 114, - GetKeyword = 115, - ModuleKeyword = 116, - RequireKeyword = 117, - NumberKeyword = 118, - SetKeyword = 119, - StringKeyword = 120, - SymbolKeyword = 121, - TypeKeyword = 122, - FromKeyword = 123, - OfKeyword = 124, - QualifiedName = 125, - ComputedPropertyName = 126, - TypeParameter = 127, - Parameter = 128, - PropertySignature = 129, - PropertyDeclaration = 130, - MethodSignature = 131, - MethodDeclaration = 132, - Constructor = 133, - GetAccessor = 134, - SetAccessor = 135, - CallSignature = 136, - ConstructSignature = 137, - IndexSignature = 138, - TypeReference = 139, - FunctionType = 140, - ConstructorType = 141, - TypeQuery = 142, - TypeLiteral = 143, - ArrayType = 144, - TupleType = 145, - UnionType = 146, - ParenthesizedType = 147, - ObjectBindingPattern = 148, - ArrayBindingPattern = 149, - BindingElement = 150, - ArrayLiteralExpression = 151, - ObjectLiteralExpression = 152, - PropertyAccessExpression = 153, - ElementAccessExpression = 154, - CallExpression = 155, - NewExpression = 156, - TaggedTemplateExpression = 157, - TypeAssertionExpression = 158, - ParenthesizedExpression = 159, - FunctionExpression = 160, - ArrowFunction = 161, - DeleteExpression = 162, - TypeOfExpression = 163, - VoidExpression = 164, - PrefixUnaryExpression = 165, - PostfixUnaryExpression = 166, - BinaryExpression = 167, - ConditionalExpression = 168, - TemplateExpression = 169, - YieldExpression = 170, - SpreadElementExpression = 171, - OmittedExpression = 172, - TemplateSpan = 173, - Block = 174, - VariableStatement = 175, - EmptyStatement = 176, - ExpressionStatement = 177, - IfStatement = 178, - DoStatement = 179, - WhileStatement = 180, - ForStatement = 181, - ForInStatement = 182, - ForOfStatement = 183, - ContinueStatement = 184, - BreakStatement = 185, - ReturnStatement = 186, - WithStatement = 187, - SwitchStatement = 188, - LabeledStatement = 189, - ThrowStatement = 190, - TryStatement = 191, - DebuggerStatement = 192, - VariableDeclaration = 193, - VariableDeclarationList = 194, - FunctionDeclaration = 195, - ClassDeclaration = 196, - InterfaceDeclaration = 197, - TypeAliasDeclaration = 198, - EnumDeclaration = 199, - ModuleDeclaration = 200, - ModuleBlock = 201, - CaseBlock = 202, - ImportEqualsDeclaration = 203, - ImportDeclaration = 204, - ImportClause = 205, - NamespaceImport = 206, - NamedImports = 207, - ImportSpecifier = 208, - ExportAssignment = 209, - ExportDeclaration = 210, - NamedExports = 211, - ExportSpecifier = 212, - ExternalModuleReference = 213, - CaseClause = 214, - DefaultClause = 215, - HeritageClause = 216, - CatchClause = 217, - PropertyAssignment = 218, - ShorthandPropertyAssignment = 219, - EnumMember = 220, - SourceFile = 221, - SyntaxList = 222, - Count = 223, - FirstAssignment = 52, - LastAssignment = 63, - FirstReservedWord = 65, - LastReservedWord = 100, - FirstKeyword = 65, - LastKeyword = 124, - FirstFutureReservedWord = 102, - LastFutureReservedWord = 110, - FirstTypeNode = 139, - LastTypeNode = 147, + AtToken = 52, + EqualsToken = 53, + PlusEqualsToken = 54, + MinusEqualsToken = 55, + AsteriskEqualsToken = 56, + SlashEqualsToken = 57, + PercentEqualsToken = 58, + LessThanLessThanEqualsToken = 59, + GreaterThanGreaterThanEqualsToken = 60, + GreaterThanGreaterThanGreaterThanEqualsToken = 61, + AmpersandEqualsToken = 62, + BarEqualsToken = 63, + CaretEqualsToken = 64, + Identifier = 65, + BreakKeyword = 66, + CaseKeyword = 67, + CatchKeyword = 68, + ClassKeyword = 69, + ConstKeyword = 70, + ContinueKeyword = 71, + DebuggerKeyword = 72, + DefaultKeyword = 73, + DeleteKeyword = 74, + DoKeyword = 75, + ElseKeyword = 76, + EnumKeyword = 77, + ExportKeyword = 78, + ExtendsKeyword = 79, + FalseKeyword = 80, + FinallyKeyword = 81, + ForKeyword = 82, + FunctionKeyword = 83, + IfKeyword = 84, + ImportKeyword = 85, + InKeyword = 86, + InstanceOfKeyword = 87, + NewKeyword = 88, + NullKeyword = 89, + ReturnKeyword = 90, + SuperKeyword = 91, + SwitchKeyword = 92, + ThisKeyword = 93, + ThrowKeyword = 94, + TrueKeyword = 95, + TryKeyword = 96, + TypeOfKeyword = 97, + VarKeyword = 98, + VoidKeyword = 99, + WhileKeyword = 100, + WithKeyword = 101, + AsKeyword = 102, + ImplementsKeyword = 103, + InterfaceKeyword = 104, + LetKeyword = 105, + PackageKeyword = 106, + PrivateKeyword = 107, + ProtectedKeyword = 108, + PublicKeyword = 109, + StaticKeyword = 110, + YieldKeyword = 111, + AnyKeyword = 112, + BooleanKeyword = 113, + ConstructorKeyword = 114, + DeclareKeyword = 115, + GetKeyword = 116, + ModuleKeyword = 117, + RequireKeyword = 118, + NumberKeyword = 119, + SetKeyword = 120, + StringKeyword = 121, + SymbolKeyword = 122, + TypeKeyword = 123, + FromKeyword = 124, + OfKeyword = 125, + QualifiedName = 126, + ComputedPropertyName = 127, + TypeParameter = 128, + Parameter = 129, + Decorator = 130, + PropertySignature = 131, + PropertyDeclaration = 132, + MethodSignature = 133, + MethodDeclaration = 134, + Constructor = 135, + GetAccessor = 136, + SetAccessor = 137, + CallSignature = 138, + ConstructSignature = 139, + IndexSignature = 140, + TypeReference = 141, + FunctionType = 142, + ConstructorType = 143, + TypeQuery = 144, + TypeLiteral = 145, + ArrayType = 146, + TupleType = 147, + UnionType = 148, + ParenthesizedType = 149, + ObjectBindingPattern = 150, + ArrayBindingPattern = 151, + BindingElement = 152, + ArrayLiteralExpression = 153, + ObjectLiteralExpression = 154, + PropertyAccessExpression = 155, + ElementAccessExpression = 156, + CallExpression = 157, + NewExpression = 158, + TaggedTemplateExpression = 159, + TypeAssertionExpression = 160, + ParenthesizedExpression = 161, + FunctionExpression = 162, + ArrowFunction = 163, + DeleteExpression = 164, + TypeOfExpression = 165, + VoidExpression = 166, + PrefixUnaryExpression = 167, + PostfixUnaryExpression = 168, + BinaryExpression = 169, + ConditionalExpression = 170, + TemplateExpression = 171, + YieldExpression = 172, + SpreadElementExpression = 173, + OmittedExpression = 174, + TemplateSpan = 175, + Block = 176, + VariableStatement = 177, + EmptyStatement = 178, + ExpressionStatement = 179, + IfStatement = 180, + DoStatement = 181, + WhileStatement = 182, + ForStatement = 183, + ForInStatement = 184, + ForOfStatement = 185, + ContinueStatement = 186, + BreakStatement = 187, + ReturnStatement = 188, + WithStatement = 189, + SwitchStatement = 190, + LabeledStatement = 191, + ThrowStatement = 192, + TryStatement = 193, + DebuggerStatement = 194, + VariableDeclaration = 195, + VariableDeclarationList = 196, + FunctionDeclaration = 197, + ClassDeclaration = 198, + InterfaceDeclaration = 199, + TypeAliasDeclaration = 200, + EnumDeclaration = 201, + ModuleDeclaration = 202, + ModuleBlock = 203, + CaseBlock = 204, + ImportEqualsDeclaration = 205, + ImportDeclaration = 206, + ImportClause = 207, + NamespaceImport = 208, + NamedImports = 209, + ImportSpecifier = 210, + ExportAssignment = 211, + ExportDeclaration = 212, + NamedExports = 213, + ExportSpecifier = 214, + IncompleteDeclaration = 215, + ExternalModuleReference = 216, + CaseClause = 217, + DefaultClause = 218, + HeritageClause = 219, + CatchClause = 220, + PropertyAssignment = 221, + ShorthandPropertyAssignment = 222, + EnumMember = 223, + SourceFile = 224, + SyntaxList = 225, + Count = 226, + FirstAssignment = 53, + LastAssignment = 64, + FirstReservedWord = 66, + LastReservedWord = 101, + FirstKeyword = 66, + LastKeyword = 125, + FirstFutureReservedWord = 103, + LastFutureReservedWord = 111, + FirstTypeNode = 141, + LastTypeNode = 149, FirstPunctuation = 14, - LastPunctuation = 63, + LastPunctuation = 64, FirstToken = 0, - LastToken = 124, + LastToken = 125, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -335,8 +338,8 @@ declare module "typescript" { FirstTemplateToken = 10, LastTemplateToken = 13, FirstBinaryOperator = 24, - LastBinaryOperator = 63, - FirstNode = 125, + LastBinaryOperator = 64, + FirstNode = 126, } const enum NodeFlags { Export = 1, @@ -361,10 +364,11 @@ declare module "typescript" { DisallowIn = 2, Yield = 4, GeneratorParameter = 8, - ThisNodeHasError = 16, - ParserGeneratedFlags = 31, - ThisNodeOrAnySubNodesHasError = 32, - HasAggregatedChildData = 64, + Decorator = 16, + ThisNodeHasError = 32, + ParserGeneratedFlags = 63, + ThisNodeOrAnySubNodesHasError = 64, + HasAggregatedChildData = 128, } const enum RelationComparisonResult { Succeeded = 1, @@ -375,6 +379,7 @@ declare module "typescript" { kind: SyntaxKind; flags: NodeFlags; parserContextFlags?: ParserContextFlags; + decorators?: NodeArray; modifiers?: ModifiersArray; id?: number; parent?: Node; @@ -405,6 +410,10 @@ declare module "typescript" { interface ComputedPropertyName extends Node { expression: Expression; } + interface Decorator extends Node { + atToken: Node; + expression: LeftHandSideExpression; + } interface TypeParameterDeclaration extends Declaration { name: Identifier; constraint?: TypeNode; @@ -607,7 +616,9 @@ declare module "typescript" { expression: Expression; } interface ArrayLiteralExpression extends PrimaryExpression { + openBracketToken: Node; elements: NodeArray; + closeBracketToken: Node; } interface SpreadElementExpression extends Expression { expression: Expression; @@ -622,7 +633,9 @@ declare module "typescript" { } interface ElementAccessExpression extends MemberExpression { expression: LeftHandSideExpression; + openBracketToken: Node; argumentExpression?: Expression; + closeBracketToken: Node; } interface CallExpression extends LeftHandSideExpression { expression: LeftHandSideExpression; @@ -2023,24 +2036,24 @@ function delint(sourceFile) { delintNode(sourceFile); function delintNode(node) { switch (node.kind) { - case 181 /* ForStatement */: - case 182 /* ForInStatement */: - case 180 /* WhileStatement */: - case 179 /* DoStatement */: - if (node.statement.kind !== 174 /* Block */) { + case 183 /* ForStatement */: + case 184 /* ForInStatement */: + case 182 /* WhileStatement */: + case 181 /* DoStatement */: + if (node.statement.kind !== 176 /* Block */) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; - case 178 /* IfStatement */: + case 180 /* IfStatement */: var ifStatement = node; - if (ifStatement.thenStatement.kind !== 174 /* Block */) { + if (ifStatement.thenStatement.kind !== 176 /* Block */) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } - if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 174 /* Block */ && ifStatement.elseStatement.kind !== 178 /* IfStatement */) { + if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 176 /* Block */ && ifStatement.elseStatement.kind !== 180 /* IfStatement */) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; - case 167 /* BinaryExpression */: + case 169 /* BinaryExpression */: var op = node.operatorToken.kind; 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 a40848b9e4c63..c19778ea49926 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -497,562 +497,571 @@ declare module "typescript" { ColonToken = 51, >ColonToken : SyntaxKind - EqualsToken = 52, + AtToken = 52, +>AtToken : SyntaxKind + + EqualsToken = 53, >EqualsToken : SyntaxKind - PlusEqualsToken = 53, + PlusEqualsToken = 54, >PlusEqualsToken : SyntaxKind - MinusEqualsToken = 54, + MinusEqualsToken = 55, >MinusEqualsToken : SyntaxKind - AsteriskEqualsToken = 55, + AsteriskEqualsToken = 56, >AsteriskEqualsToken : SyntaxKind - SlashEqualsToken = 56, + SlashEqualsToken = 57, >SlashEqualsToken : SyntaxKind - PercentEqualsToken = 57, + PercentEqualsToken = 58, >PercentEqualsToken : SyntaxKind - LessThanLessThanEqualsToken = 58, + LessThanLessThanEqualsToken = 59, >LessThanLessThanEqualsToken : SyntaxKind - GreaterThanGreaterThanEqualsToken = 59, + GreaterThanGreaterThanEqualsToken = 60, >GreaterThanGreaterThanEqualsToken : SyntaxKind - GreaterThanGreaterThanGreaterThanEqualsToken = 60, + GreaterThanGreaterThanGreaterThanEqualsToken = 61, >GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - AmpersandEqualsToken = 61, + AmpersandEqualsToken = 62, >AmpersandEqualsToken : SyntaxKind - BarEqualsToken = 62, + BarEqualsToken = 63, >BarEqualsToken : SyntaxKind - CaretEqualsToken = 63, + CaretEqualsToken = 64, >CaretEqualsToken : SyntaxKind - Identifier = 64, + Identifier = 65, >Identifier : SyntaxKind - BreakKeyword = 65, + BreakKeyword = 66, >BreakKeyword : SyntaxKind - CaseKeyword = 66, + CaseKeyword = 67, >CaseKeyword : SyntaxKind - CatchKeyword = 67, + CatchKeyword = 68, >CatchKeyword : SyntaxKind - ClassKeyword = 68, + ClassKeyword = 69, >ClassKeyword : SyntaxKind - ConstKeyword = 69, + ConstKeyword = 70, >ConstKeyword : SyntaxKind - ContinueKeyword = 70, + ContinueKeyword = 71, >ContinueKeyword : SyntaxKind - DebuggerKeyword = 71, + DebuggerKeyword = 72, >DebuggerKeyword : SyntaxKind - DefaultKeyword = 72, + DefaultKeyword = 73, >DefaultKeyword : SyntaxKind - DeleteKeyword = 73, + DeleteKeyword = 74, >DeleteKeyword : SyntaxKind - DoKeyword = 74, + DoKeyword = 75, >DoKeyword : SyntaxKind - ElseKeyword = 75, + ElseKeyword = 76, >ElseKeyword : SyntaxKind - EnumKeyword = 76, + EnumKeyword = 77, >EnumKeyword : SyntaxKind - ExportKeyword = 77, + ExportKeyword = 78, >ExportKeyword : SyntaxKind - ExtendsKeyword = 78, + ExtendsKeyword = 79, >ExtendsKeyword : SyntaxKind - FalseKeyword = 79, + FalseKeyword = 80, >FalseKeyword : SyntaxKind - FinallyKeyword = 80, + FinallyKeyword = 81, >FinallyKeyword : SyntaxKind - ForKeyword = 81, + ForKeyword = 82, >ForKeyword : SyntaxKind - FunctionKeyword = 82, + FunctionKeyword = 83, >FunctionKeyword : SyntaxKind - IfKeyword = 83, + IfKeyword = 84, >IfKeyword : SyntaxKind - ImportKeyword = 84, + ImportKeyword = 85, >ImportKeyword : SyntaxKind - InKeyword = 85, + InKeyword = 86, >InKeyword : SyntaxKind - InstanceOfKeyword = 86, + InstanceOfKeyword = 87, >InstanceOfKeyword : SyntaxKind - NewKeyword = 87, + NewKeyword = 88, >NewKeyword : SyntaxKind - NullKeyword = 88, + NullKeyword = 89, >NullKeyword : SyntaxKind - ReturnKeyword = 89, + ReturnKeyword = 90, >ReturnKeyword : SyntaxKind - SuperKeyword = 90, + SuperKeyword = 91, >SuperKeyword : SyntaxKind - SwitchKeyword = 91, + SwitchKeyword = 92, >SwitchKeyword : SyntaxKind - ThisKeyword = 92, + ThisKeyword = 93, >ThisKeyword : SyntaxKind - ThrowKeyword = 93, + ThrowKeyword = 94, >ThrowKeyword : SyntaxKind - TrueKeyword = 94, + TrueKeyword = 95, >TrueKeyword : SyntaxKind - TryKeyword = 95, + TryKeyword = 96, >TryKeyword : SyntaxKind - TypeOfKeyword = 96, + TypeOfKeyword = 97, >TypeOfKeyword : SyntaxKind - VarKeyword = 97, + VarKeyword = 98, >VarKeyword : SyntaxKind - VoidKeyword = 98, + VoidKeyword = 99, >VoidKeyword : SyntaxKind - WhileKeyword = 99, + WhileKeyword = 100, >WhileKeyword : SyntaxKind - WithKeyword = 100, + WithKeyword = 101, >WithKeyword : SyntaxKind - AsKeyword = 101, + AsKeyword = 102, >AsKeyword : SyntaxKind - ImplementsKeyword = 102, + ImplementsKeyword = 103, >ImplementsKeyword : SyntaxKind - InterfaceKeyword = 103, + InterfaceKeyword = 104, >InterfaceKeyword : SyntaxKind - LetKeyword = 104, + LetKeyword = 105, >LetKeyword : SyntaxKind - PackageKeyword = 105, + PackageKeyword = 106, >PackageKeyword : SyntaxKind - PrivateKeyword = 106, + PrivateKeyword = 107, >PrivateKeyword : SyntaxKind - ProtectedKeyword = 107, + ProtectedKeyword = 108, >ProtectedKeyword : SyntaxKind - PublicKeyword = 108, + PublicKeyword = 109, >PublicKeyword : SyntaxKind - StaticKeyword = 109, + StaticKeyword = 110, >StaticKeyword : SyntaxKind - YieldKeyword = 110, + YieldKeyword = 111, >YieldKeyword : SyntaxKind - AnyKeyword = 111, + AnyKeyword = 112, >AnyKeyword : SyntaxKind - BooleanKeyword = 112, + BooleanKeyword = 113, >BooleanKeyword : SyntaxKind - ConstructorKeyword = 113, + ConstructorKeyword = 114, >ConstructorKeyword : SyntaxKind - DeclareKeyword = 114, + DeclareKeyword = 115, >DeclareKeyword : SyntaxKind - GetKeyword = 115, + GetKeyword = 116, >GetKeyword : SyntaxKind - ModuleKeyword = 116, + ModuleKeyword = 117, >ModuleKeyword : SyntaxKind - RequireKeyword = 117, + RequireKeyword = 118, >RequireKeyword : SyntaxKind - NumberKeyword = 118, + NumberKeyword = 119, >NumberKeyword : SyntaxKind - SetKeyword = 119, + SetKeyword = 120, >SetKeyword : SyntaxKind - StringKeyword = 120, + StringKeyword = 121, >StringKeyword : SyntaxKind - SymbolKeyword = 121, + SymbolKeyword = 122, >SymbolKeyword : SyntaxKind - TypeKeyword = 122, + TypeKeyword = 123, >TypeKeyword : SyntaxKind - FromKeyword = 123, + FromKeyword = 124, >FromKeyword : SyntaxKind - OfKeyword = 124, + OfKeyword = 125, >OfKeyword : SyntaxKind - QualifiedName = 125, + QualifiedName = 126, >QualifiedName : SyntaxKind - ComputedPropertyName = 126, + ComputedPropertyName = 127, >ComputedPropertyName : SyntaxKind - TypeParameter = 127, + TypeParameter = 128, >TypeParameter : SyntaxKind - Parameter = 128, + Parameter = 129, >Parameter : SyntaxKind - PropertySignature = 129, + Decorator = 130, +>Decorator : SyntaxKind + + PropertySignature = 131, >PropertySignature : SyntaxKind - PropertyDeclaration = 130, + PropertyDeclaration = 132, >PropertyDeclaration : SyntaxKind - MethodSignature = 131, + MethodSignature = 133, >MethodSignature : SyntaxKind - MethodDeclaration = 132, + MethodDeclaration = 134, >MethodDeclaration : SyntaxKind - Constructor = 133, + Constructor = 135, >Constructor : SyntaxKind - GetAccessor = 134, + GetAccessor = 136, >GetAccessor : SyntaxKind - SetAccessor = 135, + SetAccessor = 137, >SetAccessor : SyntaxKind - CallSignature = 136, + CallSignature = 138, >CallSignature : SyntaxKind - ConstructSignature = 137, + ConstructSignature = 139, >ConstructSignature : SyntaxKind - IndexSignature = 138, + IndexSignature = 140, >IndexSignature : SyntaxKind - TypeReference = 139, + TypeReference = 141, >TypeReference : SyntaxKind - FunctionType = 140, + FunctionType = 142, >FunctionType : SyntaxKind - ConstructorType = 141, + ConstructorType = 143, >ConstructorType : SyntaxKind - TypeQuery = 142, + TypeQuery = 144, >TypeQuery : SyntaxKind - TypeLiteral = 143, + TypeLiteral = 145, >TypeLiteral : SyntaxKind - ArrayType = 144, + ArrayType = 146, >ArrayType : SyntaxKind - TupleType = 145, + TupleType = 147, >TupleType : SyntaxKind - UnionType = 146, + UnionType = 148, >UnionType : SyntaxKind - ParenthesizedType = 147, + ParenthesizedType = 149, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 148, + ObjectBindingPattern = 150, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 149, + ArrayBindingPattern = 151, >ArrayBindingPattern : SyntaxKind - BindingElement = 150, + BindingElement = 152, >BindingElement : SyntaxKind - ArrayLiteralExpression = 151, + ArrayLiteralExpression = 153, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 152, + ObjectLiteralExpression = 154, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 153, + PropertyAccessExpression = 155, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 154, + ElementAccessExpression = 156, >ElementAccessExpression : SyntaxKind - CallExpression = 155, + CallExpression = 157, >CallExpression : SyntaxKind - NewExpression = 156, + NewExpression = 158, >NewExpression : SyntaxKind - TaggedTemplateExpression = 157, + TaggedTemplateExpression = 159, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 158, + TypeAssertionExpression = 160, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 159, + ParenthesizedExpression = 161, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 160, + FunctionExpression = 162, >FunctionExpression : SyntaxKind - ArrowFunction = 161, + ArrowFunction = 163, >ArrowFunction : SyntaxKind - DeleteExpression = 162, + DeleteExpression = 164, >DeleteExpression : SyntaxKind - TypeOfExpression = 163, + TypeOfExpression = 165, >TypeOfExpression : SyntaxKind - VoidExpression = 164, + VoidExpression = 166, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 165, + PrefixUnaryExpression = 167, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 166, + PostfixUnaryExpression = 168, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 167, + BinaryExpression = 169, >BinaryExpression : SyntaxKind - ConditionalExpression = 168, + ConditionalExpression = 170, >ConditionalExpression : SyntaxKind - TemplateExpression = 169, + TemplateExpression = 171, >TemplateExpression : SyntaxKind - YieldExpression = 170, + YieldExpression = 172, >YieldExpression : SyntaxKind - SpreadElementExpression = 171, + SpreadElementExpression = 173, >SpreadElementExpression : SyntaxKind - OmittedExpression = 172, + OmittedExpression = 174, >OmittedExpression : SyntaxKind - TemplateSpan = 173, + TemplateSpan = 175, >TemplateSpan : SyntaxKind - Block = 174, + Block = 176, >Block : SyntaxKind - VariableStatement = 175, + VariableStatement = 177, >VariableStatement : SyntaxKind - EmptyStatement = 176, + EmptyStatement = 178, >EmptyStatement : SyntaxKind - ExpressionStatement = 177, + ExpressionStatement = 179, >ExpressionStatement : SyntaxKind - IfStatement = 178, + IfStatement = 180, >IfStatement : SyntaxKind - DoStatement = 179, + DoStatement = 181, >DoStatement : SyntaxKind - WhileStatement = 180, + WhileStatement = 182, >WhileStatement : SyntaxKind - ForStatement = 181, + ForStatement = 183, >ForStatement : SyntaxKind - ForInStatement = 182, + ForInStatement = 184, >ForInStatement : SyntaxKind - ForOfStatement = 183, + ForOfStatement = 185, >ForOfStatement : SyntaxKind - ContinueStatement = 184, + ContinueStatement = 186, >ContinueStatement : SyntaxKind - BreakStatement = 185, + BreakStatement = 187, >BreakStatement : SyntaxKind - ReturnStatement = 186, + ReturnStatement = 188, >ReturnStatement : SyntaxKind - WithStatement = 187, + WithStatement = 189, >WithStatement : SyntaxKind - SwitchStatement = 188, + SwitchStatement = 190, >SwitchStatement : SyntaxKind - LabeledStatement = 189, + LabeledStatement = 191, >LabeledStatement : SyntaxKind - ThrowStatement = 190, + ThrowStatement = 192, >ThrowStatement : SyntaxKind - TryStatement = 191, + TryStatement = 193, >TryStatement : SyntaxKind - DebuggerStatement = 192, + DebuggerStatement = 194, >DebuggerStatement : SyntaxKind - VariableDeclaration = 193, + VariableDeclaration = 195, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 194, + VariableDeclarationList = 196, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 195, + FunctionDeclaration = 197, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 196, + ClassDeclaration = 198, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 197, + InterfaceDeclaration = 199, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 198, + TypeAliasDeclaration = 200, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 199, + EnumDeclaration = 201, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 200, + ModuleDeclaration = 202, >ModuleDeclaration : SyntaxKind - ModuleBlock = 201, + ModuleBlock = 203, >ModuleBlock : SyntaxKind - CaseBlock = 202, + CaseBlock = 204, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 203, + ImportEqualsDeclaration = 205, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 204, + ImportDeclaration = 206, >ImportDeclaration : SyntaxKind - ImportClause = 205, + ImportClause = 207, >ImportClause : SyntaxKind - NamespaceImport = 206, + NamespaceImport = 208, >NamespaceImport : SyntaxKind - NamedImports = 207, + NamedImports = 209, >NamedImports : SyntaxKind - ImportSpecifier = 208, + ImportSpecifier = 210, >ImportSpecifier : SyntaxKind - ExportAssignment = 209, + ExportAssignment = 211, >ExportAssignment : SyntaxKind - ExportDeclaration = 210, + ExportDeclaration = 212, >ExportDeclaration : SyntaxKind - NamedExports = 211, + NamedExports = 213, >NamedExports : SyntaxKind - ExportSpecifier = 212, + ExportSpecifier = 214, >ExportSpecifier : SyntaxKind - ExternalModuleReference = 213, + IncompleteDeclaration = 215, +>IncompleteDeclaration : SyntaxKind + + ExternalModuleReference = 216, >ExternalModuleReference : SyntaxKind - CaseClause = 214, + CaseClause = 217, >CaseClause : SyntaxKind - DefaultClause = 215, + DefaultClause = 218, >DefaultClause : SyntaxKind - HeritageClause = 216, + HeritageClause = 219, >HeritageClause : SyntaxKind - CatchClause = 217, + CatchClause = 220, >CatchClause : SyntaxKind - PropertyAssignment = 218, + PropertyAssignment = 221, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 219, + ShorthandPropertyAssignment = 222, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 220, + EnumMember = 223, >EnumMember : SyntaxKind - SourceFile = 221, + SourceFile = 224, >SourceFile : SyntaxKind - SyntaxList = 222, + SyntaxList = 225, >SyntaxList : SyntaxKind - Count = 223, + Count = 226, >Count : SyntaxKind - FirstAssignment = 52, + FirstAssignment = 53, >FirstAssignment : SyntaxKind - LastAssignment = 63, + LastAssignment = 64, >LastAssignment : SyntaxKind - FirstReservedWord = 65, + FirstReservedWord = 66, >FirstReservedWord : SyntaxKind - LastReservedWord = 100, + LastReservedWord = 101, >LastReservedWord : SyntaxKind - FirstKeyword = 65, + FirstKeyword = 66, >FirstKeyword : SyntaxKind - LastKeyword = 124, + LastKeyword = 125, >LastKeyword : SyntaxKind - FirstFutureReservedWord = 102, + FirstFutureReservedWord = 103, >FirstFutureReservedWord : SyntaxKind - LastFutureReservedWord = 110, + LastFutureReservedWord = 111, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 139, + FirstTypeNode = 141, >FirstTypeNode : SyntaxKind - LastTypeNode = 147, + LastTypeNode = 149, >LastTypeNode : SyntaxKind FirstPunctuation = 14, >FirstPunctuation : SyntaxKind - LastPunctuation = 63, + LastPunctuation = 64, >LastPunctuation : SyntaxKind FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 124, + LastToken = 125, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -1076,10 +1085,10 @@ declare module "typescript" { FirstBinaryOperator = 24, >FirstBinaryOperator : SyntaxKind - LastBinaryOperator = 63, + LastBinaryOperator = 64, >LastBinaryOperator : SyntaxKind - FirstNode = 125, + FirstNode = 126, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -1148,16 +1157,19 @@ declare module "typescript" { GeneratorParameter = 8, >GeneratorParameter : ParserContextFlags - ThisNodeHasError = 16, + Decorator = 16, +>Decorator : ParserContextFlags + + ThisNodeHasError = 32, >ThisNodeHasError : ParserContextFlags - ParserGeneratedFlags = 31, + ParserGeneratedFlags = 63, >ParserGeneratedFlags : ParserContextFlags - ThisNodeOrAnySubNodesHasError = 32, + ThisNodeOrAnySubNodesHasError = 64, >ThisNodeOrAnySubNodesHasError : ParserContextFlags - HasAggregatedChildData = 64, + HasAggregatedChildData = 128, >HasAggregatedChildData : ParserContextFlags } const enum RelationComparisonResult { @@ -1188,6 +1200,11 @@ declare module "typescript" { >parserContextFlags : ParserContextFlags >ParserContextFlags : ParserContextFlags + decorators?: NodeArray; +>decorators : NodeArray +>NodeArray : NodeArray +>Decorator : Decorator + modifiers?: ModifiersArray; >modifiers : ModifiersArray >ModifiersArray : ModifiersArray @@ -1282,6 +1299,18 @@ declare module "typescript" { expression: Expression; >expression : Expression >Expression : Expression + } + interface Decorator extends Node { +>Decorator : Decorator +>Node : Node + + atToken: Node; +>atToken : Node +>Node : Node + + expression: LeftHandSideExpression; +>expression : LeftHandSideExpression +>LeftHandSideExpression : LeftHandSideExpression } interface TypeParameterDeclaration extends Declaration { >TypeParameterDeclaration : TypeParameterDeclaration @@ -1881,10 +1910,18 @@ declare module "typescript" { >ArrayLiteralExpression : ArrayLiteralExpression >PrimaryExpression : PrimaryExpression + openBracketToken: Node; +>openBracketToken : Node +>Node : Node + elements: NodeArray; >elements : NodeArray >NodeArray : NodeArray >Expression : Expression + + closeBracketToken: Node; +>closeBracketToken : Node +>Node : Node } interface SpreadElementExpression extends Expression { >SpreadElementExpression : SpreadElementExpression @@ -1928,9 +1965,17 @@ declare module "typescript" { >expression : LeftHandSideExpression >LeftHandSideExpression : LeftHandSideExpression + openBracketToken: Node; +>openBracketToken : Node +>Node : Node + argumentExpression?: Expression; >argumentExpression : Expression >Expression : Expression + + closeBracketToken: Node; +>closeBracketToken : Node +>Node : Node } interface CallExpression extends LeftHandSideExpression { >CallExpression : CallExpression diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index da8fe979d1700..11fb8bdef9385 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -143,192 +143,195 @@ declare module "typescript" { BarBarToken = 49, QuestionToken = 50, ColonToken = 51, - EqualsToken = 52, - PlusEqualsToken = 53, - MinusEqualsToken = 54, - AsteriskEqualsToken = 55, - SlashEqualsToken = 56, - PercentEqualsToken = 57, - LessThanLessThanEqualsToken = 58, - GreaterThanGreaterThanEqualsToken = 59, - GreaterThanGreaterThanGreaterThanEqualsToken = 60, - AmpersandEqualsToken = 61, - BarEqualsToken = 62, - CaretEqualsToken = 63, - Identifier = 64, - BreakKeyword = 65, - CaseKeyword = 66, - CatchKeyword = 67, - ClassKeyword = 68, - ConstKeyword = 69, - ContinueKeyword = 70, - DebuggerKeyword = 71, - DefaultKeyword = 72, - DeleteKeyword = 73, - DoKeyword = 74, - ElseKeyword = 75, - EnumKeyword = 76, - ExportKeyword = 77, - ExtendsKeyword = 78, - FalseKeyword = 79, - FinallyKeyword = 80, - ForKeyword = 81, - FunctionKeyword = 82, - IfKeyword = 83, - ImportKeyword = 84, - InKeyword = 85, - InstanceOfKeyword = 86, - NewKeyword = 87, - NullKeyword = 88, - ReturnKeyword = 89, - SuperKeyword = 90, - SwitchKeyword = 91, - ThisKeyword = 92, - ThrowKeyword = 93, - TrueKeyword = 94, - TryKeyword = 95, - TypeOfKeyword = 96, - VarKeyword = 97, - VoidKeyword = 98, - WhileKeyword = 99, - WithKeyword = 100, - AsKeyword = 101, - ImplementsKeyword = 102, - InterfaceKeyword = 103, - LetKeyword = 104, - PackageKeyword = 105, - PrivateKeyword = 106, - ProtectedKeyword = 107, - PublicKeyword = 108, - StaticKeyword = 109, - YieldKeyword = 110, - AnyKeyword = 111, - BooleanKeyword = 112, - ConstructorKeyword = 113, - DeclareKeyword = 114, - GetKeyword = 115, - ModuleKeyword = 116, - RequireKeyword = 117, - NumberKeyword = 118, - SetKeyword = 119, - StringKeyword = 120, - SymbolKeyword = 121, - TypeKeyword = 122, - FromKeyword = 123, - OfKeyword = 124, - QualifiedName = 125, - ComputedPropertyName = 126, - TypeParameter = 127, - Parameter = 128, - PropertySignature = 129, - PropertyDeclaration = 130, - MethodSignature = 131, - MethodDeclaration = 132, - Constructor = 133, - GetAccessor = 134, - SetAccessor = 135, - CallSignature = 136, - ConstructSignature = 137, - IndexSignature = 138, - TypeReference = 139, - FunctionType = 140, - ConstructorType = 141, - TypeQuery = 142, - TypeLiteral = 143, - ArrayType = 144, - TupleType = 145, - UnionType = 146, - ParenthesizedType = 147, - ObjectBindingPattern = 148, - ArrayBindingPattern = 149, - BindingElement = 150, - ArrayLiteralExpression = 151, - ObjectLiteralExpression = 152, - PropertyAccessExpression = 153, - ElementAccessExpression = 154, - CallExpression = 155, - NewExpression = 156, - TaggedTemplateExpression = 157, - TypeAssertionExpression = 158, - ParenthesizedExpression = 159, - FunctionExpression = 160, - ArrowFunction = 161, - DeleteExpression = 162, - TypeOfExpression = 163, - VoidExpression = 164, - PrefixUnaryExpression = 165, - PostfixUnaryExpression = 166, - BinaryExpression = 167, - ConditionalExpression = 168, - TemplateExpression = 169, - YieldExpression = 170, - SpreadElementExpression = 171, - OmittedExpression = 172, - TemplateSpan = 173, - Block = 174, - VariableStatement = 175, - EmptyStatement = 176, - ExpressionStatement = 177, - IfStatement = 178, - DoStatement = 179, - WhileStatement = 180, - ForStatement = 181, - ForInStatement = 182, - ForOfStatement = 183, - ContinueStatement = 184, - BreakStatement = 185, - ReturnStatement = 186, - WithStatement = 187, - SwitchStatement = 188, - LabeledStatement = 189, - ThrowStatement = 190, - TryStatement = 191, - DebuggerStatement = 192, - VariableDeclaration = 193, - VariableDeclarationList = 194, - FunctionDeclaration = 195, - ClassDeclaration = 196, - InterfaceDeclaration = 197, - TypeAliasDeclaration = 198, - EnumDeclaration = 199, - ModuleDeclaration = 200, - ModuleBlock = 201, - CaseBlock = 202, - ImportEqualsDeclaration = 203, - ImportDeclaration = 204, - ImportClause = 205, - NamespaceImport = 206, - NamedImports = 207, - ImportSpecifier = 208, - ExportAssignment = 209, - ExportDeclaration = 210, - NamedExports = 211, - ExportSpecifier = 212, - ExternalModuleReference = 213, - CaseClause = 214, - DefaultClause = 215, - HeritageClause = 216, - CatchClause = 217, - PropertyAssignment = 218, - ShorthandPropertyAssignment = 219, - EnumMember = 220, - SourceFile = 221, - SyntaxList = 222, - Count = 223, - FirstAssignment = 52, - LastAssignment = 63, - FirstReservedWord = 65, - LastReservedWord = 100, - FirstKeyword = 65, - LastKeyword = 124, - FirstFutureReservedWord = 102, - LastFutureReservedWord = 110, - FirstTypeNode = 139, - LastTypeNode = 147, + AtToken = 52, + EqualsToken = 53, + PlusEqualsToken = 54, + MinusEqualsToken = 55, + AsteriskEqualsToken = 56, + SlashEqualsToken = 57, + PercentEqualsToken = 58, + LessThanLessThanEqualsToken = 59, + GreaterThanGreaterThanEqualsToken = 60, + GreaterThanGreaterThanGreaterThanEqualsToken = 61, + AmpersandEqualsToken = 62, + BarEqualsToken = 63, + CaretEqualsToken = 64, + Identifier = 65, + BreakKeyword = 66, + CaseKeyword = 67, + CatchKeyword = 68, + ClassKeyword = 69, + ConstKeyword = 70, + ContinueKeyword = 71, + DebuggerKeyword = 72, + DefaultKeyword = 73, + DeleteKeyword = 74, + DoKeyword = 75, + ElseKeyword = 76, + EnumKeyword = 77, + ExportKeyword = 78, + ExtendsKeyword = 79, + FalseKeyword = 80, + FinallyKeyword = 81, + ForKeyword = 82, + FunctionKeyword = 83, + IfKeyword = 84, + ImportKeyword = 85, + InKeyword = 86, + InstanceOfKeyword = 87, + NewKeyword = 88, + NullKeyword = 89, + ReturnKeyword = 90, + SuperKeyword = 91, + SwitchKeyword = 92, + ThisKeyword = 93, + ThrowKeyword = 94, + TrueKeyword = 95, + TryKeyword = 96, + TypeOfKeyword = 97, + VarKeyword = 98, + VoidKeyword = 99, + WhileKeyword = 100, + WithKeyword = 101, + AsKeyword = 102, + ImplementsKeyword = 103, + InterfaceKeyword = 104, + LetKeyword = 105, + PackageKeyword = 106, + PrivateKeyword = 107, + ProtectedKeyword = 108, + PublicKeyword = 109, + StaticKeyword = 110, + YieldKeyword = 111, + AnyKeyword = 112, + BooleanKeyword = 113, + ConstructorKeyword = 114, + DeclareKeyword = 115, + GetKeyword = 116, + ModuleKeyword = 117, + RequireKeyword = 118, + NumberKeyword = 119, + SetKeyword = 120, + StringKeyword = 121, + SymbolKeyword = 122, + TypeKeyword = 123, + FromKeyword = 124, + OfKeyword = 125, + QualifiedName = 126, + ComputedPropertyName = 127, + TypeParameter = 128, + Parameter = 129, + Decorator = 130, + PropertySignature = 131, + PropertyDeclaration = 132, + MethodSignature = 133, + MethodDeclaration = 134, + Constructor = 135, + GetAccessor = 136, + SetAccessor = 137, + CallSignature = 138, + ConstructSignature = 139, + IndexSignature = 140, + TypeReference = 141, + FunctionType = 142, + ConstructorType = 143, + TypeQuery = 144, + TypeLiteral = 145, + ArrayType = 146, + TupleType = 147, + UnionType = 148, + ParenthesizedType = 149, + ObjectBindingPattern = 150, + ArrayBindingPattern = 151, + BindingElement = 152, + ArrayLiteralExpression = 153, + ObjectLiteralExpression = 154, + PropertyAccessExpression = 155, + ElementAccessExpression = 156, + CallExpression = 157, + NewExpression = 158, + TaggedTemplateExpression = 159, + TypeAssertionExpression = 160, + ParenthesizedExpression = 161, + FunctionExpression = 162, + ArrowFunction = 163, + DeleteExpression = 164, + TypeOfExpression = 165, + VoidExpression = 166, + PrefixUnaryExpression = 167, + PostfixUnaryExpression = 168, + BinaryExpression = 169, + ConditionalExpression = 170, + TemplateExpression = 171, + YieldExpression = 172, + SpreadElementExpression = 173, + OmittedExpression = 174, + TemplateSpan = 175, + Block = 176, + VariableStatement = 177, + EmptyStatement = 178, + ExpressionStatement = 179, + IfStatement = 180, + DoStatement = 181, + WhileStatement = 182, + ForStatement = 183, + ForInStatement = 184, + ForOfStatement = 185, + ContinueStatement = 186, + BreakStatement = 187, + ReturnStatement = 188, + WithStatement = 189, + SwitchStatement = 190, + LabeledStatement = 191, + ThrowStatement = 192, + TryStatement = 193, + DebuggerStatement = 194, + VariableDeclaration = 195, + VariableDeclarationList = 196, + FunctionDeclaration = 197, + ClassDeclaration = 198, + InterfaceDeclaration = 199, + TypeAliasDeclaration = 200, + EnumDeclaration = 201, + ModuleDeclaration = 202, + ModuleBlock = 203, + CaseBlock = 204, + ImportEqualsDeclaration = 205, + ImportDeclaration = 206, + ImportClause = 207, + NamespaceImport = 208, + NamedImports = 209, + ImportSpecifier = 210, + ExportAssignment = 211, + ExportDeclaration = 212, + NamedExports = 213, + ExportSpecifier = 214, + IncompleteDeclaration = 215, + ExternalModuleReference = 216, + CaseClause = 217, + DefaultClause = 218, + HeritageClause = 219, + CatchClause = 220, + PropertyAssignment = 221, + ShorthandPropertyAssignment = 222, + EnumMember = 223, + SourceFile = 224, + SyntaxList = 225, + Count = 226, + FirstAssignment = 53, + LastAssignment = 64, + FirstReservedWord = 66, + LastReservedWord = 101, + FirstKeyword = 66, + LastKeyword = 125, + FirstFutureReservedWord = 103, + LastFutureReservedWord = 111, + FirstTypeNode = 141, + LastTypeNode = 149, FirstPunctuation = 14, - LastPunctuation = 63, + LastPunctuation = 64, FirstToken = 0, - LastToken = 124, + LastToken = 125, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -336,8 +339,8 @@ declare module "typescript" { FirstTemplateToken = 10, LastTemplateToken = 13, FirstBinaryOperator = 24, - LastBinaryOperator = 63, - FirstNode = 125, + LastBinaryOperator = 64, + FirstNode = 126, } const enum NodeFlags { Export = 1, @@ -362,10 +365,11 @@ declare module "typescript" { DisallowIn = 2, Yield = 4, GeneratorParameter = 8, - ThisNodeHasError = 16, - ParserGeneratedFlags = 31, - ThisNodeOrAnySubNodesHasError = 32, - HasAggregatedChildData = 64, + Decorator = 16, + ThisNodeHasError = 32, + ParserGeneratedFlags = 63, + ThisNodeOrAnySubNodesHasError = 64, + HasAggregatedChildData = 128, } const enum RelationComparisonResult { Succeeded = 1, @@ -376,6 +380,7 @@ declare module "typescript" { kind: SyntaxKind; flags: NodeFlags; parserContextFlags?: ParserContextFlags; + decorators?: NodeArray; modifiers?: ModifiersArray; id?: number; parent?: Node; @@ -406,6 +411,10 @@ declare module "typescript" { interface ComputedPropertyName extends Node { expression: Expression; } + interface Decorator extends Node { + atToken: Node; + expression: LeftHandSideExpression; + } interface TypeParameterDeclaration extends Declaration { name: Identifier; constraint?: TypeNode; @@ -608,7 +617,9 @@ declare module "typescript" { expression: Expression; } interface ArrayLiteralExpression extends PrimaryExpression { + openBracketToken: Node; elements: NodeArray; + closeBracketToken: Node; } interface SpreadElementExpression extends Expression { expression: Expression; @@ -623,7 +634,9 @@ declare module "typescript" { } interface ElementAccessExpression extends MemberExpression { expression: LeftHandSideExpression; + openBracketToken: Node; argumentExpression?: Expression; + closeBracketToken: Node; } interface CallExpression extends LeftHandSideExpression { expression: LeftHandSideExpression; diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index b694678d4cb9a..4e56770573af7 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -447,562 +447,571 @@ declare module "typescript" { ColonToken = 51, >ColonToken : SyntaxKind - EqualsToken = 52, + AtToken = 52, +>AtToken : SyntaxKind + + EqualsToken = 53, >EqualsToken : SyntaxKind - PlusEqualsToken = 53, + PlusEqualsToken = 54, >PlusEqualsToken : SyntaxKind - MinusEqualsToken = 54, + MinusEqualsToken = 55, >MinusEqualsToken : SyntaxKind - AsteriskEqualsToken = 55, + AsteriskEqualsToken = 56, >AsteriskEqualsToken : SyntaxKind - SlashEqualsToken = 56, + SlashEqualsToken = 57, >SlashEqualsToken : SyntaxKind - PercentEqualsToken = 57, + PercentEqualsToken = 58, >PercentEqualsToken : SyntaxKind - LessThanLessThanEqualsToken = 58, + LessThanLessThanEqualsToken = 59, >LessThanLessThanEqualsToken : SyntaxKind - GreaterThanGreaterThanEqualsToken = 59, + GreaterThanGreaterThanEqualsToken = 60, >GreaterThanGreaterThanEqualsToken : SyntaxKind - GreaterThanGreaterThanGreaterThanEqualsToken = 60, + GreaterThanGreaterThanGreaterThanEqualsToken = 61, >GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - AmpersandEqualsToken = 61, + AmpersandEqualsToken = 62, >AmpersandEqualsToken : SyntaxKind - BarEqualsToken = 62, + BarEqualsToken = 63, >BarEqualsToken : SyntaxKind - CaretEqualsToken = 63, + CaretEqualsToken = 64, >CaretEqualsToken : SyntaxKind - Identifier = 64, + Identifier = 65, >Identifier : SyntaxKind - BreakKeyword = 65, + BreakKeyword = 66, >BreakKeyword : SyntaxKind - CaseKeyword = 66, + CaseKeyword = 67, >CaseKeyword : SyntaxKind - CatchKeyword = 67, + CatchKeyword = 68, >CatchKeyword : SyntaxKind - ClassKeyword = 68, + ClassKeyword = 69, >ClassKeyword : SyntaxKind - ConstKeyword = 69, + ConstKeyword = 70, >ConstKeyword : SyntaxKind - ContinueKeyword = 70, + ContinueKeyword = 71, >ContinueKeyword : SyntaxKind - DebuggerKeyword = 71, + DebuggerKeyword = 72, >DebuggerKeyword : SyntaxKind - DefaultKeyword = 72, + DefaultKeyword = 73, >DefaultKeyword : SyntaxKind - DeleteKeyword = 73, + DeleteKeyword = 74, >DeleteKeyword : SyntaxKind - DoKeyword = 74, + DoKeyword = 75, >DoKeyword : SyntaxKind - ElseKeyword = 75, + ElseKeyword = 76, >ElseKeyword : SyntaxKind - EnumKeyword = 76, + EnumKeyword = 77, >EnumKeyword : SyntaxKind - ExportKeyword = 77, + ExportKeyword = 78, >ExportKeyword : SyntaxKind - ExtendsKeyword = 78, + ExtendsKeyword = 79, >ExtendsKeyword : SyntaxKind - FalseKeyword = 79, + FalseKeyword = 80, >FalseKeyword : SyntaxKind - FinallyKeyword = 80, + FinallyKeyword = 81, >FinallyKeyword : SyntaxKind - ForKeyword = 81, + ForKeyword = 82, >ForKeyword : SyntaxKind - FunctionKeyword = 82, + FunctionKeyword = 83, >FunctionKeyword : SyntaxKind - IfKeyword = 83, + IfKeyword = 84, >IfKeyword : SyntaxKind - ImportKeyword = 84, + ImportKeyword = 85, >ImportKeyword : SyntaxKind - InKeyword = 85, + InKeyword = 86, >InKeyword : SyntaxKind - InstanceOfKeyword = 86, + InstanceOfKeyword = 87, >InstanceOfKeyword : SyntaxKind - NewKeyword = 87, + NewKeyword = 88, >NewKeyword : SyntaxKind - NullKeyword = 88, + NullKeyword = 89, >NullKeyword : SyntaxKind - ReturnKeyword = 89, + ReturnKeyword = 90, >ReturnKeyword : SyntaxKind - SuperKeyword = 90, + SuperKeyword = 91, >SuperKeyword : SyntaxKind - SwitchKeyword = 91, + SwitchKeyword = 92, >SwitchKeyword : SyntaxKind - ThisKeyword = 92, + ThisKeyword = 93, >ThisKeyword : SyntaxKind - ThrowKeyword = 93, + ThrowKeyword = 94, >ThrowKeyword : SyntaxKind - TrueKeyword = 94, + TrueKeyword = 95, >TrueKeyword : SyntaxKind - TryKeyword = 95, + TryKeyword = 96, >TryKeyword : SyntaxKind - TypeOfKeyword = 96, + TypeOfKeyword = 97, >TypeOfKeyword : SyntaxKind - VarKeyword = 97, + VarKeyword = 98, >VarKeyword : SyntaxKind - VoidKeyword = 98, + VoidKeyword = 99, >VoidKeyword : SyntaxKind - WhileKeyword = 99, + WhileKeyword = 100, >WhileKeyword : SyntaxKind - WithKeyword = 100, + WithKeyword = 101, >WithKeyword : SyntaxKind - AsKeyword = 101, + AsKeyword = 102, >AsKeyword : SyntaxKind - ImplementsKeyword = 102, + ImplementsKeyword = 103, >ImplementsKeyword : SyntaxKind - InterfaceKeyword = 103, + InterfaceKeyword = 104, >InterfaceKeyword : SyntaxKind - LetKeyword = 104, + LetKeyword = 105, >LetKeyword : SyntaxKind - PackageKeyword = 105, + PackageKeyword = 106, >PackageKeyword : SyntaxKind - PrivateKeyword = 106, + PrivateKeyword = 107, >PrivateKeyword : SyntaxKind - ProtectedKeyword = 107, + ProtectedKeyword = 108, >ProtectedKeyword : SyntaxKind - PublicKeyword = 108, + PublicKeyword = 109, >PublicKeyword : SyntaxKind - StaticKeyword = 109, + StaticKeyword = 110, >StaticKeyword : SyntaxKind - YieldKeyword = 110, + YieldKeyword = 111, >YieldKeyword : SyntaxKind - AnyKeyword = 111, + AnyKeyword = 112, >AnyKeyword : SyntaxKind - BooleanKeyword = 112, + BooleanKeyword = 113, >BooleanKeyword : SyntaxKind - ConstructorKeyword = 113, + ConstructorKeyword = 114, >ConstructorKeyword : SyntaxKind - DeclareKeyword = 114, + DeclareKeyword = 115, >DeclareKeyword : SyntaxKind - GetKeyword = 115, + GetKeyword = 116, >GetKeyword : SyntaxKind - ModuleKeyword = 116, + ModuleKeyword = 117, >ModuleKeyword : SyntaxKind - RequireKeyword = 117, + RequireKeyword = 118, >RequireKeyword : SyntaxKind - NumberKeyword = 118, + NumberKeyword = 119, >NumberKeyword : SyntaxKind - SetKeyword = 119, + SetKeyword = 120, >SetKeyword : SyntaxKind - StringKeyword = 120, + StringKeyword = 121, >StringKeyword : SyntaxKind - SymbolKeyword = 121, + SymbolKeyword = 122, >SymbolKeyword : SyntaxKind - TypeKeyword = 122, + TypeKeyword = 123, >TypeKeyword : SyntaxKind - FromKeyword = 123, + FromKeyword = 124, >FromKeyword : SyntaxKind - OfKeyword = 124, + OfKeyword = 125, >OfKeyword : SyntaxKind - QualifiedName = 125, + QualifiedName = 126, >QualifiedName : SyntaxKind - ComputedPropertyName = 126, + ComputedPropertyName = 127, >ComputedPropertyName : SyntaxKind - TypeParameter = 127, + TypeParameter = 128, >TypeParameter : SyntaxKind - Parameter = 128, + Parameter = 129, >Parameter : SyntaxKind - PropertySignature = 129, + Decorator = 130, +>Decorator : SyntaxKind + + PropertySignature = 131, >PropertySignature : SyntaxKind - PropertyDeclaration = 130, + PropertyDeclaration = 132, >PropertyDeclaration : SyntaxKind - MethodSignature = 131, + MethodSignature = 133, >MethodSignature : SyntaxKind - MethodDeclaration = 132, + MethodDeclaration = 134, >MethodDeclaration : SyntaxKind - Constructor = 133, + Constructor = 135, >Constructor : SyntaxKind - GetAccessor = 134, + GetAccessor = 136, >GetAccessor : SyntaxKind - SetAccessor = 135, + SetAccessor = 137, >SetAccessor : SyntaxKind - CallSignature = 136, + CallSignature = 138, >CallSignature : SyntaxKind - ConstructSignature = 137, + ConstructSignature = 139, >ConstructSignature : SyntaxKind - IndexSignature = 138, + IndexSignature = 140, >IndexSignature : SyntaxKind - TypeReference = 139, + TypeReference = 141, >TypeReference : SyntaxKind - FunctionType = 140, + FunctionType = 142, >FunctionType : SyntaxKind - ConstructorType = 141, + ConstructorType = 143, >ConstructorType : SyntaxKind - TypeQuery = 142, + TypeQuery = 144, >TypeQuery : SyntaxKind - TypeLiteral = 143, + TypeLiteral = 145, >TypeLiteral : SyntaxKind - ArrayType = 144, + ArrayType = 146, >ArrayType : SyntaxKind - TupleType = 145, + TupleType = 147, >TupleType : SyntaxKind - UnionType = 146, + UnionType = 148, >UnionType : SyntaxKind - ParenthesizedType = 147, + ParenthesizedType = 149, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 148, + ObjectBindingPattern = 150, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 149, + ArrayBindingPattern = 151, >ArrayBindingPattern : SyntaxKind - BindingElement = 150, + BindingElement = 152, >BindingElement : SyntaxKind - ArrayLiteralExpression = 151, + ArrayLiteralExpression = 153, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 152, + ObjectLiteralExpression = 154, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 153, + PropertyAccessExpression = 155, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 154, + ElementAccessExpression = 156, >ElementAccessExpression : SyntaxKind - CallExpression = 155, + CallExpression = 157, >CallExpression : SyntaxKind - NewExpression = 156, + NewExpression = 158, >NewExpression : SyntaxKind - TaggedTemplateExpression = 157, + TaggedTemplateExpression = 159, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 158, + TypeAssertionExpression = 160, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 159, + ParenthesizedExpression = 161, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 160, + FunctionExpression = 162, >FunctionExpression : SyntaxKind - ArrowFunction = 161, + ArrowFunction = 163, >ArrowFunction : SyntaxKind - DeleteExpression = 162, + DeleteExpression = 164, >DeleteExpression : SyntaxKind - TypeOfExpression = 163, + TypeOfExpression = 165, >TypeOfExpression : SyntaxKind - VoidExpression = 164, + VoidExpression = 166, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 165, + PrefixUnaryExpression = 167, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 166, + PostfixUnaryExpression = 168, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 167, + BinaryExpression = 169, >BinaryExpression : SyntaxKind - ConditionalExpression = 168, + ConditionalExpression = 170, >ConditionalExpression : SyntaxKind - TemplateExpression = 169, + TemplateExpression = 171, >TemplateExpression : SyntaxKind - YieldExpression = 170, + YieldExpression = 172, >YieldExpression : SyntaxKind - SpreadElementExpression = 171, + SpreadElementExpression = 173, >SpreadElementExpression : SyntaxKind - OmittedExpression = 172, + OmittedExpression = 174, >OmittedExpression : SyntaxKind - TemplateSpan = 173, + TemplateSpan = 175, >TemplateSpan : SyntaxKind - Block = 174, + Block = 176, >Block : SyntaxKind - VariableStatement = 175, + VariableStatement = 177, >VariableStatement : SyntaxKind - EmptyStatement = 176, + EmptyStatement = 178, >EmptyStatement : SyntaxKind - ExpressionStatement = 177, + ExpressionStatement = 179, >ExpressionStatement : SyntaxKind - IfStatement = 178, + IfStatement = 180, >IfStatement : SyntaxKind - DoStatement = 179, + DoStatement = 181, >DoStatement : SyntaxKind - WhileStatement = 180, + WhileStatement = 182, >WhileStatement : SyntaxKind - ForStatement = 181, + ForStatement = 183, >ForStatement : SyntaxKind - ForInStatement = 182, + ForInStatement = 184, >ForInStatement : SyntaxKind - ForOfStatement = 183, + ForOfStatement = 185, >ForOfStatement : SyntaxKind - ContinueStatement = 184, + ContinueStatement = 186, >ContinueStatement : SyntaxKind - BreakStatement = 185, + BreakStatement = 187, >BreakStatement : SyntaxKind - ReturnStatement = 186, + ReturnStatement = 188, >ReturnStatement : SyntaxKind - WithStatement = 187, + WithStatement = 189, >WithStatement : SyntaxKind - SwitchStatement = 188, + SwitchStatement = 190, >SwitchStatement : SyntaxKind - LabeledStatement = 189, + LabeledStatement = 191, >LabeledStatement : SyntaxKind - ThrowStatement = 190, + ThrowStatement = 192, >ThrowStatement : SyntaxKind - TryStatement = 191, + TryStatement = 193, >TryStatement : SyntaxKind - DebuggerStatement = 192, + DebuggerStatement = 194, >DebuggerStatement : SyntaxKind - VariableDeclaration = 193, + VariableDeclaration = 195, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 194, + VariableDeclarationList = 196, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 195, + FunctionDeclaration = 197, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 196, + ClassDeclaration = 198, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 197, + InterfaceDeclaration = 199, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 198, + TypeAliasDeclaration = 200, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 199, + EnumDeclaration = 201, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 200, + ModuleDeclaration = 202, >ModuleDeclaration : SyntaxKind - ModuleBlock = 201, + ModuleBlock = 203, >ModuleBlock : SyntaxKind - CaseBlock = 202, + CaseBlock = 204, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 203, + ImportEqualsDeclaration = 205, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 204, + ImportDeclaration = 206, >ImportDeclaration : SyntaxKind - ImportClause = 205, + ImportClause = 207, >ImportClause : SyntaxKind - NamespaceImport = 206, + NamespaceImport = 208, >NamespaceImport : SyntaxKind - NamedImports = 207, + NamedImports = 209, >NamedImports : SyntaxKind - ImportSpecifier = 208, + ImportSpecifier = 210, >ImportSpecifier : SyntaxKind - ExportAssignment = 209, + ExportAssignment = 211, >ExportAssignment : SyntaxKind - ExportDeclaration = 210, + ExportDeclaration = 212, >ExportDeclaration : SyntaxKind - NamedExports = 211, + NamedExports = 213, >NamedExports : SyntaxKind - ExportSpecifier = 212, + ExportSpecifier = 214, >ExportSpecifier : SyntaxKind - ExternalModuleReference = 213, + IncompleteDeclaration = 215, +>IncompleteDeclaration : SyntaxKind + + ExternalModuleReference = 216, >ExternalModuleReference : SyntaxKind - CaseClause = 214, + CaseClause = 217, >CaseClause : SyntaxKind - DefaultClause = 215, + DefaultClause = 218, >DefaultClause : SyntaxKind - HeritageClause = 216, + HeritageClause = 219, >HeritageClause : SyntaxKind - CatchClause = 217, + CatchClause = 220, >CatchClause : SyntaxKind - PropertyAssignment = 218, + PropertyAssignment = 221, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 219, + ShorthandPropertyAssignment = 222, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 220, + EnumMember = 223, >EnumMember : SyntaxKind - SourceFile = 221, + SourceFile = 224, >SourceFile : SyntaxKind - SyntaxList = 222, + SyntaxList = 225, >SyntaxList : SyntaxKind - Count = 223, + Count = 226, >Count : SyntaxKind - FirstAssignment = 52, + FirstAssignment = 53, >FirstAssignment : SyntaxKind - LastAssignment = 63, + LastAssignment = 64, >LastAssignment : SyntaxKind - FirstReservedWord = 65, + FirstReservedWord = 66, >FirstReservedWord : SyntaxKind - LastReservedWord = 100, + LastReservedWord = 101, >LastReservedWord : SyntaxKind - FirstKeyword = 65, + FirstKeyword = 66, >FirstKeyword : SyntaxKind - LastKeyword = 124, + LastKeyword = 125, >LastKeyword : SyntaxKind - FirstFutureReservedWord = 102, + FirstFutureReservedWord = 103, >FirstFutureReservedWord : SyntaxKind - LastFutureReservedWord = 110, + LastFutureReservedWord = 111, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 139, + FirstTypeNode = 141, >FirstTypeNode : SyntaxKind - LastTypeNode = 147, + LastTypeNode = 149, >LastTypeNode : SyntaxKind FirstPunctuation = 14, >FirstPunctuation : SyntaxKind - LastPunctuation = 63, + LastPunctuation = 64, >LastPunctuation : SyntaxKind FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 124, + LastToken = 125, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -1026,10 +1035,10 @@ declare module "typescript" { FirstBinaryOperator = 24, >FirstBinaryOperator : SyntaxKind - LastBinaryOperator = 63, + LastBinaryOperator = 64, >LastBinaryOperator : SyntaxKind - FirstNode = 125, + FirstNode = 126, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -1098,16 +1107,19 @@ declare module "typescript" { GeneratorParameter = 8, >GeneratorParameter : ParserContextFlags - ThisNodeHasError = 16, + Decorator = 16, +>Decorator : ParserContextFlags + + ThisNodeHasError = 32, >ThisNodeHasError : ParserContextFlags - ParserGeneratedFlags = 31, + ParserGeneratedFlags = 63, >ParserGeneratedFlags : ParserContextFlags - ThisNodeOrAnySubNodesHasError = 32, + ThisNodeOrAnySubNodesHasError = 64, >ThisNodeOrAnySubNodesHasError : ParserContextFlags - HasAggregatedChildData = 64, + HasAggregatedChildData = 128, >HasAggregatedChildData : ParserContextFlags } const enum RelationComparisonResult { @@ -1138,6 +1150,11 @@ declare module "typescript" { >parserContextFlags : ParserContextFlags >ParserContextFlags : ParserContextFlags + decorators?: NodeArray; +>decorators : NodeArray +>NodeArray : NodeArray +>Decorator : Decorator + modifiers?: ModifiersArray; >modifiers : ModifiersArray >ModifiersArray : ModifiersArray @@ -1232,6 +1249,18 @@ declare module "typescript" { expression: Expression; >expression : Expression >Expression : Expression + } + interface Decorator extends Node { +>Decorator : Decorator +>Node : Node + + atToken: Node; +>atToken : Node +>Node : Node + + expression: LeftHandSideExpression; +>expression : LeftHandSideExpression +>LeftHandSideExpression : LeftHandSideExpression } interface TypeParameterDeclaration extends Declaration { >TypeParameterDeclaration : TypeParameterDeclaration @@ -1831,10 +1860,18 @@ declare module "typescript" { >ArrayLiteralExpression : ArrayLiteralExpression >PrimaryExpression : PrimaryExpression + openBracketToken: Node; +>openBracketToken : Node +>Node : Node + elements: NodeArray; >elements : NodeArray >NodeArray : NodeArray >Expression : Expression + + closeBracketToken: Node; +>closeBracketToken : Node +>Node : Node } interface SpreadElementExpression extends Expression { >SpreadElementExpression : SpreadElementExpression @@ -1878,9 +1915,17 @@ declare module "typescript" { >expression : LeftHandSideExpression >LeftHandSideExpression : LeftHandSideExpression + openBracketToken: Node; +>openBracketToken : Node +>Node : Node + argumentExpression?: Expression; >argumentExpression : Expression >Expression : Expression + + closeBracketToken: Node; +>closeBracketToken : Node +>Node : Node } interface CallExpression extends LeftHandSideExpression { >CallExpression : CallExpression diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index f380994eba888..b9a40c6a197dc 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -180,192 +180,195 @@ declare module "typescript" { BarBarToken = 49, QuestionToken = 50, ColonToken = 51, - EqualsToken = 52, - PlusEqualsToken = 53, - MinusEqualsToken = 54, - AsteriskEqualsToken = 55, - SlashEqualsToken = 56, - PercentEqualsToken = 57, - LessThanLessThanEqualsToken = 58, - GreaterThanGreaterThanEqualsToken = 59, - GreaterThanGreaterThanGreaterThanEqualsToken = 60, - AmpersandEqualsToken = 61, - BarEqualsToken = 62, - CaretEqualsToken = 63, - Identifier = 64, - BreakKeyword = 65, - CaseKeyword = 66, - CatchKeyword = 67, - ClassKeyword = 68, - ConstKeyword = 69, - ContinueKeyword = 70, - DebuggerKeyword = 71, - DefaultKeyword = 72, - DeleteKeyword = 73, - DoKeyword = 74, - ElseKeyword = 75, - EnumKeyword = 76, - ExportKeyword = 77, - ExtendsKeyword = 78, - FalseKeyword = 79, - FinallyKeyword = 80, - ForKeyword = 81, - FunctionKeyword = 82, - IfKeyword = 83, - ImportKeyword = 84, - InKeyword = 85, - InstanceOfKeyword = 86, - NewKeyword = 87, - NullKeyword = 88, - ReturnKeyword = 89, - SuperKeyword = 90, - SwitchKeyword = 91, - ThisKeyword = 92, - ThrowKeyword = 93, - TrueKeyword = 94, - TryKeyword = 95, - TypeOfKeyword = 96, - VarKeyword = 97, - VoidKeyword = 98, - WhileKeyword = 99, - WithKeyword = 100, - AsKeyword = 101, - ImplementsKeyword = 102, - InterfaceKeyword = 103, - LetKeyword = 104, - PackageKeyword = 105, - PrivateKeyword = 106, - ProtectedKeyword = 107, - PublicKeyword = 108, - StaticKeyword = 109, - YieldKeyword = 110, - AnyKeyword = 111, - BooleanKeyword = 112, - ConstructorKeyword = 113, - DeclareKeyword = 114, - GetKeyword = 115, - ModuleKeyword = 116, - RequireKeyword = 117, - NumberKeyword = 118, - SetKeyword = 119, - StringKeyword = 120, - SymbolKeyword = 121, - TypeKeyword = 122, - FromKeyword = 123, - OfKeyword = 124, - QualifiedName = 125, - ComputedPropertyName = 126, - TypeParameter = 127, - Parameter = 128, - PropertySignature = 129, - PropertyDeclaration = 130, - MethodSignature = 131, - MethodDeclaration = 132, - Constructor = 133, - GetAccessor = 134, - SetAccessor = 135, - CallSignature = 136, - ConstructSignature = 137, - IndexSignature = 138, - TypeReference = 139, - FunctionType = 140, - ConstructorType = 141, - TypeQuery = 142, - TypeLiteral = 143, - ArrayType = 144, - TupleType = 145, - UnionType = 146, - ParenthesizedType = 147, - ObjectBindingPattern = 148, - ArrayBindingPattern = 149, - BindingElement = 150, - ArrayLiteralExpression = 151, - ObjectLiteralExpression = 152, - PropertyAccessExpression = 153, - ElementAccessExpression = 154, - CallExpression = 155, - NewExpression = 156, - TaggedTemplateExpression = 157, - TypeAssertionExpression = 158, - ParenthesizedExpression = 159, - FunctionExpression = 160, - ArrowFunction = 161, - DeleteExpression = 162, - TypeOfExpression = 163, - VoidExpression = 164, - PrefixUnaryExpression = 165, - PostfixUnaryExpression = 166, - BinaryExpression = 167, - ConditionalExpression = 168, - TemplateExpression = 169, - YieldExpression = 170, - SpreadElementExpression = 171, - OmittedExpression = 172, - TemplateSpan = 173, - Block = 174, - VariableStatement = 175, - EmptyStatement = 176, - ExpressionStatement = 177, - IfStatement = 178, - DoStatement = 179, - WhileStatement = 180, - ForStatement = 181, - ForInStatement = 182, - ForOfStatement = 183, - ContinueStatement = 184, - BreakStatement = 185, - ReturnStatement = 186, - WithStatement = 187, - SwitchStatement = 188, - LabeledStatement = 189, - ThrowStatement = 190, - TryStatement = 191, - DebuggerStatement = 192, - VariableDeclaration = 193, - VariableDeclarationList = 194, - FunctionDeclaration = 195, - ClassDeclaration = 196, - InterfaceDeclaration = 197, - TypeAliasDeclaration = 198, - EnumDeclaration = 199, - ModuleDeclaration = 200, - ModuleBlock = 201, - CaseBlock = 202, - ImportEqualsDeclaration = 203, - ImportDeclaration = 204, - ImportClause = 205, - NamespaceImport = 206, - NamedImports = 207, - ImportSpecifier = 208, - ExportAssignment = 209, - ExportDeclaration = 210, - NamedExports = 211, - ExportSpecifier = 212, - ExternalModuleReference = 213, - CaseClause = 214, - DefaultClause = 215, - HeritageClause = 216, - CatchClause = 217, - PropertyAssignment = 218, - ShorthandPropertyAssignment = 219, - EnumMember = 220, - SourceFile = 221, - SyntaxList = 222, - Count = 223, - FirstAssignment = 52, - LastAssignment = 63, - FirstReservedWord = 65, - LastReservedWord = 100, - FirstKeyword = 65, - LastKeyword = 124, - FirstFutureReservedWord = 102, - LastFutureReservedWord = 110, - FirstTypeNode = 139, - LastTypeNode = 147, + AtToken = 52, + EqualsToken = 53, + PlusEqualsToken = 54, + MinusEqualsToken = 55, + AsteriskEqualsToken = 56, + SlashEqualsToken = 57, + PercentEqualsToken = 58, + LessThanLessThanEqualsToken = 59, + GreaterThanGreaterThanEqualsToken = 60, + GreaterThanGreaterThanGreaterThanEqualsToken = 61, + AmpersandEqualsToken = 62, + BarEqualsToken = 63, + CaretEqualsToken = 64, + Identifier = 65, + BreakKeyword = 66, + CaseKeyword = 67, + CatchKeyword = 68, + ClassKeyword = 69, + ConstKeyword = 70, + ContinueKeyword = 71, + DebuggerKeyword = 72, + DefaultKeyword = 73, + DeleteKeyword = 74, + DoKeyword = 75, + ElseKeyword = 76, + EnumKeyword = 77, + ExportKeyword = 78, + ExtendsKeyword = 79, + FalseKeyword = 80, + FinallyKeyword = 81, + ForKeyword = 82, + FunctionKeyword = 83, + IfKeyword = 84, + ImportKeyword = 85, + InKeyword = 86, + InstanceOfKeyword = 87, + NewKeyword = 88, + NullKeyword = 89, + ReturnKeyword = 90, + SuperKeyword = 91, + SwitchKeyword = 92, + ThisKeyword = 93, + ThrowKeyword = 94, + TrueKeyword = 95, + TryKeyword = 96, + TypeOfKeyword = 97, + VarKeyword = 98, + VoidKeyword = 99, + WhileKeyword = 100, + WithKeyword = 101, + AsKeyword = 102, + ImplementsKeyword = 103, + InterfaceKeyword = 104, + LetKeyword = 105, + PackageKeyword = 106, + PrivateKeyword = 107, + ProtectedKeyword = 108, + PublicKeyword = 109, + StaticKeyword = 110, + YieldKeyword = 111, + AnyKeyword = 112, + BooleanKeyword = 113, + ConstructorKeyword = 114, + DeclareKeyword = 115, + GetKeyword = 116, + ModuleKeyword = 117, + RequireKeyword = 118, + NumberKeyword = 119, + SetKeyword = 120, + StringKeyword = 121, + SymbolKeyword = 122, + TypeKeyword = 123, + FromKeyword = 124, + OfKeyword = 125, + QualifiedName = 126, + ComputedPropertyName = 127, + TypeParameter = 128, + Parameter = 129, + Decorator = 130, + PropertySignature = 131, + PropertyDeclaration = 132, + MethodSignature = 133, + MethodDeclaration = 134, + Constructor = 135, + GetAccessor = 136, + SetAccessor = 137, + CallSignature = 138, + ConstructSignature = 139, + IndexSignature = 140, + TypeReference = 141, + FunctionType = 142, + ConstructorType = 143, + TypeQuery = 144, + TypeLiteral = 145, + ArrayType = 146, + TupleType = 147, + UnionType = 148, + ParenthesizedType = 149, + ObjectBindingPattern = 150, + ArrayBindingPattern = 151, + BindingElement = 152, + ArrayLiteralExpression = 153, + ObjectLiteralExpression = 154, + PropertyAccessExpression = 155, + ElementAccessExpression = 156, + CallExpression = 157, + NewExpression = 158, + TaggedTemplateExpression = 159, + TypeAssertionExpression = 160, + ParenthesizedExpression = 161, + FunctionExpression = 162, + ArrowFunction = 163, + DeleteExpression = 164, + TypeOfExpression = 165, + VoidExpression = 166, + PrefixUnaryExpression = 167, + PostfixUnaryExpression = 168, + BinaryExpression = 169, + ConditionalExpression = 170, + TemplateExpression = 171, + YieldExpression = 172, + SpreadElementExpression = 173, + OmittedExpression = 174, + TemplateSpan = 175, + Block = 176, + VariableStatement = 177, + EmptyStatement = 178, + ExpressionStatement = 179, + IfStatement = 180, + DoStatement = 181, + WhileStatement = 182, + ForStatement = 183, + ForInStatement = 184, + ForOfStatement = 185, + ContinueStatement = 186, + BreakStatement = 187, + ReturnStatement = 188, + WithStatement = 189, + SwitchStatement = 190, + LabeledStatement = 191, + ThrowStatement = 192, + TryStatement = 193, + DebuggerStatement = 194, + VariableDeclaration = 195, + VariableDeclarationList = 196, + FunctionDeclaration = 197, + ClassDeclaration = 198, + InterfaceDeclaration = 199, + TypeAliasDeclaration = 200, + EnumDeclaration = 201, + ModuleDeclaration = 202, + ModuleBlock = 203, + CaseBlock = 204, + ImportEqualsDeclaration = 205, + ImportDeclaration = 206, + ImportClause = 207, + NamespaceImport = 208, + NamedImports = 209, + ImportSpecifier = 210, + ExportAssignment = 211, + ExportDeclaration = 212, + NamedExports = 213, + ExportSpecifier = 214, + IncompleteDeclaration = 215, + ExternalModuleReference = 216, + CaseClause = 217, + DefaultClause = 218, + HeritageClause = 219, + CatchClause = 220, + PropertyAssignment = 221, + ShorthandPropertyAssignment = 222, + EnumMember = 223, + SourceFile = 224, + SyntaxList = 225, + Count = 226, + FirstAssignment = 53, + LastAssignment = 64, + FirstReservedWord = 66, + LastReservedWord = 101, + FirstKeyword = 66, + LastKeyword = 125, + FirstFutureReservedWord = 103, + LastFutureReservedWord = 111, + FirstTypeNode = 141, + LastTypeNode = 149, FirstPunctuation = 14, - LastPunctuation = 63, + LastPunctuation = 64, FirstToken = 0, - LastToken = 124, + LastToken = 125, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -373,8 +376,8 @@ declare module "typescript" { FirstTemplateToken = 10, LastTemplateToken = 13, FirstBinaryOperator = 24, - LastBinaryOperator = 63, - FirstNode = 125, + LastBinaryOperator = 64, + FirstNode = 126, } const enum NodeFlags { Export = 1, @@ -399,10 +402,11 @@ declare module "typescript" { DisallowIn = 2, Yield = 4, GeneratorParameter = 8, - ThisNodeHasError = 16, - ParserGeneratedFlags = 31, - ThisNodeOrAnySubNodesHasError = 32, - HasAggregatedChildData = 64, + Decorator = 16, + ThisNodeHasError = 32, + ParserGeneratedFlags = 63, + ThisNodeOrAnySubNodesHasError = 64, + HasAggregatedChildData = 128, } const enum RelationComparisonResult { Succeeded = 1, @@ -413,6 +417,7 @@ declare module "typescript" { kind: SyntaxKind; flags: NodeFlags; parserContextFlags?: ParserContextFlags; + decorators?: NodeArray; modifiers?: ModifiersArray; id?: number; parent?: Node; @@ -443,6 +448,10 @@ declare module "typescript" { interface ComputedPropertyName extends Node { expression: Expression; } + interface Decorator extends Node { + atToken: Node; + expression: LeftHandSideExpression; + } interface TypeParameterDeclaration extends Declaration { name: Identifier; constraint?: TypeNode; @@ -645,7 +654,9 @@ declare module "typescript" { expression: Expression; } interface ArrayLiteralExpression extends PrimaryExpression { + openBracketToken: Node; elements: NodeArray; + closeBracketToken: Node; } interface SpreadElementExpression extends Expression { expression: Expression; @@ -660,7 +671,9 @@ declare module "typescript" { } interface ElementAccessExpression extends MemberExpression { expression: LeftHandSideExpression; + openBracketToken: Node; argumentExpression?: Expression; + closeBracketToken: Node; } interface CallExpression extends LeftHandSideExpression { expression: LeftHandSideExpression; diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index 06329de5c961f..5b52c1522a58f 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -620,562 +620,571 @@ declare module "typescript" { ColonToken = 51, >ColonToken : SyntaxKind - EqualsToken = 52, + AtToken = 52, +>AtToken : SyntaxKind + + EqualsToken = 53, >EqualsToken : SyntaxKind - PlusEqualsToken = 53, + PlusEqualsToken = 54, >PlusEqualsToken : SyntaxKind - MinusEqualsToken = 54, + MinusEqualsToken = 55, >MinusEqualsToken : SyntaxKind - AsteriskEqualsToken = 55, + AsteriskEqualsToken = 56, >AsteriskEqualsToken : SyntaxKind - SlashEqualsToken = 56, + SlashEqualsToken = 57, >SlashEqualsToken : SyntaxKind - PercentEqualsToken = 57, + PercentEqualsToken = 58, >PercentEqualsToken : SyntaxKind - LessThanLessThanEqualsToken = 58, + LessThanLessThanEqualsToken = 59, >LessThanLessThanEqualsToken : SyntaxKind - GreaterThanGreaterThanEqualsToken = 59, + GreaterThanGreaterThanEqualsToken = 60, >GreaterThanGreaterThanEqualsToken : SyntaxKind - GreaterThanGreaterThanGreaterThanEqualsToken = 60, + GreaterThanGreaterThanGreaterThanEqualsToken = 61, >GreaterThanGreaterThanGreaterThanEqualsToken : SyntaxKind - AmpersandEqualsToken = 61, + AmpersandEqualsToken = 62, >AmpersandEqualsToken : SyntaxKind - BarEqualsToken = 62, + BarEqualsToken = 63, >BarEqualsToken : SyntaxKind - CaretEqualsToken = 63, + CaretEqualsToken = 64, >CaretEqualsToken : SyntaxKind - Identifier = 64, + Identifier = 65, >Identifier : SyntaxKind - BreakKeyword = 65, + BreakKeyword = 66, >BreakKeyword : SyntaxKind - CaseKeyword = 66, + CaseKeyword = 67, >CaseKeyword : SyntaxKind - CatchKeyword = 67, + CatchKeyword = 68, >CatchKeyword : SyntaxKind - ClassKeyword = 68, + ClassKeyword = 69, >ClassKeyword : SyntaxKind - ConstKeyword = 69, + ConstKeyword = 70, >ConstKeyword : SyntaxKind - ContinueKeyword = 70, + ContinueKeyword = 71, >ContinueKeyword : SyntaxKind - DebuggerKeyword = 71, + DebuggerKeyword = 72, >DebuggerKeyword : SyntaxKind - DefaultKeyword = 72, + DefaultKeyword = 73, >DefaultKeyword : SyntaxKind - DeleteKeyword = 73, + DeleteKeyword = 74, >DeleteKeyword : SyntaxKind - DoKeyword = 74, + DoKeyword = 75, >DoKeyword : SyntaxKind - ElseKeyword = 75, + ElseKeyword = 76, >ElseKeyword : SyntaxKind - EnumKeyword = 76, + EnumKeyword = 77, >EnumKeyword : SyntaxKind - ExportKeyword = 77, + ExportKeyword = 78, >ExportKeyword : SyntaxKind - ExtendsKeyword = 78, + ExtendsKeyword = 79, >ExtendsKeyword : SyntaxKind - FalseKeyword = 79, + FalseKeyword = 80, >FalseKeyword : SyntaxKind - FinallyKeyword = 80, + FinallyKeyword = 81, >FinallyKeyword : SyntaxKind - ForKeyword = 81, + ForKeyword = 82, >ForKeyword : SyntaxKind - FunctionKeyword = 82, + FunctionKeyword = 83, >FunctionKeyword : SyntaxKind - IfKeyword = 83, + IfKeyword = 84, >IfKeyword : SyntaxKind - ImportKeyword = 84, + ImportKeyword = 85, >ImportKeyword : SyntaxKind - InKeyword = 85, + InKeyword = 86, >InKeyword : SyntaxKind - InstanceOfKeyword = 86, + InstanceOfKeyword = 87, >InstanceOfKeyword : SyntaxKind - NewKeyword = 87, + NewKeyword = 88, >NewKeyword : SyntaxKind - NullKeyword = 88, + NullKeyword = 89, >NullKeyword : SyntaxKind - ReturnKeyword = 89, + ReturnKeyword = 90, >ReturnKeyword : SyntaxKind - SuperKeyword = 90, + SuperKeyword = 91, >SuperKeyword : SyntaxKind - SwitchKeyword = 91, + SwitchKeyword = 92, >SwitchKeyword : SyntaxKind - ThisKeyword = 92, + ThisKeyword = 93, >ThisKeyword : SyntaxKind - ThrowKeyword = 93, + ThrowKeyword = 94, >ThrowKeyword : SyntaxKind - TrueKeyword = 94, + TrueKeyword = 95, >TrueKeyword : SyntaxKind - TryKeyword = 95, + TryKeyword = 96, >TryKeyword : SyntaxKind - TypeOfKeyword = 96, + TypeOfKeyword = 97, >TypeOfKeyword : SyntaxKind - VarKeyword = 97, + VarKeyword = 98, >VarKeyword : SyntaxKind - VoidKeyword = 98, + VoidKeyword = 99, >VoidKeyword : SyntaxKind - WhileKeyword = 99, + WhileKeyword = 100, >WhileKeyword : SyntaxKind - WithKeyword = 100, + WithKeyword = 101, >WithKeyword : SyntaxKind - AsKeyword = 101, + AsKeyword = 102, >AsKeyword : SyntaxKind - ImplementsKeyword = 102, + ImplementsKeyword = 103, >ImplementsKeyword : SyntaxKind - InterfaceKeyword = 103, + InterfaceKeyword = 104, >InterfaceKeyword : SyntaxKind - LetKeyword = 104, + LetKeyword = 105, >LetKeyword : SyntaxKind - PackageKeyword = 105, + PackageKeyword = 106, >PackageKeyword : SyntaxKind - PrivateKeyword = 106, + PrivateKeyword = 107, >PrivateKeyword : SyntaxKind - ProtectedKeyword = 107, + ProtectedKeyword = 108, >ProtectedKeyword : SyntaxKind - PublicKeyword = 108, + PublicKeyword = 109, >PublicKeyword : SyntaxKind - StaticKeyword = 109, + StaticKeyword = 110, >StaticKeyword : SyntaxKind - YieldKeyword = 110, + YieldKeyword = 111, >YieldKeyword : SyntaxKind - AnyKeyword = 111, + AnyKeyword = 112, >AnyKeyword : SyntaxKind - BooleanKeyword = 112, + BooleanKeyword = 113, >BooleanKeyword : SyntaxKind - ConstructorKeyword = 113, + ConstructorKeyword = 114, >ConstructorKeyword : SyntaxKind - DeclareKeyword = 114, + DeclareKeyword = 115, >DeclareKeyword : SyntaxKind - GetKeyword = 115, + GetKeyword = 116, >GetKeyword : SyntaxKind - ModuleKeyword = 116, + ModuleKeyword = 117, >ModuleKeyword : SyntaxKind - RequireKeyword = 117, + RequireKeyword = 118, >RequireKeyword : SyntaxKind - NumberKeyword = 118, + NumberKeyword = 119, >NumberKeyword : SyntaxKind - SetKeyword = 119, + SetKeyword = 120, >SetKeyword : SyntaxKind - StringKeyword = 120, + StringKeyword = 121, >StringKeyword : SyntaxKind - SymbolKeyword = 121, + SymbolKeyword = 122, >SymbolKeyword : SyntaxKind - TypeKeyword = 122, + TypeKeyword = 123, >TypeKeyword : SyntaxKind - FromKeyword = 123, + FromKeyword = 124, >FromKeyword : SyntaxKind - OfKeyword = 124, + OfKeyword = 125, >OfKeyword : SyntaxKind - QualifiedName = 125, + QualifiedName = 126, >QualifiedName : SyntaxKind - ComputedPropertyName = 126, + ComputedPropertyName = 127, >ComputedPropertyName : SyntaxKind - TypeParameter = 127, + TypeParameter = 128, >TypeParameter : SyntaxKind - Parameter = 128, + Parameter = 129, >Parameter : SyntaxKind - PropertySignature = 129, + Decorator = 130, +>Decorator : SyntaxKind + + PropertySignature = 131, >PropertySignature : SyntaxKind - PropertyDeclaration = 130, + PropertyDeclaration = 132, >PropertyDeclaration : SyntaxKind - MethodSignature = 131, + MethodSignature = 133, >MethodSignature : SyntaxKind - MethodDeclaration = 132, + MethodDeclaration = 134, >MethodDeclaration : SyntaxKind - Constructor = 133, + Constructor = 135, >Constructor : SyntaxKind - GetAccessor = 134, + GetAccessor = 136, >GetAccessor : SyntaxKind - SetAccessor = 135, + SetAccessor = 137, >SetAccessor : SyntaxKind - CallSignature = 136, + CallSignature = 138, >CallSignature : SyntaxKind - ConstructSignature = 137, + ConstructSignature = 139, >ConstructSignature : SyntaxKind - IndexSignature = 138, + IndexSignature = 140, >IndexSignature : SyntaxKind - TypeReference = 139, + TypeReference = 141, >TypeReference : SyntaxKind - FunctionType = 140, + FunctionType = 142, >FunctionType : SyntaxKind - ConstructorType = 141, + ConstructorType = 143, >ConstructorType : SyntaxKind - TypeQuery = 142, + TypeQuery = 144, >TypeQuery : SyntaxKind - TypeLiteral = 143, + TypeLiteral = 145, >TypeLiteral : SyntaxKind - ArrayType = 144, + ArrayType = 146, >ArrayType : SyntaxKind - TupleType = 145, + TupleType = 147, >TupleType : SyntaxKind - UnionType = 146, + UnionType = 148, >UnionType : SyntaxKind - ParenthesizedType = 147, + ParenthesizedType = 149, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 148, + ObjectBindingPattern = 150, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 149, + ArrayBindingPattern = 151, >ArrayBindingPattern : SyntaxKind - BindingElement = 150, + BindingElement = 152, >BindingElement : SyntaxKind - ArrayLiteralExpression = 151, + ArrayLiteralExpression = 153, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 152, + ObjectLiteralExpression = 154, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 153, + PropertyAccessExpression = 155, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 154, + ElementAccessExpression = 156, >ElementAccessExpression : SyntaxKind - CallExpression = 155, + CallExpression = 157, >CallExpression : SyntaxKind - NewExpression = 156, + NewExpression = 158, >NewExpression : SyntaxKind - TaggedTemplateExpression = 157, + TaggedTemplateExpression = 159, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 158, + TypeAssertionExpression = 160, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 159, + ParenthesizedExpression = 161, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 160, + FunctionExpression = 162, >FunctionExpression : SyntaxKind - ArrowFunction = 161, + ArrowFunction = 163, >ArrowFunction : SyntaxKind - DeleteExpression = 162, + DeleteExpression = 164, >DeleteExpression : SyntaxKind - TypeOfExpression = 163, + TypeOfExpression = 165, >TypeOfExpression : SyntaxKind - VoidExpression = 164, + VoidExpression = 166, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 165, + PrefixUnaryExpression = 167, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 166, + PostfixUnaryExpression = 168, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 167, + BinaryExpression = 169, >BinaryExpression : SyntaxKind - ConditionalExpression = 168, + ConditionalExpression = 170, >ConditionalExpression : SyntaxKind - TemplateExpression = 169, + TemplateExpression = 171, >TemplateExpression : SyntaxKind - YieldExpression = 170, + YieldExpression = 172, >YieldExpression : SyntaxKind - SpreadElementExpression = 171, + SpreadElementExpression = 173, >SpreadElementExpression : SyntaxKind - OmittedExpression = 172, + OmittedExpression = 174, >OmittedExpression : SyntaxKind - TemplateSpan = 173, + TemplateSpan = 175, >TemplateSpan : SyntaxKind - Block = 174, + Block = 176, >Block : SyntaxKind - VariableStatement = 175, + VariableStatement = 177, >VariableStatement : SyntaxKind - EmptyStatement = 176, + EmptyStatement = 178, >EmptyStatement : SyntaxKind - ExpressionStatement = 177, + ExpressionStatement = 179, >ExpressionStatement : SyntaxKind - IfStatement = 178, + IfStatement = 180, >IfStatement : SyntaxKind - DoStatement = 179, + DoStatement = 181, >DoStatement : SyntaxKind - WhileStatement = 180, + WhileStatement = 182, >WhileStatement : SyntaxKind - ForStatement = 181, + ForStatement = 183, >ForStatement : SyntaxKind - ForInStatement = 182, + ForInStatement = 184, >ForInStatement : SyntaxKind - ForOfStatement = 183, + ForOfStatement = 185, >ForOfStatement : SyntaxKind - ContinueStatement = 184, + ContinueStatement = 186, >ContinueStatement : SyntaxKind - BreakStatement = 185, + BreakStatement = 187, >BreakStatement : SyntaxKind - ReturnStatement = 186, + ReturnStatement = 188, >ReturnStatement : SyntaxKind - WithStatement = 187, + WithStatement = 189, >WithStatement : SyntaxKind - SwitchStatement = 188, + SwitchStatement = 190, >SwitchStatement : SyntaxKind - LabeledStatement = 189, + LabeledStatement = 191, >LabeledStatement : SyntaxKind - ThrowStatement = 190, + ThrowStatement = 192, >ThrowStatement : SyntaxKind - TryStatement = 191, + TryStatement = 193, >TryStatement : SyntaxKind - DebuggerStatement = 192, + DebuggerStatement = 194, >DebuggerStatement : SyntaxKind - VariableDeclaration = 193, + VariableDeclaration = 195, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 194, + VariableDeclarationList = 196, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 195, + FunctionDeclaration = 197, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 196, + ClassDeclaration = 198, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 197, + InterfaceDeclaration = 199, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 198, + TypeAliasDeclaration = 200, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 199, + EnumDeclaration = 201, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 200, + ModuleDeclaration = 202, >ModuleDeclaration : SyntaxKind - ModuleBlock = 201, + ModuleBlock = 203, >ModuleBlock : SyntaxKind - CaseBlock = 202, + CaseBlock = 204, >CaseBlock : SyntaxKind - ImportEqualsDeclaration = 203, + ImportEqualsDeclaration = 205, >ImportEqualsDeclaration : SyntaxKind - ImportDeclaration = 204, + ImportDeclaration = 206, >ImportDeclaration : SyntaxKind - ImportClause = 205, + ImportClause = 207, >ImportClause : SyntaxKind - NamespaceImport = 206, + NamespaceImport = 208, >NamespaceImport : SyntaxKind - NamedImports = 207, + NamedImports = 209, >NamedImports : SyntaxKind - ImportSpecifier = 208, + ImportSpecifier = 210, >ImportSpecifier : SyntaxKind - ExportAssignment = 209, + ExportAssignment = 211, >ExportAssignment : SyntaxKind - ExportDeclaration = 210, + ExportDeclaration = 212, >ExportDeclaration : SyntaxKind - NamedExports = 211, + NamedExports = 213, >NamedExports : SyntaxKind - ExportSpecifier = 212, + ExportSpecifier = 214, >ExportSpecifier : SyntaxKind - ExternalModuleReference = 213, + IncompleteDeclaration = 215, +>IncompleteDeclaration : SyntaxKind + + ExternalModuleReference = 216, >ExternalModuleReference : SyntaxKind - CaseClause = 214, + CaseClause = 217, >CaseClause : SyntaxKind - DefaultClause = 215, + DefaultClause = 218, >DefaultClause : SyntaxKind - HeritageClause = 216, + HeritageClause = 219, >HeritageClause : SyntaxKind - CatchClause = 217, + CatchClause = 220, >CatchClause : SyntaxKind - PropertyAssignment = 218, + PropertyAssignment = 221, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 219, + ShorthandPropertyAssignment = 222, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 220, + EnumMember = 223, >EnumMember : SyntaxKind - SourceFile = 221, + SourceFile = 224, >SourceFile : SyntaxKind - SyntaxList = 222, + SyntaxList = 225, >SyntaxList : SyntaxKind - Count = 223, + Count = 226, >Count : SyntaxKind - FirstAssignment = 52, + FirstAssignment = 53, >FirstAssignment : SyntaxKind - LastAssignment = 63, + LastAssignment = 64, >LastAssignment : SyntaxKind - FirstReservedWord = 65, + FirstReservedWord = 66, >FirstReservedWord : SyntaxKind - LastReservedWord = 100, + LastReservedWord = 101, >LastReservedWord : SyntaxKind - FirstKeyword = 65, + FirstKeyword = 66, >FirstKeyword : SyntaxKind - LastKeyword = 124, + LastKeyword = 125, >LastKeyword : SyntaxKind - FirstFutureReservedWord = 102, + FirstFutureReservedWord = 103, >FirstFutureReservedWord : SyntaxKind - LastFutureReservedWord = 110, + LastFutureReservedWord = 111, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 139, + FirstTypeNode = 141, >FirstTypeNode : SyntaxKind - LastTypeNode = 147, + LastTypeNode = 149, >LastTypeNode : SyntaxKind FirstPunctuation = 14, >FirstPunctuation : SyntaxKind - LastPunctuation = 63, + LastPunctuation = 64, >LastPunctuation : SyntaxKind FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 124, + LastToken = 125, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -1199,10 +1208,10 @@ declare module "typescript" { FirstBinaryOperator = 24, >FirstBinaryOperator : SyntaxKind - LastBinaryOperator = 63, + LastBinaryOperator = 64, >LastBinaryOperator : SyntaxKind - FirstNode = 125, + FirstNode = 126, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -1271,16 +1280,19 @@ declare module "typescript" { GeneratorParameter = 8, >GeneratorParameter : ParserContextFlags - ThisNodeHasError = 16, + Decorator = 16, +>Decorator : ParserContextFlags + + ThisNodeHasError = 32, >ThisNodeHasError : ParserContextFlags - ParserGeneratedFlags = 31, + ParserGeneratedFlags = 63, >ParserGeneratedFlags : ParserContextFlags - ThisNodeOrAnySubNodesHasError = 32, + ThisNodeOrAnySubNodesHasError = 64, >ThisNodeOrAnySubNodesHasError : ParserContextFlags - HasAggregatedChildData = 64, + HasAggregatedChildData = 128, >HasAggregatedChildData : ParserContextFlags } const enum RelationComparisonResult { @@ -1311,6 +1323,11 @@ declare module "typescript" { >parserContextFlags : ParserContextFlags >ParserContextFlags : ParserContextFlags + decorators?: NodeArray; +>decorators : NodeArray +>NodeArray : NodeArray +>Decorator : Decorator + modifiers?: ModifiersArray; >modifiers : ModifiersArray >ModifiersArray : ModifiersArray @@ -1405,6 +1422,18 @@ declare module "typescript" { expression: Expression; >expression : Expression >Expression : Expression + } + interface Decorator extends Node { +>Decorator : Decorator +>Node : Node + + atToken: Node; +>atToken : Node +>Node : Node + + expression: LeftHandSideExpression; +>expression : LeftHandSideExpression +>LeftHandSideExpression : LeftHandSideExpression } interface TypeParameterDeclaration extends Declaration { >TypeParameterDeclaration : TypeParameterDeclaration @@ -2004,10 +2033,18 @@ declare module "typescript" { >ArrayLiteralExpression : ArrayLiteralExpression >PrimaryExpression : PrimaryExpression + openBracketToken: Node; +>openBracketToken : Node +>Node : Node + elements: NodeArray; >elements : NodeArray >NodeArray : NodeArray >Expression : Expression + + closeBracketToken: Node; +>closeBracketToken : Node +>Node : Node } interface SpreadElementExpression extends Expression { >SpreadElementExpression : SpreadElementExpression @@ -2051,9 +2088,17 @@ declare module "typescript" { >expression : LeftHandSideExpression >LeftHandSideExpression : LeftHandSideExpression + openBracketToken: Node; +>openBracketToken : Node +>Node : Node + argumentExpression?: Expression; >argumentExpression : Expression >Expression : Expression + + closeBracketToken: Node; +>closeBracketToken : Node +>Node : Node } interface CallExpression extends LeftHandSideExpression { >CallExpression : CallExpression