diff --git a/tests/baselines/reference/APISample_compile.js b/tests/baselines/reference/APISample_compile.js index 6840f079972..7725563214d 100644 --- a/tests/baselines/reference/APISample_compile.js +++ b/tests/baselines/reference/APISample_compile.js @@ -160,129 +160,136 @@ declare module "typescript" { VoidKeyword = 98, WhileKeyword = 99, WithKeyword = 100, - ImplementsKeyword = 101, - InterfaceKeyword = 102, - LetKeyword = 103, - PackageKeyword = 104, - PrivateKeyword = 105, - ProtectedKeyword = 106, - PublicKeyword = 107, - StaticKeyword = 108, - YieldKeyword = 109, - AnyKeyword = 110, - BooleanKeyword = 111, - ConstructorKeyword = 112, - DeclareKeyword = 113, - GetKeyword = 114, - ModuleKeyword = 115, - RequireKeyword = 116, - NumberKeyword = 117, - SetKeyword = 118, - StringKeyword = 119, - TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + AsKeyword = 101, + FromKeyword = 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, + TypeKeyword = 122, + QualifiedName = 123, + ComputedPropertyName = 124, + TypeParameter = 125, + Parameter = 126, + PropertySignature = 127, + PropertyDeclaration = 128, + MethodSignature = 129, + MethodDeclaration = 130, + Constructor = 131, + GetAccessor = 132, + SetAccessor = 133, + CallSignature = 134, + ConstructSignature = 135, + IndexSignature = 136, + TypeReference = 137, + FunctionType = 138, + ConstructorType = 139, + TypeQuery = 140, + TypeLiteral = 141, + ArrayType = 142, + TupleType = 143, + UnionType = 144, + ParenthesizedType = 145, + ObjectBindingPattern = 146, + ArrayBindingPattern = 147, + BindingElement = 148, + ArrayLiteralExpression = 149, + ObjectLiteralExpression = 150, + PropertyAccessExpression = 151, + ElementAccessExpression = 152, + CallExpression = 153, + NewExpression = 154, + TaggedTemplateExpression = 155, + TypeAssertionExpression = 156, + ParenthesizedExpression = 157, + FunctionExpression = 158, + ArrowFunction = 159, + DeleteExpression = 160, + TypeOfExpression = 161, + VoidExpression = 162, + PrefixUnaryExpression = 163, + PostfixUnaryExpression = 164, + BinaryExpression = 165, + ConditionalExpression = 166, + TemplateExpression = 167, + YieldExpression = 168, + SpreadElementExpression = 169, + OmittedExpression = 170, + TemplateSpan = 171, + Block = 172, + VariableStatement = 173, + EmptyStatement = 174, + ExpressionStatement = 175, + IfStatement = 176, + DoStatement = 177, + WhileStatement = 178, + ForStatement = 179, + ForInStatement = 180, + ContinueStatement = 181, + BreakStatement = 182, + ReturnStatement = 183, + WithStatement = 184, + SwitchStatement = 185, + LabeledStatement = 186, + ThrowStatement = 187, + TryStatement = 188, + DebuggerStatement = 189, + VariableDeclaration = 190, + VariableDeclarationList = 191, + FunctionDeclaration = 192, + ClassDeclaration = 193, + InterfaceDeclaration = 194, + TypeAliasDeclaration = 195, + EnumDeclaration = 196, + ModuleDeclaration = 197, + ModuleBlock = 198, + ImportEqualsDeclaration = 199, + ExportAssignment = 200, + ImportDeclaration = 201, + ImportClause = 202, + NamespaceImport = 203, + NamedImports = 204, + ImportSpecifier = 205, + ExternalModuleReference = 206, + CaseClause = 207, + DefaultClause = 208, + HeritageClause = 209, + CatchClause = 210, + PropertyAssignment = 211, + ShorthandPropertyAssignment = 212, + EnumMember = 213, + SourceFile = 214, + SyntaxList = 215, + Count = 216, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, - FirstFutureReservedWord = 101, - LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + LastKeyword = 122, + FirstFutureReservedWord = 103, + LastFutureReservedWord = 111, + FirstTypeNode = 137, + LastTypeNode = 145, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, - LastToken = 120, + LastToken = 122, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -291,7 +298,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 123, } const enum NodeFlags { Export = 1, @@ -702,13 +709,31 @@ declare module "typescript" { interface ModuleBlock extends Node, ModuleElement { statements: NodeArray; } - interface ImportDeclaration extends Declaration, ModuleElement { + interface ImportEqualsDeclaration extends Declaration, ModuleElement { name: Identifier; moduleReference: EntityName | ExternalModuleReference; } interface ExternalModuleReference extends Node { expression?: Expression; } + interface ImportDeclaration extends Statement, ModuleElement { + importClause?: ImportClause; + moduleSpecifier: Expression; + } + interface ImportClause extends Declaration { + name?: Identifier; + namedBindings?: NamespaceImport | NamedImports; + } + interface NamespaceImport extends Declaration { + name: Identifier; + } + interface NamedImports extends Node { + elements: NodeArray; + } + interface ImportSpecifier extends Declaration { + propertyName?: Identifier; + name: Identifier; + } interface ExportAssignment extends Statement, ModuleElement { exportName: Identifier; } @@ -869,7 +894,7 @@ declare module "typescript" { } interface SymbolVisibilityResult { accessibility: SymbolAccessibility; - aliasesToMakeVisible?: ImportDeclaration[]; + aliasesToMakeVisible?: ImportEqualsDeclaration[]; errorSymbolName?: string; errorNode?: Node; } @@ -880,8 +905,8 @@ declare module "typescript" { getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string; getExpressionNamePrefix(node: Identifier): string; getExportAssignmentName(node: SourceFile): string; - isReferencedImportDeclaration(node: ImportDeclaration): boolean; - isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean; + isReferencedImportDeclaration(node: Node): boolean; + isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; getNodeCheckFlags(node: Node): NodeCheckFlags; isDeclarationVisible(node: Declaration): boolean; isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; diff --git a/tests/baselines/reference/APISample_compile.types b/tests/baselines/reference/APISample_compile.types index d70172377ca..ceb647564bc 100644 --- a/tests/baselines/reference/APISample_compile.types +++ b/tests/baselines/reference/APISample_compile.types @@ -496,331 +496,352 @@ declare module "typescript" { WithKeyword = 100, >WithKeyword : SyntaxKind - ImplementsKeyword = 101, + AsKeyword = 101, +>AsKeyword : SyntaxKind + + FromKeyword = 102, +>FromKeyword : SyntaxKind + + ImplementsKeyword = 103, >ImplementsKeyword : SyntaxKind - InterfaceKeyword = 102, + InterfaceKeyword = 104, >InterfaceKeyword : SyntaxKind - LetKeyword = 103, + LetKeyword = 105, >LetKeyword : SyntaxKind - PackageKeyword = 104, + PackageKeyword = 106, >PackageKeyword : SyntaxKind - PrivateKeyword = 105, + PrivateKeyword = 107, >PrivateKeyword : SyntaxKind - ProtectedKeyword = 106, + ProtectedKeyword = 108, >ProtectedKeyword : SyntaxKind - PublicKeyword = 107, + PublicKeyword = 109, >PublicKeyword : SyntaxKind - StaticKeyword = 108, + StaticKeyword = 110, >StaticKeyword : SyntaxKind - YieldKeyword = 109, + YieldKeyword = 111, >YieldKeyword : SyntaxKind - AnyKeyword = 110, + AnyKeyword = 112, >AnyKeyword : SyntaxKind - BooleanKeyword = 111, + BooleanKeyword = 113, >BooleanKeyword : SyntaxKind - ConstructorKeyword = 112, + ConstructorKeyword = 114, >ConstructorKeyword : SyntaxKind - DeclareKeyword = 113, + DeclareKeyword = 115, >DeclareKeyword : SyntaxKind - GetKeyword = 114, + GetKeyword = 116, >GetKeyword : SyntaxKind - ModuleKeyword = 115, + ModuleKeyword = 117, >ModuleKeyword : SyntaxKind - RequireKeyword = 116, + RequireKeyword = 118, >RequireKeyword : SyntaxKind - NumberKeyword = 117, + NumberKeyword = 119, >NumberKeyword : SyntaxKind - SetKeyword = 118, + SetKeyword = 120, >SetKeyword : SyntaxKind - StringKeyword = 119, + StringKeyword = 121, >StringKeyword : SyntaxKind - TypeKeyword = 120, + TypeKeyword = 122, >TypeKeyword : SyntaxKind - QualifiedName = 121, + QualifiedName = 123, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 124, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 125, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 126, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 127, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 128, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 129, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 130, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 131, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 132, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 133, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 134, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 135, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 136, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 137, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 138, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 139, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 140, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 141, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 142, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 143, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 144, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 145, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 146, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 147, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 148, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 149, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 150, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 151, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 152, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 153, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 154, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 155, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 156, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 157, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 158, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 159, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 160, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 161, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 162, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 163, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 164, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 165, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 166, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 167, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 168, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 169, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 170, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 171, >TemplateSpan : SyntaxKind - Block = 170, + Block = 172, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 173, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 174, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 175, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 176, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 177, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 178, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 179, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 180, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ContinueStatement = 181, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 182, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 183, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 184, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 185, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 186, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 187, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 188, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 189, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 190, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 191, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 192, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 193, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 194, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 195, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 196, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 197, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 198, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, ->ImportDeclaration : SyntaxKind + ImportEqualsDeclaration = 199, +>ImportEqualsDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 200, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ImportDeclaration = 201, +>ImportDeclaration : SyntaxKind + + ImportClause = 202, +>ImportClause : SyntaxKind + + NamespaceImport = 203, +>NamespaceImport : SyntaxKind + + NamedImports = 204, +>NamedImports : SyntaxKind + + ImportSpecifier = 205, +>ImportSpecifier : SyntaxKind + + ExternalModuleReference = 206, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 207, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 208, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 209, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 210, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 211, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 212, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 213, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 214, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 215, >SyntaxList : SyntaxKind - Count = 209, + Count = 216, >Count : SyntaxKind FirstAssignment = 52, @@ -838,19 +859,19 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 122, >LastKeyword : SyntaxKind - FirstFutureReservedWord = 101, + FirstFutureReservedWord = 103, >FirstFutureReservedWord : SyntaxKind - LastFutureReservedWord = 109, + LastFutureReservedWord = 111, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 137, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 145, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -862,7 +883,7 @@ declare module "typescript" { FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 120, + LastToken = 122, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -889,7 +910,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 123, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -2131,8 +2152,8 @@ declare module "typescript" { >NodeArray : NodeArray >ModuleElement : ModuleElement } - interface ImportDeclaration extends Declaration, ModuleElement { ->ImportDeclaration : ImportDeclaration + interface ImportEqualsDeclaration extends Declaration, ModuleElement { +>ImportEqualsDeclaration : ImportEqualsDeclaration >Declaration : Declaration >ModuleElement : ModuleElement @@ -2152,6 +2173,61 @@ declare module "typescript" { expression?: Expression; >expression : Expression >Expression : Expression + } + interface ImportDeclaration extends Statement, ModuleElement { +>ImportDeclaration : ImportDeclaration +>Statement : Statement +>ModuleElement : ModuleElement + + importClause?: ImportClause; +>importClause : ImportClause +>ImportClause : ImportClause + + moduleSpecifier: Expression; +>moduleSpecifier : Expression +>Expression : Expression + } + interface ImportClause extends Declaration { +>ImportClause : ImportClause +>Declaration : Declaration + + name?: Identifier; +>name : Identifier +>Identifier : Identifier + + namedBindings?: NamespaceImport | NamedImports; +>namedBindings : NamespaceImport | NamedImports +>NamespaceImport : NamespaceImport +>NamedImports : NamedImports + } + interface NamespaceImport extends Declaration { +>NamespaceImport : NamespaceImport +>Declaration : Declaration + + name: Identifier; +>name : Identifier +>Identifier : Identifier + } + interface NamedImports extends Node { +>NamedImports : NamedImports +>Node : Node + + elements: NodeArray; +>elements : NodeArray +>NodeArray : NodeArray +>ImportSpecifier : ImportSpecifier + } + interface ImportSpecifier extends Declaration { +>ImportSpecifier : ImportSpecifier +>Declaration : Declaration + + propertyName?: Identifier; +>propertyName : Identifier +>Identifier : Identifier + + name: Identifier; +>name : Identifier +>Identifier : Identifier } interface ExportAssignment extends Statement, ModuleElement { >ExportAssignment : ExportAssignment @@ -2785,9 +2861,9 @@ declare module "typescript" { >accessibility : SymbolAccessibility >SymbolAccessibility : SymbolAccessibility - aliasesToMakeVisible?: ImportDeclaration[]; ->aliasesToMakeVisible : ImportDeclaration[] ->ImportDeclaration : ImportDeclaration + aliasesToMakeVisible?: ImportEqualsDeclaration[]; +>aliasesToMakeVisible : ImportEqualsDeclaration[] +>ImportEqualsDeclaration : ImportEqualsDeclaration errorSymbolName?: string; >errorSymbolName : string @@ -2822,15 +2898,15 @@ declare module "typescript" { >node : SourceFile >SourceFile : SourceFile - isReferencedImportDeclaration(node: ImportDeclaration): boolean; ->isReferencedImportDeclaration : (node: ImportDeclaration) => boolean ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration + isReferencedImportDeclaration(node: Node): boolean; +>isReferencedImportDeclaration : (node: Node) => boolean +>node : Node +>Node : Node - isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean; ->isTopLevelValueImportWithEntityName : (node: ImportDeclaration) => boolean ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration + isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; +>isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean +>node : ImportEqualsDeclaration +>ImportEqualsDeclaration : ImportEqualsDeclaration getNodeCheckFlags(node: Node): NodeCheckFlags; >getNodeCheckFlags : (node: Node) => NodeCheckFlags diff --git a/tests/baselines/reference/APISample_linter.js b/tests/baselines/reference/APISample_linter.js index c8bec722309..baaa55c9626 100644 --- a/tests/baselines/reference/APISample_linter.js +++ b/tests/baselines/reference/APISample_linter.js @@ -191,129 +191,136 @@ declare module "typescript" { VoidKeyword = 98, WhileKeyword = 99, WithKeyword = 100, - ImplementsKeyword = 101, - InterfaceKeyword = 102, - LetKeyword = 103, - PackageKeyword = 104, - PrivateKeyword = 105, - ProtectedKeyword = 106, - PublicKeyword = 107, - StaticKeyword = 108, - YieldKeyword = 109, - AnyKeyword = 110, - BooleanKeyword = 111, - ConstructorKeyword = 112, - DeclareKeyword = 113, - GetKeyword = 114, - ModuleKeyword = 115, - RequireKeyword = 116, - NumberKeyword = 117, - SetKeyword = 118, - StringKeyword = 119, - TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + AsKeyword = 101, + FromKeyword = 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, + TypeKeyword = 122, + QualifiedName = 123, + ComputedPropertyName = 124, + TypeParameter = 125, + Parameter = 126, + PropertySignature = 127, + PropertyDeclaration = 128, + MethodSignature = 129, + MethodDeclaration = 130, + Constructor = 131, + GetAccessor = 132, + SetAccessor = 133, + CallSignature = 134, + ConstructSignature = 135, + IndexSignature = 136, + TypeReference = 137, + FunctionType = 138, + ConstructorType = 139, + TypeQuery = 140, + TypeLiteral = 141, + ArrayType = 142, + TupleType = 143, + UnionType = 144, + ParenthesizedType = 145, + ObjectBindingPattern = 146, + ArrayBindingPattern = 147, + BindingElement = 148, + ArrayLiteralExpression = 149, + ObjectLiteralExpression = 150, + PropertyAccessExpression = 151, + ElementAccessExpression = 152, + CallExpression = 153, + NewExpression = 154, + TaggedTemplateExpression = 155, + TypeAssertionExpression = 156, + ParenthesizedExpression = 157, + FunctionExpression = 158, + ArrowFunction = 159, + DeleteExpression = 160, + TypeOfExpression = 161, + VoidExpression = 162, + PrefixUnaryExpression = 163, + PostfixUnaryExpression = 164, + BinaryExpression = 165, + ConditionalExpression = 166, + TemplateExpression = 167, + YieldExpression = 168, + SpreadElementExpression = 169, + OmittedExpression = 170, + TemplateSpan = 171, + Block = 172, + VariableStatement = 173, + EmptyStatement = 174, + ExpressionStatement = 175, + IfStatement = 176, + DoStatement = 177, + WhileStatement = 178, + ForStatement = 179, + ForInStatement = 180, + ContinueStatement = 181, + BreakStatement = 182, + ReturnStatement = 183, + WithStatement = 184, + SwitchStatement = 185, + LabeledStatement = 186, + ThrowStatement = 187, + TryStatement = 188, + DebuggerStatement = 189, + VariableDeclaration = 190, + VariableDeclarationList = 191, + FunctionDeclaration = 192, + ClassDeclaration = 193, + InterfaceDeclaration = 194, + TypeAliasDeclaration = 195, + EnumDeclaration = 196, + ModuleDeclaration = 197, + ModuleBlock = 198, + ImportEqualsDeclaration = 199, + ExportAssignment = 200, + ImportDeclaration = 201, + ImportClause = 202, + NamespaceImport = 203, + NamedImports = 204, + ImportSpecifier = 205, + ExternalModuleReference = 206, + CaseClause = 207, + DefaultClause = 208, + HeritageClause = 209, + CatchClause = 210, + PropertyAssignment = 211, + ShorthandPropertyAssignment = 212, + EnumMember = 213, + SourceFile = 214, + SyntaxList = 215, + Count = 216, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, - FirstFutureReservedWord = 101, - LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + LastKeyword = 122, + FirstFutureReservedWord = 103, + LastFutureReservedWord = 111, + FirstTypeNode = 137, + LastTypeNode = 145, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, - LastToken = 120, + LastToken = 122, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -322,7 +329,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 123, } const enum NodeFlags { Export = 1, @@ -733,13 +740,31 @@ declare module "typescript" { interface ModuleBlock extends Node, ModuleElement { statements: NodeArray; } - interface ImportDeclaration extends Declaration, ModuleElement { + interface ImportEqualsDeclaration extends Declaration, ModuleElement { name: Identifier; moduleReference: EntityName | ExternalModuleReference; } interface ExternalModuleReference extends Node { expression?: Expression; } + interface ImportDeclaration extends Statement, ModuleElement { + importClause?: ImportClause; + moduleSpecifier: Expression; + } + interface ImportClause extends Declaration { + name?: Identifier; + namedBindings?: NamespaceImport | NamedImports; + } + interface NamespaceImport extends Declaration { + name: Identifier; + } + interface NamedImports extends Node { + elements: NodeArray; + } + interface ImportSpecifier extends Declaration { + propertyName?: Identifier; + name: Identifier; + } interface ExportAssignment extends Statement, ModuleElement { exportName: Identifier; } @@ -900,7 +925,7 @@ declare module "typescript" { } interface SymbolVisibilityResult { accessibility: SymbolAccessibility; - aliasesToMakeVisible?: ImportDeclaration[]; + aliasesToMakeVisible?: ImportEqualsDeclaration[]; errorSymbolName?: string; errorNode?: Node; } @@ -911,8 +936,8 @@ declare module "typescript" { getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string; getExpressionNamePrefix(node: Identifier): string; getExportAssignmentName(node: SourceFile): string; - isReferencedImportDeclaration(node: ImportDeclaration): boolean; - isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean; + isReferencedImportDeclaration(node: Node): boolean; + isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; getNodeCheckFlags(node: Node): NodeCheckFlags; isDeclarationVisible(node: Declaration): boolean; isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; @@ -1951,24 +1976,24 @@ function delint(sourceFile) { delintNode(sourceFile); function delintNode(node) { switch (node.kind) { - case 177 /* ForStatement */: - case 178 /* ForInStatement */: - case 176 /* WhileStatement */: - case 175 /* DoStatement */: - if (node.statement.kind !== 170 /* Block */) { + case 179 /* ForStatement */: + case 180 /* ForInStatement */: + case 178 /* WhileStatement */: + case 177 /* DoStatement */: + if (node.statement.kind !== 172 /* Block */) { report(node, "A looping statement's contents should be wrapped in a block body."); } break; - case 174 /* IfStatement */: + case 176 /* IfStatement */: var ifStatement = node; - if (ifStatement.thenStatement.kind !== 170 /* Block */) { + if (ifStatement.thenStatement.kind !== 172 /* Block */) { report(ifStatement.thenStatement, "An if statement's contents should be wrapped in a block body."); } - if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 170 /* Block */ && ifStatement.elseStatement.kind !== 174 /* IfStatement */) { + if (ifStatement.elseStatement && ifStatement.elseStatement.kind !== 172 /* Block */ && ifStatement.elseStatement.kind !== 176 /* IfStatement */) { report(ifStatement.elseStatement, "An else statement's contents should be wrapped in a block body."); } break; - case 163 /* BinaryExpression */: + case 165 /* BinaryExpression */: var op = node.operator; if (op === 28 /* EqualsEqualsToken */ || op === 29 /* ExclamationEqualsToken */) { report(node, "Use '===' and '!=='."); diff --git a/tests/baselines/reference/APISample_linter.types b/tests/baselines/reference/APISample_linter.types index 26254c69d54..5daa9aca11c 100644 --- a/tests/baselines/reference/APISample_linter.types +++ b/tests/baselines/reference/APISample_linter.types @@ -640,331 +640,352 @@ declare module "typescript" { WithKeyword = 100, >WithKeyword : SyntaxKind - ImplementsKeyword = 101, + AsKeyword = 101, +>AsKeyword : SyntaxKind + + FromKeyword = 102, +>FromKeyword : SyntaxKind + + ImplementsKeyword = 103, >ImplementsKeyword : SyntaxKind - InterfaceKeyword = 102, + InterfaceKeyword = 104, >InterfaceKeyword : SyntaxKind - LetKeyword = 103, + LetKeyword = 105, >LetKeyword : SyntaxKind - PackageKeyword = 104, + PackageKeyword = 106, >PackageKeyword : SyntaxKind - PrivateKeyword = 105, + PrivateKeyword = 107, >PrivateKeyword : SyntaxKind - ProtectedKeyword = 106, + ProtectedKeyword = 108, >ProtectedKeyword : SyntaxKind - PublicKeyword = 107, + PublicKeyword = 109, >PublicKeyword : SyntaxKind - StaticKeyword = 108, + StaticKeyword = 110, >StaticKeyword : SyntaxKind - YieldKeyword = 109, + YieldKeyword = 111, >YieldKeyword : SyntaxKind - AnyKeyword = 110, + AnyKeyword = 112, >AnyKeyword : SyntaxKind - BooleanKeyword = 111, + BooleanKeyword = 113, >BooleanKeyword : SyntaxKind - ConstructorKeyword = 112, + ConstructorKeyword = 114, >ConstructorKeyword : SyntaxKind - DeclareKeyword = 113, + DeclareKeyword = 115, >DeclareKeyword : SyntaxKind - GetKeyword = 114, + GetKeyword = 116, >GetKeyword : SyntaxKind - ModuleKeyword = 115, + ModuleKeyword = 117, >ModuleKeyword : SyntaxKind - RequireKeyword = 116, + RequireKeyword = 118, >RequireKeyword : SyntaxKind - NumberKeyword = 117, + NumberKeyword = 119, >NumberKeyword : SyntaxKind - SetKeyword = 118, + SetKeyword = 120, >SetKeyword : SyntaxKind - StringKeyword = 119, + StringKeyword = 121, >StringKeyword : SyntaxKind - TypeKeyword = 120, + TypeKeyword = 122, >TypeKeyword : SyntaxKind - QualifiedName = 121, + QualifiedName = 123, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 124, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 125, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 126, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 127, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 128, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 129, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 130, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 131, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 132, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 133, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 134, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 135, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 136, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 137, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 138, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 139, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 140, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 141, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 142, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 143, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 144, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 145, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 146, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 147, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 148, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 149, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 150, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 151, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 152, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 153, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 154, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 155, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 156, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 157, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 158, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 159, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 160, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 161, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 162, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 163, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 164, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 165, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 166, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 167, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 168, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 169, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 170, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 171, >TemplateSpan : SyntaxKind - Block = 170, + Block = 172, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 173, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 174, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 175, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 176, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 177, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 178, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 179, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 180, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ContinueStatement = 181, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 182, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 183, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 184, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 185, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 186, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 187, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 188, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 189, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 190, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 191, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 192, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 193, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 194, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 195, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 196, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 197, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 198, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, ->ImportDeclaration : SyntaxKind + ImportEqualsDeclaration = 199, +>ImportEqualsDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 200, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ImportDeclaration = 201, +>ImportDeclaration : SyntaxKind + + ImportClause = 202, +>ImportClause : SyntaxKind + + NamespaceImport = 203, +>NamespaceImport : SyntaxKind + + NamedImports = 204, +>NamedImports : SyntaxKind + + ImportSpecifier = 205, +>ImportSpecifier : SyntaxKind + + ExternalModuleReference = 206, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 207, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 208, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 209, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 210, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 211, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 212, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 213, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 214, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 215, >SyntaxList : SyntaxKind - Count = 209, + Count = 216, >Count : SyntaxKind FirstAssignment = 52, @@ -982,19 +1003,19 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 122, >LastKeyword : SyntaxKind - FirstFutureReservedWord = 101, + FirstFutureReservedWord = 103, >FirstFutureReservedWord : SyntaxKind - LastFutureReservedWord = 109, + LastFutureReservedWord = 111, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 137, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 145, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -1006,7 +1027,7 @@ declare module "typescript" { FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 120, + LastToken = 122, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -1033,7 +1054,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 123, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -2275,8 +2296,8 @@ declare module "typescript" { >NodeArray : NodeArray >ModuleElement : ModuleElement } - interface ImportDeclaration extends Declaration, ModuleElement { ->ImportDeclaration : ImportDeclaration + interface ImportEqualsDeclaration extends Declaration, ModuleElement { +>ImportEqualsDeclaration : ImportEqualsDeclaration >Declaration : Declaration >ModuleElement : ModuleElement @@ -2296,6 +2317,61 @@ declare module "typescript" { expression?: Expression; >expression : Expression >Expression : Expression + } + interface ImportDeclaration extends Statement, ModuleElement { +>ImportDeclaration : ImportDeclaration +>Statement : Statement +>ModuleElement : ModuleElement + + importClause?: ImportClause; +>importClause : ImportClause +>ImportClause : ImportClause + + moduleSpecifier: Expression; +>moduleSpecifier : Expression +>Expression : Expression + } + interface ImportClause extends Declaration { +>ImportClause : ImportClause +>Declaration : Declaration + + name?: Identifier; +>name : Identifier +>Identifier : Identifier + + namedBindings?: NamespaceImport | NamedImports; +>namedBindings : NamespaceImport | NamedImports +>NamespaceImport : NamespaceImport +>NamedImports : NamedImports + } + interface NamespaceImport extends Declaration { +>NamespaceImport : NamespaceImport +>Declaration : Declaration + + name: Identifier; +>name : Identifier +>Identifier : Identifier + } + interface NamedImports extends Node { +>NamedImports : NamedImports +>Node : Node + + elements: NodeArray; +>elements : NodeArray +>NodeArray : NodeArray +>ImportSpecifier : ImportSpecifier + } + interface ImportSpecifier extends Declaration { +>ImportSpecifier : ImportSpecifier +>Declaration : Declaration + + propertyName?: Identifier; +>propertyName : Identifier +>Identifier : Identifier + + name: Identifier; +>name : Identifier +>Identifier : Identifier } interface ExportAssignment extends Statement, ModuleElement { >ExportAssignment : ExportAssignment @@ -2929,9 +3005,9 @@ declare module "typescript" { >accessibility : SymbolAccessibility >SymbolAccessibility : SymbolAccessibility - aliasesToMakeVisible?: ImportDeclaration[]; ->aliasesToMakeVisible : ImportDeclaration[] ->ImportDeclaration : ImportDeclaration + aliasesToMakeVisible?: ImportEqualsDeclaration[]; +>aliasesToMakeVisible : ImportEqualsDeclaration[] +>ImportEqualsDeclaration : ImportEqualsDeclaration errorSymbolName?: string; >errorSymbolName : string @@ -2966,15 +3042,15 @@ declare module "typescript" { >node : SourceFile >SourceFile : SourceFile - isReferencedImportDeclaration(node: ImportDeclaration): boolean; ->isReferencedImportDeclaration : (node: ImportDeclaration) => boolean ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration + isReferencedImportDeclaration(node: Node): boolean; +>isReferencedImportDeclaration : (node: Node) => boolean +>node : Node +>Node : Node - isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean; ->isTopLevelValueImportWithEntityName : (node: ImportDeclaration) => boolean ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration + isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; +>isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean +>node : ImportEqualsDeclaration +>ImportEqualsDeclaration : ImportEqualsDeclaration getNodeCheckFlags(node: Node): NodeCheckFlags; >getNodeCheckFlags : (node: Node) => NodeCheckFlags diff --git a/tests/baselines/reference/APISample_transform.js b/tests/baselines/reference/APISample_transform.js index ad66d289eb7..8e920c476f4 100644 --- a/tests/baselines/reference/APISample_transform.js +++ b/tests/baselines/reference/APISample_transform.js @@ -192,129 +192,136 @@ declare module "typescript" { VoidKeyword = 98, WhileKeyword = 99, WithKeyword = 100, - ImplementsKeyword = 101, - InterfaceKeyword = 102, - LetKeyword = 103, - PackageKeyword = 104, - PrivateKeyword = 105, - ProtectedKeyword = 106, - PublicKeyword = 107, - StaticKeyword = 108, - YieldKeyword = 109, - AnyKeyword = 110, - BooleanKeyword = 111, - ConstructorKeyword = 112, - DeclareKeyword = 113, - GetKeyword = 114, - ModuleKeyword = 115, - RequireKeyword = 116, - NumberKeyword = 117, - SetKeyword = 118, - StringKeyword = 119, - TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + AsKeyword = 101, + FromKeyword = 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, + TypeKeyword = 122, + QualifiedName = 123, + ComputedPropertyName = 124, + TypeParameter = 125, + Parameter = 126, + PropertySignature = 127, + PropertyDeclaration = 128, + MethodSignature = 129, + MethodDeclaration = 130, + Constructor = 131, + GetAccessor = 132, + SetAccessor = 133, + CallSignature = 134, + ConstructSignature = 135, + IndexSignature = 136, + TypeReference = 137, + FunctionType = 138, + ConstructorType = 139, + TypeQuery = 140, + TypeLiteral = 141, + ArrayType = 142, + TupleType = 143, + UnionType = 144, + ParenthesizedType = 145, + ObjectBindingPattern = 146, + ArrayBindingPattern = 147, + BindingElement = 148, + ArrayLiteralExpression = 149, + ObjectLiteralExpression = 150, + PropertyAccessExpression = 151, + ElementAccessExpression = 152, + CallExpression = 153, + NewExpression = 154, + TaggedTemplateExpression = 155, + TypeAssertionExpression = 156, + ParenthesizedExpression = 157, + FunctionExpression = 158, + ArrowFunction = 159, + DeleteExpression = 160, + TypeOfExpression = 161, + VoidExpression = 162, + PrefixUnaryExpression = 163, + PostfixUnaryExpression = 164, + BinaryExpression = 165, + ConditionalExpression = 166, + TemplateExpression = 167, + YieldExpression = 168, + SpreadElementExpression = 169, + OmittedExpression = 170, + TemplateSpan = 171, + Block = 172, + VariableStatement = 173, + EmptyStatement = 174, + ExpressionStatement = 175, + IfStatement = 176, + DoStatement = 177, + WhileStatement = 178, + ForStatement = 179, + ForInStatement = 180, + ContinueStatement = 181, + BreakStatement = 182, + ReturnStatement = 183, + WithStatement = 184, + SwitchStatement = 185, + LabeledStatement = 186, + ThrowStatement = 187, + TryStatement = 188, + DebuggerStatement = 189, + VariableDeclaration = 190, + VariableDeclarationList = 191, + FunctionDeclaration = 192, + ClassDeclaration = 193, + InterfaceDeclaration = 194, + TypeAliasDeclaration = 195, + EnumDeclaration = 196, + ModuleDeclaration = 197, + ModuleBlock = 198, + ImportEqualsDeclaration = 199, + ExportAssignment = 200, + ImportDeclaration = 201, + ImportClause = 202, + NamespaceImport = 203, + NamedImports = 204, + ImportSpecifier = 205, + ExternalModuleReference = 206, + CaseClause = 207, + DefaultClause = 208, + HeritageClause = 209, + CatchClause = 210, + PropertyAssignment = 211, + ShorthandPropertyAssignment = 212, + EnumMember = 213, + SourceFile = 214, + SyntaxList = 215, + Count = 216, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, - FirstFutureReservedWord = 101, - LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + LastKeyword = 122, + FirstFutureReservedWord = 103, + LastFutureReservedWord = 111, + FirstTypeNode = 137, + LastTypeNode = 145, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, - LastToken = 120, + LastToken = 122, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -323,7 +330,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 123, } const enum NodeFlags { Export = 1, @@ -734,13 +741,31 @@ declare module "typescript" { interface ModuleBlock extends Node, ModuleElement { statements: NodeArray; } - interface ImportDeclaration extends Declaration, ModuleElement { + interface ImportEqualsDeclaration extends Declaration, ModuleElement { name: Identifier; moduleReference: EntityName | ExternalModuleReference; } interface ExternalModuleReference extends Node { expression?: Expression; } + interface ImportDeclaration extends Statement, ModuleElement { + importClause?: ImportClause; + moduleSpecifier: Expression; + } + interface ImportClause extends Declaration { + name?: Identifier; + namedBindings?: NamespaceImport | NamedImports; + } + interface NamespaceImport extends Declaration { + name: Identifier; + } + interface NamedImports extends Node { + elements: NodeArray; + } + interface ImportSpecifier extends Declaration { + propertyName?: Identifier; + name: Identifier; + } interface ExportAssignment extends Statement, ModuleElement { exportName: Identifier; } @@ -901,7 +926,7 @@ declare module "typescript" { } interface SymbolVisibilityResult { accessibility: SymbolAccessibility; - aliasesToMakeVisible?: ImportDeclaration[]; + aliasesToMakeVisible?: ImportEqualsDeclaration[]; errorSymbolName?: string; errorNode?: Node; } @@ -912,8 +937,8 @@ declare module "typescript" { getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string; getExpressionNamePrefix(node: Identifier): string; getExportAssignmentName(node: SourceFile): string; - isReferencedImportDeclaration(node: ImportDeclaration): boolean; - isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean; + isReferencedImportDeclaration(node: Node): boolean; + isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; getNodeCheckFlags(node: Node): NodeCheckFlags; isDeclarationVisible(node: Declaration): boolean; isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; diff --git a/tests/baselines/reference/APISample_transform.types b/tests/baselines/reference/APISample_transform.types index c6d74cc811d..142165ab4ec 100644 --- a/tests/baselines/reference/APISample_transform.types +++ b/tests/baselines/reference/APISample_transform.types @@ -592,331 +592,352 @@ declare module "typescript" { WithKeyword = 100, >WithKeyword : SyntaxKind - ImplementsKeyword = 101, + AsKeyword = 101, +>AsKeyword : SyntaxKind + + FromKeyword = 102, +>FromKeyword : SyntaxKind + + ImplementsKeyword = 103, >ImplementsKeyword : SyntaxKind - InterfaceKeyword = 102, + InterfaceKeyword = 104, >InterfaceKeyword : SyntaxKind - LetKeyword = 103, + LetKeyword = 105, >LetKeyword : SyntaxKind - PackageKeyword = 104, + PackageKeyword = 106, >PackageKeyword : SyntaxKind - PrivateKeyword = 105, + PrivateKeyword = 107, >PrivateKeyword : SyntaxKind - ProtectedKeyword = 106, + ProtectedKeyword = 108, >ProtectedKeyword : SyntaxKind - PublicKeyword = 107, + PublicKeyword = 109, >PublicKeyword : SyntaxKind - StaticKeyword = 108, + StaticKeyword = 110, >StaticKeyword : SyntaxKind - YieldKeyword = 109, + YieldKeyword = 111, >YieldKeyword : SyntaxKind - AnyKeyword = 110, + AnyKeyword = 112, >AnyKeyword : SyntaxKind - BooleanKeyword = 111, + BooleanKeyword = 113, >BooleanKeyword : SyntaxKind - ConstructorKeyword = 112, + ConstructorKeyword = 114, >ConstructorKeyword : SyntaxKind - DeclareKeyword = 113, + DeclareKeyword = 115, >DeclareKeyword : SyntaxKind - GetKeyword = 114, + GetKeyword = 116, >GetKeyword : SyntaxKind - ModuleKeyword = 115, + ModuleKeyword = 117, >ModuleKeyword : SyntaxKind - RequireKeyword = 116, + RequireKeyword = 118, >RequireKeyword : SyntaxKind - NumberKeyword = 117, + NumberKeyword = 119, >NumberKeyword : SyntaxKind - SetKeyword = 118, + SetKeyword = 120, >SetKeyword : SyntaxKind - StringKeyword = 119, + StringKeyword = 121, >StringKeyword : SyntaxKind - TypeKeyword = 120, + TypeKeyword = 122, >TypeKeyword : SyntaxKind - QualifiedName = 121, + QualifiedName = 123, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 124, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 125, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 126, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 127, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 128, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 129, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 130, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 131, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 132, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 133, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 134, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 135, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 136, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 137, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 138, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 139, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 140, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 141, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 142, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 143, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 144, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 145, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 146, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 147, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 148, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 149, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 150, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 151, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 152, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 153, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 154, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 155, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 156, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 157, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 158, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 159, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 160, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 161, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 162, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 163, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 164, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 165, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 166, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 167, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 168, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 169, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 170, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 171, >TemplateSpan : SyntaxKind - Block = 170, + Block = 172, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 173, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 174, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 175, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 176, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 177, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 178, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 179, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 180, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ContinueStatement = 181, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 182, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 183, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 184, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 185, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 186, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 187, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 188, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 189, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 190, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 191, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 192, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 193, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 194, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 195, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 196, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 197, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 198, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, ->ImportDeclaration : SyntaxKind + ImportEqualsDeclaration = 199, +>ImportEqualsDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 200, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ImportDeclaration = 201, +>ImportDeclaration : SyntaxKind + + ImportClause = 202, +>ImportClause : SyntaxKind + + NamespaceImport = 203, +>NamespaceImport : SyntaxKind + + NamedImports = 204, +>NamedImports : SyntaxKind + + ImportSpecifier = 205, +>ImportSpecifier : SyntaxKind + + ExternalModuleReference = 206, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 207, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 208, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 209, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 210, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 211, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 212, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 213, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 214, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 215, >SyntaxList : SyntaxKind - Count = 209, + Count = 216, >Count : SyntaxKind FirstAssignment = 52, @@ -934,19 +955,19 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 122, >LastKeyword : SyntaxKind - FirstFutureReservedWord = 101, + FirstFutureReservedWord = 103, >FirstFutureReservedWord : SyntaxKind - LastFutureReservedWord = 109, + LastFutureReservedWord = 111, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 137, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 145, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -958,7 +979,7 @@ declare module "typescript" { FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 120, + LastToken = 122, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -985,7 +1006,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 123, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -2227,8 +2248,8 @@ declare module "typescript" { >NodeArray : NodeArray >ModuleElement : ModuleElement } - interface ImportDeclaration extends Declaration, ModuleElement { ->ImportDeclaration : ImportDeclaration + interface ImportEqualsDeclaration extends Declaration, ModuleElement { +>ImportEqualsDeclaration : ImportEqualsDeclaration >Declaration : Declaration >ModuleElement : ModuleElement @@ -2248,6 +2269,61 @@ declare module "typescript" { expression?: Expression; >expression : Expression >Expression : Expression + } + interface ImportDeclaration extends Statement, ModuleElement { +>ImportDeclaration : ImportDeclaration +>Statement : Statement +>ModuleElement : ModuleElement + + importClause?: ImportClause; +>importClause : ImportClause +>ImportClause : ImportClause + + moduleSpecifier: Expression; +>moduleSpecifier : Expression +>Expression : Expression + } + interface ImportClause extends Declaration { +>ImportClause : ImportClause +>Declaration : Declaration + + name?: Identifier; +>name : Identifier +>Identifier : Identifier + + namedBindings?: NamespaceImport | NamedImports; +>namedBindings : NamespaceImport | NamedImports +>NamespaceImport : NamespaceImport +>NamedImports : NamedImports + } + interface NamespaceImport extends Declaration { +>NamespaceImport : NamespaceImport +>Declaration : Declaration + + name: Identifier; +>name : Identifier +>Identifier : Identifier + } + interface NamedImports extends Node { +>NamedImports : NamedImports +>Node : Node + + elements: NodeArray; +>elements : NodeArray +>NodeArray : NodeArray +>ImportSpecifier : ImportSpecifier + } + interface ImportSpecifier extends Declaration { +>ImportSpecifier : ImportSpecifier +>Declaration : Declaration + + propertyName?: Identifier; +>propertyName : Identifier +>Identifier : Identifier + + name: Identifier; +>name : Identifier +>Identifier : Identifier } interface ExportAssignment extends Statement, ModuleElement { >ExportAssignment : ExportAssignment @@ -2881,9 +2957,9 @@ declare module "typescript" { >accessibility : SymbolAccessibility >SymbolAccessibility : SymbolAccessibility - aliasesToMakeVisible?: ImportDeclaration[]; ->aliasesToMakeVisible : ImportDeclaration[] ->ImportDeclaration : ImportDeclaration + aliasesToMakeVisible?: ImportEqualsDeclaration[]; +>aliasesToMakeVisible : ImportEqualsDeclaration[] +>ImportEqualsDeclaration : ImportEqualsDeclaration errorSymbolName?: string; >errorSymbolName : string @@ -2918,15 +2994,15 @@ declare module "typescript" { >node : SourceFile >SourceFile : SourceFile - isReferencedImportDeclaration(node: ImportDeclaration): boolean; ->isReferencedImportDeclaration : (node: ImportDeclaration) => boolean ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration + isReferencedImportDeclaration(node: Node): boolean; +>isReferencedImportDeclaration : (node: Node) => boolean +>node : Node +>Node : Node - isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean; ->isTopLevelValueImportWithEntityName : (node: ImportDeclaration) => boolean ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration + isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; +>isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean +>node : ImportEqualsDeclaration +>ImportEqualsDeclaration : ImportEqualsDeclaration getNodeCheckFlags(node: Node): NodeCheckFlags; >getNodeCheckFlags : (node: Node) => NodeCheckFlags diff --git a/tests/baselines/reference/APISample_watcher.js b/tests/baselines/reference/APISample_watcher.js index 2add8dfd45e..5d9055b357c 100644 --- a/tests/baselines/reference/APISample_watcher.js +++ b/tests/baselines/reference/APISample_watcher.js @@ -229,129 +229,136 @@ declare module "typescript" { VoidKeyword = 98, WhileKeyword = 99, WithKeyword = 100, - ImplementsKeyword = 101, - InterfaceKeyword = 102, - LetKeyword = 103, - PackageKeyword = 104, - PrivateKeyword = 105, - ProtectedKeyword = 106, - PublicKeyword = 107, - StaticKeyword = 108, - YieldKeyword = 109, - AnyKeyword = 110, - BooleanKeyword = 111, - ConstructorKeyword = 112, - DeclareKeyword = 113, - GetKeyword = 114, - ModuleKeyword = 115, - RequireKeyword = 116, - NumberKeyword = 117, - SetKeyword = 118, - StringKeyword = 119, - TypeKeyword = 120, - QualifiedName = 121, - ComputedPropertyName = 122, - TypeParameter = 123, - Parameter = 124, - PropertySignature = 125, - PropertyDeclaration = 126, - MethodSignature = 127, - MethodDeclaration = 128, - Constructor = 129, - GetAccessor = 130, - SetAccessor = 131, - CallSignature = 132, - ConstructSignature = 133, - IndexSignature = 134, - TypeReference = 135, - FunctionType = 136, - ConstructorType = 137, - TypeQuery = 138, - TypeLiteral = 139, - ArrayType = 140, - TupleType = 141, - UnionType = 142, - ParenthesizedType = 143, - ObjectBindingPattern = 144, - ArrayBindingPattern = 145, - BindingElement = 146, - ArrayLiteralExpression = 147, - ObjectLiteralExpression = 148, - PropertyAccessExpression = 149, - ElementAccessExpression = 150, - CallExpression = 151, - NewExpression = 152, - TaggedTemplateExpression = 153, - TypeAssertionExpression = 154, - ParenthesizedExpression = 155, - FunctionExpression = 156, - ArrowFunction = 157, - DeleteExpression = 158, - TypeOfExpression = 159, - VoidExpression = 160, - PrefixUnaryExpression = 161, - PostfixUnaryExpression = 162, - BinaryExpression = 163, - ConditionalExpression = 164, - TemplateExpression = 165, - YieldExpression = 166, - SpreadElementExpression = 167, - OmittedExpression = 168, - TemplateSpan = 169, - Block = 170, - VariableStatement = 171, - EmptyStatement = 172, - ExpressionStatement = 173, - IfStatement = 174, - DoStatement = 175, - WhileStatement = 176, - ForStatement = 177, - ForInStatement = 178, - ContinueStatement = 179, - BreakStatement = 180, - ReturnStatement = 181, - WithStatement = 182, - SwitchStatement = 183, - LabeledStatement = 184, - ThrowStatement = 185, - TryStatement = 186, - DebuggerStatement = 187, - VariableDeclaration = 188, - VariableDeclarationList = 189, - FunctionDeclaration = 190, - ClassDeclaration = 191, - InterfaceDeclaration = 192, - TypeAliasDeclaration = 193, - EnumDeclaration = 194, - ModuleDeclaration = 195, - ModuleBlock = 196, - ImportDeclaration = 197, - ExportAssignment = 198, - ExternalModuleReference = 199, - CaseClause = 200, - DefaultClause = 201, - HeritageClause = 202, - CatchClause = 203, - PropertyAssignment = 204, - ShorthandPropertyAssignment = 205, - EnumMember = 206, - SourceFile = 207, - SyntaxList = 208, - Count = 209, + AsKeyword = 101, + FromKeyword = 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, + TypeKeyword = 122, + QualifiedName = 123, + ComputedPropertyName = 124, + TypeParameter = 125, + Parameter = 126, + PropertySignature = 127, + PropertyDeclaration = 128, + MethodSignature = 129, + MethodDeclaration = 130, + Constructor = 131, + GetAccessor = 132, + SetAccessor = 133, + CallSignature = 134, + ConstructSignature = 135, + IndexSignature = 136, + TypeReference = 137, + FunctionType = 138, + ConstructorType = 139, + TypeQuery = 140, + TypeLiteral = 141, + ArrayType = 142, + TupleType = 143, + UnionType = 144, + ParenthesizedType = 145, + ObjectBindingPattern = 146, + ArrayBindingPattern = 147, + BindingElement = 148, + ArrayLiteralExpression = 149, + ObjectLiteralExpression = 150, + PropertyAccessExpression = 151, + ElementAccessExpression = 152, + CallExpression = 153, + NewExpression = 154, + TaggedTemplateExpression = 155, + TypeAssertionExpression = 156, + ParenthesizedExpression = 157, + FunctionExpression = 158, + ArrowFunction = 159, + DeleteExpression = 160, + TypeOfExpression = 161, + VoidExpression = 162, + PrefixUnaryExpression = 163, + PostfixUnaryExpression = 164, + BinaryExpression = 165, + ConditionalExpression = 166, + TemplateExpression = 167, + YieldExpression = 168, + SpreadElementExpression = 169, + OmittedExpression = 170, + TemplateSpan = 171, + Block = 172, + VariableStatement = 173, + EmptyStatement = 174, + ExpressionStatement = 175, + IfStatement = 176, + DoStatement = 177, + WhileStatement = 178, + ForStatement = 179, + ForInStatement = 180, + ContinueStatement = 181, + BreakStatement = 182, + ReturnStatement = 183, + WithStatement = 184, + SwitchStatement = 185, + LabeledStatement = 186, + ThrowStatement = 187, + TryStatement = 188, + DebuggerStatement = 189, + VariableDeclaration = 190, + VariableDeclarationList = 191, + FunctionDeclaration = 192, + ClassDeclaration = 193, + InterfaceDeclaration = 194, + TypeAliasDeclaration = 195, + EnumDeclaration = 196, + ModuleDeclaration = 197, + ModuleBlock = 198, + ImportEqualsDeclaration = 199, + ExportAssignment = 200, + ImportDeclaration = 201, + ImportClause = 202, + NamespaceImport = 203, + NamedImports = 204, + ImportSpecifier = 205, + ExternalModuleReference = 206, + CaseClause = 207, + DefaultClause = 208, + HeritageClause = 209, + CatchClause = 210, + PropertyAssignment = 211, + ShorthandPropertyAssignment = 212, + EnumMember = 213, + SourceFile = 214, + SyntaxList = 215, + Count = 216, FirstAssignment = 52, LastAssignment = 63, FirstReservedWord = 65, LastReservedWord = 100, FirstKeyword = 65, - LastKeyword = 120, - FirstFutureReservedWord = 101, - LastFutureReservedWord = 109, - FirstTypeNode = 135, - LastTypeNode = 143, + LastKeyword = 122, + FirstFutureReservedWord = 103, + LastFutureReservedWord = 111, + FirstTypeNode = 137, + LastTypeNode = 145, FirstPunctuation = 14, LastPunctuation = 63, FirstToken = 0, - LastToken = 120, + LastToken = 122, FirstTriviaToken = 2, LastTriviaToken = 6, FirstLiteralToken = 7, @@ -360,7 +367,7 @@ declare module "typescript" { LastTemplateToken = 13, FirstBinaryOperator = 24, LastBinaryOperator = 63, - FirstNode = 121, + FirstNode = 123, } const enum NodeFlags { Export = 1, @@ -771,13 +778,31 @@ declare module "typescript" { interface ModuleBlock extends Node, ModuleElement { statements: NodeArray; } - interface ImportDeclaration extends Declaration, ModuleElement { + interface ImportEqualsDeclaration extends Declaration, ModuleElement { name: Identifier; moduleReference: EntityName | ExternalModuleReference; } interface ExternalModuleReference extends Node { expression?: Expression; } + interface ImportDeclaration extends Statement, ModuleElement { + importClause?: ImportClause; + moduleSpecifier: Expression; + } + interface ImportClause extends Declaration { + name?: Identifier; + namedBindings?: NamespaceImport | NamedImports; + } + interface NamespaceImport extends Declaration { + name: Identifier; + } + interface NamedImports extends Node { + elements: NodeArray; + } + interface ImportSpecifier extends Declaration { + propertyName?: Identifier; + name: Identifier; + } interface ExportAssignment extends Statement, ModuleElement { exportName: Identifier; } @@ -938,7 +963,7 @@ declare module "typescript" { } interface SymbolVisibilityResult { accessibility: SymbolAccessibility; - aliasesToMakeVisible?: ImportDeclaration[]; + aliasesToMakeVisible?: ImportEqualsDeclaration[]; errorSymbolName?: string; errorNode?: Node; } @@ -949,8 +974,8 @@ declare module "typescript" { getLocalNameOfContainer(container: ModuleDeclaration | EnumDeclaration): string; getExpressionNamePrefix(node: Identifier): string; getExportAssignmentName(node: SourceFile): string; - isReferencedImportDeclaration(node: ImportDeclaration): boolean; - isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean; + isReferencedImportDeclaration(node: Node): boolean; + isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; getNodeCheckFlags(node: Node): NodeCheckFlags; isDeclarationVisible(node: Declaration): boolean; isImplementationOfOverload(node: FunctionLikeDeclaration): boolean; diff --git a/tests/baselines/reference/APISample_watcher.types b/tests/baselines/reference/APISample_watcher.types index 3af8537fdb7..8f40648be38 100644 --- a/tests/baselines/reference/APISample_watcher.types +++ b/tests/baselines/reference/APISample_watcher.types @@ -765,331 +765,352 @@ declare module "typescript" { WithKeyword = 100, >WithKeyword : SyntaxKind - ImplementsKeyword = 101, + AsKeyword = 101, +>AsKeyword : SyntaxKind + + FromKeyword = 102, +>FromKeyword : SyntaxKind + + ImplementsKeyword = 103, >ImplementsKeyword : SyntaxKind - InterfaceKeyword = 102, + InterfaceKeyword = 104, >InterfaceKeyword : SyntaxKind - LetKeyword = 103, + LetKeyword = 105, >LetKeyword : SyntaxKind - PackageKeyword = 104, + PackageKeyword = 106, >PackageKeyword : SyntaxKind - PrivateKeyword = 105, + PrivateKeyword = 107, >PrivateKeyword : SyntaxKind - ProtectedKeyword = 106, + ProtectedKeyword = 108, >ProtectedKeyword : SyntaxKind - PublicKeyword = 107, + PublicKeyword = 109, >PublicKeyword : SyntaxKind - StaticKeyword = 108, + StaticKeyword = 110, >StaticKeyword : SyntaxKind - YieldKeyword = 109, + YieldKeyword = 111, >YieldKeyword : SyntaxKind - AnyKeyword = 110, + AnyKeyword = 112, >AnyKeyword : SyntaxKind - BooleanKeyword = 111, + BooleanKeyword = 113, >BooleanKeyword : SyntaxKind - ConstructorKeyword = 112, + ConstructorKeyword = 114, >ConstructorKeyword : SyntaxKind - DeclareKeyword = 113, + DeclareKeyword = 115, >DeclareKeyword : SyntaxKind - GetKeyword = 114, + GetKeyword = 116, >GetKeyword : SyntaxKind - ModuleKeyword = 115, + ModuleKeyword = 117, >ModuleKeyword : SyntaxKind - RequireKeyword = 116, + RequireKeyword = 118, >RequireKeyword : SyntaxKind - NumberKeyword = 117, + NumberKeyword = 119, >NumberKeyword : SyntaxKind - SetKeyword = 118, + SetKeyword = 120, >SetKeyword : SyntaxKind - StringKeyword = 119, + StringKeyword = 121, >StringKeyword : SyntaxKind - TypeKeyword = 120, + TypeKeyword = 122, >TypeKeyword : SyntaxKind - QualifiedName = 121, + QualifiedName = 123, >QualifiedName : SyntaxKind - ComputedPropertyName = 122, + ComputedPropertyName = 124, >ComputedPropertyName : SyntaxKind - TypeParameter = 123, + TypeParameter = 125, >TypeParameter : SyntaxKind - Parameter = 124, + Parameter = 126, >Parameter : SyntaxKind - PropertySignature = 125, + PropertySignature = 127, >PropertySignature : SyntaxKind - PropertyDeclaration = 126, + PropertyDeclaration = 128, >PropertyDeclaration : SyntaxKind - MethodSignature = 127, + MethodSignature = 129, >MethodSignature : SyntaxKind - MethodDeclaration = 128, + MethodDeclaration = 130, >MethodDeclaration : SyntaxKind - Constructor = 129, + Constructor = 131, >Constructor : SyntaxKind - GetAccessor = 130, + GetAccessor = 132, >GetAccessor : SyntaxKind - SetAccessor = 131, + SetAccessor = 133, >SetAccessor : SyntaxKind - CallSignature = 132, + CallSignature = 134, >CallSignature : SyntaxKind - ConstructSignature = 133, + ConstructSignature = 135, >ConstructSignature : SyntaxKind - IndexSignature = 134, + IndexSignature = 136, >IndexSignature : SyntaxKind - TypeReference = 135, + TypeReference = 137, >TypeReference : SyntaxKind - FunctionType = 136, + FunctionType = 138, >FunctionType : SyntaxKind - ConstructorType = 137, + ConstructorType = 139, >ConstructorType : SyntaxKind - TypeQuery = 138, + TypeQuery = 140, >TypeQuery : SyntaxKind - TypeLiteral = 139, + TypeLiteral = 141, >TypeLiteral : SyntaxKind - ArrayType = 140, + ArrayType = 142, >ArrayType : SyntaxKind - TupleType = 141, + TupleType = 143, >TupleType : SyntaxKind - UnionType = 142, + UnionType = 144, >UnionType : SyntaxKind - ParenthesizedType = 143, + ParenthesizedType = 145, >ParenthesizedType : SyntaxKind - ObjectBindingPattern = 144, + ObjectBindingPattern = 146, >ObjectBindingPattern : SyntaxKind - ArrayBindingPattern = 145, + ArrayBindingPattern = 147, >ArrayBindingPattern : SyntaxKind - BindingElement = 146, + BindingElement = 148, >BindingElement : SyntaxKind - ArrayLiteralExpression = 147, + ArrayLiteralExpression = 149, >ArrayLiteralExpression : SyntaxKind - ObjectLiteralExpression = 148, + ObjectLiteralExpression = 150, >ObjectLiteralExpression : SyntaxKind - PropertyAccessExpression = 149, + PropertyAccessExpression = 151, >PropertyAccessExpression : SyntaxKind - ElementAccessExpression = 150, + ElementAccessExpression = 152, >ElementAccessExpression : SyntaxKind - CallExpression = 151, + CallExpression = 153, >CallExpression : SyntaxKind - NewExpression = 152, + NewExpression = 154, >NewExpression : SyntaxKind - TaggedTemplateExpression = 153, + TaggedTemplateExpression = 155, >TaggedTemplateExpression : SyntaxKind - TypeAssertionExpression = 154, + TypeAssertionExpression = 156, >TypeAssertionExpression : SyntaxKind - ParenthesizedExpression = 155, + ParenthesizedExpression = 157, >ParenthesizedExpression : SyntaxKind - FunctionExpression = 156, + FunctionExpression = 158, >FunctionExpression : SyntaxKind - ArrowFunction = 157, + ArrowFunction = 159, >ArrowFunction : SyntaxKind - DeleteExpression = 158, + DeleteExpression = 160, >DeleteExpression : SyntaxKind - TypeOfExpression = 159, + TypeOfExpression = 161, >TypeOfExpression : SyntaxKind - VoidExpression = 160, + VoidExpression = 162, >VoidExpression : SyntaxKind - PrefixUnaryExpression = 161, + PrefixUnaryExpression = 163, >PrefixUnaryExpression : SyntaxKind - PostfixUnaryExpression = 162, + PostfixUnaryExpression = 164, >PostfixUnaryExpression : SyntaxKind - BinaryExpression = 163, + BinaryExpression = 165, >BinaryExpression : SyntaxKind - ConditionalExpression = 164, + ConditionalExpression = 166, >ConditionalExpression : SyntaxKind - TemplateExpression = 165, + TemplateExpression = 167, >TemplateExpression : SyntaxKind - YieldExpression = 166, + YieldExpression = 168, >YieldExpression : SyntaxKind - SpreadElementExpression = 167, + SpreadElementExpression = 169, >SpreadElementExpression : SyntaxKind - OmittedExpression = 168, + OmittedExpression = 170, >OmittedExpression : SyntaxKind - TemplateSpan = 169, + TemplateSpan = 171, >TemplateSpan : SyntaxKind - Block = 170, + Block = 172, >Block : SyntaxKind - VariableStatement = 171, + VariableStatement = 173, >VariableStatement : SyntaxKind - EmptyStatement = 172, + EmptyStatement = 174, >EmptyStatement : SyntaxKind - ExpressionStatement = 173, + ExpressionStatement = 175, >ExpressionStatement : SyntaxKind - IfStatement = 174, + IfStatement = 176, >IfStatement : SyntaxKind - DoStatement = 175, + DoStatement = 177, >DoStatement : SyntaxKind - WhileStatement = 176, + WhileStatement = 178, >WhileStatement : SyntaxKind - ForStatement = 177, + ForStatement = 179, >ForStatement : SyntaxKind - ForInStatement = 178, + ForInStatement = 180, >ForInStatement : SyntaxKind - ContinueStatement = 179, + ContinueStatement = 181, >ContinueStatement : SyntaxKind - BreakStatement = 180, + BreakStatement = 182, >BreakStatement : SyntaxKind - ReturnStatement = 181, + ReturnStatement = 183, >ReturnStatement : SyntaxKind - WithStatement = 182, + WithStatement = 184, >WithStatement : SyntaxKind - SwitchStatement = 183, + SwitchStatement = 185, >SwitchStatement : SyntaxKind - LabeledStatement = 184, + LabeledStatement = 186, >LabeledStatement : SyntaxKind - ThrowStatement = 185, + ThrowStatement = 187, >ThrowStatement : SyntaxKind - TryStatement = 186, + TryStatement = 188, >TryStatement : SyntaxKind - DebuggerStatement = 187, + DebuggerStatement = 189, >DebuggerStatement : SyntaxKind - VariableDeclaration = 188, + VariableDeclaration = 190, >VariableDeclaration : SyntaxKind - VariableDeclarationList = 189, + VariableDeclarationList = 191, >VariableDeclarationList : SyntaxKind - FunctionDeclaration = 190, + FunctionDeclaration = 192, >FunctionDeclaration : SyntaxKind - ClassDeclaration = 191, + ClassDeclaration = 193, >ClassDeclaration : SyntaxKind - InterfaceDeclaration = 192, + InterfaceDeclaration = 194, >InterfaceDeclaration : SyntaxKind - TypeAliasDeclaration = 193, + TypeAliasDeclaration = 195, >TypeAliasDeclaration : SyntaxKind - EnumDeclaration = 194, + EnumDeclaration = 196, >EnumDeclaration : SyntaxKind - ModuleDeclaration = 195, + ModuleDeclaration = 197, >ModuleDeclaration : SyntaxKind - ModuleBlock = 196, + ModuleBlock = 198, >ModuleBlock : SyntaxKind - ImportDeclaration = 197, ->ImportDeclaration : SyntaxKind + ImportEqualsDeclaration = 199, +>ImportEqualsDeclaration : SyntaxKind - ExportAssignment = 198, + ExportAssignment = 200, >ExportAssignment : SyntaxKind - ExternalModuleReference = 199, + ImportDeclaration = 201, +>ImportDeclaration : SyntaxKind + + ImportClause = 202, +>ImportClause : SyntaxKind + + NamespaceImport = 203, +>NamespaceImport : SyntaxKind + + NamedImports = 204, +>NamedImports : SyntaxKind + + ImportSpecifier = 205, +>ImportSpecifier : SyntaxKind + + ExternalModuleReference = 206, >ExternalModuleReference : SyntaxKind - CaseClause = 200, + CaseClause = 207, >CaseClause : SyntaxKind - DefaultClause = 201, + DefaultClause = 208, >DefaultClause : SyntaxKind - HeritageClause = 202, + HeritageClause = 209, >HeritageClause : SyntaxKind - CatchClause = 203, + CatchClause = 210, >CatchClause : SyntaxKind - PropertyAssignment = 204, + PropertyAssignment = 211, >PropertyAssignment : SyntaxKind - ShorthandPropertyAssignment = 205, + ShorthandPropertyAssignment = 212, >ShorthandPropertyAssignment : SyntaxKind - EnumMember = 206, + EnumMember = 213, >EnumMember : SyntaxKind - SourceFile = 207, + SourceFile = 214, >SourceFile : SyntaxKind - SyntaxList = 208, + SyntaxList = 215, >SyntaxList : SyntaxKind - Count = 209, + Count = 216, >Count : SyntaxKind FirstAssignment = 52, @@ -1107,19 +1128,19 @@ declare module "typescript" { FirstKeyword = 65, >FirstKeyword : SyntaxKind - LastKeyword = 120, + LastKeyword = 122, >LastKeyword : SyntaxKind - FirstFutureReservedWord = 101, + FirstFutureReservedWord = 103, >FirstFutureReservedWord : SyntaxKind - LastFutureReservedWord = 109, + LastFutureReservedWord = 111, >LastFutureReservedWord : SyntaxKind - FirstTypeNode = 135, + FirstTypeNode = 137, >FirstTypeNode : SyntaxKind - LastTypeNode = 143, + LastTypeNode = 145, >LastTypeNode : SyntaxKind FirstPunctuation = 14, @@ -1131,7 +1152,7 @@ declare module "typescript" { FirstToken = 0, >FirstToken : SyntaxKind - LastToken = 120, + LastToken = 122, >LastToken : SyntaxKind FirstTriviaToken = 2, @@ -1158,7 +1179,7 @@ declare module "typescript" { LastBinaryOperator = 63, >LastBinaryOperator : SyntaxKind - FirstNode = 121, + FirstNode = 123, >FirstNode : SyntaxKind } const enum NodeFlags { @@ -2400,8 +2421,8 @@ declare module "typescript" { >NodeArray : NodeArray >ModuleElement : ModuleElement } - interface ImportDeclaration extends Declaration, ModuleElement { ->ImportDeclaration : ImportDeclaration + interface ImportEqualsDeclaration extends Declaration, ModuleElement { +>ImportEqualsDeclaration : ImportEqualsDeclaration >Declaration : Declaration >ModuleElement : ModuleElement @@ -2421,6 +2442,61 @@ declare module "typescript" { expression?: Expression; >expression : Expression >Expression : Expression + } + interface ImportDeclaration extends Statement, ModuleElement { +>ImportDeclaration : ImportDeclaration +>Statement : Statement +>ModuleElement : ModuleElement + + importClause?: ImportClause; +>importClause : ImportClause +>ImportClause : ImportClause + + moduleSpecifier: Expression; +>moduleSpecifier : Expression +>Expression : Expression + } + interface ImportClause extends Declaration { +>ImportClause : ImportClause +>Declaration : Declaration + + name?: Identifier; +>name : Identifier +>Identifier : Identifier + + namedBindings?: NamespaceImport | NamedImports; +>namedBindings : NamespaceImport | NamedImports +>NamespaceImport : NamespaceImport +>NamedImports : NamedImports + } + interface NamespaceImport extends Declaration { +>NamespaceImport : NamespaceImport +>Declaration : Declaration + + name: Identifier; +>name : Identifier +>Identifier : Identifier + } + interface NamedImports extends Node { +>NamedImports : NamedImports +>Node : Node + + elements: NodeArray; +>elements : NodeArray +>NodeArray : NodeArray +>ImportSpecifier : ImportSpecifier + } + interface ImportSpecifier extends Declaration { +>ImportSpecifier : ImportSpecifier +>Declaration : Declaration + + propertyName?: Identifier; +>propertyName : Identifier +>Identifier : Identifier + + name: Identifier; +>name : Identifier +>Identifier : Identifier } interface ExportAssignment extends Statement, ModuleElement { >ExportAssignment : ExportAssignment @@ -3054,9 +3130,9 @@ declare module "typescript" { >accessibility : SymbolAccessibility >SymbolAccessibility : SymbolAccessibility - aliasesToMakeVisible?: ImportDeclaration[]; ->aliasesToMakeVisible : ImportDeclaration[] ->ImportDeclaration : ImportDeclaration + aliasesToMakeVisible?: ImportEqualsDeclaration[]; +>aliasesToMakeVisible : ImportEqualsDeclaration[] +>ImportEqualsDeclaration : ImportEqualsDeclaration errorSymbolName?: string; >errorSymbolName : string @@ -3091,15 +3167,15 @@ declare module "typescript" { >node : SourceFile >SourceFile : SourceFile - isReferencedImportDeclaration(node: ImportDeclaration): boolean; ->isReferencedImportDeclaration : (node: ImportDeclaration) => boolean ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration + isReferencedImportDeclaration(node: Node): boolean; +>isReferencedImportDeclaration : (node: Node) => boolean +>node : Node +>Node : Node - isTopLevelValueImportWithEntityName(node: ImportDeclaration): boolean; ->isTopLevelValueImportWithEntityName : (node: ImportDeclaration) => boolean ->node : ImportDeclaration ->ImportDeclaration : ImportDeclaration + isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; +>isTopLevelValueImportEqualsWithEntityName : (node: ImportEqualsDeclaration) => boolean +>node : ImportEqualsDeclaration +>ImportEqualsDeclaration : ImportEqualsDeclaration getNodeCheckFlags(node: Node): NodeCheckFlags; >getNodeCheckFlags : (node: Node) => NodeCheckFlags diff --git a/tests/baselines/reference/es6ImportDefaultBinding.types b/tests/baselines/reference/es6ImportDefaultBinding.types index 262ce5966b3..bfc01b1f8a7 100644 --- a/tests/baselines/reference/es6ImportDefaultBinding.types +++ b/tests/baselines/reference/es6ImportDefaultBinding.types @@ -5,4 +5,5 @@ export var a = 10; === tests/cases/compiler/es6ImportDefaultBinding_1.ts === import defaultBinding from "es6ImportDefaultBinding_0"; -No type information for this code. \ No newline at end of file +>defaultBinding : typeof defaultBinding + diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.errors.txt b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.errors.txt new file mode 100644 index 00000000000..9a34b2c47c8 --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.errors.txt @@ -0,0 +1,33 @@ +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(1,8): error TS2300: Duplicate identifier 'defaultBinding'. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(2,8): error TS2300: Duplicate identifier 'defaultBinding'. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(3,8): error TS2300: Duplicate identifier 'defaultBinding'. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(4,8): error TS2300: Duplicate identifier 'defaultBinding'. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(5,8): error TS2300: Duplicate identifier 'defaultBinding'. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts(6,8): error TS2300: Duplicate identifier 'defaultBinding'. + + +==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0.ts (0 errors) ==== + + export var a = 10; + export var x = a; + export var m = a; + +==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts (6 errors) ==== + import defaultBinding, { } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. + import defaultBinding, { a } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. + import defaultBinding, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. + import defaultBinding, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. + import defaultBinding, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. + import defaultBinding, { m, } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.types deleted file mode 100644 index 35dacc7d93a..00000000000 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImport.types +++ /dev/null @@ -1,21 +0,0 @@ -=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_0.ts === - -export var a = 10; ->a : number - -export var x = a; ->x : number ->a : number - -export var m = a; ->m : number ->a : number - -=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImport_1.ts === -import defaultBinding, { } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; -No type information for this code.import defaultBinding, { a } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; -No type information for this code.import defaultBinding, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; -No type information for this code.import defaultBinding, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; -No type information for this code.import defaultBinding, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; -No type information for this code.import defaultBinding, { m, } from "es6ImportDefaultBindingFollowedWithNamedImport_0"; -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.errors.txt b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.errors.txt new file mode 100644 index 00000000000..49c930272fc --- /dev/null +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.errors.txt @@ -0,0 +1,33 @@ +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(1,8): error TS2300: Duplicate identifier 'defaultBinding'. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(2,8): error TS2300: Duplicate identifier 'defaultBinding'. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(3,8): error TS2300: Duplicate identifier 'defaultBinding'. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(4,8): error TS2300: Duplicate identifier 'defaultBinding'. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(5,8): error TS2300: Duplicate identifier 'defaultBinding'. +tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts(6,8): error TS2300: Duplicate identifier 'defaultBinding'. + + +==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0.ts (0 errors) ==== + + export var a = 10; + export var x = a; + export var m = a; + +==== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts (6 errors) ==== + import defaultBinding, { } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. + import defaultBinding, { a } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. + import defaultBinding, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. + import defaultBinding, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. + import defaultBinding, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. + import defaultBinding, { m, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; + ~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'defaultBinding'. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.types deleted file mode 100644 index a98cca1edcf..00000000000 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamedImportInEs5.types +++ /dev/null @@ -1,21 +0,0 @@ -=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_0.ts === - -export var a = 10; ->a : number - -export var x = a; ->x : number ->a : number - -export var m = a; ->m : number ->a : number - -=== tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamedImportInEs5_1.ts === -import defaultBinding, { } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; -No type information for this code.import defaultBinding, { a } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; -No type information for this code.import defaultBinding, { a as b } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; -No type information for this code.import defaultBinding, { x, a as y } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; -No type information for this code.import defaultBinding, { x as z, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; -No type information for this code.import defaultBinding, { m, } from "es6ImportDefaultBindingFollowedWithNamedImportInEs5_0"; -No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding.types index 9f9db16a6f4..6726447b3c3 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBinding.types @@ -5,4 +5,6 @@ export var a = 10; === tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBinding_1.ts === import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBinding_0"; -No type information for this code. \ No newline at end of file +>defaultBinding : typeof defaultBinding +>nameSpaceBinding : typeof defaultBinding + diff --git a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.types b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.types index 841bb9d68b5..65e3921865b 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.types +++ b/tests/baselines/reference/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5.types @@ -5,4 +5,6 @@ export var a = 10; === tests/cases/compiler/es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_1.ts === import defaultBinding, * as nameSpaceBinding from "es6ImportDefaultBindingFollowedWithNamespaceBindingInEs5_0"; -No type information for this code. \ No newline at end of file +>defaultBinding : typeof defaultBinding +>nameSpaceBinding : typeof defaultBinding + diff --git a/tests/baselines/reference/es6ImportDefaultBindingInEs5.types b/tests/baselines/reference/es6ImportDefaultBindingInEs5.types index 1f3c4141f5b..3350030cd1d 100644 --- a/tests/baselines/reference/es6ImportDefaultBindingInEs5.types +++ b/tests/baselines/reference/es6ImportDefaultBindingInEs5.types @@ -5,4 +5,5 @@ export var a = 10; === tests/cases/compiler/es6ImportDefaultBindingInEs5_1.ts === import defaultBinding from "es6ImportDefaultBindingInEs5_0"; -No type information for this code. \ No newline at end of file +>defaultBinding : typeof defaultBinding + diff --git a/tests/baselines/reference/es6ImportNameSpaceImport.types b/tests/baselines/reference/es6ImportNameSpaceImport.types index d7cd562dc27..1e09de42ec6 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImport.types +++ b/tests/baselines/reference/es6ImportNameSpaceImport.types @@ -5,4 +5,5 @@ export var a = 10; === tests/cases/compiler/es6ImportNameSpaceImport_1.ts === import * as nameSpaceBinding from "es6ImportNameSpaceImport_0"; -No type information for this code. \ No newline at end of file +>nameSpaceBinding : typeof nameSpaceBinding + diff --git a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types index 7818a4568e0..cb7b669eea1 100644 --- a/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types +++ b/tests/baselines/reference/es6ImportNameSpaceImportInEs5.types @@ -5,4 +5,5 @@ export var a = 10; === tests/cases/compiler/es6ImportNameSpaceImportInEs5_1.ts === import * as nameSpaceBinding from "es6ImportNameSpaceImportInEs5_0"; -No type information for this code. \ No newline at end of file +>nameSpaceBinding : typeof nameSpaceBinding + diff --git a/tests/baselines/reference/es6ImportNamedImport.types b/tests/baselines/reference/es6ImportNamedImport.types index 23fc73ef6e9..e86955b3c96 100644 --- a/tests/baselines/reference/es6ImportNamedImport.types +++ b/tests/baselines/reference/es6ImportNamedImport.types @@ -19,11 +19,32 @@ export var x1 = 10; === tests/cases/compiler/es6ImportNamedImport_1.ts === import { } from "es6ImportNamedImport_0"; -No type information for this code.import { a } from "es6ImportNamedImport_0"; -No type information for this code.import { a as b } from "es6ImportNamedImport_0"; -No type information for this code.import { x, a as y } from "es6ImportNamedImport_0"; -No type information for this code.import { x as z, } from "es6ImportNamedImport_0"; -No type information for this code.import { m, } from "es6ImportNamedImport_0"; -No type information for this code.import { a1, x1 } from "es6ImportNamedImport_0"; -No type information for this code.import { a1 as a11, x1 as x11 } from "es6ImportNamedImport_0"; -No type information for this code. \ No newline at end of file +import { a } from "es6ImportNamedImport_0"; +>a : number + +import { a as b } from "es6ImportNamedImport_0"; +>a : unknown +>b : number + +import { x, a as y } from "es6ImportNamedImport_0"; +>x : number +>a : unknown +>y : number + +import { x as z, } from "es6ImportNamedImport_0"; +>x : unknown +>z : number + +import { m, } from "es6ImportNamedImport_0"; +>m : number + +import { a1, x1 } from "es6ImportNamedImport_0"; +>a1 : number +>x1 : number + +import { a1 as a11, x1 as x11 } from "es6ImportNamedImport_0"; +>a1 : unknown +>a11 : number +>x1 : unknown +>x11 : number + diff --git a/tests/baselines/reference/es6ImportNamedImportIdentifiersParsing.errors.txt b/tests/baselines/reference/es6ImportNamedImportIdentifiersParsing.errors.txt index 7d0570aa716..d57a163597a 100644 --- a/tests/baselines/reference/es6ImportNamedImportIdentifiersParsing.errors.txt +++ b/tests/baselines/reference/es6ImportNamedImportIdentifiersParsing.errors.txt @@ -1,18 +1,33 @@ +tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(2,10): error TS2300: Duplicate identifier 'yield'. tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(3,10): error TS1003: Identifier expected. +tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(3,10): error TS2300: Duplicate identifier 'default'. tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(4,19): error TS1003: Identifier expected. +tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(4,19): error TS2300: Duplicate identifier 'default'. +tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(5,21): error TS2300: Duplicate identifier 'yield'. tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(6,21): error TS1003: Identifier expected. +tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts(6,21): error TS2300: Duplicate identifier 'default'. -==== tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts (3 errors) ==== +==== tests/cases/compiler/es6ImportNamedImportIdentifiersParsing.ts (8 errors) ==== import { yield } from "somemodule"; // Allowed + ~~~~~ +!!! error TS2300: Duplicate identifier 'yield'. import { default } from "somemodule"; // Error - as this is keyword that is not allowed as identifier ~~~~~~~ !!! error TS1003: Identifier expected. + ~~~~~~~ +!!! error TS2300: Duplicate identifier 'default'. import { yield as default } from "somemodule"; // error to use default as binding name ~~~~~~~ !!! error TS1003: Identifier expected. + ~~~~~~~ +!!! error TS2300: Duplicate identifier 'default'. import { default as yield } from "somemodule"; // no error + ~~~~~ +!!! error TS2300: Duplicate identifier 'yield'. import { default as default } from "somemodule"; // default as is ok, error of default binding name ~~~~~~~ -!!! error TS1003: Identifier expected. \ No newline at end of file +!!! error TS1003: Identifier expected. + ~~~~~~~ +!!! error TS2300: Duplicate identifier 'default'. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportNamedImportIdentifiersParsing.js b/tests/baselines/reference/es6ImportNamedImportIdentifiersParsing.js new file mode 100644 index 00000000000..8db7fcd6f9c --- /dev/null +++ b/tests/baselines/reference/es6ImportNamedImportIdentifiersParsing.js @@ -0,0 +1,9 @@ +//// [es6ImportNamedImportIdentifiersParsing.ts] + +import { yield } from "somemodule"; // Allowed +import { default } from "somemodule"; // Error - as this is keyword that is not allowed as identifier +import { yield as default } from "somemodule"; // error to use default as binding name +import { default as yield } from "somemodule"; // no error +import { default as default } from "somemodule"; // default as is ok, error of default binding name + +//// [es6ImportNamedImportIdentifiersParsing.js] diff --git a/tests/baselines/reference/es6ImportNamedImportInEs5.types b/tests/baselines/reference/es6ImportNamedImportInEs5.types index 7fecc149aa2..4f96b8a4dfa 100644 --- a/tests/baselines/reference/es6ImportNamedImportInEs5.types +++ b/tests/baselines/reference/es6ImportNamedImportInEs5.types @@ -19,11 +19,32 @@ export var x1 = 10; === tests/cases/compiler/es6ImportNamedImportInEs5_1.ts === import { } from "es6ImportNamedImportInEs5_0"; -No type information for this code.import { a } from "es6ImportNamedImportInEs5_0"; -No type information for this code.import { a as b } from "es6ImportNamedImportInEs5_0"; -No type information for this code.import { x, a as y } from "es6ImportNamedImportInEs5_0"; -No type information for this code.import { x as z, } from "es6ImportNamedImportInEs5_0"; -No type information for this code.import { m, } from "es6ImportNamedImportInEs5_0"; -No type information for this code.import { a1, x1 } from "es6ImportNamedImportInEs5_0"; -No type information for this code.import { a1 as a11, x1 as x11 } from "es6ImportNamedImportInEs5_0"; -No type information for this code. \ No newline at end of file +import { a } from "es6ImportNamedImportInEs5_0"; +>a : number + +import { a as b } from "es6ImportNamedImportInEs5_0"; +>a : unknown +>b : number + +import { x, a as y } from "es6ImportNamedImportInEs5_0"; +>x : number +>a : unknown +>y : number + +import { x as z, } from "es6ImportNamedImportInEs5_0"; +>x : unknown +>z : number + +import { m, } from "es6ImportNamedImportInEs5_0"; +>m : number + +import { a1, x1 } from "es6ImportNamedImportInEs5_0"; +>a1 : number +>x1 : number + +import { a1 as a11, x1 as x11 } from "es6ImportNamedImportInEs5_0"; +>a1 : unknown +>a11 : number +>x1 : unknown +>x11 : number + diff --git a/tests/baselines/reference/es6ImportNamedImportParsingError.errors.txt b/tests/baselines/reference/es6ImportNamedImportParsingError.errors.txt deleted file mode 100644 index fd5a077f648..00000000000 --- a/tests/baselines/reference/es6ImportNamedImportParsingError.errors.txt +++ /dev/null @@ -1,52 +0,0 @@ -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,10): error TS1003: Identifier expected. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,12): error TS1109: Expression expected. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,14): error TS2304: Cannot find name 'from'. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(1,19): error TS1005: ';' expected. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(2,24): error TS1005: '{' expected. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,1): error TS1128: Declaration or statement expected. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,8): error TS1128: Declaration or statement expected. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,12): error TS2304: Cannot find name 'a'. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,16): error TS2304: Cannot find name 'from'. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(3,21): error TS1005: ';' expected. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,13): error TS1005: 'from' expected. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,15): error TS2304: Cannot find name 'from'. -tests/cases/compiler/es6ImportNamedImportParsingError_1.ts(4,20): error TS1005: ';' expected. - - -==== tests/cases/compiler/es6ImportNamedImportParsingError_0.ts (0 errors) ==== - - export var a = 10; - export var x = a; - export var m = a; - -==== tests/cases/compiler/es6ImportNamedImportParsingError_1.ts (13 errors) ==== - import { * } from "es6ImportNamedImportParsingError_0"; - ~ -!!! error TS1003: Identifier expected. - ~ -!!! error TS1109: Expression expected. - ~~~~ -!!! error TS2304: Cannot find name 'from'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1005: ';' expected. - import defaultBinding, from "es6ImportNamedImportParsingError_0"; - ~~~~ -!!! error TS1005: '{' expected. - import , { a } from "es6ImportNamedImportParsingError_0"; - ~~~~~~ -!!! error TS1128: Declaration or statement expected. - ~ -!!! error TS1128: Declaration or statement expected. - ~ -!!! error TS2304: Cannot find name 'a'. - ~~~~ -!!! error TS2304: Cannot find name 'from'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1005: ';' expected. - import { a }, from "es6ImportNamedImportParsingError_0"; - ~ -!!! error TS1005: 'from' expected. - ~~~~ -!!! error TS2304: Cannot find name 'from'. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS1005: ';' expected. \ No newline at end of file diff --git a/tests/baselines/reference/es6ImportParseErrors.js b/tests/baselines/reference/es6ImportParseErrors.js new file mode 100644 index 00000000000..a42d65fbc9d --- /dev/null +++ b/tests/baselines/reference/es6ImportParseErrors.js @@ -0,0 +1,6 @@ +//// [es6ImportParseErrors.ts] + +import 10; + +//// [es6ImportParseErrors.js] +10; diff --git a/tests/baselines/reference/es6ImportWithoutFromClause.js b/tests/baselines/reference/es6ImportWithoutFromClause.js index aa5e25bcd6f..43d21885c27 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClause.js +++ b/tests/baselines/reference/es6ImportWithoutFromClause.js @@ -10,3 +10,4 @@ import "es6ImportWithoutFromClause_0"; //// [es6ImportWithoutFromClause_0.js] exports.a = 10; //// [es6ImportWithoutFromClause_1.js] +require("es6ImportWithoutFromClause_0"); diff --git a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.js b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.js index 3782987c2ff..f6610ac5ad2 100644 --- a/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.js +++ b/tests/baselines/reference/es6ImportWithoutFromClauseInEs5.js @@ -10,3 +10,4 @@ import "es6ImportWithoutFromClauseInEs5_0"; //// [es6ImportWithoutFromClauseInEs5_0.js] exports.a = 10; //// [es6ImportWithoutFromClauseInEs5_1.js] +require("es6ImportWithoutFromClauseInEs5_0");