diff --git a/internal/ast/ast.go b/internal/ast/ast.go index 0e724fc80b..67f0afc4e3 100644 --- a/internal/ast/ast.go +++ b/internal/ast/ast.go @@ -357,7 +357,7 @@ func (n *Node) Expression() *Node { return n.AsThrowStatement().Expression case KindExternalModuleReference: return n.AsExternalModuleReference().Expression - case KindExportAssignment: + case KindExportAssignment, KindJSExportAssignment: return n.AsExportAssignment().Expression case KindDecorator: return n.AsDecorator().Expression @@ -532,7 +532,7 @@ func (n *Node) Type() *Node { return n.AsJSDocNonNullableType().Type case KindJSDocOptionalType: return n.AsJSDocOptionalType().Type - case KindEnumMember, KindBindingElement, KindExportAssignment, KindBinaryExpression: + case KindEnumMember, KindBindingElement, KindExportAssignment, KindJSExportAssignment, KindBinaryExpression, KindCommonJSExport: return nil default: funcLike := n.FunctionLikeData() @@ -907,6 +907,10 @@ func (n *Node) AsExportAssignment() *ExportAssignment { return n.data.(*ExportAssignment) } +func (n *Node) AsCommonJSExport() *CommonJSExport { + return n.data.(*CommonJSExport) +} + func (n *Node) AsObjectLiteralExpression() *ObjectLiteralExpression { return n.data.(*ObjectLiteralExpression) } @@ -4314,6 +4318,7 @@ func IsNamedImports(node *Node) bool { // This is either an `export =` or an `export default` declaration. // Unless `isExportEquals` is set, this node was parsed as an `export default`. +// If Kind is KindJSExportAssignment, it is a synthetic declaration for `module.exports =`. type ExportAssignment struct { StatementBase DeclarationBase @@ -4323,17 +4328,25 @@ type ExportAssignment struct { Expression *Expression // Expression } -func (f *NodeFactory) NewExportAssignment(modifiers *ModifierList, isExportEquals bool, expression *Expression) *Node { +func (f *NodeFactory) newExportOrJSExportAssignment(kind Kind, modifiers *ModifierList, isExportEquals bool, expression *Expression) *Node { data := &ExportAssignment{} data.modifiers = modifiers data.IsExportEquals = isExportEquals data.Expression = expression - return f.newNode(KindExportAssignment, data) + return f.newNode(kind, data) +} + +func (f *NodeFactory) NewExportAssignment(modifiers *ModifierList, isExportEquals bool, expression *Expression) *Node { + return f.newExportOrJSExportAssignment(KindExportAssignment, modifiers, isExportEquals, expression) +} + +func (f *NodeFactory) NewJSExportAssignment(expression *Expression) *Node { + return f.newExportOrJSExportAssignment(KindJSExportAssignment, nil /*modifiers*/, true, expression) } func (f *NodeFactory) UpdateExportAssignment(node *ExportAssignment, modifiers *ModifierList, expression *Expression) *Node { if modifiers != node.modifiers || expression != node.Expression { - return updateNode(f.NewExportAssignment(modifiers, node.IsExportEquals, expression), node.AsNode(), f.hooks) + return updateNode(f.newExportOrJSExportAssignment(node.Kind, modifiers, node.IsExportEquals, expression), node.AsNode(), f.hooks) } return node.AsNode() } @@ -4347,7 +4360,7 @@ func (node *ExportAssignment) VisitEachChild(v *NodeVisitor) *Node { } func (node *ExportAssignment) Clone(f NodeFactoryCoercible) *Node { - return cloneNode(f.AsNodeFactory().NewExportAssignment(node.Modifiers(), node.IsExportEquals, node.Expression), node.AsNode(), f.AsNodeFactory().hooks) + return cloneNode(f.AsNodeFactory().newExportOrJSExportAssignment(node.Kind, node.Modifiers(), node.IsExportEquals, node.Expression), node.AsNode(), f.AsNodeFactory().hooks) } func (node *ExportAssignment) computeSubtreeFacts() SubtreeFacts { @@ -4358,6 +4371,60 @@ func IsExportAssignment(node *Node) bool { return node.Kind == KindExportAssignment } +func IsJSExportAssignment(node *Node) bool { + return node.Kind == KindJSExportAssignment +} + +func IsAnyExportAssignment(node *Node) bool { + return node.Kind == KindExportAssignment || node.Kind == KindJSExportAssignment +} + +// CommonJSExport + +type CommonJSExport struct { + StatementBase + DeclarationBase + ExportableBase + ModifiersBase + name *IdentifierNode + Initializer *Expression +} + +func (f *NodeFactory) NewCommonJSExport(modifiers *ModifierList, name *IdentifierNode, initializer *Expression) *Node { + data := &CommonJSExport{} + data.modifiers = modifiers + data.name = name + data.Initializer = initializer + return newNode(KindCommonJSExport, data, f.hooks) +} + +func (f *NodeFactory) UpdateCommonJSExport(node *CommonJSExport, modifiers *ModifierList, name *IdentifierNode, initializer *Expression) *Node { + if modifiers != node.modifiers || initializer != node.Initializer || name != node.name { + return updateNode(f.NewCommonJSExport(node.modifiers, name, initializer), node.AsNode(), f.hooks) + } + return node.AsNode() +} + +func (node *CommonJSExport) ForEachChild(v Visitor) bool { + return visitModifiers(v, node.modifiers) || visit(v, node.name) || visit(v, node.Initializer) +} + +func (node *CommonJSExport) VisitEachChild(v *NodeVisitor) *Node { + return v.Factory.UpdateCommonJSExport(node, v.visitModifiers(node.modifiers), v.visitNode(node.name), v.visitNode(node.Initializer)) +} + +func (node *CommonJSExport) Clone(f NodeFactoryCoercible) *Node { + return cloneNode(f.AsNodeFactory().NewCommonJSExport(node.Modifiers(), node.name, node.Initializer), node.AsNode(), f.AsNodeFactory().hooks) +} + +func IsCommonJSExport(node *Node) bool { + return node.Kind == KindCommonJSExport +} + +func (node *CommonJSExport) Name() *DeclarationName { + return node.name +} + // NamespaceExportDeclaration type NamespaceExportDeclaration struct { diff --git a/internal/ast/kind.go b/internal/ast/kind.go index 228c440c58..3107c895bd 100644 --- a/internal/ast/kind.go +++ b/internal/ast/kind.go @@ -377,8 +377,10 @@ const ( KindJSDocImportTag // Synthesized list KindSyntaxList - // Synthesized JS nodes + // Reparsed JS nodes KindJSTypeAliasDeclaration + KindJSExportAssignment + KindCommonJSExport // Transformation nodes KindNotEmittedStatement KindPartiallyEmittedExpression diff --git a/internal/ast/kind_stringer_generated.go b/internal/ast/kind_stringer_generated.go index 62972bad69..329adfa55d 100644 --- a/internal/ast/kind_stringer_generated.go +++ b/internal/ast/kind_stringer_generated.go @@ -354,16 +354,18 @@ func _() { _ = x[KindJSDocImportTag-343] _ = x[KindSyntaxList-344] _ = x[KindJSTypeAliasDeclaration-345] - _ = x[KindNotEmittedStatement-346] - _ = x[KindPartiallyEmittedExpression-347] - _ = x[KindCommaListExpression-348] - _ = x[KindSyntheticReferenceExpression-349] - _ = x[KindCount-350] + _ = x[KindJSExportAssignment-346] + _ = x[KindCommonJSExport-347] + _ = x[KindNotEmittedStatement-348] + _ = x[KindPartiallyEmittedExpression-349] + _ = x[KindCommaListExpression-350] + _ = x[KindSyntheticReferenceExpression-351] + _ = x[KindCount-352] } -const _Kind_name = "KindUnknownKindEndOfFileKindSingleLineCommentTriviaKindMultiLineCommentTriviaKindNewLineTriviaKindWhitespaceTriviaKindConflictMarkerTriviaKindNonTextFileMarkerTriviaKindNumericLiteralKindBigIntLiteralKindStringLiteralKindJsxTextKindJsxTextAllWhiteSpacesKindRegularExpressionLiteralKindNoSubstitutionTemplateLiteralKindTemplateHeadKindTemplateMiddleKindTemplateTailKindOpenBraceTokenKindCloseBraceTokenKindOpenParenTokenKindCloseParenTokenKindOpenBracketTokenKindCloseBracketTokenKindDotTokenKindDotDotDotTokenKindSemicolonTokenKindCommaTokenKindQuestionDotTokenKindLessThanTokenKindLessThanSlashTokenKindGreaterThanTokenKindLessThanEqualsTokenKindGreaterThanEqualsTokenKindEqualsEqualsTokenKindExclamationEqualsTokenKindEqualsEqualsEqualsTokenKindExclamationEqualsEqualsTokenKindEqualsGreaterThanTokenKindPlusTokenKindMinusTokenKindAsteriskTokenKindAsteriskAsteriskTokenKindSlashTokenKindPercentTokenKindPlusPlusTokenKindMinusMinusTokenKindLessThanLessThanTokenKindGreaterThanGreaterThanTokenKindGreaterThanGreaterThanGreaterThanTokenKindAmpersandTokenKindBarTokenKindCaretTokenKindExclamationTokenKindTildeTokenKindAmpersandAmpersandTokenKindBarBarTokenKindQuestionTokenKindColonTokenKindAtTokenKindQuestionQuestionTokenKindBacktickTokenKindHashTokenKindEqualsTokenKindPlusEqualsTokenKindMinusEqualsTokenKindAsteriskEqualsTokenKindAsteriskAsteriskEqualsTokenKindSlashEqualsTokenKindPercentEqualsTokenKindLessThanLessThanEqualsTokenKindGreaterThanGreaterThanEqualsTokenKindGreaterThanGreaterThanGreaterThanEqualsTokenKindAmpersandEqualsTokenKindBarEqualsTokenKindBarBarEqualsTokenKindAmpersandAmpersandEqualsTokenKindQuestionQuestionEqualsTokenKindCaretEqualsTokenKindIdentifierKindPrivateIdentifierKindJSDocCommentTextTokenKindBreakKeywordKindCaseKeywordKindCatchKeywordKindClassKeywordKindConstKeywordKindContinueKeywordKindDebuggerKeywordKindDefaultKeywordKindDeleteKeywordKindDoKeywordKindElseKeywordKindEnumKeywordKindExportKeywordKindExtendsKeywordKindFalseKeywordKindFinallyKeywordKindForKeywordKindFunctionKeywordKindIfKeywordKindImportKeywordKindInKeywordKindInstanceOfKeywordKindNewKeywordKindNullKeywordKindReturnKeywordKindSuperKeywordKindSwitchKeywordKindThisKeywordKindThrowKeywordKindTrueKeywordKindTryKeywordKindTypeOfKeywordKindVarKeywordKindVoidKeywordKindWhileKeywordKindWithKeywordKindImplementsKeywordKindInterfaceKeywordKindLetKeywordKindPackageKeywordKindPrivateKeywordKindProtectedKeywordKindPublicKeywordKindStaticKeywordKindYieldKeywordKindAbstractKeywordKindAccessorKeywordKindAsKeywordKindAssertsKeywordKindAssertKeywordKindAnyKeywordKindAsyncKeywordKindAwaitKeywordKindBooleanKeywordKindConstructorKeywordKindDeclareKeywordKindGetKeywordKindImmediateKeywordKindInferKeywordKindIntrinsicKeywordKindIsKeywordKindKeyOfKeywordKindModuleKeywordKindNamespaceKeywordKindNeverKeywordKindOutKeywordKindReadonlyKeywordKindRequireKeywordKindNumberKeywordKindObjectKeywordKindSatisfiesKeywordKindSetKeywordKindStringKeywordKindSymbolKeywordKindTypeKeywordKindUndefinedKeywordKindUniqueKeywordKindUnknownKeywordKindUsingKeywordKindFromKeywordKindGlobalKeywordKindBigIntKeywordKindOverrideKeywordKindOfKeywordKindQualifiedNameKindComputedPropertyNameKindTypeParameterKindParameterKindDecoratorKindPropertySignatureKindPropertyDeclarationKindMethodSignatureKindMethodDeclarationKindClassStaticBlockDeclarationKindConstructorKindGetAccessorKindSetAccessorKindCallSignatureKindConstructSignatureKindIndexSignatureKindTypePredicateKindTypeReferenceKindFunctionTypeKindConstructorTypeKindTypeQueryKindTypeLiteralKindArrayTypeKindTupleTypeKindOptionalTypeKindRestTypeKindUnionTypeKindIntersectionTypeKindConditionalTypeKindInferTypeKindParenthesizedTypeKindThisTypeKindTypeOperatorKindIndexedAccessTypeKindMappedTypeKindLiteralTypeKindNamedTupleMemberKindTemplateLiteralTypeKindTemplateLiteralTypeSpanKindImportTypeKindObjectBindingPatternKindArrayBindingPatternKindBindingElementKindArrayLiteralExpressionKindObjectLiteralExpressionKindPropertyAccessExpressionKindElementAccessExpressionKindCallExpressionKindNewExpressionKindTaggedTemplateExpressionKindTypeAssertionExpressionKindParenthesizedExpressionKindFunctionExpressionKindArrowFunctionKindDeleteExpressionKindTypeOfExpressionKindVoidExpressionKindAwaitExpressionKindPrefixUnaryExpressionKindPostfixUnaryExpressionKindBinaryExpressionKindConditionalExpressionKindTemplateExpressionKindYieldExpressionKindSpreadElementKindClassExpressionKindOmittedExpressionKindExpressionWithTypeArgumentsKindAsExpressionKindNonNullExpressionKindMetaPropertyKindSyntheticExpressionKindSatisfiesExpressionKindTemplateSpanKindSemicolonClassElementKindBlockKindEmptyStatementKindVariableStatementKindExpressionStatementKindIfStatementKindDoStatementKindWhileStatementKindForStatementKindForInStatementKindForOfStatementKindContinueStatementKindBreakStatementKindReturnStatementKindWithStatementKindSwitchStatementKindLabeledStatementKindThrowStatementKindTryStatementKindDebuggerStatementKindVariableDeclarationKindVariableDeclarationListKindFunctionDeclarationKindClassDeclarationKindInterfaceDeclarationKindTypeAliasDeclarationKindEnumDeclarationKindModuleDeclarationKindModuleBlockKindCaseBlockKindNamespaceExportDeclarationKindImportEqualsDeclarationKindImportDeclarationKindImportClauseKindNamespaceImportKindNamedImportsKindImportSpecifierKindExportAssignmentKindExportDeclarationKindNamedExportsKindNamespaceExportKindExportSpecifierKindMissingDeclarationKindExternalModuleReferenceKindJsxElementKindJsxSelfClosingElementKindJsxOpeningElementKindJsxClosingElementKindJsxFragmentKindJsxOpeningFragmentKindJsxClosingFragmentKindJsxAttributeKindJsxAttributesKindJsxSpreadAttributeKindJsxExpressionKindJsxNamespacedNameKindCaseClauseKindDefaultClauseKindHeritageClauseKindCatchClauseKindImportAttributesKindImportAttributeKindPropertyAssignmentKindShorthandPropertyAssignmentKindSpreadAssignmentKindEnumMemberKindSourceFileKindBundleKindJSDocTypeExpressionKindJSDocNameReferenceKindJSDocMemberNameKindJSDocAllTypeKindJSDocNullableTypeKindJSDocNonNullableTypeKindJSDocOptionalTypeKindJSDocVariadicTypeKindJSDocKindJSDocTextKindJSDocTypeLiteralKindJSDocSignatureKindJSDocLinkKindJSDocLinkCodeKindJSDocLinkPlainKindJSDocTagKindJSDocAugmentsTagKindJSDocImplementsTagKindJSDocDeprecatedTagKindJSDocPublicTagKindJSDocPrivateTagKindJSDocProtectedTagKindJSDocReadonlyTagKindJSDocOverrideTagKindJSDocCallbackTagKindJSDocOverloadTagKindJSDocParameterTagKindJSDocReturnTagKindJSDocThisTagKindJSDocTypeTagKindJSDocTemplateTagKindJSDocTypedefTagKindJSDocSeeTagKindJSDocPropertyTagKindJSDocSatisfiesTagKindJSDocImportTagKindSyntaxListKindJSTypeAliasDeclarationKindNotEmittedStatementKindPartiallyEmittedExpressionKindCommaListExpressionKindSyntheticReferenceExpressionKindCount" +const _Kind_name = "KindUnknownKindEndOfFileKindSingleLineCommentTriviaKindMultiLineCommentTriviaKindNewLineTriviaKindWhitespaceTriviaKindConflictMarkerTriviaKindNonTextFileMarkerTriviaKindNumericLiteralKindBigIntLiteralKindStringLiteralKindJsxTextKindJsxTextAllWhiteSpacesKindRegularExpressionLiteralKindNoSubstitutionTemplateLiteralKindTemplateHeadKindTemplateMiddleKindTemplateTailKindOpenBraceTokenKindCloseBraceTokenKindOpenParenTokenKindCloseParenTokenKindOpenBracketTokenKindCloseBracketTokenKindDotTokenKindDotDotDotTokenKindSemicolonTokenKindCommaTokenKindQuestionDotTokenKindLessThanTokenKindLessThanSlashTokenKindGreaterThanTokenKindLessThanEqualsTokenKindGreaterThanEqualsTokenKindEqualsEqualsTokenKindExclamationEqualsTokenKindEqualsEqualsEqualsTokenKindExclamationEqualsEqualsTokenKindEqualsGreaterThanTokenKindPlusTokenKindMinusTokenKindAsteriskTokenKindAsteriskAsteriskTokenKindSlashTokenKindPercentTokenKindPlusPlusTokenKindMinusMinusTokenKindLessThanLessThanTokenKindGreaterThanGreaterThanTokenKindGreaterThanGreaterThanGreaterThanTokenKindAmpersandTokenKindBarTokenKindCaretTokenKindExclamationTokenKindTildeTokenKindAmpersandAmpersandTokenKindBarBarTokenKindQuestionTokenKindColonTokenKindAtTokenKindQuestionQuestionTokenKindBacktickTokenKindHashTokenKindEqualsTokenKindPlusEqualsTokenKindMinusEqualsTokenKindAsteriskEqualsTokenKindAsteriskAsteriskEqualsTokenKindSlashEqualsTokenKindPercentEqualsTokenKindLessThanLessThanEqualsTokenKindGreaterThanGreaterThanEqualsTokenKindGreaterThanGreaterThanGreaterThanEqualsTokenKindAmpersandEqualsTokenKindBarEqualsTokenKindBarBarEqualsTokenKindAmpersandAmpersandEqualsTokenKindQuestionQuestionEqualsTokenKindCaretEqualsTokenKindIdentifierKindPrivateIdentifierKindJSDocCommentTextTokenKindBreakKeywordKindCaseKeywordKindCatchKeywordKindClassKeywordKindConstKeywordKindContinueKeywordKindDebuggerKeywordKindDefaultKeywordKindDeleteKeywordKindDoKeywordKindElseKeywordKindEnumKeywordKindExportKeywordKindExtendsKeywordKindFalseKeywordKindFinallyKeywordKindForKeywordKindFunctionKeywordKindIfKeywordKindImportKeywordKindInKeywordKindInstanceOfKeywordKindNewKeywordKindNullKeywordKindReturnKeywordKindSuperKeywordKindSwitchKeywordKindThisKeywordKindThrowKeywordKindTrueKeywordKindTryKeywordKindTypeOfKeywordKindVarKeywordKindVoidKeywordKindWhileKeywordKindWithKeywordKindImplementsKeywordKindInterfaceKeywordKindLetKeywordKindPackageKeywordKindPrivateKeywordKindProtectedKeywordKindPublicKeywordKindStaticKeywordKindYieldKeywordKindAbstractKeywordKindAccessorKeywordKindAsKeywordKindAssertsKeywordKindAssertKeywordKindAnyKeywordKindAsyncKeywordKindAwaitKeywordKindBooleanKeywordKindConstructorKeywordKindDeclareKeywordKindGetKeywordKindImmediateKeywordKindInferKeywordKindIntrinsicKeywordKindIsKeywordKindKeyOfKeywordKindModuleKeywordKindNamespaceKeywordKindNeverKeywordKindOutKeywordKindReadonlyKeywordKindRequireKeywordKindNumberKeywordKindObjectKeywordKindSatisfiesKeywordKindSetKeywordKindStringKeywordKindSymbolKeywordKindTypeKeywordKindUndefinedKeywordKindUniqueKeywordKindUnknownKeywordKindUsingKeywordKindFromKeywordKindGlobalKeywordKindBigIntKeywordKindOverrideKeywordKindOfKeywordKindQualifiedNameKindComputedPropertyNameKindTypeParameterKindParameterKindDecoratorKindPropertySignatureKindPropertyDeclarationKindMethodSignatureKindMethodDeclarationKindClassStaticBlockDeclarationKindConstructorKindGetAccessorKindSetAccessorKindCallSignatureKindConstructSignatureKindIndexSignatureKindTypePredicateKindTypeReferenceKindFunctionTypeKindConstructorTypeKindTypeQueryKindTypeLiteralKindArrayTypeKindTupleTypeKindOptionalTypeKindRestTypeKindUnionTypeKindIntersectionTypeKindConditionalTypeKindInferTypeKindParenthesizedTypeKindThisTypeKindTypeOperatorKindIndexedAccessTypeKindMappedTypeKindLiteralTypeKindNamedTupleMemberKindTemplateLiteralTypeKindTemplateLiteralTypeSpanKindImportTypeKindObjectBindingPatternKindArrayBindingPatternKindBindingElementKindArrayLiteralExpressionKindObjectLiteralExpressionKindPropertyAccessExpressionKindElementAccessExpressionKindCallExpressionKindNewExpressionKindTaggedTemplateExpressionKindTypeAssertionExpressionKindParenthesizedExpressionKindFunctionExpressionKindArrowFunctionKindDeleteExpressionKindTypeOfExpressionKindVoidExpressionKindAwaitExpressionKindPrefixUnaryExpressionKindPostfixUnaryExpressionKindBinaryExpressionKindConditionalExpressionKindTemplateExpressionKindYieldExpressionKindSpreadElementKindClassExpressionKindOmittedExpressionKindExpressionWithTypeArgumentsKindAsExpressionKindNonNullExpressionKindMetaPropertyKindSyntheticExpressionKindSatisfiesExpressionKindTemplateSpanKindSemicolonClassElementKindBlockKindEmptyStatementKindVariableStatementKindExpressionStatementKindIfStatementKindDoStatementKindWhileStatementKindForStatementKindForInStatementKindForOfStatementKindContinueStatementKindBreakStatementKindReturnStatementKindWithStatementKindSwitchStatementKindLabeledStatementKindThrowStatementKindTryStatementKindDebuggerStatementKindVariableDeclarationKindVariableDeclarationListKindFunctionDeclarationKindClassDeclarationKindInterfaceDeclarationKindTypeAliasDeclarationKindEnumDeclarationKindModuleDeclarationKindModuleBlockKindCaseBlockKindNamespaceExportDeclarationKindImportEqualsDeclarationKindImportDeclarationKindImportClauseKindNamespaceImportKindNamedImportsKindImportSpecifierKindExportAssignmentKindExportDeclarationKindNamedExportsKindNamespaceExportKindExportSpecifierKindMissingDeclarationKindExternalModuleReferenceKindJsxElementKindJsxSelfClosingElementKindJsxOpeningElementKindJsxClosingElementKindJsxFragmentKindJsxOpeningFragmentKindJsxClosingFragmentKindJsxAttributeKindJsxAttributesKindJsxSpreadAttributeKindJsxExpressionKindJsxNamespacedNameKindCaseClauseKindDefaultClauseKindHeritageClauseKindCatchClauseKindImportAttributesKindImportAttributeKindPropertyAssignmentKindShorthandPropertyAssignmentKindSpreadAssignmentKindEnumMemberKindSourceFileKindBundleKindJSDocTypeExpressionKindJSDocNameReferenceKindJSDocMemberNameKindJSDocAllTypeKindJSDocNullableTypeKindJSDocNonNullableTypeKindJSDocOptionalTypeKindJSDocVariadicTypeKindJSDocKindJSDocTextKindJSDocTypeLiteralKindJSDocSignatureKindJSDocLinkKindJSDocLinkCodeKindJSDocLinkPlainKindJSDocTagKindJSDocAugmentsTagKindJSDocImplementsTagKindJSDocDeprecatedTagKindJSDocPublicTagKindJSDocPrivateTagKindJSDocProtectedTagKindJSDocReadonlyTagKindJSDocOverrideTagKindJSDocCallbackTagKindJSDocOverloadTagKindJSDocParameterTagKindJSDocReturnTagKindJSDocThisTagKindJSDocTypeTagKindJSDocTemplateTagKindJSDocTypedefTagKindJSDocSeeTagKindJSDocPropertyTagKindJSDocSatisfiesTagKindJSDocImportTagKindSyntaxListKindJSTypeAliasDeclarationKindJSExportAssignmentKindCommonJSExportKindNotEmittedStatementKindPartiallyEmittedExpressionKindCommaListExpressionKindSyntheticReferenceExpressionKindCount" -var _Kind_index = [...]uint16{0, 11, 24, 51, 77, 94, 114, 138, 165, 183, 200, 217, 228, 253, 281, 314, 330, 348, 364, 382, 401, 419, 438, 458, 479, 491, 509, 527, 541, 561, 578, 600, 620, 643, 669, 690, 716, 743, 775, 801, 814, 828, 845, 870, 884, 900, 917, 936, 961, 992, 1034, 1052, 1064, 1078, 1098, 1112, 1139, 1154, 1171, 1185, 1196, 1221, 1238, 1251, 1266, 1285, 1305, 1328, 1359, 1379, 1401, 1432, 1469, 1517, 1541, 1559, 1580, 1613, 1644, 1664, 1678, 1699, 1724, 1740, 1755, 1771, 1787, 1803, 1822, 1841, 1859, 1876, 1889, 1904, 1919, 1936, 1954, 1970, 1988, 2002, 2021, 2034, 2051, 2064, 2085, 2099, 2114, 2131, 2147, 2164, 2179, 2195, 2210, 2224, 2241, 2255, 2270, 2286, 2301, 2322, 2342, 2356, 2374, 2392, 2412, 2429, 2446, 2462, 2481, 2500, 2513, 2531, 2548, 2562, 2578, 2594, 2612, 2634, 2652, 2666, 2686, 2702, 2722, 2735, 2751, 2768, 2788, 2804, 2818, 2837, 2855, 2872, 2889, 2909, 2923, 2940, 2957, 2972, 2992, 3009, 3027, 3043, 3058, 3075, 3092, 3111, 3124, 3141, 3165, 3182, 3195, 3208, 3229, 3252, 3271, 3292, 3323, 3338, 3353, 3368, 3385, 3407, 3425, 3442, 3459, 3475, 3494, 3507, 3522, 3535, 3548, 3564, 3576, 3589, 3609, 3628, 3641, 3662, 3674, 3690, 3711, 3725, 3740, 3760, 3783, 3810, 3824, 3848, 3871, 3889, 3915, 3942, 3970, 3997, 4015, 4032, 4060, 4087, 4114, 4136, 4153, 4173, 4193, 4211, 4230, 4255, 4281, 4301, 4326, 4348, 4367, 4384, 4403, 4424, 4455, 4471, 4492, 4508, 4531, 4554, 4570, 4595, 4604, 4622, 4643, 4666, 4681, 4696, 4714, 4730, 4748, 4766, 4787, 4805, 4824, 4841, 4860, 4880, 4898, 4914, 4935, 4958, 4985, 5008, 5028, 5052, 5076, 5095, 5116, 5131, 5144, 5174, 5201, 5222, 5238, 5257, 5273, 5292, 5312, 5333, 5349, 5368, 5387, 5409, 5436, 5450, 5475, 5496, 5517, 5532, 5554, 5576, 5592, 5609, 5631, 5648, 5669, 5683, 5700, 5718, 5733, 5753, 5772, 5794, 5825, 5845, 5859, 5873, 5883, 5906, 5928, 5947, 5963, 5984, 6008, 6029, 6050, 6059, 6072, 6092, 6110, 6123, 6140, 6158, 6170, 6190, 6212, 6234, 6252, 6271, 6292, 6312, 6332, 6352, 6372, 6393, 6411, 6427, 6443, 6463, 6482, 6497, 6517, 6538, 6556, 6570, 6596, 6619, 6649, 6672, 6704, 6713} +var _Kind_index = [...]uint16{0, 11, 24, 51, 77, 94, 114, 138, 165, 183, 200, 217, 228, 253, 281, 314, 330, 348, 364, 382, 401, 419, 438, 458, 479, 491, 509, 527, 541, 561, 578, 600, 620, 643, 669, 690, 716, 743, 775, 801, 814, 828, 845, 870, 884, 900, 917, 936, 961, 992, 1034, 1052, 1064, 1078, 1098, 1112, 1139, 1154, 1171, 1185, 1196, 1221, 1238, 1251, 1266, 1285, 1305, 1328, 1359, 1379, 1401, 1432, 1469, 1517, 1541, 1559, 1580, 1613, 1644, 1664, 1678, 1699, 1724, 1740, 1755, 1771, 1787, 1803, 1822, 1841, 1859, 1876, 1889, 1904, 1919, 1936, 1954, 1970, 1988, 2002, 2021, 2034, 2051, 2064, 2085, 2099, 2114, 2131, 2147, 2164, 2179, 2195, 2210, 2224, 2241, 2255, 2270, 2286, 2301, 2322, 2342, 2356, 2374, 2392, 2412, 2429, 2446, 2462, 2481, 2500, 2513, 2531, 2548, 2562, 2578, 2594, 2612, 2634, 2652, 2666, 2686, 2702, 2722, 2735, 2751, 2768, 2788, 2804, 2818, 2837, 2855, 2872, 2889, 2909, 2923, 2940, 2957, 2972, 2992, 3009, 3027, 3043, 3058, 3075, 3092, 3111, 3124, 3141, 3165, 3182, 3195, 3208, 3229, 3252, 3271, 3292, 3323, 3338, 3353, 3368, 3385, 3407, 3425, 3442, 3459, 3475, 3494, 3507, 3522, 3535, 3548, 3564, 3576, 3589, 3609, 3628, 3641, 3662, 3674, 3690, 3711, 3725, 3740, 3760, 3783, 3810, 3824, 3848, 3871, 3889, 3915, 3942, 3970, 3997, 4015, 4032, 4060, 4087, 4114, 4136, 4153, 4173, 4193, 4211, 4230, 4255, 4281, 4301, 4326, 4348, 4367, 4384, 4403, 4424, 4455, 4471, 4492, 4508, 4531, 4554, 4570, 4595, 4604, 4622, 4643, 4666, 4681, 4696, 4714, 4730, 4748, 4766, 4787, 4805, 4824, 4841, 4860, 4880, 4898, 4914, 4935, 4958, 4985, 5008, 5028, 5052, 5076, 5095, 5116, 5131, 5144, 5174, 5201, 5222, 5238, 5257, 5273, 5292, 5312, 5333, 5349, 5368, 5387, 5409, 5436, 5450, 5475, 5496, 5517, 5532, 5554, 5576, 5592, 5609, 5631, 5648, 5669, 5683, 5700, 5718, 5733, 5753, 5772, 5794, 5825, 5845, 5859, 5873, 5883, 5906, 5928, 5947, 5963, 5984, 6008, 6029, 6050, 6059, 6072, 6092, 6110, 6123, 6140, 6158, 6170, 6190, 6212, 6234, 6252, 6271, 6292, 6312, 6332, 6352, 6372, 6393, 6411, 6427, 6443, 6463, 6482, 6497, 6517, 6538, 6556, 6570, 6596, 6618, 6636, 6659, 6689, 6712, 6744, 6753} func (i Kind) String() string { if i < 0 || i >= Kind(len(_Kind_index)-1) { diff --git a/internal/ast/symbol.go b/internal/ast/symbol.go index 92e9412cd9..ea5d73a7eb 100644 --- a/internal/ast/symbol.go +++ b/internal/ast/symbol.go @@ -49,6 +49,7 @@ const ( InternalSymbolNameExportEquals = "export=" // Export assignment symbol InternalSymbolNameDefault = "default" // Default export symbol (technically not wholly internal, but included here for usability) InternalSymbolNameThis = "this" + InternalSymbolNameModuleExports = "module.exports" ) func SymbolName(symbol *Symbol) string { diff --git a/internal/ast/utilities.go b/internal/ast/utilities.go index 9db2a10260..53ee669474 100644 --- a/internal/ast/utilities.go +++ b/internal/ast/utilities.go @@ -649,6 +649,7 @@ func isDeclarationStatementKind(kind Kind) bool { KindImportEqualsDeclaration, KindExportDeclaration, KindExportAssignment, + KindJSExportAssignment, KindNamespaceExportDeclaration: return true } @@ -1304,7 +1305,7 @@ func GetElementOrPropertyAccessArgumentExpressionOrName(node *Node) *Node { } func GetElementOrPropertyAccessName(node *Node) string { - name := getElementOrPropertyAccessArgumentExpressionOrName(node) + name := GetElementOrPropertyAccessArgumentExpressionOrName(node) if name == nil { return "" } @@ -1351,10 +1352,10 @@ func GetNonAssignedNameOfDeclaration(declaration *Node) *Node { switch declaration.Kind { case KindBinaryExpression: if IsFunctionPropertyAssignment(declaration) { - return getElementOrPropertyAccessArgumentExpressionOrName(declaration.AsBinaryExpression().Left) + return GetElementOrPropertyAccessArgumentExpressionOrName(declaration.AsBinaryExpression().Left) } return nil - case KindExportAssignment: + case KindExportAssignment, KindJSExportAssignment: expr := declaration.AsExportAssignment().Expression if IsIdentifier(expr) { return expr @@ -1414,22 +1415,6 @@ func IsFunctionPropertyAssignment(node *Node) bool { return false } -// Does not handle signed numeric names like `a[+0]` - handling those would require handling prefix unary expressions -// throughout late binding handling as well, which is awkward (but ultimately probably doable if there is demand) -func getElementOrPropertyAccessArgumentExpressionOrName(node *Node) *Node { - switch node.Kind { - case KindPropertyAccessExpression: - return node.Name() - case KindElementAccessExpression: - arg := SkipParentheses(node.AsElementAccessExpression().ArgumentExpression) - if IsStringOrNumericLiteralLike(arg) { - return arg - } - return node - } - panic("Unhandled case in getElementOrPropertyAccessArgumentExpressionOrName") -} - /** * A declaration has a dynamic name if all of the following are true: * 1. The declaration has a computed property name. @@ -1495,10 +1480,6 @@ func IsEffectiveExternalModule(node *SourceFile, compilerOptions *core.CompilerO return IsExternalModule(node) || (isCommonJSContainingModuleKind(compilerOptions.GetEmitModuleKind()) && node.CommonJSModuleIndicator != nil) } -func IsEffectiveExternalModuleWorker(node *SourceFile, moduleKind core.ModuleKind) bool { - return IsExternalModule(node) || (isCommonJSContainingModuleKind(moduleKind) && node.CommonJSModuleIndicator != nil) -} - func isCommonJSContainingModuleKind(kind core.ModuleKind) bool { return kind == core.ModuleKindCommonJS || kind == core.ModuleKindNode16 || kind == core.ModuleKindNodeNext } @@ -1668,20 +1649,7 @@ func IsEnumConst(node *Node) bool { } func ExportAssignmentIsAlias(node *Node) bool { - return isAliasableExpression(getExportAssignmentExpression(node)) -} - -func getExportAssignmentExpression(node *Node) *Node { - switch node.Kind { - case KindExportAssignment: - return node.AsExportAssignment().Expression - case KindBinaryExpression: - return node.AsBinaryExpression().Right - } - panic("Unhandled case in getExportAssignmentExpression") -} - -func isAliasableExpression(e *Node) bool { + e := node.AsExportAssignment().Expression return IsEntityNameExpression(e) || IsClassExpression(e) } @@ -2086,6 +2054,7 @@ func GetMeaningFromDeclaration(node *Node) SemanticMeaning { KindImportEqualsDeclaration, KindImportDeclaration, KindExportAssignment, + KindJSExportAssignment, KindExportDeclaration: return SemanticMeaningAll @@ -2474,6 +2443,8 @@ func IsNonLocalAlias(symbol *Symbol, excludes SymbolFlags) bool { // An alias symbol is created by one of the following declarations: // // import = ... +// const = ... (JS only) +// const { , ... } = ... (JS only) // import from ... // import * as from ... // import { x as } from ... @@ -2481,6 +2452,7 @@ func IsNonLocalAlias(symbol *Symbol, excludes SymbolFlags) bool { // export * as ns from ... // export = // export default +// module.exports = (JS only) func IsAliasSymbolDeclaration(node *Node) bool { switch node.Kind { case KindImportEqualsDeclaration, KindNamespaceExportDeclaration, KindNamespaceImport, KindNamespaceExport, @@ -2488,8 +2460,10 @@ func IsAliasSymbolDeclaration(node *Node) bool { return true case KindImportClause: return node.AsImportClause().Name() != nil - case KindExportAssignment: + case KindExportAssignment, KindJSExportAssignment: return ExportAssignmentIsAlias(node) + case KindVariableDeclaration, KindBindingElement: + return IsVariableDeclarationInitializedToRequire(node) } return false } @@ -2568,7 +2542,7 @@ func ForEachDynamicImportOrRequireCall( lastIndex, size := findImportOrRequire(file.Text(), 0) for lastIndex >= 0 { node := GetNodeAtPosition(file, lastIndex, isJavaScriptFile && includeTypeSpaceImports) - if isJavaScriptFile && IsRequireCall(node, requireStringLiteralLikeArgument) { + if isJavaScriptFile && IsRequireCall(node) { if cb(node, node.Arguments()[0]) { return true } @@ -2595,7 +2569,8 @@ func ForEachDynamicImportOrRequireCall( return false } -func IsRequireCall(node *Node, requireStringLiteralLikeArgument bool) bool { +// IsVariableDeclarationInitializedToRequire should be used wherever parent pointers are set +func IsRequireCall(node *Node) bool { if !IsCallExpression(node) { return false } @@ -2606,7 +2581,7 @@ func IsRequireCall(node *Node, requireStringLiteralLikeArgument bool) bool { if len(call.Arguments.Nodes) != 1 { return false } - return !requireStringLiteralLikeArgument || IsStringLiteralLike(call.Arguments.Nodes[0]) + return IsStringLiteralLike(call.Arguments.Nodes[0]) } func IsUnterminatedLiteral(node *Node) bool { @@ -2664,6 +2639,36 @@ func GetPragmaArgument(pragma *Pragma, name string) string { return "" } +// Of the form: `const x = require("x")` or `const { x } = require("x")` or with `var` or `let` +// The variable must not be exported and must not have a type annotation, even a jsdoc one. +// The initializer must be a call to `require` with a string literal or a string literal-like argument. +func IsVariableDeclarationInitializedToRequire(node *Node) bool { + if !IsInJSFile(node) { + return false + } + if node.Kind == KindBindingElement { + node = node.Parent.Parent + } + if node.Kind != KindVariableDeclaration { + return false + } + + return node.Parent.Parent.ModifierFlags()&ModifierFlagsExport == 0 && + node.AsVariableDeclaration().Initializer != nil && + node.Type() == nil && + IsRequireCall(node.AsVariableDeclaration().Initializer) +} + +func IsModuleExportsAccessExpression(node *Node) bool { + return (IsPropertyAccessExpression(node) || isLiteralLikeElementAccess(node)) && + IsModuleIdentifier(node.Expression()) && + GetElementOrPropertyAccessName(node) == "exports" +} + +func isLiteralLikeElementAccess(node *Node) bool { + return node.Kind == KindElementAccessExpression && IsStringOrNumericLiteralLike(node.AsElementAccessExpression().ArgumentExpression) +} + func IsCheckJSEnabledForFile(sourceFile *SourceFile, compilerOptions *core.CompilerOptions) bool { if sourceFile.CheckJsDirective != nil { return sourceFile.CheckJsDirective.Enabled diff --git a/internal/binder/binder.go b/internal/binder/binder.go index 86eb4d1a20..4be642f266 100644 --- a/internal/binder/binder.go +++ b/internal/binder/binder.go @@ -305,6 +305,8 @@ func (b *Binder) declareSymbolEx(symbolTable ast.SymbolTable, parent *ast.Symbol func (b *Binder) getDeclarationName(node *ast.Node) string { if ast.IsExportAssignment(node) { return core.IfElse(node.AsExportAssignment().IsExportEquals, ast.InternalSymbolNameExportEquals, ast.InternalSymbolNameDefault) + } else if ast.IsJSExportAssignment(node) { + return ast.InternalSymbolNameExportEquals } name := ast.GetNameOfDeclaration(node) if name != nil { @@ -375,12 +377,16 @@ func GetSymbolNameForPrivateIdentifier(containingClassSymbol *ast.Symbol, descri } func (b *Binder) declareModuleMember(node *ast.Node, symbolFlags ast.SymbolFlags, symbolExcludes ast.SymbolFlags) *ast.Symbol { + container := b.container + if node.Kind == ast.KindCommonJSExport { + container = b.file.AsNode() + } hasExportModifier := ast.GetCombinedModifierFlags(node)&ast.ModifierFlagsExport != 0 if symbolFlags&ast.SymbolFlagsAlias != 0 { if node.Kind == ast.KindExportSpecifier || (node.Kind == ast.KindImportEqualsDeclaration && hasExportModifier) { - return b.declareSymbol(ast.GetExports(b.container.Symbol()), b.container.Symbol(), node, symbolFlags, symbolExcludes) + return b.declareSymbol(ast.GetExports(container.Symbol()), container.Symbol(), node, symbolFlags, symbolExcludes) } - return b.declareSymbol(ast.GetLocals(b.container), nil /*parent*/, node, symbolFlags, symbolExcludes) + return b.declareSymbol(ast.GetLocals(container), nil /*parent*/, node, symbolFlags, symbolExcludes) } // Exported module members are given 2 symbols: A local symbol that is classified with an ExportValue flag, // and an associated export symbol with all the correct flags set on it. There are 2 main reasons: @@ -397,21 +403,21 @@ func (b *Binder) declareModuleMember(node *ast.Node, symbolFlags ast.SymbolFlags // during global merging in the checker. Why? The only case when ambient module is permitted inside another module is module augmentation // and this case is specially handled. Module augmentations should only be merged with original module definition // and should never be merged directly with other augmentation, and the latter case would be possible if automatic merge is allowed. - if !ast.IsAmbientModule(node) && (hasExportModifier || b.container.Flags&ast.NodeFlagsExportContext != 0) { - if !ast.IsLocalsContainer(b.container) || (ast.HasSyntacticModifier(node, ast.ModifierFlagsDefault) && b.getDeclarationName(node) == ast.InternalSymbolNameMissing) { - return b.declareSymbol(ast.GetExports(b.container.Symbol()), b.container.Symbol(), node, symbolFlags, symbolExcludes) + if !ast.IsAmbientModule(node) && (hasExportModifier || container.Flags&ast.NodeFlagsExportContext != 0) { + if !ast.IsLocalsContainer(container) || (ast.HasSyntacticModifier(node, ast.ModifierFlagsDefault) && b.getDeclarationName(node) == ast.InternalSymbolNameMissing) || ast.IsCommonJSExport(node) { + return b.declareSymbol(ast.GetExports(container.Symbol()), container.Symbol(), node, symbolFlags, symbolExcludes) // No local symbol for an unnamed default! } exportKind := ast.SymbolFlagsNone if symbolFlags&ast.SymbolFlagsValue != 0 { exportKind = ast.SymbolFlagsExportValue } - local := b.declareSymbol(ast.GetLocals(b.container), nil /*parent*/, node, exportKind, symbolExcludes) - local.ExportSymbol = b.declareSymbol(ast.GetExports(b.container.Symbol()), b.container.Symbol(), node, symbolFlags, symbolExcludes) + local := b.declareSymbol(ast.GetLocals(container), nil /*parent*/, node, exportKind, symbolExcludes) + local.ExportSymbol = b.declareSymbol(ast.GetExports(container.Symbol()), container.Symbol(), node, symbolFlags, symbolExcludes) node.ExportableData().LocalSymbol = local return local } - return b.declareSymbol(ast.GetLocals(b.container), nil /*parent*/, node, symbolFlags, symbolExcludes) + return b.declareSymbol(ast.GetLocals(container), nil /*parent*/, node, symbolFlags, symbolExcludes) } func (b *Binder) declareClassMember(node *ast.Node, symbolFlags ast.SymbolFlags, symbolExcludes ast.SymbolFlags) *ast.Symbol { @@ -422,7 +428,7 @@ func (b *Binder) declareClassMember(node *ast.Node, symbolFlags ast.SymbolFlags, } func (b *Binder) declareSourceFileMember(node *ast.Node, symbolFlags ast.SymbolFlags, symbolExcludes ast.SymbolFlags) *ast.Symbol { - if ast.IsExternalModule(b.file) { + if ast.IsExternalOrCommonJSModule(b.file) { return b.declareModuleMember(node, symbolFlags, symbolExcludes) } return b.declareSymbol(ast.GetLocals(b.file.AsNode()), nil /*parent*/, node, symbolFlags, symbolExcludes) @@ -643,6 +649,8 @@ func (b *Binder) bind(node *ast.Node) bool { case ast.KindBindingElement: node.AsBindingElement().FlowNode = b.currentFlow b.bindVariableDeclarationOrBindingElement(node) + case ast.KindCommonJSExport: + b.declareModuleMember(node, ast.SymbolFlagsFunctionScopedVariable, ast.SymbolFlagsFunctionScopedVariableExcludes) case ast.KindPropertyDeclaration, ast.KindPropertySignature: b.bindPropertyWorker(node) case ast.KindPropertyAssignment, ast.KindShorthandPropertyAssignment: @@ -676,6 +684,8 @@ func (b *Binder) bind(node *ast.Node) bool { b.bindClassLikeDeclaration(node) case ast.KindInterfaceDeclaration: b.bindBlockScopedDeclaration(node, ast.SymbolFlagsInterface, ast.SymbolFlagsInterfaceExcludes) + case ast.KindCallExpression: + b.bindCallExpression(node) case ast.KindTypeAliasDeclaration, ast.KindJSTypeAliasDeclaration: b.bindBlockScopedDeclaration(node, ast.SymbolFlagsTypeAlias, ast.SymbolFlagsTypeAliasExcludes) case ast.KindEnumDeclaration: @@ -690,7 +700,7 @@ func (b *Binder) bind(node *ast.Node) bool { b.bindImportClause(node) case ast.KindExportDeclaration: b.bindExportDeclaration(node) - case ast.KindExportAssignment: + case ast.KindExportAssignment, ast.KindJSExportAssignment: b.bindExportAssignment(node) case ast.KindSourceFile: b.updateStrictModeStatementList(node.AsSourceFile().Statements) @@ -762,7 +772,7 @@ func (b *Binder) bindPropertyWorker(node *ast.Node) { func (b *Binder) bindSourceFileIfExternalModule() { b.setExportContextFlag(b.file.AsNode()) - if ast.IsExternalModule(b.file) { + if ast.IsExternalOrCommonJSModule(b.file) { b.bindSourceFileAsExternalModule() } else if ast.IsJsonSourceFile(b.file) { b.bindSourceFileAsExternalModule() @@ -857,7 +867,11 @@ func (b *Binder) bindExportDeclaration(node *ast.Node) { } func (b *Binder) bindExportAssignment(node *ast.Node) { - if b.container.Symbol() == nil { + container := b.container + if ast.IsJSExportAssignment(node) { + container = b.file.AsNode() + } + if container.Symbol() == nil && ast.IsExportAssignment(node) { // Incorrect export assignment in some sort of block construct b.bindAnonymousDeclaration(node, ast.SymbolFlagsValue, b.getDeclarationName(node)) } else { @@ -867,8 +881,8 @@ func (b *Binder) bindExportAssignment(node *ast.Node) { } // If there is an `export default x;` alias declaration, can't `export default` anything else. // (In contrast, you can still have `export default function f() {}` and `export default interface I {}`.) - symbol := b.declareSymbol(ast.GetExports(b.container.Symbol()), b.container.Symbol(), node, flags, ast.SymbolFlagsAll) - if node.AsExportAssignment().IsExportEquals { + symbol := b.declareSymbol(ast.GetExports(container.Symbol()), container.Symbol(), node, flags, ast.SymbolFlagsAll) + if ast.IsJSExportAssignment(node) || node.AsExportAssignment().IsExportEquals { // Will be an error later, since the module already has other exports. Just make sure this has a valueDeclaration set. SetValueDeclaration(symbol, node) } @@ -905,7 +919,7 @@ func (b *Binder) hasExportDeclarations(node *ast.Node) bool { } } return core.Some(statements, func(s *ast.Node) bool { - return ast.IsExportDeclaration(s) || ast.IsExportAssignment(s) + return ast.IsExportDeclaration(s) || ast.IsExportAssignment(s) || ast.IsJSExportAssignment(s) }) } @@ -919,6 +933,19 @@ func (b *Binder) bindFunctionExpression(node *ast.Node) { b.bindAnonymousDeclaration(node, ast.SymbolFlagsFunction, bindingName) } +func (b *Binder) bindCallExpression(node *ast.Node) { + // !!! for ModuleDetectionKind.Force, external module indicator is forced to `true` in Strada for source files, in which case + // we should set the commonjs module indicator but not call b.bindSourceFileAsExternalModule + // !!! && file.externalModuleIndicator !== true (used for ModuleDetectionKind.Force) + if ast.IsInJSFile(node) && + b.file.ExternalModuleIndicator == nil && + b.file.CommonJSModuleIndicator == nil && + ast.IsVariableDeclarationInitializedToRequire(node.Parent) { + b.file.CommonJSModuleIndicator = node + b.bindSourceFileAsExternalModule() + } +} + func (b *Binder) bindClassLikeDeclaration(node *ast.Node) { name := node.Name() switch node.Kind { @@ -1031,6 +1058,8 @@ func (b *Binder) bindVariableDeclarationOrBindingElement(node *ast.Node) { } if name := node.Name(); name != nil && !ast.IsBindingPattern(name) { switch { + case ast.IsVariableDeclarationInitializedToRequire(node): + b.declareSymbolAndAddToSymbolTable(node, ast.SymbolFlagsAlias, ast.SymbolFlagsAliasExcludes) case ast.IsBlockOrCatchScoped(node): b.bindBlockScopedDeclaration(node, ast.SymbolFlagsBlockScopedVariable, ast.SymbolFlagsBlockScopedVariableExcludes) case ast.IsPartOfParameterDeclaration(node): @@ -1581,6 +1610,8 @@ func (b *Binder) bindChildren(node *ast.Node) { case ast.KindObjectLiteralExpression, ast.KindArrayLiteralExpression, ast.KindPropertyAssignment, ast.KindSpreadElement: b.inAssignmentPattern = saveInAssignmentPattern b.bindEachChild(node) + case ast.KindJSExportAssignment, ast.KindCommonJSExport: + return // Reparsed nodes do not double-bind children, which are not reparsed default: b.bindEachChild(node) } diff --git a/internal/binder/nameresolver.go b/internal/binder/nameresolver.go index 168d44db7d..e14c630a6b 100644 --- a/internal/binder/nameresolver.go +++ b/internal/binder/nameresolver.go @@ -12,6 +12,8 @@ type NameResolver struct { Error func(location *ast.Node, message *diagnostics.Message, args ...any) *ast.Diagnostic Globals ast.SymbolTable ArgumentsSymbol *ast.Symbol + RequireSymbol *ast.Symbol + GetModuleSymbol func(sourceFile *ast.Node) *ast.Symbol Lookup func(symbols ast.SymbolTable, name string, meaning ast.SymbolFlags) *ast.Symbol SymbolReferenced func(symbol *ast.Symbol, meaning ast.SymbolFlags) SetRequiresScopeChangeCache func(node *ast.Node, value core.Tristate) @@ -303,10 +305,34 @@ loop: } } if result == nil { + // TODO: Move this to the next == nil block, or move the other up here. + if lastLocation != nil && + lastLocation.Kind == ast.KindSourceFile && + lastLocation.AsSourceFile().CommonJSModuleIndicator != nil && + name == "exports" && + meaning&lastLocation.Symbol().Flags != 0 { + return lastLocation.Symbol() + } + if lastLocation != nil && + r.GetModuleSymbol != nil && + lastLocation.Kind == ast.KindSourceFile && + lastLocation.AsSourceFile().CommonJSModuleIndicator != nil && + name == "module" && + originalLocation.Parent != nil && + ast.IsModuleExportsAccessExpression(originalLocation.Parent) && + meaning&lastLocation.Symbol().Flags != 0 { + return r.GetModuleSymbol(lastLocation) + } if !excludeGlobals { result = r.lookup(r.Globals, name, meaning|ast.SymbolFlagsGlobalLookup) } } + if result == nil { + if originalLocation != nil && originalLocation.Parent != nil && originalLocation.Parent.Parent != nil && + ast.IsVariableDeclarationInitializedToRequire(originalLocation.Parent.Parent) { + return r.RequireSymbol + } + } if nameNotFoundMessage != nil { if propertyWithInvalidInitializer != nil && r.OnPropertyWithInvalidInitializer != nil && r.OnPropertyWithInvalidInitializer(originalLocation, name, propertyWithInvalidInitializer, result) { return nil diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 12fb0affe1..6a4360df3c 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -1349,6 +1349,8 @@ func (c *Checker) createNameResolver() *binder.NameResolver { Error: c.error, Globals: c.globals, ArgumentsSymbol: c.argumentsSymbol, + RequireSymbol: c.requireSymbol, + GetModuleSymbol: c.getModuleSymbol, Lookup: c.getSymbol, SymbolReferenced: c.symbolReferenced, SetRequiresScopeChangeCache: c.setRequiresScopeChangeCache, @@ -1366,6 +1368,8 @@ func (c *Checker) createNameResolverForSuggestion() *binder.NameResolver { Error: c.error, Globals: c.globals, ArgumentsSymbol: c.argumentsSymbol, + RequireSymbol: c.requireSymbol, + GetModuleSymbol: c.getModuleSymbol, Lookup: c.getSuggestionForSymbolNameLookup, SymbolReferenced: c.symbolReferenced, SetRequiresScopeChangeCache: c.setRequiresScopeChangeCache, @@ -1373,6 +1377,12 @@ func (c *Checker) createNameResolverForSuggestion() *binder.NameResolver { } } +func (c *Checker) getModuleSymbol(sourceFile *ast.Node) *ast.Symbol { + result := c.newSymbol(ast.SymbolFlagsModuleExports|ast.SymbolFlagsFunctionScopedVariable, ast.InternalSymbolNameModuleExports) + result.ValueDeclaration = sourceFile + return result +} + func (c *Checker) symbolReferenced(symbol *ast.Symbol, meaning ast.SymbolFlags) { c.symbolReferenceLinks.Get(symbol).referenceKinds |= meaning } @@ -2201,7 +2211,7 @@ func (c *Checker) checkSourceElementWorker(node *ast.Node) { c.checkImportEqualsDeclaration(node) case ast.KindExportDeclaration: c.checkExportDeclaration(node) - case ast.KindExportAssignment: + case ast.KindExportAssignment, ast.KindJSExportAssignment: c.checkExportAssignment(node) case ast.KindEmptyStatement: c.checkGrammarStatementInAmbientContext(node) @@ -4880,7 +4890,7 @@ func (c *Checker) checkModuleAugmentationElement(node *ast.Node) { for _, decl := range node.AsVariableStatement().DeclarationList.AsVariableDeclarationList().Declarations.Nodes { c.checkModuleAugmentationElement(decl) } - case ast.KindExportAssignment, ast.KindExportDeclaration: + case ast.KindExportAssignment, ast.KindJSExportAssignment, ast.KindExportDeclaration: c.grammarErrorOnFirstToken(node, diagnostics.Exports_and_export_assignments_are_not_permitted_in_module_augmentations) case ast.KindImportEqualsDeclaration: // import a = e.x; in module augmentation is ok, but not import a = require('fs) @@ -5201,8 +5211,7 @@ func (c *Checker) checkExportSpecifier(node *ast.Node) { } func (c *Checker) checkExportAssignment(node *ast.Node) { - exportAssignment := node.AsExportAssignment() - isExportEquals := exportAssignment.IsExportEquals + isExportEquals := ast.IsJSExportAssignment(node) || node.AsExportAssignment().IsExportEquals illegalContextMessage := core.IfElse(isExportEquals, diagnostics.An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration, diagnostics.A_default_export_must_be_at_the_top_level_of_a_file_or_module_declaration) @@ -5222,7 +5231,7 @@ func (c *Checker) checkExportAssignment(node *ast.Node) { } return } - if !c.checkGrammarModifiers(node) && exportAssignment.Modifiers() != nil { + if !c.checkGrammarModifiers(node) && ast.IsExportAssignment(node) && node.AsExportAssignment().Modifiers() != nil { c.grammarErrorOnFirstToken(node, diagnostics.An_export_assignment_cannot_have_modifiers) } isIllegalExportDefaultInCJS := !isExportEquals && node.Flags&ast.NodeFlagsAmbient == 0 && c.compilerOptions.VerbatimModuleSyntax.IsTrue() && c.program.GetEmitModuleFormatOfFile(ast.GetSourceFileOfNode(node)) == core.ModuleKindCommonJS @@ -5471,7 +5480,7 @@ func (c *Checker) checkVariableLikeDeclaration(node *ast.Node) { } // For a commonjs `const x = require`, validate the alias and exit symbol := c.getSymbolOfDeclaration(node) - if symbol.Flags&ast.SymbolFlagsAlias != 0 && (isVariableDeclarationInitializedToBareOrAccessedRequire(node) || isBindingElementOfBareOrAccessedRequire(node)) { + if symbol.Flags&ast.SymbolFlagsAlias != 0 && ast.IsVariableDeclarationInitializedToRequire(node) { c.checkAliasSymbol(node) return } @@ -6341,7 +6350,7 @@ func (c *Checker) checkAliasSymbol(node *ast.Node) { } } } - if c.compilerOptions.VerbatimModuleSyntax.IsTrue() && !ast.IsImportEqualsDeclaration(node) && c.program.GetEmitModuleFormatOfFile(ast.GetSourceFileOfNode(node)) == core.ModuleKindCommonJS { + if c.compilerOptions.VerbatimModuleSyntax.IsTrue() && !ast.IsImportEqualsDeclaration(node) && !ast.IsVariableDeclarationInitializedToRequire(node) && c.program.GetEmitModuleFormatOfFile(ast.GetSourceFileOfNode(node)) == core.ModuleKindCommonJS { c.error(node, diagnostics.ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_verbatimModuleSyntax_is_enabled) } else if c.moduleKind == core.ModuleKindPreserve && !ast.IsImportEqualsDeclaration(node) && !ast.IsVariableDeclaration(node) && c.program.GetEmitModuleFormatOfFile(ast.GetSourceFileOfNode(node)) == core.ModuleKindCommonJS { // In `--module preserve`, ESM input syntax emits ESM output syntax, but there will be times @@ -6472,9 +6481,9 @@ func (c *Checker) getDeclarationSpaces(node *ast.Declaration) DeclarationSpaces return DeclarationSpacesExportType | DeclarationSpacesExportValue case ast.KindSourceFile: return DeclarationSpacesExportType | DeclarationSpacesExportValue | DeclarationSpacesExportNamespace - case ast.KindExportAssignment, ast.KindBinaryExpression: + case ast.KindExportAssignment, ast.KindJSExportAssignment, ast.KindBinaryExpression: var expression *ast.Node - if ast.IsExportAssignment(node) { + if ast.IsExportAssignment(node) || ast.IsJSExportAssignment(node) { expression = node.Expression() } else { expression = node.AsBinaryExpression().Right @@ -6493,12 +6502,14 @@ func (c *Checker) getDeclarationSpaces(node *ast.Declaration) DeclarationSpaces result |= c.getDeclarationSpaces(d) } return result + case ast.KindCommonJSExport: + return DeclarationSpacesExportValue case ast.KindVariableDeclaration, ast.KindBindingElement, ast.KindFunctionDeclaration, ast.KindImportSpecifier: return DeclarationSpacesExportValue case ast.KindMethodSignature, ast.KindPropertySignature: return DeclarationSpacesExportType } - panic("Unhandled case in getDeclarationSpaces") + panic("Unhandled case in getDeclarationSpaces: " + node.Kind.String()) } func (c *Checker) checkTypeParameters(typeParameterDeclarations []*ast.Node) { @@ -6854,7 +6865,7 @@ func (c *Checker) getQuickTypeOfExpression(node *ast.Node) *Type { return nil // Optimize for the common case of a call to a function with a single non-generic call // signature where we can just fetch the return type without checking the arguments. - case ast.IsCallExpression(expr) && expr.Expression().Kind != ast.KindSuperKeyword && !isRequireCall(expr, true /*requireStringLiteralLikeArgument*/) && !c.isSymbolOrSymbolForCall(expr): + case ast.IsCallExpression(expr) && expr.Expression().Kind != ast.KindSuperKeyword && !ast.IsVariableDeclarationInitializedToRequire(expr.Parent) && !c.isSymbolOrSymbolForCall(expr): if isCallChain(expr) { return c.getReturnTypeOfSingleNonGenericSignatureOfCallChain(expr) } @@ -7887,6 +7898,9 @@ func (c *Checker) checkCallExpression(node *ast.Node, checkMode CheckMode) *Type return c.anyType } } + if ast.IsInJSFile(node) && c.isCommonJSRequire(node) { + return c.resolveExternalModuleTypeByLiteral(node.AsCallExpression().Arguments.Nodes[0]) + } returnType := c.getReturnTypeOfSignature(signature) // Treat any call to the global 'Symbol' function that is part of a const variable or readonly property // as a fresh unique symbol literal type. @@ -13598,15 +13612,6 @@ func (c *Checker) resolveSymbolEx(symbol *ast.Symbol, dontResolveAlias bool) *as func (c *Checker) getTargetOfImportEqualsDeclaration(node *ast.Node, dontResolveAlias bool) *ast.Symbol { // Node is ImportEqualsDeclaration | VariableDeclaration - commonJSPropertyAccess := c.getCommonJSPropertyAccess(node) - if commonJSPropertyAccess != nil { - access := commonJSPropertyAccess.AsPropertyAccessExpression() - name := ast.GetLeftmostAccessExpression(access.Expression).AsCallExpression().Arguments.Nodes[0] - if ast.IsIdentifier(access.Name()) { - return c.resolveSymbol(c.getPropertyOfType(c.resolveExternalModuleTypeByLiteral(name), access.Name().Text())) - } - return nil - } if ast.IsVariableDeclaration(node) || node.AsImportEqualsDeclaration().ModuleReference.Kind == ast.KindExternalModuleReference { moduleReference := getExternalModuleRequireArgument(node) if moduleReference == nil { @@ -13622,16 +13627,6 @@ func (c *Checker) getTargetOfImportEqualsDeclaration(node *ast.Node, dontResolve return resolved } -func (c *Checker) getCommonJSPropertyAccess(node *ast.Node) *ast.Node { - if ast.IsVariableDeclaration(node) { - initializer := node.Initializer() - if initializer != nil && ast.IsPropertyAccessExpression(initializer) { - return initializer - } - } - return nil -} - func (c *Checker) resolveExternalModuleTypeByLiteral(name *ast.Node) *Type { moduleSym := c.resolveExternalModuleName(name, name, false /*ignoreErrors*/) if moduleSym != nil { @@ -13797,7 +13792,7 @@ func (c *Checker) getTargetOfNamespaceExport(node *ast.Node, dontResolveAlias bo func (c *Checker) getTargetOfImportSpecifier(node *ast.Node, dontResolveAlias bool) *ast.Symbol { name := node.PropertyNameOrName() - if ast.ModuleExportNameIsDefault(name) { + if ast.IsImportSpecifier(node) && ast.ModuleExportNameIsDefault(name) { specifier := c.getModuleSpecifierForImportOrExport(node) if specifier != nil { moduleSymbol := c.resolveExternalModuleName(node, specifier, false /*ignoreErrors*/) @@ -13807,6 +13802,9 @@ func (c *Checker) getTargetOfImportSpecifier(node *ast.Node, dontResolveAlias bo } } root := node.Parent.Parent.Parent // ImportDeclaration + if ast.IsBindingElement(node) { + root = ast.GetRootDeclaration(node) + } resolved := c.getExternalModuleMember(root, node, dontResolveAlias) c.markSymbolOfAliasDeclarationIfTypeOnly(node, nil /*immediateTarget*/, resolved, false /*overwriteEmpty*/, nil, "") return resolved @@ -13830,7 +13828,7 @@ func (c *Checker) getExternalModuleMember(node *ast.Node, specifier *ast.Node, d return nil } nameText := name.Text() - suppressInteropError := nameText == ast.InternalSymbolNameDefault && c.allowSyntheticDefaultImports + suppressInteropError := node.Kind == ast.KindVariableDeclaration || nameText == ast.InternalSymbolNameDefault && c.allowSyntheticDefaultImports targetSymbol := c.resolveESModuleSymbol(moduleSymbol, moduleSpecifier /*dontResolveAlias*/, false, suppressInteropError) if targetSymbol != nil { // Note: The empty string is a valid module export name: @@ -14314,48 +14312,13 @@ func (c *Checker) tryFindAmbientModule(moduleName string, withAugmentations bool func (c *Checker) resolveExternalModuleSymbol(moduleSymbol *ast.Symbol, dontResolveAlias bool) *ast.Symbol { if moduleSymbol != nil { exportEquals := c.resolveSymbolEx(moduleSymbol.Exports[ast.InternalSymbolNameExportEquals], dontResolveAlias) - exported := c.getMergedSymbol(c.getCommonJSExportEquals(c.getMergedSymbol(exportEquals), c.getMergedSymbol(moduleSymbol))) - if exported != nil { - return exported + if exportEquals != nil { + return c.getMergedSymbol(exportEquals) } } return moduleSymbol } -func (c *Checker) getCommonJSExportEquals(exported *ast.Symbol, moduleSymbol *ast.Symbol) *ast.Symbol { - if exported == nil || exported == c.unknownSymbol || exported == moduleSymbol || len(moduleSymbol.Exports) == 1 || exported.Flags&ast.SymbolFlagsAlias != 0 { - return exported - } - links := c.moduleSymbolLinks.Get(exported) - if links.cjsExportMerged != nil { - return links.cjsExportMerged - } - var merged *ast.Symbol - if exported.Flags&ast.SymbolFlagsTransient != 0 { - merged = exported - } else { - merged = c.cloneSymbol(exported) - } - merged.Flags |= ast.SymbolFlagsValueModule - mergedExports := ast.GetExports(merged) - for name, s := range moduleSymbol.Exports { - if name != ast.InternalSymbolNameExportEquals { - if existing, ok := mergedExports[name]; ok { - s = c.mergeSymbol(existing, s /*unidirectional*/, false) - } - mergedExports[name] = s - } - } - if merged == exported { - // We just mutated a symbol, reset any cached links we may have already set - // (Notably required to make late bound members appear) - c.moduleSymbolLinks.Get(merged).resolvedExports = nil - } - c.moduleSymbolLinks.Get(merged).cjsExportMerged = merged - links.cjsExportMerged = merged - return links.cjsExportMerged -} - // An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export =' // references a symbol that is at least declared as a module or a variable. The target of the 'export =' may // combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable). @@ -14444,6 +14407,39 @@ func (c *Checker) getTypeWithSyntheticDefaultImportType(t *Type, symbol *ast.Sym return t } +func (c *Checker) isCommonJSRequire(node *ast.Node) bool { + if !ast.IsVariableDeclarationInitializedToRequire(node.Parent) { + return false + } + if !ast.IsIdentifier(node.Expression()) { + panic("Expected identifier for require call") + } + // Make sure require is not a local function + resolvedRequire := c.resolveName(node.Expression(), node.Expression().Text(), ast.SymbolFlagsValue, nil /*nameNotFoundMessage*/, true /*isUse*/, false /*excludeGlobals*/) + if resolvedRequire == c.requireSymbol { + return true + } + // project includes symbol named 'require' - make sure that it is ambient and local non-alias + if resolvedRequire == nil || resolvedRequire.Flags&ast.SymbolFlagsAlias != 0 { + return false + } + + var targetDeclarationKind ast.Kind + if resolvedRequire.Flags&ast.SymbolFlagsFunction != 0 { + targetDeclarationKind = ast.KindFunctionDeclaration + } else if resolvedRequire.Flags&ast.SymbolFlagsVariable != 0 { + targetDeclarationKind = ast.KindVariableDeclaration + } else { + targetDeclarationKind = ast.KindUnknown + } + if targetDeclarationKind != ast.KindUnknown { + decl := ast.GetDeclarationOfKind(resolvedRequire, targetDeclarationKind) + // function/variable declaration should be ambient + return decl != nil && decl.Flags&ast.NodeFlagsAmbient != 0 + } + return false +} + func (c *Checker) createDefaultPropertyWrapperForModule(symbol *ast.Symbol, originalSymbol *ast.Symbol, anonymousSymbol *ast.Symbol) *Type { memberTable := make(ast.SymbolTable) newSymbol := c.newSymbol(ast.SymbolFlagsAlias, ast.InternalSymbolNameDefault) @@ -14482,11 +14478,11 @@ func (c *Checker) getTargetOfAliasDeclaration(node *ast.Node, dontRecursivelyRes return c.getTargetOfNamespaceImport(node, dontRecursivelyResolve) case ast.KindNamespaceExport: return c.getTargetOfNamespaceExport(node, dontRecursivelyResolve) - case ast.KindImportSpecifier: + case ast.KindImportSpecifier, ast.KindBindingElement: return c.getTargetOfImportSpecifier(node, dontRecursivelyResolve) case ast.KindExportSpecifier: return c.getTargetOfExportSpecifier(node, ast.SymbolFlagsValue|ast.SymbolFlagsType|ast.SymbolFlagsNamespace, dontRecursivelyResolve) - case ast.KindExportAssignment: + case ast.KindExportAssignment, ast.KindJSExportAssignment: return c.getTargetOfExportAssignment(node, dontRecursivelyResolve) case ast.KindBinaryExpression: return c.getTargetOfBinaryExpression(node, dontRecursivelyResolve) @@ -14499,7 +14495,7 @@ func (c *Checker) getTargetOfAliasDeclaration(node *ast.Node, dontRecursivelyRes case ast.KindElementAccessExpression, ast.KindPropertyAccessExpression: return c.getTargetOfAccessExpression(node, dontRecursivelyResolve) } - panic("Unhandled case in getTargetOfAliasDeclaration") + panic("Unhandled case in getTargetOfAliasDeclaration: " + node.Kind.String()) } /** @@ -14535,7 +14531,10 @@ func (c *Checker) resolveEntityName(name *ast.Node, meaning ast.SymbolFlags, ign panic("Unknown entity name kind") } if symbol != nil && symbol != c.unknownSymbol { - if !ast.NodeIsSynthesized(name) && ast.IsEntityName(name) && (symbol.Flags&ast.SymbolFlagsAlias != 0 || name.Parent != nil && name.Parent.Kind == ast.KindExportAssignment) { + if !ast.NodeIsSynthesized(name) && ast.IsEntityName(name) && + (symbol.Flags&ast.SymbolFlagsAlias != 0 || + name.Parent != nil && name.Parent.Kind == ast.KindExportAssignment || + name.Parent != nil && name.Parent.Kind == ast.KindJSExportAssignment) { c.markSymbolOfAliasDeclarationIfTypeOnly(getAliasDeclarationFromName(name), symbol, nil /*finalTarget*/, true /*overwriteEmpty*/, nil, "") } if symbol.Flags&meaning == 0 && !dontResolveAlias { @@ -14553,6 +14552,21 @@ func (c *Checker) resolveQualifiedName(name *ast.Node, left *ast.Node, right *as if namespace == c.unknownSymbol { return namespace } + if namespace.ValueDeclaration != nil && + ast.IsInJSFile(namespace.ValueDeclaration) && + c.compilerOptions.GetModuleResolutionKind() != core.ModuleResolutionKindBundler && + ast.IsVariableDeclaration(namespace.ValueDeclaration) && + namespace.ValueDeclaration.AsVariableDeclaration().Initializer != nil && + c.isCommonJSRequire(namespace.ValueDeclaration.AsVariableDeclaration().Initializer) { + moduleName := namespace.ValueDeclaration.AsVariableDeclaration().Initializer.AsCallExpression().Arguments.Nodes[0] + moduleSym := c.resolveExternalModuleName(moduleName, moduleName, false /*ignoreErrors*/) + if moduleSym != nil { + resolvedModuleSymbol := c.resolveExternalModuleSymbol(moduleSym, false /*dontResolveAlias*/) + if resolvedModuleSymbol != nil { + namespace = resolvedModuleSymbol + } + } + } text := right.AsIdentifier().Text symbol := c.getMergedSymbol(c.getSymbol(c.getExportsOfSymbol(namespace), text, meaning)) if symbol == nil && namespace.Flags&ast.SymbolFlagsAlias != 0 { @@ -14676,31 +14690,7 @@ func (c *Checker) getResolvedMembersOrExportsOfSymbol(symbol *ast.Symbol, resolu } } } - resolved := c.combineSymbolTables(earlySymbols, lateSymbols) - if symbol.Flags&ast.SymbolFlagsTransient != 0 && len(symbol.Declarations) != 0 { - moduleLinks := c.moduleSymbolLinks.Get(symbol) - if moduleLinks.cjsExportMerged != nil { - for _, decl := range symbol.Declarations { - original := c.membersAndExportsLinks.Get(decl.Symbol())[resolutionKind] - if resolved == nil { - resolved = original - continue - } - if original == nil { - continue - } - for name, s := range original { - existing := resolved[name] - if existing == nil { - resolved[name] = s - } else if existing != s { - resolved[name] = c.mergeSymbol(existing, s, false) - } - } - } - } - } - links[resolutionKind] = resolved + links[resolutionKind] = c.combineSymbolTables(earlySymbols, lateSymbols) } return links[resolutionKind] } @@ -14965,7 +14955,7 @@ func (c *Checker) resolveAlias(symbol *ast.Symbol) *ast.Symbol { links.aliasTarget = c.resolvingSymbol node := c.getDeclarationOfAliasSymbol(symbol) if node == nil { - panic("Unexpected nil in resolveAlias") + panic("Unexpected nil in resolveAlias for symbol: " + c.symbolToString(symbol)) } target := c.getTargetOfAliasDeclaration(node, false /*dontRecursivelyResolve*/) if links.aliasTarget == c.resolvingSymbol { @@ -15252,15 +15242,9 @@ func (c *Checker) getTypeOfVariableOrParameterOrPropertyWorker(symbol *ast.Symbo return c.anyType } if symbol.Flags&ast.SymbolFlagsModuleExports != 0 && symbol.ValueDeclaration != nil { - fileSymbol := c.getSymbolOfDeclaration(ast.GetSourceFileOfNode(symbol.ValueDeclaration).AsNode()) - result := c.newSymbol(fileSymbol.Flags, "exports") - result.Parent = symbol - result.Declarations = fileSymbol.Declarations - result.ValueDeclaration = fileSymbol.ValueDeclaration - result.Members = maps.Clone(fileSymbol.Members) - result.Exports = maps.Clone(fileSymbol.Exports) + fileSymbol := c.resolveExternalModuleSymbol(symbol.ValueDeclaration.Symbol(), false /*dontResolveAlias*/) members := make(ast.SymbolTable, 1) - members["exports"] = result + members["exports"] = fileSymbol return c.newAnonymousType(symbol, members, nil, nil, nil) } // Debug.assertIsDefined(symbol.valueDeclaration) @@ -15287,7 +15271,7 @@ func (c *Checker) getTypeOfVariableOrParameterOrPropertyWorker(symbol *ast.Symbo result = c.checkExpressionForMutableLocation(declaration.Name(), CheckModeNormal) case ast.KindMethodDeclaration: result = c.checkObjectLiteralMethod(declaration, CheckModeNormal) - case ast.KindExportAssignment: + case ast.KindExportAssignment, ast.KindJSExportAssignment: result = c.widenTypeForVariableLikeDeclaration(c.checkExpressionCached(declaration.AsExportAssignment().Expression), declaration, false /*reportErrors*/) case ast.KindBinaryExpression: result = c.getWidenedTypeForAssignmentDeclaration(symbol) @@ -15295,8 +15279,10 @@ func (c *Checker) getTypeOfVariableOrParameterOrPropertyWorker(symbol *ast.Symbo result = c.checkJsxAttribute(declaration, CheckModeNormal) case ast.KindEnumMember: result = c.getTypeOfEnumMember(symbol) + case ast.KindCommonJSExport: + result = c.checkExpression(declaration.AsCommonJSExport().Initializer) default: - panic("Unhandled case in getTypeOfVariableOrParameterOrPropertyWorker") + panic("Unhandled case in getTypeOfVariableOrParameterOrPropertyWorker: " + declaration.Kind.String()) } if !c.popTypeResolution() { return c.reportCircularityError(symbol) @@ -17041,16 +17027,13 @@ func (c *Checker) getTypeOfAlias(symbol *ast.Symbol) *Type { } targetSymbol := c.resolveAlias(symbol) exportSymbol := c.getTargetOfAliasDeclaration(c.getDeclarationOfAliasSymbol(symbol), true /*dontRecursivelyResolve*/) - declaredType := c.getExportAssignmentType(exportSymbol) // It only makes sense to get the type of a value symbol. If the result of resolving // the alias is not a value, then it has no type. To get the type associated with a // type symbol, call getDeclaredTypeOfSymbol. // This check is important because without it, a call to getTypeOfSymbol could end // up recursively calling getTypeOfAlias, causing a stack overflow. if links.resolvedType == nil { - if declaredType != nil { - links.resolvedType = declaredType - } else if c.getSymbolFlags(targetSymbol)&ast.SymbolFlagsValue != 0 { + if c.getSymbolFlags(targetSymbol)&ast.SymbolFlagsValue != 0 { links.resolvedType = c.getTypeOfSymbol(targetSymbol) } else { links.resolvedType = c.errorType @@ -17067,20 +17050,6 @@ func (c *Checker) getTypeOfAlias(symbol *ast.Symbol) *Type { return links.resolvedType } -func (c *Checker) getExportAssignmentType(symbol *ast.Symbol) *Type { - if symbol != nil { - for _, d := range symbol.Declarations { - if ast.IsExportAssignment(d) { - t := c.tryGetTypeFromTypeNode(d) - if t != nil { - return t - } - } - } - } - return nil -} - func (c *Checker) addOptionality(t *Type) *Type { return c.addOptionalityEx(t, false /*isProperty*/, true /*isOptional*/) } @@ -25452,6 +25421,21 @@ func (c *Checker) isAssignmentToReadonlyEntity(expr *ast.Node, symbol *ast.Symbo // no assignment means it doesn't matter whether the entity is readonly return false } + if ast.IsAccessExpression(expr) { + node := ast.SkipParentheses(expr.Expression()) + if ast.IsIdentifier(node) { + expressionSymbol := c.getResolvedSymbol(node) + // CommonJS module.exports is never readonly + if expressionSymbol.Flags&ast.SymbolFlagsModuleExports != 0 { + return false + } + // references through namespace import should be readonly + if expressionSymbol.Flags&ast.SymbolFlagsAlias != 0 { + declaration := c.getDeclarationOfAliasSymbol(expressionSymbol) + return declaration != nil && ast.IsNamespaceImport(declaration) + } + } + } if c.isReadonlySymbol(symbol) { // Allow assignments to readonly properties within constructors of the same class declaration. if symbol.Flags&ast.SymbolFlagsProperty != 0 && ast.IsAccessExpression(expr) && expr.Expression().Kind == ast.KindThisKeyword { @@ -25472,17 +25456,6 @@ func (c *Checker) isAssignmentToReadonlyEntity(expr *ast.Node, symbol *ast.Symbo } return true } - if ast.IsAccessExpression(expr) { - // references through namespace import should be readonly - node := ast.SkipParentheses(expr.Expression()) - if ast.IsIdentifier(node) { - symbol := c.getResolvedSymbol(node) - if symbol.Flags&ast.SymbolFlagsAlias != 0 { - declaration := c.getDeclarationOfAliasSymbol(symbol) - return declaration != nil && ast.IsNamespaceImport(declaration) - } - } - } return false } @@ -26398,7 +26371,7 @@ func isExportOrExportExpression(location *ast.Node) bool { return ast.FindAncestor(location, func(n *ast.Node) bool { parent := n.Parent if parent != nil { - if ast.IsExportAssignment(parent) { + if ast.IsAnyExportAssignment(parent) { return parent.AsExportAssignment().Expression == n && ast.IsEntityNameExpression(n) } if ast.IsExportSpecifier(parent) { @@ -27185,8 +27158,6 @@ func (c *Checker) getContextualType(node *ast.Node, contextFlags ContextFlags) * return c.getContextualType(parent, contextFlags) case ast.KindSatisfiesExpression: return c.getTypeFromTypeNode(parent.AsSatisfiesExpression().Type) - case ast.KindExportAssignment: - return c.tryGetTypeFromTypeNode(parent) case ast.KindJsxExpression: return c.getContextualTypeForJsxExpression(parent, contextFlags) case ast.KindJsxAttribute, ast.KindJsxSpreadAttribute: @@ -27597,9 +27568,9 @@ func (c *Checker) getContextualTypeForBinaryOperand(node *ast.Node, contextFlags binary := node.Parent.AsBinaryExpression() switch binary.OperatorToken.Kind { case ast.KindEqualsToken, ast.KindAmpersandAmpersandEqualsToken, ast.KindBarBarEqualsToken, ast.KindQuestionQuestionEqualsToken: - // In an assignment expression, the right operand is contextually typed by the type of the left operand. - // If the binary operator has a symbol, this is an assignment declaration and there is no contextual type. - if node == binary.Right && (binary.Symbol == nil || c.canGetContextualTypeForAssignmentDeclaration(binary.Left)) { + // In an assignment expression, the right operand is contextually typed by the type of the left operand + // unless it's an assignment declaration. + if node == binary.Right && !c.isReferenceToModuleExports(binary.Left) && (binary.Symbol == nil || c.canGetContextualTypeForAssignmentDeclaration(binary.Left)) { return c.getContextualTypeFromAssignmentTarget(binary.Left) } case ast.KindBarBarToken, ast.KindQuestionQuestionToken: @@ -27630,6 +27601,18 @@ func (c *Checker) canGetContextualTypeForAssignmentDeclaration(node *ast.Node) b return symbol.ValueDeclaration != nil && ast.IsVariableDeclaration(symbol.ValueDeclaration) && symbol.ValueDeclaration.Type() != nil } +func (c *Checker) isReferenceToModuleExports(node *ast.Node) bool { + if ast.IsAccessExpression(node) { + expr := node.Expression() + if ast.IsIdentifier(expr) { + // Node is the left operand of an assignment expression of the form 'module.exports = expr'. + symbol := c.getExportSymbolOfValueSymbolIfExported(c.getResolvedSymbol(expr)) + return symbol.Flags&ast.SymbolFlagsModuleExports != 0 + } + } + return false +} + func (c *Checker) getContextualTypeFromAssignmentTarget(node *ast.Node) *Type { if ast.IsAccessExpression(node) && node.Expression().Kind == ast.KindThisKeyword { var symbol *ast.Symbol @@ -29313,7 +29296,7 @@ func (c *Checker) GetSymbolAtLocation(node *ast.Node) *ast.Symbol { // `getSymbolOfDeclaration` for a declaration, etc. func (c *Checker) getSymbolAtLocation(node *ast.Node, ignoreErrors bool) *ast.Symbol { if ast.IsSourceFile(node) { - if ast.IsExternalModule(node.AsSourceFile()) { + if ast.IsExternalOrCommonJSModule(node.AsSourceFile()) { return c.getMergedSymbol(node.Symbol()) } return nil @@ -29399,9 +29382,11 @@ func (c *Checker) getSymbolAtLocation(node *ast.Node, ignoreErrors bool) *ast.Sy case ast.KindStringLiteral, ast.KindNoSubstitutionTemplateLiteral: // 1). import x = require("./mo/*gotToDefinitionHere*/d") // 2). External module name in an import declaration + // 3). Require in Javascript // 4). type A = import("./f/*gotToDefinitionHere*/oo") if (ast.IsExternalModuleImportEqualsDeclaration(grandParent) && getExternalModuleImportEqualsDeclarationExpression(grandParent) == node) || ((parent.Kind == ast.KindImportDeclaration || parent.Kind == ast.KindExportDeclaration) && parent.AsImportDeclaration().ModuleSpecifier == node) || + ast.IsVariableDeclarationInitializedToRequire(grandParent) || (ast.IsLiteralTypeNode(parent) && ast.IsLiteralImportTypeNode(grandParent) && grandParent.AsImportTypeNode().Argument == parent) { return c.resolveExternalModuleName(node, node, ignoreErrors) } @@ -29606,7 +29591,7 @@ func (c *Checker) isThisPropertyAndThisTyped(node *ast.Node) bool { } func (c *Checker) getTypeOfNode(node *ast.Node) *Type { - if ast.IsSourceFile(node) && !ast.IsExternalModule(node.AsSourceFile()) { + if ast.IsSourceFile(node) && !ast.IsExternalOrCommonJSModule(node.AsSourceFile()) { return c.errorType } diff --git a/internal/checker/emitresolver.go b/internal/checker/emitresolver.go index 1b2bca67c0..978cf716d3 100644 --- a/internal/checker/emitresolver.go +++ b/internal/checker/emitresolver.go @@ -79,7 +79,7 @@ func (r *emitResolver) isValueAliasDeclarationWorker(node *ast.Node) bool { } return exportClause != nil && (ast.IsNamespaceExport(exportClause) || core.Some(exportClause.AsNamedExports().Elements.Nodes, r.isValueAliasDeclaration)) - case ast.KindExportAssignment: + case ast.KindExportAssignment, ast.KindJSExportAssignment: if node.AsExportAssignment().Expression != nil && node.AsExportAssignment().Expression.Kind == ast.KindIdentifier { return r.isAliasResolvedToValue(c.getSymbolOfDeclaration(node), true /*excludeTypeOnlyValues*/) } @@ -121,8 +121,8 @@ func (r *emitResolver) IsTopLevelValueImportEqualsWithEntityName(node *ast.Node) if !ast.IsParseTreeNode(node) || node.Kind != ast.KindImportEqualsDeclaration || node.Parent.Kind != ast.KindSourceFile { return false } - n := node.AsImportEqualsDeclaration() - if ast.NodeIsMissing(n.ModuleReference) || n.ModuleReference.Kind != ast.KindExternalModuleReference { + if ast.IsImportEqualsDeclaration(node) && + (ast.NodeIsMissing(node.AsImportEqualsDeclaration().ModuleReference) || node.AsImportEqualsDeclaration().ModuleReference.Kind != ast.KindExternalModuleReference) { return false } @@ -142,6 +142,9 @@ func (r *emitResolver) MarkLinkedReferencesRecursively(file *ast.SourceFile) { if ast.IsImportEqualsDeclaration(n) && n.ModifierFlags()&ast.ModifierFlagsExport == 0 { return false // These are deferred and marked in a chain when referenced } + if ast.IsJSExportAssignment(n) { + return false + } if ast.IsImportDeclaration(n) { return false // likewise, these are ultimately what get marked by calls on other nodes - we want to skip them } diff --git a/internal/checker/grammarchecks.go b/internal/checker/grammarchecks.go index 12abaf7410..6e61fdaaf8 100644 --- a/internal/checker/grammarchecks.go +++ b/internal/checker/grammarchecks.go @@ -601,6 +601,7 @@ func (c *Checker) findFirstIllegalModifier(node *ast.Node) *ast.Node { ast.KindImportEqualsDeclaration, ast.KindExportDeclaration, ast.KindExportAssignment, + ast.KindJSExportAssignment, ast.KindFunctionExpression, ast.KindArrowFunction, ast.KindParameter, @@ -2020,7 +2021,7 @@ func (c *Checker) checkGrammarTopLevelElementForRequiredDeclareModifier(node *as // export_opt AmbientDeclaration // // TODO: The spec needs to be amended to reflect this grammar. - if node.Kind == ast.KindInterfaceDeclaration || node.Kind == ast.KindTypeAliasDeclaration || node.Kind == ast.KindImportDeclaration || node.Kind == ast.KindImportEqualsDeclaration || node.Kind == ast.KindExportDeclaration || node.Kind == ast.KindExportAssignment || node.Kind == ast.KindNamespaceExportDeclaration || ast.HasSyntacticModifier(node, ast.ModifierFlagsAmbient|ast.ModifierFlagsExport|ast.ModifierFlagsDefault) { + if node.Kind == ast.KindInterfaceDeclaration || node.Kind == ast.KindTypeAliasDeclaration || node.Kind == ast.KindImportDeclaration || node.Kind == ast.KindImportEqualsDeclaration || node.Kind == ast.KindExportDeclaration || node.Kind == ast.KindExportAssignment || node.Kind == ast.KindJSExportAssignment || node.Kind == ast.KindNamespaceExportDeclaration || ast.HasSyntacticModifier(node, ast.ModifierFlagsAmbient|ast.ModifierFlagsExport|ast.ModifierFlagsDefault) { return false } diff --git a/internal/checker/types.go b/internal/checker/types.go index 9da2867153..767abf2438 100644 --- a/internal/checker/types.go +++ b/internal/checker/types.go @@ -126,7 +126,6 @@ type AliasSymbolLinks struct { type ModuleSymbolLinks struct { resolvedExports ast.SymbolTable // Resolved exports of module or combined early- and late-bound static members of a class. - cjsExportMerged *ast.Symbol // Version of the symbol with all non export= exports merged with the export= target typeOnlyExportStarMap map[string]*ast.Node // Set on a module symbol when some of its exports were resolved through a 'export type * from "mod"' declaration exportsChecked bool } diff --git a/internal/checker/utilities.go b/internal/checker/utilities.go index 178e3e52ab..4c22427383 100644 --- a/internal/checker/utilities.go +++ b/internal/checker/utilities.go @@ -96,40 +96,6 @@ func hasReadonlyModifier(node *ast.Node) bool { return hasModifier(node, ast.ModifierFlagsReadonly) } -func isBindingElementOfBareOrAccessedRequire(node *ast.Node) bool { - return ast.IsBindingElement(node) && isVariableDeclarationInitializedToBareOrAccessedRequire(node.Parent.Parent) -} - -/** - * Like {@link isVariableDeclarationInitializedToRequire} but allows things like `require("...").foo.bar` or `require("...")["baz"]`. - */ -func isVariableDeclarationInitializedToBareOrAccessedRequire(node *ast.Node) bool { - return isVariableDeclarationInitializedWithRequireHelper(node, true /*allowAccessedRequire*/) -} - -func isVariableDeclarationInitializedWithRequireHelper(node *ast.Node, allowAccessedRequire bool) bool { - if node.Kind == ast.KindVariableDeclaration && node.AsVariableDeclaration().Initializer != nil { - initializer := node.AsVariableDeclaration().Initializer - if allowAccessedRequire { - initializer = ast.GetLeftmostAccessExpression(initializer) - } - return isRequireCall(initializer, true /*requireStringLiteralLikeArgument*/) - } - return false -} - -func isRequireCall(node *ast.Node, requireStringLiteralLikeArgument bool) bool { - if ast.IsCallExpression(node) { - callExpression := node.AsCallExpression() - if len(callExpression.Arguments.Nodes) == 1 { - if ast.IsIdentifier(callExpression.Expression) && callExpression.Expression.AsIdentifier().Text == "require" { - return !requireStringLiteralLikeArgument || ast.IsStringLiteralLike(callExpression.Arguments.Nodes[0]) - } - } - } - return false -} - func isStaticPrivateIdentifierProperty(s *ast.Symbol) bool { return s.ValueDeclaration != nil && ast.IsPrivateIdentifierClassElementDeclaration(s.ValueDeclaration) && ast.IsStatic(s.ValueDeclaration) } @@ -342,7 +308,7 @@ func canHaveSymbol(node *ast.Node) bool { switch node.Kind { case ast.KindArrowFunction, ast.KindBinaryExpression, ast.KindBindingElement, ast.KindCallExpression, ast.KindCallSignature, ast.KindClassDeclaration, ast.KindClassExpression, ast.KindClassStaticBlockDeclaration, ast.KindConstructor, ast.KindConstructorType, - ast.KindConstructSignature, ast.KindElementAccessExpression, ast.KindEnumDeclaration, ast.KindEnumMember, ast.KindExportAssignment, + ast.KindConstructSignature, ast.KindElementAccessExpression, ast.KindEnumDeclaration, ast.KindEnumMember, ast.KindExportAssignment, ast.KindJSExportAssignment, ast.KindExportDeclaration, ast.KindExportSpecifier, ast.KindFunctionDeclaration, ast.KindFunctionExpression, ast.KindFunctionType, ast.KindGetAccessor, ast.KindIdentifier, ast.KindImportClause, ast.KindImportEqualsDeclaration, ast.KindImportSpecifier, ast.KindIndexSignature, ast.KindInterfaceDeclaration, ast.KindJSDocSignature, ast.KindJSDocTypeLiteral, @@ -382,7 +348,7 @@ func isShorthandAmbientModule(node *ast.Node) bool { func getAliasDeclarationFromName(node *ast.Node) *ast.Node { switch node.Parent.Kind { - case ast.KindImportClause, ast.KindImportSpecifier, ast.KindNamespaceImport, ast.KindExportSpecifier, ast.KindExportAssignment, + case ast.KindImportClause, ast.KindImportSpecifier, ast.KindNamespaceImport, ast.KindExportSpecifier, ast.KindExportAssignment, ast.KindJSExportAssignment, ast.KindImportEqualsDeclaration, ast.KindNamespaceExport: return node.Parent case ast.KindQualifiedName: @@ -423,8 +389,8 @@ func isSideEffectImport(node *ast.Node) bool { } func getExternalModuleRequireArgument(node *ast.Node) *ast.Node { - if isVariableDeclarationInitializedToBareOrAccessedRequire(node) { - return ast.GetLeftmostAccessExpression(node.AsVariableDeclaration().Initializer).AsCallExpression().Arguments.Nodes[0] + if ast.IsVariableDeclarationInitializedToRequire(node) { + return node.AsVariableDeclaration().Initializer.AsCallExpression().Arguments.Nodes[0] } return nil } @@ -1523,30 +1489,13 @@ func getFunctionFlags(node *ast.Node) FunctionFlags { return flags } -func getLeftSideOfImportEqualsOrExportAssignment(nodeOnRightSide *ast.EntityName) *ast.Node { - for nodeOnRightSide.Parent.Kind == ast.KindQualifiedName { - nodeOnRightSide = nodeOnRightSide.Parent - } - - if nodeOnRightSide.Parent.Kind == ast.KindImportEqualsDeclaration { - if nodeOnRightSide.Parent.AsImportEqualsDeclaration().ModuleReference == nodeOnRightSide { - return nodeOnRightSide.Parent - } - return nil - } - - if nodeOnRightSide.Parent.Kind == ast.KindExportAssignment { - if nodeOnRightSide.Parent.AsExportAssignment().Expression == nodeOnRightSide { - return nodeOnRightSide.Parent - } - return nil +func isInRightSideOfImportOrExportAssignment(node *ast.EntityName) bool { + for node.Parent.Kind == ast.KindQualifiedName { + node = node.Parent } - return nil -} - -func isInRightSideOfImportOrExportAssignment(node *ast.EntityName) bool { - return getLeftSideOfImportEqualsOrExportAssignment(node) != nil + return node.Parent.Kind == ast.KindImportEqualsDeclaration && node.Parent.AsImportEqualsDeclaration().ModuleReference == node || + (node.Parent.Kind == ast.KindExportAssignment || node.Parent.Kind == ast.KindJSExportAssignment) && node.Parent.AsExportAssignment().Expression == node } func isJsxIntrinsicTagName(tagName *ast.Node) bool { @@ -1586,12 +1535,6 @@ func isInNameOfExpressionWithTypeArguments(node *ast.Node) bool { return node.Parent.Kind == ast.KindExpressionWithTypeArguments } -func getTypeParameterFromJSDoc(node *ast.Node) *ast.Node { - name := node.Name().Text() - typeParameters := node.Parent.Parent.Parent.TypeParameters() - return core.Find(typeParameters, func(p *ast.Node) bool { return p.Name().Text() == name }) -} - func isTypeDeclarationName(name *ast.Node) bool { return name.Kind == ast.KindIdentifier && isTypeDeclaration(name.Parent) && diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go index deb948012f..f4fc8c1ecf 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -382,6 +382,8 @@ func (p *fileLoader) resolveImportsAndModuleAugmentations(file *ast.SourceFile) hasAllowedExtension := false if p.compilerOptions.ResolveJsonModule.IsTrue() { hasAllowedExtension = tspath.FileExtensionIsOneOf(resolvedFileName, tspath.SupportedTSExtensionsWithJsonFlat) + } else if p.compilerOptions.AllowJs.IsTrue() { + hasAllowedExtension = tspath.FileExtensionIsOneOf(resolvedFileName, tspath.SupportedJSExtensionsFlat) || tspath.FileExtensionIsOneOf(resolvedFileName, tspath.SupportedTSExtensionsFlat) } else { hasAllowedExtension = tspath.FileExtensionIsOneOf(resolvedFileName, tspath.SupportedTSExtensionsFlat) } diff --git a/internal/ls/utilities.go b/internal/ls/utilities.go index 460fbbd1b0..6c642513a3 100644 --- a/internal/ls/utilities.go +++ b/internal/ls/utilities.go @@ -25,7 +25,7 @@ func tryGetImportFromModuleSpecifier(node *ast.StringLiteralLike) *ast.Node { case ast.KindExternalModuleReference: return node.Parent.Parent case ast.KindCallExpression: - if ast.IsImportCall(node.Parent) || ast.IsRequireCall(node.Parent, false /*requireStringLiteralLikeArgument*/) { + if ast.IsImportCall(node.Parent) || ast.IsRequireCall(node.Parent) { return node.Parent } return nil diff --git a/internal/parser/parser.go b/internal/parser/parser.go index 79ba593620..97717c832a 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -76,6 +76,7 @@ type Parser struct { jsdocCommentRangesSpace []ast.CommentRange jsdocTagCommentsSpace []string reparseList []*ast.Node + commonJSModuleIndicator *ast.Node } var viableKeywordSuggestions = scanner.GetViableKeywordSuggestions() @@ -346,6 +347,7 @@ func (p *Parser) finishSourceFile(result *ast.SourceFile, isDeclarationFile bool p.processPragmasIntoFields(result) result.SetDiagnostics(attachFileToDiagnostics(p.diagnostics, result)) result.ExternalModuleIndicator = isFileProbablyExternalModule(result) // !!! + result.CommonJSModuleIndicator = p.commonJSModuleIndicator result.IsDeclarationFile = isDeclarationFile result.LanguageVersion = p.languageVersion result.LanguageVariant = p.languageVariant @@ -1400,6 +1402,7 @@ func (p *Parser) parseExpressionOrLabeledStatement() *ast.Statement { result := p.factory.NewExpressionStatement(expression) p.finishNode(result, pos) p.withJSDoc(result, hasJSDoc && !hasParen) + p.reparseCommonJS(result) return result } diff --git a/internal/parser/reparser.go b/internal/parser/reparser.go new file mode 100644 index 0000000000..67f8a29185 --- /dev/null +++ b/internal/parser/reparser.go @@ -0,0 +1,68 @@ +package parser + +import ( + "github.com/microsoft/typescript-go/internal/ast" + "github.com/microsoft/typescript-go/internal/core" +) + +type jsDeclarationKind int + +const ( + jsDeclarationKindNone jsDeclarationKind = iota + /// module.exports = expr + jsDeclarationKindModuleExports + /// exports.name = expr + /// module.exports.name = expr + jsDeclarationKindExportsProperty + /// className.prototype.name = expr + jsDeclarationKindPrototypeProperty + /// this.name = expr + jsDeclarationKindThisProperty + // F.name = expr + jsDeclarationKindProperty +) + +func (p *Parser) reparseCommonJS(node *ast.Node) { + if p.scriptKind != core.ScriptKindJS && p.scriptKind != core.ScriptKindJSX { + return + } + if node.Kind != ast.KindExpressionStatement || node.AsExpressionStatement().Expression.Kind != ast.KindBinaryExpression { + return + } + bin := node.AsExpressionStatement().Expression.AsBinaryExpression() + kind := getAssignmentDeclarationKind(bin) + var export *ast.Node + switch kind { + case jsDeclarationKindModuleExports: + export = p.factory.NewJSExportAssignment(bin.Right) + case jsDeclarationKindExportsProperty: + nodes := p.nodeSlicePool.NewSlice(1) + nodes[0] = p.factory.NewModifier(ast.KindExportKeyword) + nodes[0].Flags = ast.NodeFlagsReparsed + nodes[0].Loc = bin.Loc + // TODO: Name can sometimes be a string literal, so downstream code needs to handle this + export = p.factory.NewCommonJSExport(p.newModifierList(bin.Loc, nodes), ast.GetElementOrPropertyAccessArgumentExpressionOrName(bin.Left), bin.Right) + } + if export != nil { + export.Flags = ast.NodeFlagsReparsed + export.Loc = bin.Loc + p.reparseList = append(p.reparseList, export) + p.commonJSModuleIndicator = export + } +} + +func getAssignmentDeclarationKind(bin *ast.BinaryExpression) jsDeclarationKind { + if bin.OperatorToken.Kind != ast.KindEqualsToken || !ast.IsAccessExpression(bin.Left) { + return jsDeclarationKindNone + } + if ast.IsModuleExportsAccessExpression(bin.Left) { + return jsDeclarationKindModuleExports + } else if ast.IsAccessExpression(bin.Left) && + (ast.IsModuleExportsAccessExpression(bin.Left.Expression()) || ast.IsExportsIdentifier(bin.Left.Expression())) && + + (ast.IsIdentifier(ast.GetElementOrPropertyAccessArgumentExpressionOrName(bin.Left)) || ast.IsStringLiteralLike(ast.GetElementOrPropertyAccessArgumentExpressionOrName(bin.Left))) { + return jsDeclarationKindExportsProperty + } + // !!! module.exports property, this.property, expando.property + return jsDeclarationKindNone +} diff --git a/internal/printer/printer.go b/internal/printer/printer.go index 4a5413a8eb..a88f2af874 100644 --- a/internal/printer/printer.go +++ b/internal/printer/printer.go @@ -3740,6 +3740,24 @@ func (p *Printer) emitExportAssignment(node *ast.ExportAssignment) { p.exitNode(node.AsNode(), state) } +// export declare var = ; +func (p *Printer) emitCommonJSExport(node *ast.CommonJSExport) { + state := p.enterNode(node.AsNode()) + p.emitToken(ast.KindExportKeyword, node.Pos(), WriteKindKeyword, node.AsNode()) + p.writeSpace() + p.writeKeyword("var") + p.writeSpace() + if node.Name().Kind == ast.KindStringLiteral { + // TODO: This doesn't work for illegal names. + p.write(node.Name().AsStringLiteral().Text) + } else { + p.emitBindingName(node.Name()) + } + p.emitInitializer(node.Initializer, node.Name().End(), node.AsNode()) + p.writeTrailingSemicolon() + p.exitNode(node.AsNode(), state) +} + func (p *Printer) emitExportDeclaration(node *ast.ExportDeclaration) { state := p.enterNode(node.AsNode()) p.emitModifierList(node.AsNode(), node.Modifiers(), false /*allowDecorators*/) @@ -3937,10 +3955,12 @@ func (p *Printer) emitStatement(node *ast.Statement) { p.emitImportEqualsDeclaration(node.AsImportEqualsDeclaration()) case ast.KindImportDeclaration: p.emitImportDeclaration(node.AsImportDeclaration()) - case ast.KindExportAssignment: + case ast.KindExportAssignment, ast.KindJSExportAssignment: p.emitExportAssignment(node.AsExportAssignment()) case ast.KindExportDeclaration: p.emitExportDeclaration(node.AsExportDeclaration()) + case ast.KindCommonJSExport: + p.emitCommonJSExport(node.AsCommonJSExport()) default: panic(fmt.Sprintf("unhandled statement: %v", node.Kind)) diff --git a/internal/transformers/commonjsmodule.go b/internal/transformers/commonjsmodule.go index b4d4e220fd..a97dda2785 100644 --- a/internal/transformers/commonjsmodule.go +++ b/internal/transformers/commonjsmodule.go @@ -69,6 +69,8 @@ func (tx *CommonJSModuleTransformer) visitTopLevel(node *ast.Node) *ast.Node { node = tx.visitTopLevelExportDeclaration(node.AsExportDeclaration()) case ast.KindExportAssignment: node = tx.visitTopLevelExportAssignment(node.AsExportAssignment()) + case ast.KindJSExportAssignment: + node = nil case ast.KindFunctionDeclaration: node = tx.visitTopLevelFunctionDeclaration(node.AsFunctionDeclaration()) case ast.KindClassDeclaration: @@ -1632,7 +1634,7 @@ func (tx *CommonJSModuleTransformer) visitCallExpression(node *ast.CallExpressio needsRewrite := false if tx.compilerOptions.RewriteRelativeImportExtensions.IsTrue() { if ast.IsImportCall(node.AsNode()) && len(node.Arguments.Nodes) > 0 || - ast.IsInJSFile(node.AsNode()) && ast.IsRequireCall(node.AsNode(), false /*requireStringLiteralLikeArgument*/) { + ast.IsInJSFile(node.AsNode()) && ast.IsRequireCall(node.AsNode()) { needsRewrite = true } } diff --git a/internal/transformers/esmodule.go b/internal/transformers/esmodule.go index a43974d3ef..bd1ad3ccf8 100644 --- a/internal/transformers/esmodule.go +++ b/internal/transformers/esmodule.go @@ -43,6 +43,8 @@ func (tx *ESModuleTransformer) visit(node *ast.Node) *ast.Node { node = tx.visitImportEqualsDeclaration(node.AsImportEqualsDeclaration()) case ast.KindExportAssignment: node = tx.visitExportAssignment(node.AsExportAssignment()) + case ast.KindJSExportAssignment: + node = nil case ast.KindExportDeclaration: node = tx.visitExportDeclaration(node.AsExportDeclaration()) case ast.KindCallExpression: @@ -244,7 +246,7 @@ func (tx *ESModuleTransformer) visitExportDeclaration(node *ast.ExportDeclaratio func (tx *ESModuleTransformer) visitCallExpression(node *ast.CallExpression) *ast.Node { if tx.compilerOptions.RewriteRelativeImportExtensions.IsTrue() { if ast.IsImportCall(node.AsNode()) && len(node.Arguments.Nodes) > 0 || - ast.IsInJSFile(node.AsNode()) && ast.IsRequireCall(node.AsNode(), false /*requireStringLiteralLikeArgument*/) { + ast.IsInJSFile(node.AsNode()) && ast.IsRequireCall(node.AsNode()) { return tx.visitImportOrRequireCall(node) } } diff --git a/internal/transformers/externalmoduleinfo.go b/internal/transformers/externalmoduleinfo.go index 6d9f2595ee..911a2ac52a 100644 --- a/internal/transformers/externalmoduleinfo.go +++ b/internal/transformers/externalmoduleinfo.go @@ -17,7 +17,7 @@ type externalModuleInfo struct { exportedBindings core.MultiMap[*ast.Declaration, *ast.ModuleExportName] // Maps local declarations to their associated export aliases exportedNames []*ast.ModuleExportName // all exported names in the module, both local and re-exported, excluding the names of locally exported function declarations exportedFunctions collections.OrderedSet[*ast.FunctionDeclarationNode] // all of the top-level exported function declarations - exportEquals *ast.ExportAssignment // an export= declaration if one was present + exportEquals *ast.ExportAssignment // an export=/module.exports= declaration if one was present hasExportStarsToExportValues bool // whether this module contains export* } @@ -106,6 +106,11 @@ func (c *externalModuleInfoCollector) collect() *externalModuleInfo { // export = x c.output.exportEquals = n } + case ast.KindJSExportAssignment: + if c.output.exportEquals == nil { + // module.exports = x + c.output.exportEquals = node.AsExportAssignment() + } case ast.KindVariableStatement: n := node.AsVariableStatement() diff --git a/internal/transformers/importelision.go b/internal/transformers/importelision.go index 2ce400bdd3..f7f91ca135 100644 --- a/internal/transformers/importelision.go +++ b/internal/transformers/importelision.go @@ -71,7 +71,7 @@ func (tx *ImportElisionTransformer) visit(node *ast.Node) *ast.Node { return nil } return node - case ast.KindExportAssignment: + case ast.KindExportAssignment, ast.KindJSExportAssignment: if !tx.isElisionBlocked(node) && !tx.compilerOptions.VerbatimModuleSyntax.IsTrue() && !tx.isValueAliasDeclaration(node) { // elide unused import return nil diff --git a/internal/transformers/typeeraser.go b/internal/transformers/typeeraser.go index aa5cfcf117..c2eaa6d748 100644 --- a/internal/transformers/typeeraser.go +++ b/internal/transformers/typeeraser.go @@ -95,6 +95,9 @@ func (tx *TypeEraserTransformer) visit(node *ast.Node) *ast.Node { ast.KindIndexSignature: return nil + case ast.KindJSExportAssignment: + // reparsed commonjs are elided + return nil case ast.KindTypeAliasDeclaration, ast.KindJSTypeAliasDeclaration, ast.KindInterfaceDeclaration: diff --git a/internal/transformers/utilities.go b/internal/transformers/utilities.go index a7beeb6853..fd1ff7f2fd 100644 --- a/internal/transformers/utilities.go +++ b/internal/transformers/utilities.go @@ -75,6 +75,7 @@ func isIdentifierReference(name *ast.IdentifierNode, parent *ast.Node) bool { ast.KindThrowStatement, ast.KindExpressionStatement, ast.KindExportAssignment, + ast.KindJSExportAssignment, ast.KindPropertyAccessExpression, ast.KindTemplateSpan: // only an `Expression()` child that can be `Identifier` would be an instance of `IdentifierReference` diff --git a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).symbols b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).symbols index 2e6e242888..68df41a245 100644 --- a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).symbols +++ b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).symbols @@ -6,10 +6,13 @@ const fs = require("fs"); >fs : Symbol(fs, Decl(app.js, 2, 5)) >require : Symbol(require, Decl(node.d.ts, 0, 0)) +>"fs" : Symbol("fs", Decl(node.d.ts, 0, 50)) const text = fs.readFileSync("/a/b/c"); >text : Symbol(text, Decl(app.js, 3, 5)) +>fs.readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21)) >fs : Symbol(fs, Decl(app.js, 2, 5)) +>readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21)) === node.d.ts === declare function require(moduleName: string): any; diff --git a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).symbols.diff b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).symbols.diff index c0e2b66221..94d636d69a 100644 --- a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).symbols.diff @@ -5,12 +5,15 @@ >fs : Symbol(fs, Decl(app.js, 2, 5)) >require : Symbol(require, Decl(node.d.ts, 0, 0)) ->"fs" : Symbol(fs, Decl(node.d.ts, 0, 50)) ++>"fs" : Symbol("fs", Decl(node.d.ts, 0, 50)) const text = fs.readFileSync("/a/b/c"); >text : Symbol(text, Decl(app.js, 3, 5)) ->fs.readFileSync : Symbol(fs.readFileSync, Decl(node.d.ts, 2, 21)) ++>fs.readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21)) >fs : Symbol(fs, Decl(app.js, 2, 5)) ->readFileSync : Symbol(fs.readFileSync, Decl(node.d.ts, 2, 21)) ++>readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21)) === node.d.ts === declare function require(moduleName: string): any; diff --git a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).types b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).types index 8330bea9ef..11957d1673 100644 --- a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).types +++ b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=commonjs).types @@ -4,17 +4,17 @@ /// const fs = require("fs"); ->fs : any ->require("fs") : any +>fs : typeof import("fs") +>require("fs") : typeof import("fs") >require : (moduleName: string) => any >"fs" : "fs" const text = fs.readFileSync("/a/b/c"); ->text : any ->fs.readFileSync("/a/b/c") : any ->fs.readFileSync : any ->fs : any ->readFileSync : any +>text : string +>fs.readFileSync("/a/b/c") : string +>fs.readFileSync : (s: string) => string +>fs : typeof import("fs") +>readFileSync : (s: string) => string >"/a/b/c" : "/a/b/c" === node.d.ts === diff --git a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).symbols b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).symbols index 2e6e242888..68df41a245 100644 --- a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).symbols +++ b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).symbols @@ -6,10 +6,13 @@ const fs = require("fs"); >fs : Symbol(fs, Decl(app.js, 2, 5)) >require : Symbol(require, Decl(node.d.ts, 0, 0)) +>"fs" : Symbol("fs", Decl(node.d.ts, 0, 50)) const text = fs.readFileSync("/a/b/c"); >text : Symbol(text, Decl(app.js, 3, 5)) +>fs.readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21)) >fs : Symbol(fs, Decl(app.js, 2, 5)) +>readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21)) === node.d.ts === declare function require(moduleName: string): any; diff --git a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).symbols.diff b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).symbols.diff index 18716d57a5..09aa780be7 100644 --- a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).symbols.diff @@ -5,12 +5,15 @@ >fs : Symbol(fs, Decl(app.js, 2, 5)) >require : Symbol(require, Decl(node.d.ts, 0, 0)) ->"fs" : Symbol(fs, Decl(node.d.ts, 0, 50)) ++>"fs" : Symbol("fs", Decl(node.d.ts, 0, 50)) const text = fs.readFileSync("/a/b/c"); >text : Symbol(text, Decl(app.js, 3, 5)) ->fs.readFileSync : Symbol(fs.readFileSync, Decl(node.d.ts, 2, 21)) ++>fs.readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21)) >fs : Symbol(fs, Decl(app.js, 2, 5)) ->readFileSync : Symbol(fs.readFileSync, Decl(node.d.ts, 2, 21)) ++>readFileSync : Symbol(readFileSync, Decl(node.d.ts, 2, 21)) === node.d.ts === declare function require(moduleName: string): any; diff --git a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).types b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).types index 8330bea9ef..11957d1673 100644 --- a/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).types +++ b/testdata/baselines/reference/submodule/compiler/ambientRequireFunction(module=preserve).types @@ -4,17 +4,17 @@ /// const fs = require("fs"); ->fs : any ->require("fs") : any +>fs : typeof import("fs") +>require("fs") : typeof import("fs") >require : (moduleName: string) => any >"fs" : "fs" const text = fs.readFileSync("/a/b/c"); ->text : any ->fs.readFileSync("/a/b/c") : any ->fs.readFileSync : any ->fs : any ->readFileSync : any +>text : string +>fs.readFileSync("/a/b/c") : string +>fs.readFileSync : (s: string) => string +>fs : typeof import("fs") +>readFileSync : (s: string) => string >"/a/b/c" : "/a/b/c" === node.d.ts === diff --git a/testdata/baselines/reference/submodule/compiler/amdLikeInputDeclarationEmit.errors.txt b/testdata/baselines/reference/submodule/compiler/amdLikeInputDeclarationEmit.errors.txt index 2519b84308..1fafa07a86 100644 --- a/testdata/baselines/reference/submodule/compiler/amdLikeInputDeclarationEmit.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/amdLikeInputDeclarationEmit.errors.txt @@ -1,3 +1,4 @@ +ExtendedClass.js(17,5): error TS1231: An export assignment must be at the top level of a file or module declaration. ExtendedClass.js(17,12): error TS2339: Property 'exports' does not exist on type '{}'. ExtendedClass.js(18,19): error TS2339: Property 'exports' does not exist on type '{}'. @@ -11,7 +12,7 @@ ExtendedClass.js(18,19): error TS2339: Property 'exports' does not exist on type } export = BaseClass; } -==== ExtendedClass.js (2 errors) ==== +==== ExtendedClass.js (3 errors) ==== define("lib/ExtendedClass", ["deps/BaseClass"], /** * {typeof import("deps/BaseClass")} @@ -29,6 +30,8 @@ ExtendedClass.js(18,19): error TS2339: Property 'exports' does not exist on type // Exports the module in a way tsc recognize class export const module = {}; module.exports = ExtendedClass + ~~~~~~ +!!! error TS1231: An export assignment must be at the top level of a file or module declaration. ~~~~~~~ !!! error TS2339: Property 'exports' does not exist on type '{}'. return module.exports; diff --git a/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.errors.txt b/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.errors.txt new file mode 100644 index 0000000000..855d7577c6 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.errors.txt @@ -0,0 +1,21 @@ +something.js(5,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + +==== file.ts (0 errors) ==== + class Foo { + x: number; + } + + declare global { + var module: any; // Just here to remove unrelated error from test + } + + export = Foo; +==== something.js (1 errors) ==== + /** @typedef {typeof import("./file")} Foo */ + + /** @typedef {(foo: Foo) => string} FooFun */ + + module.exports = /** @type {FooFun} */(void 0); + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.symbols b/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.symbols index 5eb7764d5b..ad967d1a88 100644 --- a/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.symbols +++ b/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.symbols @@ -24,5 +24,7 @@ export = Foo; /** @typedef {(foo: Foo) => string} FooFun */ module.exports = /** @type {FooFun} */(void 0); ->module : Symbol(module, Decl(file.ts, 5, 7)) +>module.exports : Symbol(export=, Decl(something.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(something.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.symbols.diff b/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.symbols.diff index f3ed430fc8..13fa301e1a 100644 --- a/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.symbols.diff @@ -15,6 +15,7 @@ module.exports = /** @type {FooFun} */(void 0); ->module.exports : Symbol(module.exports, Decl(something.js, 0, 0)) ->module : Symbol(export=, Decl(something.js, 0, 0)) -->exports : Symbol(export=, Decl(something.js, 0, 0)) -+>module : Symbol(module, Decl(file.ts, 5, 7)) ++>module.exports : Symbol(export=, Decl(something.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(something.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.types b/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.types index 2ebc2e80a2..72cdd5b336 100644 --- a/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.types +++ b/testdata/baselines/reference/submodule/compiler/checkJsTypeDefNoUnusedLocalMarked.types @@ -25,9 +25,9 @@ export = Foo; module.exports = /** @type {FooFun} */(void 0); >module.exports = /** @type {FooFun} */(void 0) : (foo: typeof Foo) => string ->module.exports : any ->module : any ->exports : any +>module.exports : (foo: typeof Foo) => string +>module : { export=: (foo: typeof Foo) => string; } +>exports : (foo: typeof Foo) => string >(void 0) : (foo: typeof Foo) => string >void 0 : (foo: typeof Foo) => string >void 0 : undefined diff --git a/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.errors.txt b/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.errors.txt index 411fbb3d0f..36f03e5cb5 100644 --- a/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.errors.txt @@ -1,37 +1,28 @@ -test.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -types1.ts(1,18): error TS2306: File 'test.js' is not a module. types1.ts(3,1): error TS1005: '=' expected. -types2.ts(1,18): error TS2306: File 'test.js' is not a module. types2.ts(3,1): error TS1110: Type expected. -types3.ts(1,18): error TS2306: File 'test.js' is not a module. +types3.ts(2,13): error TS2456: Type alias 'test' circularly references itself. -==== test.js (1 errors) ==== +==== test.js (0 errors) ==== module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. message: "" } -==== types1.ts (2 errors) ==== +==== types1.ts (1 errors) ==== import test from "./test"; - ~~~~~~~~ -!!! error TS2306: File 'test.js' is not a module. export type test !!! error TS1005: '=' expected. -==== types2.ts (2 errors) ==== +==== types2.ts (1 errors) ==== import test from "./test"; - ~~~~~~~~ -!!! error TS2306: File 'test.js' is not a module. export type test = !!! error TS1110: Type expected. ==== types3.ts (1 errors) ==== import test from "./test"; - ~~~~~~~~ -!!! error TS2306: File 'test.js' is not a module. export type test = test; + ~~~~ +!!! error TS2456: Type alias 'test' circularly references itself. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.symbols b/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.symbols index 9aeb65934d..1af9d4e786 100644 --- a/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.symbols +++ b/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.symbols @@ -2,6 +2,10 @@ === test.js === module.exports = { +>module.exports : Symbol(export=, Decl(test.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(test.js, 0, 0)) + message: "" >message : Symbol(message, Decl(test.js, 0, 18)) } @@ -30,5 +34,5 @@ import test from "./test"; export type test = test; >test : Symbol(test, Decl(types3.ts, 0, 26)) ->test : Symbol(test, Decl(types3.ts, 0, 6), Decl(types3.ts, 0, 26)) +>test : Symbol(test, Decl(types3.ts, 0, 26)) diff --git a/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.symbols.diff b/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.symbols.diff index e233477e02..7fd61a3cb7 100644 --- a/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.symbols.diff @@ -8,8 +8,10 @@ module.exports = { ->module.exports : Symbol(module.exports, Decl(test.js, 0, 0)) ->module : Symbol(export=, Decl(test.js, 0, 0)) -->exports : Symbol(export=, Decl(test.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(test.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(test.js, 0, 0)) + message: "" >message : Symbol(message, Decl(test.js, 0, 18)) } @@ -19,7 +21,7 @@ import test from "./test"; >test : Symbol(test, Decl(types1.ts, 0, 6), Decl(types1.ts, 0, 26)) -@@= skipped -18, +14 lines =@@ +@@= skipped -18, +18 lines =@@ > : Symbol(unknown) @@ -37,8 +39,3 @@ import test from "./test"; >test : Symbol(test, Decl(types3.ts, 0, 6), Decl(types3.ts, 0, 26)) - export type test = test; - >test : Symbol(test, Decl(types3.ts, 0, 26)) -->test : Symbol(test, Decl(types3.ts, 0, 26)) -+>test : Symbol(test, Decl(types3.ts, 0, 6), Decl(types3.ts, 0, 26)) - diff --git a/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.types b/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.types index 6d85aab46d..d0b35d99f2 100644 --- a/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.types +++ b/testdata/baselines/reference/submodule/compiler/commonJsExportTypeDeclarationError.types @@ -3,9 +3,9 @@ === test.js === module.exports = { >module.exports = { message: ""} : { message: string; } ->module.exports : any ->module : any ->exports : any +>module.exports : { message: string; } +>module : { export=: { message: string; }; } +>exports : { message: string; } >{ message: ""} : { message: string; } message: "" @@ -15,22 +15,22 @@ module.exports = { === types1.ts === import test from "./test"; ->test : any +>test : { message: string; } export type test >test : any === types2.ts === import test from "./test"; ->test : any +>test : { message: string; } export type test = >test : any === types3.ts === import test from "./test"; ->test : any +>test : { message: string; } export type test = test; ->test : test +>test : any diff --git a/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.errors.txt b/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.errors.txt deleted file mode 100644 index b501776c69..0000000000 --- a/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.errors.txt +++ /dev/null @@ -1,18 +0,0 @@ -index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== tsconfig.json (0 errors) ==== - { - "compilerOptions": { - "allowJs": true, - "outDir": "foo", - "isolatedModules": true, - } - } - -==== index.js (1 errors) ==== - module.exports = {} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - var x = 1 - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.symbols b/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.symbols index b1c8db5448..dc49742761 100644 --- a/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.symbols +++ b/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.symbols @@ -2,6 +2,10 @@ === index.js === module.exports = {} +>module.exports : Symbol(export=, Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 0, 0)) + var x = 1 >x : Symbol(x, Decl(index.js, 1, 3)) diff --git a/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.symbols.diff b/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.symbols.diff index 8e30d82a48..ae59d3374c 100644 --- a/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.symbols.diff @@ -7,7 +7,9 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(index.js, 0, 0)) + var x = 1 >x : Symbol(x, Decl(index.js, 1, 3)) - diff --git a/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.types b/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.types index 102a5aa9ca..54da337b4e 100644 --- a/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.types +++ b/testdata/baselines/reference/submodule/compiler/commonJsIsolatedModules.types @@ -3,9 +3,9 @@ === index.js === module.exports = {} >module.exports = {} : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >{} : {} var x = 1 diff --git a/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.errors.txt b/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.errors.txt index 8c3ab30922..b8e2159d43 100644 --- a/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.errors.txt @@ -1,9 +1,9 @@ -/a.js(2,1): error TS2304: Cannot find name 'exports'. +/a.js(1,7): error TS6133: 'x' is declared but its value is never read. ==== /a.js (1 errors) ==== const x = 0; + ~ +!!! error TS6133: 'x' is declared but its value is never read. exports.y = 1; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.symbols b/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.symbols index 2acd54aec8..3a6702d713 100644 --- a/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.symbols +++ b/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.symbols @@ -5,4 +5,7 @@ const x = 0; >x : Symbol(x, Decl(a.js, 0, 5)) exports.y = 1; +>exports.y : Symbol(y, Decl(a.js, 0, 12)) +>exports : Symbol("/a", Decl(a.js, 0, 0)) +>y : Symbol(y, Decl(a.js, 0, 12)) diff --git a/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.symbols.diff b/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.symbols.diff index bdb89a67d2..1221674749 100644 --- a/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.symbols.diff @@ -1,10 +1,10 @@ --- old.commonJsUnusedLocals.symbols +++ new.commonJsUnusedLocals.symbols -@@= skipped -4, +4 lines =@@ - >x : Symbol(x, Decl(a.js, 0, 5)) +@@= skipped -5, +5 lines =@@ exports.y = 1; -->exports.y : Symbol(y, Decl(a.js, 0, 12)) + >exports.y : Symbol(y, Decl(a.js, 0, 12)) ->exports : Symbol(y, Decl(a.js, 0, 12)) -->y : Symbol(y, Decl(a.js, 0, 12)) ++>exports : Symbol("/a", Decl(a.js, 0, 0)) + >y : Symbol(y, Decl(a.js, 0, 12)) diff --git a/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.types b/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.types index 2e787c12ec..ba76be8c22 100644 --- a/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.types +++ b/testdata/baselines/reference/submodule/compiler/commonJsUnusedLocals.types @@ -7,8 +7,8 @@ const x = 0; exports.y = 1; >exports.y = 1 : 1 ->exports.y : any ->exports : any ->y : any +>exports.y : 1 +>exports : typeof import("/a") +>y : 1 >1 : 1 diff --git a/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.errors.txt b/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.errors.txt deleted file mode 100644 index a416792383..0000000000 --- a/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.errors.txt +++ /dev/null @@ -1,28 +0,0 @@ -/a.js(1,1): error TS2304: Cannot find name 'exports'. -/a.js(2,1): error TS2304: Cannot find name 'exports'. -/a.js(7,5): error TS2304: Cannot find name 'exports'. -/a.js(12,22): error TS2304: Cannot find name 'exports'. - - -==== /a.js (4 errors) ==== - exports.x = 0; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - exports.x; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - - // Works nested - { - // 'exports' does not provide a contextual type to a function-class - exports.Cls = function() { - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - this.x = 0; - } - } - - const instance = new exports.Cls(); - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.symbols b/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.symbols index cb9fee58b4..add4ebb75a 100644 --- a/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.symbols +++ b/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.symbols @@ -2,16 +2,30 @@ === /a.js === exports.x = 0; +>exports.x : Symbol(x, Decl(a.js, 0, 0)) +>exports : Symbol("/a", Decl(a.js, 0, 0)) +>x : Symbol(x, Decl(a.js, 0, 0)) + exports.x; +>exports.x : Symbol(x, Decl(a.js, 0, 0)) +>exports : Symbol("/a", Decl(a.js, 0, 0)) +>x : Symbol(x, Decl(a.js, 0, 0)) // Works nested { // 'exports' does not provide a contextual type to a function-class exports.Cls = function() { +>exports.Cls : Symbol(Cls, Decl(a.js, 4, 1)) +>exports : Symbol("/a", Decl(a.js, 0, 0)) +>Cls : Symbol(Cls, Decl(a.js, 4, 1)) + this.x = 0; } } const instance = new exports.Cls(); >instance : Symbol(instance, Decl(a.js, 11, 5)) +>exports.Cls : Symbol(Cls, Decl(a.js, 4, 1)) +>exports : Symbol("/a", Decl(a.js, 0, 0)) +>Cls : Symbol(Cls, Decl(a.js, 4, 1)) diff --git a/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.symbols.diff b/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.symbols.diff index d4672fea22..dfdcce4c73 100644 --- a/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.symbols.diff @@ -1,26 +1,22 @@ --- old.commonjsAccessExports.symbols +++ new.commonjsAccessExports.symbols -@@= skipped -1, +1 lines =@@ - +@@= skipped -2, +2 lines =@@ === /a.js === exports.x = 0; -->exports.x : Symbol(x, Decl(a.js, 0, 0)) + >exports.x : Symbol(x, Decl(a.js, 0, 0)) ->exports : Symbol(x, Decl(a.js, 0, 0)) -->x : Symbol(x, Decl(a.js, 0, 0)) -- - exports.x; -->exports.x : Symbol(x, Decl(a.js, 0, 0)) -->exports : Symbol("/a", Decl(a.js, 0, 0)) -->x : Symbol(x, Decl(a.js, 0, 0)) ++>exports : Symbol("/a", Decl(a.js, 0, 0)) + >x : Symbol(x, Decl(a.js, 0, 0)) - // Works nested - { + exports.x; +@@= skipped -13, +13 lines =@@ // 'exports' does not provide a contextual type to a function-class exports.Cls = function() { -->exports.Cls : Symbol(Cls, Decl(a.js, 4, 1)) + >exports.Cls : Symbol(Cls, Decl(a.js, 4, 1)) ->exports : Symbol(Cls, Decl(a.js, 4, 1)) -->Cls : Symbol(Cls, Decl(a.js, 4, 1)) -- ++>exports : Symbol("/a", Decl(a.js, 0, 0)) + >Cls : Symbol(Cls, Decl(a.js, 4, 1)) + this.x = 0; ->this.x : Symbol(Cls.x, Decl(a.js, 6, 30)) ->this : Symbol(Cls, Decl(a.js, 6, 17)) @@ -28,9 +24,3 @@ } } - const instance = new exports.Cls(); - >instance : Symbol(instance, Decl(a.js, 11, 5)) -->exports.Cls : Symbol(Cls, Decl(a.js, 4, 1)) -->exports : Symbol("/a", Decl(a.js, 0, 0)) -->Cls : Symbol(Cls, Decl(a.js, 4, 1)) - diff --git a/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.types b/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.types index 5adc122f6b..d96099523f 100644 --- a/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.types +++ b/testdata/baselines/reference/submodule/compiler/commonjsAccessExports.types @@ -3,15 +3,15 @@ === /a.js === exports.x = 0; >exports.x = 0 : 0 ->exports.x : any ->exports : any ->x : any +>exports.x : 0 +>exports : typeof import("/a") +>x : 0 >0 : 0 exports.x; ->exports.x : any ->exports : any ->x : any +>exports.x : 0 +>exports : typeof import("/a") +>x : 0 // Works nested { @@ -19,7 +19,7 @@ exports.x; exports.Cls = function() { >exports.Cls = function() { this.x = 0; } : () => void >exports.Cls : any ->exports : any +>exports : typeof import("/a") >Cls : any >function() { this.x = 0; } : () => void @@ -36,6 +36,6 @@ const instance = new exports.Cls(); >instance : any >new exports.Cls() : any >exports.Cls : any ->exports : any +>exports : typeof import("/a") >Cls : any diff --git a/testdata/baselines/reference/submodule/compiler/declarationFileNoCrashOnExtraExportModifier.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationFileNoCrashOnExtraExportModifier.errors.txt index d6e8ea7b47..a55cb7883b 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationFileNoCrashOnExtraExportModifier.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/declarationFileNoCrashOnExtraExportModifier.errors.txt @@ -1,9 +1,7 @@ input.ts(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -input.ts(6,14): error TS2300: Duplicate identifier 'Sub'. -input.ts(12,14): error TS2300: Duplicate identifier 'Sub'. -==== input.ts (3 errors) ==== +==== input.ts (1 errors) ==== export = exports; ~~~~~~~~~~~~~~~~~ !!! error TS2309: An export assignment cannot be used in a module with other exported elements. @@ -12,16 +10,10 @@ input.ts(12,14): error TS2300: Duplicate identifier 'Sub'. t: number; } export class Sub { - ~~~ -!!! error TS2300: Duplicate identifier 'Sub'. -!!! related TS6203 input.ts:12:14: 'Sub' was also declared here. instance!: { t: number; }; } declare namespace exports { export { Sub }; - ~~~ -!!! error TS2300: Duplicate identifier 'Sub'. -!!! related TS6203 input.ts:6:14: 'Sub' was also declared here. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationFileNoCrashOnExtraExportModifier.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationFileNoCrashOnExtraExportModifier.errors.txt.diff new file mode 100644 index 0000000000..64a38a4506 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationFileNoCrashOnExtraExportModifier.errors.txt.diff @@ -0,0 +1,30 @@ +--- old.declarationFileNoCrashOnExtraExportModifier.errors.txt ++++ new.declarationFileNoCrashOnExtraExportModifier.errors.txt +@@= skipped -0, +0 lines =@@ + input.ts(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +-input.ts(6,14): error TS2300: Duplicate identifier 'Sub'. +-input.ts(12,14): error TS2300: Duplicate identifier 'Sub'. + + +-==== input.ts (3 errors) ==== ++==== input.ts (1 errors) ==== + export = exports; + ~~~~~~~~~~~~~~~~~ + !!! error TS2309: An export assignment cannot be used in a module with other exported elements. +@@= skipped -11, +9 lines =@@ + t: number; + } + export class Sub { +- ~~~ +-!!! error TS2300: Duplicate identifier 'Sub'. +-!!! related TS6203 input.ts:12:14: 'Sub' was also declared here. + instance!: { + t: number; + }; + } + declare namespace exports { + export { Sub }; +- ~~~ +-!!! error TS2300: Duplicate identifier 'Sub'. +-!!! related TS6203 input.ts:6:14: 'Sub' was also declared here. + } diff --git a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt index 5b7857d22a..2d766c4c25 100644 --- a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt @@ -1,26 +1,29 @@ -index.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. index.js(3,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +namespacer.js(2,3): error TS2339: Property 'NS' does not exist on type '{}'. +namespacer.js(2,8): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +namespacey.js(2,3): error TS2339: Property 'bar' does not exist on type '{}'. -==== index.js (3 errors) ==== +==== index.js (1 errors) ==== const _item = require("./namespacer"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports = 12; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. Object.defineProperty(module, "exports", { value: "oh no" }); ~~~~~~ !!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== namespacey.js (0 errors) ==== +==== namespacey.js (1 errors) ==== const A = {} A.bar = class Q {} + ~~~ +!!! error TS2339: Property 'bar' does not exist on type '{}'. module.exports = A; -==== namespacer.js (0 errors) ==== +==== namespacer.js (2 errors) ==== const B = {} B.NS = require("./namespacey"); + ~~ +!!! error TS2339: Property 'NS' does not exist on type '{}'. + ~~~~~~~ +!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. Object.defineProperty(B, "NS", { value: "why though", writable: true }); module.exports = B; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols index 17e6ee47c7..fb39c7c530 100644 --- a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols +++ b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols @@ -3,11 +3,52 @@ === index.js === const _item = require("./namespacer"); >_item : Symbol(_item, Decl(index.js, 0, 5)) +>require : Symbol(require) +>"./namespacer" : Symbol("namespacer", Decl(namespacer.js, 0, 0)) module.exports = 12; +>module.exports : Symbol(export=, Decl(index.js, 0, 38)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 0, 38)) + Object.defineProperty(module, "exports", { value: "oh no" }); >Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) >value : Symbol(value, Decl(index.js, 2, 42)) +=== namespacey.js === +const A = {} +>A : Symbol(A, Decl(namespacey.js, 0, 5)) + +A.bar = class Q {} +>A : Symbol(A, Decl(namespacey.js, 0, 5)) +>Q : Symbol(Q, Decl(namespacey.js, 1, 7)) + +module.exports = A; +>module.exports : Symbol(A, Decl(namespacey.js, 0, 5)) +>module : Symbol(module.exports) +>exports : Symbol(A, Decl(namespacey.js, 0, 5)) +>A : Symbol(A, Decl(namespacey.js, 0, 5)) + +=== namespacer.js === +const B = {} +>B : Symbol(B, Decl(namespacer.js, 0, 5)) + +B.NS = require("./namespacey"); +>B : Symbol(B, Decl(namespacer.js, 0, 5)) + +Object.defineProperty(B, "NS", { value: "why though", writable: true }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>B : Symbol(B, Decl(namespacer.js, 0, 5)) +>value : Symbol(value, Decl(namespacer.js, 2, 32)) +>writable : Symbol(writable, Decl(namespacer.js, 2, 53)) + +module.exports = B; +>module.exports : Symbol(B, Decl(namespacer.js, 0, 5)) +>module : Symbol(module.exports) +>exports : Symbol(B, Decl(namespacer.js, 0, 5)) +>B : Symbol(B, Decl(namespacer.js, 0, 5)) + diff --git a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols.diff b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols.diff index 0f01f5a769..b59f9153cc 100644 --- a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols.diff @@ -1,17 +1,15 @@ --- old.ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols +++ new.ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.symbols -@@= skipped -2, +2 lines =@@ - === index.js === - const _item = require("./namespacer"); - >_item : Symbol(_item, Decl(index.js, 0, 5)) -->require : Symbol(require) -->"./namespacer" : Symbol("namespacer", Decl(namespacer.js, 0, 0)) +@@= skipped -6, +6 lines =@@ + >"./namespacer" : Symbol("namespacer", Decl(namespacer.js, 0, 0)) module.exports = 12; ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 38)) -->exports : Symbol(export=, Decl(index.js, 0, 38)) -- ++>module.exports : Symbol(export=, Decl(index.js, 0, 38)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(index.js, 0, 38)) + Object.defineProperty(module, "exports", { value: "oh no" }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) @@ -22,45 +20,60 @@ +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) >value : Symbol(value, Decl(index.js, 2, 42)) --=== namespacey.js === --const A = {} + === namespacey.js === + const A = {} ->A : Symbol(A, Decl(namespacey.js, 0, 5), Decl(namespacey.js, 0, 12)) -- --A.bar = class Q {} ++>A : Symbol(A, Decl(namespacey.js, 0, 5)) + + A.bar = class Q {} ->A.bar : Symbol(A.bar, Decl(namespacey.js, 0, 12)) ->A : Symbol(A, Decl(namespacey.js, 0, 5), Decl(namespacey.js, 0, 12)) ->bar : Symbol(A.bar, Decl(namespacey.js, 0, 12)) -->Q : Symbol(Q, Decl(namespacey.js, 1, 7)) -- --module.exports = A; ++>A : Symbol(A, Decl(namespacey.js, 0, 5)) + >Q : Symbol(Q, Decl(namespacey.js, 1, 7)) + + module.exports = A; ->module.exports : Symbol(module.exports, Decl(namespacey.js, 0, 0)) ->module : Symbol(export=, Decl(namespacey.js, 1, 18)) ->exports : Symbol(export=, Decl(namespacey.js, 1, 18)) ->A : Symbol(A, Decl(namespacey.js, 0, 5), Decl(namespacey.js, 0, 12)) -- --=== namespacer.js === --const B = {} ++>module.exports : Symbol(A, Decl(namespacey.js, 0, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(A, Decl(namespacey.js, 0, 5)) ++>A : Symbol(A, Decl(namespacey.js, 0, 5)) + + === namespacer.js === + const B = {} ->B : Symbol(B, Decl(namespacer.js, 0, 5), Decl(namespacer.js, 0, 12), Decl(namespacer.js, 2, 22)) -- --B.NS = require("./namespacey"); ++>B : Symbol(B, Decl(namespacer.js, 0, 5)) + + B.NS = require("./namespacey"); ->B.NS : Symbol(B.NS, Decl(namespacer.js, 0, 12), Decl(namespacer.js, 1, 31)) ->B : Symbol(B, Decl(namespacer.js, 0, 5), Decl(namespacer.js, 0, 12), Decl(namespacer.js, 2, 22)) ->NS : Symbol(B.NS, Decl(namespacer.js, 0, 12), Decl(namespacer.js, 1, 31)) ->require : Symbol(require) ->"./namespacey" : Symbol("namespacey", Decl(namespacey.js, 0, 0)) -- --Object.defineProperty(B, "NS", { value: "why though", writable: true }); ++>B : Symbol(B, Decl(namespacer.js, 0, 5)) + + Object.defineProperty(B, "NS", { value: "why though", writable: true }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->B : Symbol(B, Decl(namespacer.js, 0, 5), Decl(namespacer.js, 0, 12), Decl(namespacer.js, 2, 22)) ->"NS" : Symbol(B.NS, Decl(namespacer.js, 0, 12), Decl(namespacer.js, 1, 31)) -->value : Symbol(value, Decl(namespacer.js, 2, 32)) -->writable : Symbol(writable, Decl(namespacer.js, 2, 53)) -- --module.exports = B; ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>B : Symbol(B, Decl(namespacer.js, 0, 5)) + >value : Symbol(value, Decl(namespacer.js, 2, 32)) + >writable : Symbol(writable, Decl(namespacer.js, 2, 53)) + + module.exports = B; ->module.exports : Symbol(module.exports, Decl(namespacer.js, 0, 0)) ->module : Symbol(export=, Decl(namespacer.js, 2, 72)) ->exports : Symbol(export=, Decl(namespacer.js, 2, 72)) ->B : Symbol(B, Decl(namespacer.js, 0, 5), Decl(namespacer.js, 0, 12), Decl(namespacer.js, 2, 22)) -- ++>module.exports : Symbol(B, Decl(namespacer.js, 0, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(B, Decl(namespacer.js, 0, 5)) ++>B : Symbol(B, Decl(namespacer.js, 0, 5)) + diff --git a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types index bd9cdf8e67..a8380c7361 100644 --- a/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types +++ b/testdata/baselines/reference/submodule/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types @@ -2,16 +2,16 @@ === index.js === const _item = require("./namespacer"); ->_item : any ->require("./namespacer") : any +>_item : {} +>require("./namespacer") : {} >require : any >"./namespacer" : "./namespacer" module.exports = 12; >module.exports = 12 : 12 ->module.exports : any ->module : any ->exports : any +>module.exports : 12 +>module : { export=: 12; } +>exports : 12 >12 : 12 Object.defineProperty(module, "exports", { value: "oh no" }); @@ -25,3 +25,57 @@ Object.defineProperty(module, "exports", { value: "oh no" }); >value : string >"oh no" : "oh no" +=== namespacey.js === +const A = {} +>A : {} +>{} : {} + +A.bar = class Q {} +>A.bar = class Q {} : typeof Q +>A.bar : any +>A : {} +>bar : any +>class Q {} : typeof Q +>Q : typeof Q + +module.exports = A; +>module.exports = A : {} +>module.exports : {} +>module : { readonly A: {}; } +>exports : {} +>A : {} + +=== namespacer.js === +const B = {} +>B : {} +>{} : {} + +B.NS = require("./namespacey"); +>B.NS = require("./namespacey") : any +>B.NS : any +>B : {} +>NS : any +>require("./namespacey") : any +>require : any +>"./namespacey" : "./namespacey" + +Object.defineProperty(B, "NS", { value: "why though", writable: true }); +>Object.defineProperty(B, "NS", { value: "why though", writable: true }) : {} +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>B : {} +>"NS" : "NS" +>{ value: "why though", writable: true } : { value: string; writable: true; } +>value : string +>"why though" : "why though" +>writable : true +>true : true + +module.exports = B; +>module.exports = B : {} +>module.exports : {} +>module : { readonly B: {}; } +>exports : {} +>B : {} + diff --git a/testdata/baselines/reference/submodule/compiler/es5ExportEquals.types b/testdata/baselines/reference/submodule/compiler/es5ExportEquals.types index b30fb90297..741e51e0bc 100644 --- a/testdata/baselines/reference/submodule/compiler/es5ExportEquals.types +++ b/testdata/baselines/reference/submodule/compiler/es5ExportEquals.types @@ -2,8 +2,8 @@ === es5ExportEquals.ts === export function f() { } ->f : typeof f +>f : () => void export = f; ->f : typeof f +>f : () => void diff --git a/testdata/baselines/reference/submodule/compiler/es5ExportEquals.types.diff b/testdata/baselines/reference/submodule/compiler/es5ExportEquals.types.diff new file mode 100644 index 0000000000..34211a4ef7 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/es5ExportEquals.types.diff @@ -0,0 +1,13 @@ +--- old.es5ExportEquals.types ++++ new.es5ExportEquals.types +@@= skipped -1, +1 lines =@@ + + === es5ExportEquals.ts === + export function f() { } +->f : typeof f ++>f : () => void + + export = f; +->f : typeof f ++>f : () => void + diff --git a/testdata/baselines/reference/submodule/compiler/es6ExportEquals.types b/testdata/baselines/reference/submodule/compiler/es6ExportEquals.types index eeea43be2c..e6a3efcba6 100644 --- a/testdata/baselines/reference/submodule/compiler/es6ExportEquals.types +++ b/testdata/baselines/reference/submodule/compiler/es6ExportEquals.types @@ -2,8 +2,8 @@ === es6ExportEquals.ts === export function f() { } ->f : typeof f +>f : () => void export = f; ->f : typeof f +>f : () => void diff --git a/testdata/baselines/reference/submodule/compiler/es6ExportEquals.types.diff b/testdata/baselines/reference/submodule/compiler/es6ExportEquals.types.diff new file mode 100644 index 0000000000..33e5264910 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/es6ExportEquals.types.diff @@ -0,0 +1,13 @@ +--- old.es6ExportEquals.types ++++ new.es6ExportEquals.types +@@= skipped -1, +1 lines =@@ + + === es6ExportEquals.ts === + export function f() { } +->f : typeof f ++>f : () => void + + export = f; +->f : typeof f ++>f : () => void + diff --git a/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.errors.txt b/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.errors.txt index f18be0c0f6..491f957c42 100644 --- a/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.errors.txt @@ -1,6 +1,8 @@ input.js(5,48): error TS2304: Cannot find name 'P'. -input.js(48,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -input.js(52,24): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +input.js(48,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +input.js(52,17): error TS2322: Type '{ color: string; }' is not assignable to type '{ color: "blue" | "red"; }'. + Types of property 'color' are incompatible. + Type 'string' is not assignable to type '"blue" | "red"'. ==== input.js (3 errors) ==== @@ -54,12 +56,17 @@ input.js(52,24): error TS2580: Cannot find name 'module'. Do you need to install * @type {MyComponentProps} */ module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~ color: "red" + ~~~~~~~~~~~~~~~~ } + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. expectLiteral({ props: module.exports }); - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~ +!!! error TS2322: Type '{ color: string; }' is not assignable to type '{ color: "blue" | "red"; }'. +!!! error TS2322: Types of property 'color' are incompatible. +!!! error TS2322: Type 'string' is not assignable to type '"blue" | "red"'. +!!! related TS6500 input.js:32:14: The expected type comes from property 'props' which is declared here on type '{ props: { color: "blue" | "red"; }; }' \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.symbols b/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.symbols index 6096d22301..4dea05cccc 100644 --- a/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.symbols +++ b/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.symbols @@ -70,6 +70,10 @@ function foo() { * @type {MyComponentProps} */ module.exports = { +>module.exports : Symbol(export=, Decl(input.js, 42, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(input.js, 42, 1)) + color: "red" >color : Symbol(color, Decl(input.js, 47, 18)) } @@ -77,4 +81,7 @@ module.exports = { expectLiteral({ props: module.exports }); >expectLiteral : Symbol(expectLiteral, Decl(input.js, 27, 27)) >props : Symbol(props, Decl(input.js, 51, 15)) +>module.exports : Symbol(export=, Decl(input.js, 42, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(input.js, 42, 1)) diff --git a/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.symbols.diff b/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.symbols.diff index 372acfcf31..a69d6177a7 100644 --- a/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.symbols.diff @@ -63,16 +63,19 @@ module.exports = { ->module.exports : Symbol(module.exports, Decl(input.js, 0, 0)) ->module : Symbol(export=, Decl(input.js, 42, 1)) -->exports : Symbol(export=, Decl(input.js, 42, 1)) -- ++>module.exports : Symbol(export=, Decl(input.js, 42, 1)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(input.js, 42, 1)) + color: "red" - >color : Symbol(color, Decl(input.js, 47, 18)) - } -@@= skipped -25, +17 lines =@@ +@@= skipped -25, +21 lines =@@ expectLiteral({ props: module.exports }); >expectLiteral : Symbol(expectLiteral, Decl(input.js, 27, 27)) >props : Symbol(props, Decl(input.js, 51, 15)) ->module.exports : Symbol(module.exports, Decl(input.js, 0, 0)) ->module : Symbol(module, Decl(input.js, 42, 1), Decl(input.js, 51, 22)) ->exports : Symbol(module.exports, Decl(input.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(input.js, 42, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(input.js, 42, 1)) diff --git a/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.types b/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.types index 002b1288c6..5e0fa52059 100644 --- a/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.types +++ b/testdata/baselines/reference/submodule/compiler/expandoFunctionContextualTypesJs.types @@ -88,9 +88,9 @@ function foo() { */ module.exports = { >module.exports = { color: "red"} : { color: string; } ->module.exports : any ->module : any ->exports : any +>module.exports : { color: string; } +>module : { export=: { color: string; }; } +>exports : { color: string; } >{ color: "red"} : { color: string; } color: "red" @@ -101,9 +101,9 @@ module.exports = { expectLiteral({ props: module.exports }); >expectLiteral({ props: module.exports }) : void >expectLiteral : (p: { props: { color: "blue" | "red"; }; }) => void ->{ props: module.exports } : { props: any; } ->props : any ->module.exports : any ->module : any ->exports : any +>{ props: module.exports } : { props: { color: string; }; } +>props : { color: string; } +>module.exports : { color: string; } +>module : { export=: { color: string; }; } +>exports : { color: string; } diff --git a/testdata/baselines/reference/submodule/compiler/functionExpressionNames.errors.txt b/testdata/baselines/reference/submodule/compiler/functionExpressionNames.errors.txt deleted file mode 100644 index 0a77f8c301..0000000000 --- a/testdata/baselines/reference/submodule/compiler/functionExpressionNames.errors.txt +++ /dev/null @@ -1,39 +0,0 @@ -b.js(1,1): error TS2304: Cannot find name 'exports'. -b.js(4,13): error TS2304: Cannot find name 'exports'. - - -==== b.js (2 errors) ==== - exports.E = function() { - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - this.e = 'exported' - } - var e = new exports.E(); - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - - var o = { - C: function () { - this.c = 'nested object' - } - } - var og = new o.C(); - - var V = function () { - this.v = 'simple' - } - var v = new V(); - - var A; - A = function () { - this.a = 'assignment' - } - var a = new A(); - - const { - B = function() { - this.b = 'binding pattern' - } - } = { B: undefined }; - var b = new B(); - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/functionExpressionNames.symbols b/testdata/baselines/reference/submodule/compiler/functionExpressionNames.symbols index 660d9cd1ed..8ad2cab8c3 100644 --- a/testdata/baselines/reference/submodule/compiler/functionExpressionNames.symbols +++ b/testdata/baselines/reference/submodule/compiler/functionExpressionNames.symbols @@ -2,10 +2,17 @@ === b.js === exports.E = function() { +>exports.E : Symbol(E, Decl(b.js, 0, 0)) +>exports : Symbol("b", Decl(b.js, 0, 0)) +>E : Symbol(E, Decl(b.js, 0, 0)) + this.e = 'exported' } var e = new exports.E(); >e : Symbol(e, Decl(b.js, 3, 3)) +>exports.E : Symbol(E, Decl(b.js, 0, 0)) +>exports : Symbol("b", Decl(b.js, 0, 0)) +>E : Symbol(E, Decl(b.js, 0, 0)) var o = { >o : Symbol(o, Decl(b.js, 5, 3)) diff --git a/testdata/baselines/reference/submodule/compiler/functionExpressionNames.symbols.diff b/testdata/baselines/reference/submodule/compiler/functionExpressionNames.symbols.diff index ff3f223173..e8e6c3a486 100644 --- a/testdata/baselines/reference/submodule/compiler/functionExpressionNames.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/functionExpressionNames.symbols.diff @@ -1,13 +1,13 @@ --- old.functionExpressionNames.symbols +++ new.functionExpressionNames.symbols -@@= skipped -1, +1 lines =@@ - +@@= skipped -2, +2 lines =@@ === b.js === exports.E = function() { -->exports.E : Symbol(E, Decl(b.js, 0, 0)) + >exports.E : Symbol(E, Decl(b.js, 0, 0)) ->exports : Symbol(E, Decl(b.js, 0, 0)) -->E : Symbol(E, Decl(b.js, 0, 0)) -- ++>exports : Symbol("b", Decl(b.js, 0, 0)) + >E : Symbol(E, Decl(b.js, 0, 0)) + this.e = 'exported' ->this.e : Symbol(E.e, Decl(b.js, 0, 24)) ->this : Symbol(E, Decl(b.js, 0, 11)) @@ -15,13 +15,7 @@ } var e = new exports.E(); >e : Symbol(e, Decl(b.js, 3, 3)) -->exports.E : Symbol(E, Decl(b.js, 0, 0)) -->exports : Symbol("b", Decl(b.js, 0, 0)) -->E : Symbol(E, Decl(b.js, 0, 0)) - - var o = { - >o : Symbol(o, Decl(b.js, 5, 3)) -@@= skipped -22, +12 lines =@@ +@@= skipped -21, +18 lines =@@ >C : Symbol(C, Decl(b.js, 5, 9)) this.c = 'nested object' diff --git a/testdata/baselines/reference/submodule/compiler/functionExpressionNames.types b/testdata/baselines/reference/submodule/compiler/functionExpressionNames.types index 5d92e5d2b5..768669017f 100644 --- a/testdata/baselines/reference/submodule/compiler/functionExpressionNames.types +++ b/testdata/baselines/reference/submodule/compiler/functionExpressionNames.types @@ -4,7 +4,7 @@ exports.E = function() { >exports.E = function() { this.e = 'exported'} : () => void >exports.E : any ->exports : any +>exports : typeof import("b") >E : any >function() { this.e = 'exported'} : () => void @@ -19,7 +19,7 @@ var e = new exports.E(); >e : any >new exports.E() : any >exports.E : any ->exports : any +>exports : typeof import("b") >E : any var o = { diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js index 755f213e8c..8f2fc5436e 100644 --- a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js +++ b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js @@ -10,4 +10,4 @@ export = x; //// [importDeclWithExportModifierAndExportAssignment.js] "use strict"; -module.exports = x; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js.diff b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js.diff index feee8bf6e2..0a07a5e21c 100644 --- a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js.diff +++ b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.js.diff @@ -6,4 +6,5 @@ "use strict"; -exports.a = void 0; -exports.a = x.c; - module.exports = x; +-module.exports = x; ++Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.types b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.types index 31083efc78..b6bf49e8d8 100644 --- a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.types +++ b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.types @@ -7,9 +7,9 @@ module x { } export import a = x.c; >a : any ->x : typeof x +>x : any >c : any export = x; ->x : typeof x +>x : any diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.types.diff b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.types.diff new file mode 100644 index 0000000000..82bd139a70 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.types.diff @@ -0,0 +1,14 @@ +--- old.importDeclWithExportModifierAndExportAssignment.types ++++ new.importDeclWithExportModifierAndExportAssignment.types +@@= skipped -6, +6 lines =@@ + } + export import a = x.c; + >a : any +->x : typeof x ++>x : any + >c : any + + export = x; +->x : typeof x ++>x : any + diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignmentInAmbientContext.types b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignmentInAmbientContext.types index e77123f54e..256a7bf86a 100644 --- a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignmentInAmbientContext.types +++ b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignmentInAmbientContext.types @@ -10,9 +10,9 @@ declare module "m" { } export import a = x.c; >a : any ->x : typeof x +>x : any >c : c export = x; ->x : typeof x +>x : any } diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignmentInAmbientContext.types.diff b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignmentInAmbientContext.types.diff index 56bc79a559..ddf0dec991 100644 --- a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignmentInAmbientContext.types.diff +++ b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignmentInAmbientContext.types.diff @@ -1,11 +1,15 @@ --- old.importDeclWithExportModifierAndExportAssignmentInAmbientContext.types +++ new.importDeclWithExportModifierAndExportAssignmentInAmbientContext.types -@@= skipped -10, +10 lines =@@ +@@= skipped -9, +9 lines =@@ + } export import a = x.c; >a : any - >x : typeof x +->x : typeof x ->c : a ++>x : any +>c : c export = x; - >x : typeof x +->x : typeof x ++>x : any + } diff --git a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).errors.txt b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).errors.txt deleted file mode 100644 index e64601f8c9..0000000000 --- a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).errors.txt +++ /dev/null @@ -1,48 +0,0 @@ -/index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== /node_modules/tslib/package.json (0 errors) ==== - { - "name": "tslib", - "main": "tslib.js", - "module": "tslib.es6.js", - "jsnext:main": "tslib.es6.js", - "typings": "tslib.d.ts", - "exports": { - ".": { - "module": { - "types": "./modules/index.d.ts", - "default": "./tslib.es6.mjs" - }, - "import": { - "node": "./modules/index.js", - "default": { - "types": "./modules/index.d.ts", - "default": "./tslib.es6.mjs" - } - }, - "default": "./tslib.js" - }, - "./*": "./*", - "./": "./" - } - } - -==== /node_modules/tslib/tslib.d.ts (0 errors) ==== - export declare var __extends: any; - -==== /node_modules/tslib/modules/package.json (0 errors) ==== - { "type": "module" } - -==== /node_modules/tslib/modules/index.d.ts (0 errors) ==== - export {}; - -==== /index.js (1 errors) ==== - class Foo {} - - class Bar extends Foo {} - - module.exports = Bar; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).symbols b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).symbols index 2d4681bd08..285cda7771 100644 --- a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).symbols +++ b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).symbols @@ -17,5 +17,8 @@ class Bar extends Foo {} >Foo : Symbol(Foo, Decl(index.js, 0, 0)) module.exports = Bar; +>module.exports : Symbol(Bar, Decl(index.js, 0, 12)) +>module : Symbol(module.exports) +>exports : Symbol(Bar, Decl(index.js, 0, 12)) >Bar : Symbol(Bar, Decl(index.js, 0, 12)) diff --git a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).symbols.diff b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).symbols.diff index 310fc6c647..c22c0e260b 100644 --- a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).symbols.diff @@ -16,5 +16,8 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 2, 24)) ->exports : Symbol(export=, Decl(index.js, 2, 24)) ++>module.exports : Symbol(Bar, Decl(index.js, 0, 12)) ++>module : Symbol(module.exports) ++>exports : Symbol(Bar, Decl(index.js, 0, 12)) >Bar : Symbol(Bar, Decl(index.js, 0, 12)) diff --git a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).types b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).types index b84993f1a1..f7a302d8e7 100644 --- a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).types +++ b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).types @@ -18,8 +18,8 @@ class Bar extends Foo {} module.exports = Bar; >module.exports = Bar : typeof Bar ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Bar +>module : { Bar: typeof Bar; } +>exports : typeof Bar >Bar : typeof Bar diff --git a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).errors.txt b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).errors.txt deleted file mode 100644 index e64601f8c9..0000000000 --- a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).errors.txt +++ /dev/null @@ -1,48 +0,0 @@ -/index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== /node_modules/tslib/package.json (0 errors) ==== - { - "name": "tslib", - "main": "tslib.js", - "module": "tslib.es6.js", - "jsnext:main": "tslib.es6.js", - "typings": "tslib.d.ts", - "exports": { - ".": { - "module": { - "types": "./modules/index.d.ts", - "default": "./tslib.es6.mjs" - }, - "import": { - "node": "./modules/index.js", - "default": { - "types": "./modules/index.d.ts", - "default": "./tslib.es6.mjs" - } - }, - "default": "./tslib.js" - }, - "./*": "./*", - "./": "./" - } - } - -==== /node_modules/tslib/tslib.d.ts (0 errors) ==== - export declare var __extends: any; - -==== /node_modules/tslib/modules/package.json (0 errors) ==== - { "type": "module" } - -==== /node_modules/tslib/modules/index.d.ts (0 errors) ==== - export {}; - -==== /index.js (1 errors) ==== - class Foo {} - - class Bar extends Foo {} - - module.exports = Bar; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).symbols b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).symbols index 2d4681bd08..285cda7771 100644 --- a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).symbols +++ b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).symbols @@ -17,5 +17,8 @@ class Bar extends Foo {} >Foo : Symbol(Foo, Decl(index.js, 0, 0)) module.exports = Bar; +>module.exports : Symbol(Bar, Decl(index.js, 0, 12)) +>module : Symbol(module.exports) +>exports : Symbol(Bar, Decl(index.js, 0, 12)) >Bar : Symbol(Bar, Decl(index.js, 0, 12)) diff --git a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).symbols.diff b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).symbols.diff index c9f058a11c..a8542a07f3 100644 --- a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).symbols.diff @@ -16,5 +16,8 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 2, 24)) ->exports : Symbol(export=, Decl(index.js, 2, 24)) ++>module.exports : Symbol(Bar, Decl(index.js, 0, 12)) ++>module : Symbol(module.exports) ++>exports : Symbol(Bar, Decl(index.js, 0, 12)) >Bar : Symbol(Bar, Decl(index.js, 0, 12)) diff --git a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).types b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).types index b84993f1a1..f7a302d8e7 100644 --- a/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).types +++ b/testdata/baselines/reference/submodule/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).types @@ -18,8 +18,8 @@ class Bar extends Foo {} module.exports = Bar; >module.exports = Bar : typeof Bar ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Bar +>module : { Bar: typeof Bar; } +>exports : typeof Bar >Bar : typeof Bar diff --git a/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.errors.txt b/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.errors.txt index 56a479b3cd..163dc63a2c 100644 --- a/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.errors.txt @@ -1,5 +1,5 @@ /a.js(1,18): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -/node_modules/foo/src/index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/node_modules/foo/src/index.js(1,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. ==== /node_modules/foo/package.json (0 errors) ==== @@ -7,8 +7,8 @@ ==== /node_modules/foo/src/index.js (1 errors) ==== module.exports = 1; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. ==== /a.js (1 errors) ==== export const A = require("foo"); diff --git a/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.symbols b/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.symbols index ce24d27b69..38402c6034 100644 --- a/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.symbols +++ b/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.symbols @@ -1,8 +1,10 @@ //// [tests/cases/compiler/importNonExportedMember12.ts] //// === /node_modules/foo/src/index.js === - module.exports = 1; +>module.exports : Symbol(export=, Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 0, 0)) === /a.js === export const A = require("foo"); diff --git a/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.symbols.diff b/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.symbols.diff index f84807b34f..0b9c9f9e61 100644 --- a/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.symbols.diff @@ -1,14 +1,14 @@ --- old.importNonExportedMember12.symbols +++ new.importNonExportedMember12.symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/compiler/importNonExportedMember12.ts] //// +@@= skipped -1, +1 lines =@@ === /node_modules/foo/src/index.js === -+ module.exports = 1; ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 0)) -->exports : Symbol(export=, Decl(index.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(index.js, 0, 0)) === /a.js === export const A = require("foo"); diff --git a/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.types b/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.types index e0c2e59883..c76f0a8d64 100644 --- a/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.types +++ b/testdata/baselines/reference/submodule/compiler/importNonExportedMember12.types @@ -3,9 +3,9 @@ === /node_modules/foo/src/index.js === module.exports = 1; >module.exports = 1 : 1 ->module.exports : any ->module : any ->exports : any +>module.exports : 1 +>module : { export=: 1; } +>exports : 1 >1 : 1 === /a.js === diff --git a/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.errors.txt b/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.errors.txt deleted file mode 100644 index a40ca996bb..0000000000 --- a/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== index.js (1 errors) ==== - class Foo {} - - class Bar extends Foo {} - - module.exports = Bar; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.symbols b/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.symbols index fca0542170..bf438af52c 100644 --- a/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.symbols +++ b/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.symbols @@ -9,5 +9,8 @@ class Bar extends Foo {} >Foo : Symbol(Foo, Decl(index.js, 0, 0)) module.exports = Bar; +>module.exports : Symbol(Bar, Decl(index.js, 0, 12)) +>module : Symbol(module.exports) +>exports : Symbol(Bar, Decl(index.js, 0, 12)) >Bar : Symbol(Bar, Decl(index.js, 0, 12)) diff --git a/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.symbols.diff b/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.symbols.diff index 193ad7011a..6698b104d6 100644 --- a/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.symbols.diff @@ -7,5 +7,8 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 2, 24)) ->exports : Symbol(export=, Decl(index.js, 2, 24)) ++>module.exports : Symbol(Bar, Decl(index.js, 0, 12)) ++>module : Symbol(module.exports) ++>exports : Symbol(Bar, Decl(index.js, 0, 12)) >Bar : Symbol(Bar, Decl(index.js, 0, 12)) diff --git a/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.types b/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.types index 7eda35b516..bae91c5459 100644 --- a/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.types +++ b/testdata/baselines/reference/submodule/compiler/javascriptCommonjsModule.types @@ -10,8 +10,8 @@ class Bar extends Foo {} module.exports = Bar; >module.exports = Bar : typeof Bar ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Bar +>module : { Bar: typeof Bar; } +>exports : typeof Bar >Bar : typeof Bar diff --git a/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.errors.txt b/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.errors.txt deleted file mode 100644 index 269e83489e..0000000000 --- a/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.errors.txt +++ /dev/null @@ -1,15 +0,0 @@ -/a.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -/b.js(1,15): error TS2306: File '/a.js' is not a module. - - -==== /a.js (1 errors) ==== - const alias = {}; - module.exports = alias; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - -==== /b.js (1 errors) ==== - import a from "./a"; - ~~~~~ -!!! error TS2306: File '/a.js' is not a module. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.symbols b/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.symbols index ce4ccc25e3..e1364018d2 100644 --- a/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.symbols +++ b/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.symbols @@ -5,6 +5,9 @@ const alias = {}; >alias : Symbol(alias, Decl(a.js, 0, 5)) module.exports = alias; +>module.exports : Symbol(alias, Decl(a.js, 0, 5)) +>module : Symbol(module.exports) +>exports : Symbol(alias, Decl(a.js, 0, 5)) >alias : Symbol(alias, Decl(a.js, 0, 5)) === /b.js === diff --git a/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.symbols.diff b/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.symbols.diff index e35e715bf9..49b75e9dcf 100644 --- a/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.symbols.diff @@ -7,6 +7,9 @@ ->module.exports : Symbol(module.exports, Decl(a.js, 0, 0)) ->module : Symbol(export=, Decl(a.js, 0, 17)) ->exports : Symbol(export=, Decl(a.js, 0, 17)) ++>module.exports : Symbol(alias, Decl(a.js, 0, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(alias, Decl(a.js, 0, 5)) >alias : Symbol(alias, Decl(a.js, 0, 5)) === /b.js === diff --git a/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.types b/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.types index fb82f9086c..b1ae2fc014 100644 --- a/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.types +++ b/testdata/baselines/reference/submodule/compiler/javascriptImportDefaultBadExport.types @@ -7,12 +7,12 @@ const alias = {}; module.exports = alias; >module.exports = alias : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { readonly alias: {}; } +>exports : {} >alias : {} === /b.js === import a from "./a"; ->a : any +>a : {} diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.errors.txt b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.errors.txt deleted file mode 100644 index 904e9484c7..0000000000 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -file.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== file.js (1 errors) ==== - module.exports = [{ name: 'other', displayName: 'Other', defaultEnabled: true }]; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.symbols b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.symbols index e7710bb4ba..e26a7ebdd3 100644 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.symbols @@ -2,6 +2,9 @@ === file.js === module.exports = [{ name: 'other', displayName: 'Other', defaultEnabled: true }]; +>module.exports : Symbol(export=, Decl(file.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(file.js, 0, 0)) >name : Symbol(name, Decl(file.js, 0, 19)) >displayName : Symbol(displayName, Decl(file.js, 0, 34)) >defaultEnabled : Symbol(defaultEnabled, Decl(file.js, 0, 56)) diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.symbols.diff index 1f86068881..8c0e03072c 100644 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.symbols.diff @@ -6,7 +6,8 @@ module.exports = [{ name: 'other', displayName: 'Other', defaultEnabled: true }]; ->module.exports : Symbol(module.exports, Decl(file.js, 0, 0)) ->module : Symbol(export=, Decl(file.js, 0, 0)) -->exports : Symbol(export=, Decl(file.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(file.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(file.js, 0, 0)) >name : Symbol(name, Decl(file.js, 0, 19)) >displayName : Symbol(displayName, Decl(file.js, 0, 34)) - >defaultEnabled : Symbol(defaultEnabled, Decl(file.js, 0, 56)) diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.types b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.types index 4d2df0d2fb..67b36c68b4 100644 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.types +++ b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedArray.types @@ -3,9 +3,9 @@ === file.js === module.exports = [{ name: 'other', displayName: 'Other', defaultEnabled: true }]; >module.exports = [{ name: 'other', displayName: 'Other', defaultEnabled: true }] : { name: string; displayName: string; defaultEnabled: boolean; }[] ->module.exports : any ->module : any ->exports : any +>module.exports : { name: string; displayName: string; defaultEnabled: boolean; }[] +>module : { export=: { name: string; displayName: string; defaultEnabled: boolean; }[]; } +>exports : { name: string; displayName: string; defaultEnabled: boolean; }[] >[{ name: 'other', displayName: 'Other', defaultEnabled: true }] : { name: string; displayName: string; defaultEnabled: boolean; }[] >{ name: 'other', displayName: 'Other', defaultEnabled: true } : { name: string; displayName: string; defaultEnabled: boolean; } >name : string diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.errors.txt b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.errors.txt index 53710deb2f..824d5e4f6f 100644 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.errors.txt @@ -1,4 +1,4 @@ -index.js(9,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(9,1): error TS2309: An export assignment cannot be used in a module with other exported elements. index.js(9,34): error TS7006: Parameter 'options' implicitly has an 'any' type. @@ -12,8 +12,8 @@ index.js(9,34): error TS7006: Parameter 'options' implicitly has an 'any' type. * @param {Options} options */ module.exports = function loader(options) {} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. ~~~~~~~ !!! error TS7006: Parameter 'options' implicitly has an 'any' type. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.symbols b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.symbols index 4821633a68..8e050faae9 100644 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.symbols @@ -10,6 +10,9 @@ * @param {Options} options */ module.exports = function loader(options) {} +>module.exports : Symbol(export=, Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 0, 0)) >loader : Symbol(loader, Decl(index.js, 8, 16)) >options : Symbol(options, Decl(index.js, 8, 33)) diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.symbols.diff index 6be19f2b40..d5d9ba85ae 100644 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.symbols.diff @@ -6,7 +6,8 @@ module.exports = function loader(options) {} ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 0)) -->exports : Symbol(export=, Decl(index.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(index.js, 0, 0)) >loader : Symbol(loader, Decl(index.js, 8, 16)) >options : Symbol(options, Decl(index.js, 8, 33)) - diff --git a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.types b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.types index 3297612520..f3c523cdba 100644 --- a/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.types +++ b/testdata/baselines/reference/submodule/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.types @@ -11,9 +11,9 @@ */ module.exports = function loader(options) {} >module.exports = function loader(options) {} : (options: any) => void ->module.exports : any ->module : any ->exports : any +>module.exports : (options: any) => void +>module : { export=: (options: any) => void; } +>exports : (options: any) => void >function loader(options) {} : (options: any) => void >loader : (options: any) => void >options : any diff --git a/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.errors.txt b/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.errors.txt index 7e856086bc..2d268cb5a4 100644 --- a/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.errors.txt @@ -1,10 +1,9 @@ -usage.js(1,38): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(10,12): error TS2749: 'Thing' refers to a value, but is being used as a type here. Did you mean 'typeof Thing'? +index.js(17,16): error TS2749: 'Thing' refers to a value, but is being used as a type here. Did you mean 'typeof Thing'? -==== usage.js (1 errors) ==== +==== usage.js (0 errors) ==== const { Thing, useThing, cbThing } = require("./index"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. useThing(Thing.a); @@ -22,7 +21,7 @@ usage.js(1,38): error TS2580: Cannot find name 'require'. Do you need to install }; }); -==== index.js (0 errors) ==== +==== index.js (2 errors) ==== /** @enum {string} */ const Thing = Object.freeze({ a: "thing", @@ -33,6 +32,8 @@ usage.js(1,38): error TS2580: Cannot find name 'require'. Do you need to install /** * @param {Thing} x + ~~~~~ +!!! error TS2749: 'Thing' refers to a value, but is being used as a type here. Did you mean 'typeof Thing'? */ function useThing(x) {} @@ -40,6 +41,8 @@ usage.js(1,38): error TS2580: Cannot find name 'require'. Do you need to install /** * @param {(x: Thing) => void} x + ~~~~~ +!!! error TS2749: 'Thing' refers to a value, but is being used as a type here. Did you mean 'typeof Thing'? */ function cbThing(x) {} diff --git a/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.symbols b/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.symbols index fae98d1caf..22ca93d390 100644 --- a/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.symbols @@ -5,10 +5,14 @@ const { Thing, useThing, cbThing } = require("./index"); >Thing : Symbol(Thing, Decl(usage.js, 0, 7)) >useThing : Symbol(useThing, Decl(usage.js, 0, 14)) >cbThing : Symbol(cbThing, Decl(usage.js, 0, 24)) +>require : Symbol(require) +>"./index" : Symbol("index", Decl(index.js, 0, 0)) useThing(Thing.a); >useThing : Symbol(useThing, Decl(usage.js, 0, 14)) +>Thing.a : Symbol(a, Decl(index.js, 1, 29)) >Thing : Symbol(Thing, Decl(usage.js, 0, 7)) +>a : Symbol(a, Decl(index.js, 1, 29)) /** * @typedef {Object} LogEntry @@ -36,3 +40,51 @@ cbThing(type => { }; }); +=== index.js === +/** @enum {string} */ +const Thing = Object.freeze({ +>Thing : Symbol(Thing, Decl(index.js, 1, 5)) +>Object.freeze : Symbol(freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>freeze : Symbol(freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + + a: "thing", +>a : Symbol(a, Decl(index.js, 1, 29)) + + b: "chill" +>b : Symbol(b, Decl(index.js, 2, 15)) + +}); + +exports.Thing = Thing; +>exports.Thing : Symbol(Thing, Decl(index.js, 4, 3)) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>Thing : Symbol(Thing, Decl(index.js, 4, 3)) +>Thing : Symbol(Thing, Decl(index.js, 1, 5)) + +/** + * @param {Thing} x + */ +function useThing(x) {} +>useThing : Symbol(useThing, Decl(index.js, 6, 22)) +>x : Symbol(x, Decl(index.js, 11, 18)) + +exports.useThing = useThing; +>exports.useThing : Symbol(useThing, Decl(index.js, 11, 23)) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>useThing : Symbol(useThing, Decl(index.js, 11, 23)) +>useThing : Symbol(useThing, Decl(index.js, 6, 22)) + +/** + * @param {(x: Thing) => void} x + */ +function cbThing(x) {} +>cbThing : Symbol(cbThing, Decl(index.js, 13, 28)) +>x : Symbol(x, Decl(index.js, 18, 17)) + +exports.cbThing = cbThing; +>exports.cbThing : Symbol(cbThing, Decl(index.js, 18, 22)) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>cbThing : Symbol(cbThing, Decl(index.js, 18, 22)) +>cbThing : Symbol(cbThing, Decl(index.js, 13, 28)) + diff --git a/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.symbols.diff index 3b6d5dcca3..e70c9e4cf7 100644 --- a/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.symbols.diff @@ -1,21 +1,6 @@ --- old.jsEnumTagOnObjectFrozen.symbols +++ new.jsEnumTagOnObjectFrozen.symbols -@@= skipped -4, +4 lines =@@ - >Thing : Symbol(Thing, Decl(usage.js, 0, 7)) - >useThing : Symbol(useThing, Decl(usage.js, 0, 14)) - >cbThing : Symbol(cbThing, Decl(usage.js, 0, 24)) -->require : Symbol(require) -->"./index" : Symbol("index", Decl(index.js, 0, 0)) - - useThing(Thing.a); - >useThing : Symbol(useThing, Decl(usage.js, 0, 14)) -->Thing.a : Symbol(a, Decl(index.js, 1, 29)) - >Thing : Symbol(Thing, Decl(usage.js, 0, 7)) -->a : Symbol(a, Decl(index.js, 1, 29)) - - /** - * @typedef {Object} LogEntry -@@= skipped -25, +21 lines =@@ +@@= skipped -29, +29 lines =@@ time: Date.now(), >time : Symbol(time, Decl(usage.js, 12, 22)) @@ -27,55 +12,47 @@ type, >type : Symbol(type, Decl(usage.js, 13, 25)) -@@= skipped -10, +10 lines =@@ - }; - }); - --=== index.js === --/** @enum {string} */ --const Thing = Object.freeze({ +@@= skipped -13, +13 lines =@@ + === index.js === + /** @enum {string} */ + const Thing = Object.freeze({ ->Thing : Symbol(Thing, Decl(index.js, 1, 5), Decl(index.js, 0, 4)) ->Object.freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Thing : Symbol(Thing, Decl(index.js, 1, 5)) ++>Object.freeze : Symbol(freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->freeze : Symbol(ObjectConstructor.freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) -- -- a: "thing", -->a : Symbol(a, Decl(index.js, 1, 29)) -- -- b: "chill" -->b : Symbol(b, Decl(index.js, 2, 15)) -- --}); -- --exports.Thing = Thing; -->exports.Thing : Symbol(Thing, Decl(index.js, 4, 3)) ++>freeze : Symbol(freeze, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + + a: "thing", + >a : Symbol(a, Decl(index.js, 1, 29)) +@@= skipped -15, +15 lines =@@ + + exports.Thing = Thing; + >exports.Thing : Symbol(Thing, Decl(index.js, 4, 3)) ->exports : Symbol(Thing, Decl(index.js, 4, 3)) -->Thing : Symbol(Thing, Decl(index.js, 4, 3)) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >Thing : Symbol(Thing, Decl(index.js, 4, 3)) ->Thing : Symbol(Thing, Decl(index.js, 1, 5), Decl(index.js, 0, 4)) -- --/** -- * @param {Thing} x -- */ --function useThing(x) {} -->useThing : Symbol(useThing, Decl(index.js, 6, 22)) -->x : Symbol(x, Decl(index.js, 11, 18)) -- --exports.useThing = useThing; -->exports.useThing : Symbol(useThing, Decl(index.js, 11, 23)) ++>Thing : Symbol(Thing, Decl(index.js, 1, 5)) + + /** + * @param {Thing} x +@@= skipped -13, +13 lines =@@ + + exports.useThing = useThing; + >exports.useThing : Symbol(useThing, Decl(index.js, 11, 23)) ->exports : Symbol(useThing, Decl(index.js, 11, 23)) -->useThing : Symbol(useThing, Decl(index.js, 11, 23)) -->useThing : Symbol(useThing, Decl(index.js, 6, 22)) -- --/** -- * @param {(x: Thing) => void} x -- */ --function cbThing(x) {} -->cbThing : Symbol(cbThing, Decl(index.js, 13, 28)) -->x : Symbol(x, Decl(index.js, 18, 17)) -- --exports.cbThing = cbThing; -->exports.cbThing : Symbol(cbThing, Decl(index.js, 18, 22)) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >useThing : Symbol(useThing, Decl(index.js, 11, 23)) + >useThing : Symbol(useThing, Decl(index.js, 6, 22)) + +@@= skipped -13, +13 lines =@@ + + exports.cbThing = cbThing; + >exports.cbThing : Symbol(cbThing, Decl(index.js, 18, 22)) ->exports : Symbol(cbThing, Decl(index.js, 18, 22)) -->cbThing : Symbol(cbThing, Decl(index.js, 18, 22)) -->cbThing : Symbol(cbThing, Decl(index.js, 13, 28)) -- ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >cbThing : Symbol(cbThing, Decl(index.js, 18, 22)) + >cbThing : Symbol(cbThing, Decl(index.js, 13, 28)) + diff --git a/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.types b/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.types index a845130443..622e802463 100644 --- a/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.types +++ b/testdata/baselines/reference/submodule/compiler/jsEnumTagOnObjectFrozen.types @@ -2,19 +2,19 @@ === usage.js === const { Thing, useThing, cbThing } = require("./index"); ->Thing : any ->useThing : any ->cbThing : any ->require("./index") : any +>Thing : Readonly<{ a: "thing"; b: "chill"; }> +>useThing : (x: Thing) => void +>cbThing : (x: (x: Thing) => void) => void +>require("./index") : typeof import("index") >require : any >"./index" : "./index" useThing(Thing.a); ->useThing(Thing.a) : any ->useThing : any ->Thing.a : any ->Thing : any ->a : any +>useThing(Thing.a) : void +>useThing : (x: Thing) => void +>Thing.a : "thing" +>Thing : Readonly<{ a: "thing"; b: "chill"; }> +>a : "thing" /** * @typedef {Object} LogEntry @@ -23,15 +23,15 @@ useThing(Thing.a); */ cbThing(type => { ->cbThing(type => { /** @type {LogEntry} */ const logEntry = { time: Date.now(), type, };}) : any ->cbThing : any ->type => { /** @type {LogEntry} */ const logEntry = { time: Date.now(), type, };} : (type: any) => void ->type : any +>cbThing(type => { /** @type {LogEntry} */ const logEntry = { time: Date.now(), type, };}) : void +>cbThing : (x: (x: Thing) => void) => void +>type => { /** @type {LogEntry} */ const logEntry = { time: Date.now(), type, };} : (type: Thing) => void +>type : Thing /** @type {LogEntry} */ const logEntry = { >logEntry : LogEntry ->{ time: Date.now(), type, } : { time: number; type: any; } +>{ time: Date.now(), type, } : { time: number; type: Thing; } time: Date.now(), >time : number @@ -41,8 +41,63 @@ cbThing(type => { >now : () => number type, ->type : any +>type : Thing }; }); +=== index.js === +/** @enum {string} */ +const Thing = Object.freeze({ +>Thing : Readonly<{ a: "thing"; b: "chill"; }> +>Object.freeze({ a: "thing", b: "chill"}) : Readonly<{ a: "thing"; b: "chill"; }> +>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>Object : ObjectConstructor +>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } +>{ a: "thing", b: "chill"} : { a: "thing"; b: "chill"; } + + a: "thing", +>a : "thing" +>"thing" : "thing" + + b: "chill" +>b : "chill" +>"chill" : "chill" + +}); + +exports.Thing = Thing; +>exports.Thing = Thing : Readonly<{ a: "thing"; b: "chill"; }> +>exports.Thing : Readonly<{ a: "thing"; b: "chill"; }> +>exports : typeof import("index") +>Thing : Readonly<{ a: "thing"; b: "chill"; }> +>Thing : Readonly<{ a: "thing"; b: "chill"; }> + +/** + * @param {Thing} x + */ +function useThing(x) {} +>useThing : (x: Thing) => void +>x : Thing + +exports.useThing = useThing; +>exports.useThing = useThing : (x: Thing) => void +>exports.useThing : (x: Thing) => void +>exports : typeof import("index") +>useThing : (x: Thing) => void +>useThing : (x: Thing) => void + +/** + * @param {(x: Thing) => void} x + */ +function cbThing(x) {} +>cbThing : (x: (x: Thing) => void) => void +>x : (x: Thing) => void + +exports.cbThing = cbThing; +>exports.cbThing = cbThing : (x: (x: Thing) => void) => void +>exports.cbThing : (x: (x: Thing) => void) => void +>exports : typeof import("index") +>cbThing : (x: (x: Thing) => void) => void +>cbThing : (x: (x: Thing) => void) => void + diff --git a/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.errors.txt b/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.errors.txt index 394b2ac20f..8a5ba320ee 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.errors.txt @@ -1,5 +1,5 @@ -file.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -file.js(8,1): error TS2304: Cannot find name 'exports'. +file.js(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +file.js(8,9): error TS2339: Property 'customSymbol2' does not exist on type 'typeof import("file")'. ==== file.js (2 errors) ==== @@ -7,11 +7,13 @@ file.js(8,1): error TS2304: Cannot find name 'exports'. // This is a common pattern in Node’s built-in modules: module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~ customSymbol, + ~~~~~~~~~~~~~~~~~ }; + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. exports.customSymbol2 = Symbol("custom"); - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. \ No newline at end of file + ~~~~~~~~~~~~~ +!!! error TS2339: Property 'customSymbol2' does not exist on type 'typeof import("file")'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.symbols b/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.symbols index c2b54ad864..916f7562f3 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.symbols @@ -7,11 +7,16 @@ const customSymbol = Symbol("custom"); // This is a common pattern in Node’s built-in modules: module.exports = { +>module.exports : Symbol(export=, Decl(file.js, 0, 38)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(file.js, 0, 38)) + customSymbol, >customSymbol : Symbol(customSymbol, Decl(file.js, 3, 18)) }; exports.customSymbol2 = Symbol("custom"); +>exports : Symbol("file", Decl(file.js, 0, 0)) >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.symbols.diff index fecda73499..3b1a4f4ef6 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.symbols.diff @@ -7,15 +7,19 @@ ->module.exports : Symbol(module.exports, Decl(file.js, 0, 0)) ->module : Symbol(module, Decl(file.js, 0, 38)) ->exports : Symbol(module.exports, Decl(file.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(file.js, 0, 38)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(file.js, 0, 38)) + customSymbol, >customSymbol : Symbol(customSymbol, Decl(file.js, 3, 18)) - +@@= skipped -10, +10 lines =@@ }; exports.customSymbol2 = Symbol("custom"); ->exports.customSymbol2 : Symbol(customSymbol2, Decl(file.js, 5, 2)) ->exports : Symbol(customSymbol2, Decl(file.js, 5, 2)) ->customSymbol2 : Symbol(customSymbol2, Decl(file.js, 5, 2)) ++>exports : Symbol("file", Decl(file.js, 0, 0)) >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.types b/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.types index 6ee967a785..1dc6f0601f 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.types +++ b/testdata/baselines/reference/submodule/compiler/jsExportAssignmentNonMutableLocation.types @@ -10,9 +10,9 @@ const customSymbol = Symbol("custom"); // This is a common pattern in Node’s built-in modules: module.exports = { >module.exports = { customSymbol,} : { customSymbol: symbol; } ->module.exports : any ->module : any ->exports : any +>module.exports : { customSymbol: symbol; } +>module : { export=: { customSymbol: symbol; }; } +>exports : { customSymbol: symbol; } >{ customSymbol,} : { customSymbol: symbol; } customSymbol, @@ -23,7 +23,7 @@ module.exports = { exports.customSymbol2 = Symbol("custom"); >exports.customSymbol2 = Symbol("custom") : symbol >exports.customSymbol2 : any ->exports : any +>exports : typeof import("file") >customSymbol2 : any >Symbol("custom") : symbol >Symbol : SymbolConstructor diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.errors.txt b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.errors.txt index fe88096da2..b210254502 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.errors.txt @@ -1,28 +1,26 @@ -/index.ts(1,23): error TS2306: File '/test.js' is not a module. -/index.ts(3,16): error TS2306: File '/test.js' is not a module. -/test.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/index.ts(1,23): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. +/index.ts(3,16): error TS2671: Cannot augment module './test' because it resolves to a non-module entity. +/index.ts(11,10): error TS2749: 'Abcde' refers to a value, but is being used as a type here. Did you mean 'typeof Abcde'? -==== /test.js (1 errors) ==== +==== /test.js (0 errors) ==== class Abcde { /** @type {string} */ x; } module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. Abcde }; -==== /index.ts (2 errors) ==== +==== /index.ts (3 errors) ==== import { Abcde } from "./test"; ~~~~~~~~ -!!! error TS2306: File '/test.js' is not a module. +!!! error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. declare module "./test" { ~~~~~~~~ -!!! error TS2306: File '/test.js' is not a module. +!!! error TS2671: Cannot augment module './test' because it resolves to a non-module entity. interface Abcde { b: string } } @@ -31,4 +29,6 @@ // Bug: the type meaning from /test.js does not // propagate through the object literal export. const x: Abcde = { b: "" }; + ~~~~~ +!!! error TS2749: 'Abcde' refers to a value, but is being used as a type here. Did you mean 'typeof Abcde'? \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.symbols b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.symbols index 3c4e485aa6..c65e161b89 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.symbols @@ -10,6 +10,10 @@ class Abcde { } module.exports = { +>module.exports : Symbol(export=, Decl(test.js, 3, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(test.js, 3, 1)) + Abcde >Abcde : Symbol(Abcde, Decl(test.js, 5, 18)) @@ -28,12 +32,14 @@ declare module "./test" { } new Abcde().x; +>new Abcde().x : Symbol(x, Decl(test.js, 0, 13)) >Abcde : Symbol(Abcde, Decl(index.ts, 0, 8)) +>x : Symbol(x, Decl(test.js, 0, 13)) // Bug: the type meaning from /test.js does not // propagate through the object literal export. const x: Abcde = { b: "" }; >x : Symbol(x, Decl(index.ts, 10, 5)) ->Abcde : Symbol(Abcde, Decl(index.ts, 0, 8)) +>Abcde : Symbol(Abcde) >b : Symbol(b, Decl(index.ts, 10, 18)) diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.symbols.diff index cbe33aeb3c..6b729792d5 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.symbols.diff @@ -17,11 +17,13 @@ ->module.exports : Symbol("/test.js", Decl(test.js, 0, 0), Decl(index.ts, 0, 31)) ->module : Symbol(module, Decl(test.js, 3, 1)) ->exports : Symbol("/test.js", Decl(test.js, 0, 0), Decl(index.ts, 0, 31)) -- ++>module.exports : Symbol(export=, Decl(test.js, 3, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(test.js, 3, 1)) + Abcde >Abcde : Symbol(Abcde, Decl(test.js, 5, 18)) - -@@= skipped -22, +18 lines =@@ +@@= skipped -22, +22 lines =@@ >Abcde : Symbol(Abcde, Decl(index.ts, 0, 8)) declare module "./test" { @@ -37,8 +39,16 @@ new Abcde().x; ->new Abcde().x : Symbol(Abcde.x, Decl(test.js, 0, 13)) ++>new Abcde().x : Symbol(x, Decl(test.js, 0, 13)) >Abcde : Symbol(Abcde, Decl(index.ts, 0, 8)) ->x : Symbol(Abcde.x, Decl(test.js, 0, 13)) ++>x : Symbol(x, Decl(test.js, 0, 13)) // Bug: the type meaning from /test.js does not // propagate through the object literal export. + const x: Abcde = { b: "" }; + >x : Symbol(x, Decl(index.ts, 10, 5)) +->Abcde : Symbol(Abcde, Decl(index.ts, 0, 8)) ++>Abcde : Symbol(Abcde) + >b : Symbol(b, Decl(index.ts, 10, 18)) + diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.types b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.types index da00b8944d..497b6e9732 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.types +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation.types @@ -11,9 +11,9 @@ class Abcde { module.exports = { >module.exports = { Abcde} : { Abcde: typeof Abcde; } ->module.exports : any ->module : any ->exports : any +>module.exports : { Abcde: typeof Abcde; } +>module : { export=: { Abcde: typeof Abcde; }; } +>exports : { Abcde: typeof Abcde; } >{ Abcde} : { Abcde: typeof Abcde; } Abcde @@ -23,7 +23,7 @@ module.exports = { === /index.ts === import { Abcde } from "./test"; ->Abcde : any +>Abcde : typeof Abcde declare module "./test" { >"./test" : any @@ -33,10 +33,10 @@ declare module "./test" { } new Abcde().x; ->new Abcde().x : any ->new Abcde() : any ->Abcde : any ->x : any +>new Abcde().x : string +>new Abcde() : Abcde +>Abcde : typeof Abcde +>x : string // Bug: the type meaning from /test.js does not // propagate through the object literal export. diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.errors.txt b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.errors.txt index 68e0d763b8..4a8d07e7d0 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.errors.txt @@ -1,25 +1,25 @@ -/index.ts(1,19): error TS2306: File '/test.js' is not a module. -/index.ts(3,16): error TS2306: File '/test.js' is not a module. -/test.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/index.ts(1,19): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. +/index.ts(3,16): error TS2671: Cannot augment module './test' because it resolves to a non-module entity. +/index.ts(7,3): error TS2339: Property 'toFixed' does not exist on type 'string'. -==== /test.js (1 errors) ==== +==== /test.js (0 errors) ==== module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. a: "ok" }; -==== /index.ts (2 errors) ==== +==== /index.ts (3 errors) ==== import { a } from "./test"; ~~~~~~~~ -!!! error TS2306: File '/test.js' is not a module. +!!! error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. declare module "./test" { ~~~~~~~~ -!!! error TS2306: File '/test.js' is not a module. +!!! error TS2671: Cannot augment module './test' because it resolves to a non-module entity. export const a: number; } a.toFixed(); + ~~~~~~~ +!!! error TS2339: Property 'toFixed' does not exist on type 'string'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.symbols b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.symbols index 196cd06bb5..affbb5282d 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.symbols @@ -2,6 +2,10 @@ === /test.js === module.exports = { +>module.exports : Symbol(export=, Decl(test.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(test.js, 0, 0)) + a: "ok" >a : Symbol(a, Decl(test.js, 0, 18)) diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.symbols.diff index fd6a7bfee1..26d41ef8c4 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.symbols.diff @@ -7,11 +7,13 @@ ->module.exports : Symbol(module.exports, Decl(test.js, 0, 0)) ->module : Symbol("/test.js", Decl(test.js, 0, 0), Decl(index.ts, 0, 27)) ->exports : Symbol("/test.js", Decl(test.js, 0, 0), Decl(index.ts, 0, 27)) -- ++>module.exports : Symbol(export=, Decl(test.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(test.js, 0, 0)) + a: "ok" >a : Symbol(a, Decl(test.js, 0, 18)) - -@@= skipped -14, +10 lines =@@ +@@= skipped -14, +14 lines =@@ >a : Symbol(a, Decl(index.ts, 0, 8)) declare module "./test" { diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.types b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.types index 82adbcc91d..59f87990fc 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.types +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation2.types @@ -3,9 +3,9 @@ === /test.js === module.exports = { >module.exports = { a: "ok"} : { a: string; } ->module.exports : any ->module : any ->exports : any +>module.exports : { a: string; } +>module : { export=: { a: string; }; } +>exports : { a: string; } >{ a: "ok"} : { a: string; } a: "ok" @@ -16,7 +16,7 @@ module.exports = { === /index.ts === import { a } from "./test"; ->a : any +>a : string declare module "./test" { >"./test" : typeof import("./test") @@ -28,6 +28,6 @@ declare module "./test" { a.toFixed(); >a.toFixed() : any >a.toFixed : any ->a : any +>a : string >toFixed : any diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.errors.txt b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.errors.txt index ceeb582842..394d49133f 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.errors.txt @@ -1,15 +1,12 @@ -/x.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -/x.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/x.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. /x.js(2,18): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== /x.js (3 errors) ==== +==== /x.js (2 errors) ==== module.exports.x = 1; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports = require("./y.js"); - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. ~~~~~~~ !!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.symbols b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.symbols index 9047f0106e..9d49de2d46 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.symbols @@ -1,9 +1,15 @@ //// [tests/cases/compiler/jsExportMemberMergedWithModuleAugmentation3.ts] //// === /x.js === - module.exports.x = 1; +>module.exports : Symbol(export=, Decl(x.js, 0, 21)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(x.js, 0, 21)) + module.exports = require("./y.js"); +>module.exports : Symbol(export=, Decl(x.js, 0, 21)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(x.js, 0, 21)) === /y.d.ts === export declare type x = 1; diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.symbols.diff index 1099102c9d..cc0baee1c4 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.symbols.diff @@ -1,21 +1,24 @@ --- old.jsExportMemberMergedWithModuleAugmentation3.symbols +++ new.jsExportMemberMergedWithModuleAugmentation3.symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/compiler/jsExportMemberMergedWithModuleAugmentation3.ts] //// +@@= skipped -1, +1 lines =@@ === /x.js === --module.exports.x = 1; + module.exports.x = 1; ->module.exports.x : Symbol(x, Decl(x.js, 0, 0), Decl(y.d.ts, 0, 0)) ->module.exports : Symbol(x, Decl(x.js, 0, 0), Decl(y.d.ts, 0, 0)) ->module : Symbol(module, Decl(x.js, 0, 0)) ->exports : Symbol(module.exports, Decl(x.js, 0, 0)) ->x : Symbol(x, Decl(x.js, 0, 0), Decl(y.d.ts, 0, 0)) ++>module.exports : Symbol(export=, Decl(x.js, 0, 21)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(x.js, 0, 21)) -+module.exports.x = 1; module.exports = require("./y.js"); ->module.exports : Symbol(module.exports, Decl(x.js, 0, 0)) ->module : Symbol(export=, Decl(x.js, 0, 21)) -->exports : Symbol(export=, Decl(x.js, 0, 21)) ++>module.exports : Symbol(export=, Decl(x.js, 0, 21)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(x.js, 0, 21)) ->require : Symbol(require) ->"./y.js" : Symbol("/y", Decl(y.d.ts, 0, 0)) diff --git a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.types b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.types index 8f4c5a591e..111fc5d103 100644 --- a/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.types +++ b/testdata/baselines/reference/submodule/compiler/jsExportMemberMergedWithModuleAugmentation3.types @@ -5,7 +5,7 @@ module.exports.x = 1; >module.exports.x = 1 : 1 >module.exports.x : any >module.exports : any ->module : any +>module : { export=: any; } >exports : any >x : any >1 : 1 @@ -13,7 +13,7 @@ module.exports.x = 1; module.exports = require("./y.js"); >module.exports = require("./y.js") : any >module.exports : any ->module : any +>module : { export=: any; } >exports : any >require("./y.js") : any >require : any diff --git a/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.errors.txt b/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.errors.txt index 4046d09306..d5b7b24ef7 100644 --- a/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.errors.txt @@ -1,11 +1,8 @@ -foo.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. foo.js(4,10): error TS2339: Property 'b' does not exist on type 'typeof A'. -==== foo.js (2 errors) ==== +==== foo.js (1 errors) ==== module.exports = function () { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. class A { } return { c: A.b = 1, diff --git a/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.symbols b/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.symbols index b67670cf36..0d43d5d884 100644 --- a/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.symbols @@ -2,6 +2,10 @@ === foo.js === module.exports = function () { +>module.exports : Symbol(export=, Decl(foo.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(foo.js, 0, 0)) + class A { } >A : Symbol(A, Decl(foo.js, 0, 30)) diff --git a/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.symbols.diff index f1e077a653..a834d26600 100644 --- a/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.symbols.diff @@ -6,8 +6,8 @@ module.exports = function () { ->module.exports : Symbol(module.exports, Decl(foo.js, 0, 0)) ->module : Symbol(export=, Decl(foo.js, 0, 0)) -->exports : Symbol(export=, Decl(foo.js, 0, 0)) -- - class A { } - >A : Symbol(A, Decl(foo.js, 0, 30)) ++>module.exports : Symbol(export=, Decl(foo.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(foo.js, 0, 0)) + class A { } diff --git a/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.types b/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.types index 710862b850..8efabd3bca 100644 --- a/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.types +++ b/testdata/baselines/reference/submodule/compiler/jsFileClassPropertyInitalizationInObjectLiteral.types @@ -3,9 +3,9 @@ === foo.js === module.exports = function () { >module.exports = function () { class A { } return { c: A.b = 1, }} : () => { c: number; } ->module.exports : any ->module : any ->exports : any +>module.exports : () => { c: number; } +>module : { export=: () => { c: number; }; } +>exports : () => { c: number; } >function () { class A { } return { c: A.b = 1, }} : () => { c: number; } class A { } diff --git a/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.errors.txt b/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.errors.txt index 7e2863240d..eea2697f49 100644 --- a/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.errors.txt @@ -1,8 +1,7 @@ moduleA/a.js(1,17): error TS2306: File 'node_modules/b.ts' is not a module. moduleA/a.js(2,1): error TS2632: Cannot assign to 'a' because it is an import. -moduleA/a.js(3,17): error TS2306: File 'node_modules/c.js' is not a module. +moduleA/a.js(3,9): error TS2305: Module '"node_modules/c"' has no exported member 'c'. moduleA/a.js(4,1): error TS2632: Cannot assign to 'c' because it is an import. -node_modules/c.js(1,1): error TS2304: Cannot find name 'exports'. node_modules/c.js(2,1): error TS2304: Cannot find name 'c'. @@ -14,8 +13,8 @@ node_modules/c.js(2,1): error TS2304: Cannot find name 'c'. ~ !!! error TS2632: Cannot assign to 'a' because it is an import. import {c} from "c"; - ~~~ -!!! error TS2306: File 'node_modules/c.js' is not a module. + ~ +!!! error TS2305: Module '"node_modules/c"' has no exported member 'c'. c++; ~ !!! error TS2632: Cannot assign to 'c' because it is an import. @@ -23,10 +22,8 @@ node_modules/c.js(2,1): error TS2304: Cannot find name 'c'. ==== node_modules/b.ts (0 errors) ==== var a = 10; -==== node_modules/c.js (2 errors) ==== +==== node_modules/c.js (1 errors) ==== exports.a = 10; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. c = 10; ~ !!! error TS2304: Cannot find name 'c'. diff --git a/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.symbols b/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.symbols index d40c473ef7..33e46242e1 100644 --- a/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.symbols @@ -18,7 +18,10 @@ var a = 10; >a : Symbol(a, Decl(b.ts, 0, 3)) === node_modules/c.js === - exports.a = 10; +>exports.a : Symbol(a, Decl(c.js, 0, 0)) +>exports : Symbol("node_modules/c", Decl(c.js, 0, 0)) +>a : Symbol(a, Decl(c.js, 0, 0)) + c = 10; diff --git a/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.symbols.diff index 564095ca9e..51fc9372ff 100644 --- a/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.symbols.diff @@ -1,14 +1,11 @@ --- old.jsFileCompilationExternalPackageError.symbols +++ new.jsFileCompilationExternalPackageError.symbols -@@= skipped -17, +17 lines =@@ - >a : Symbol(a, Decl(b.ts, 0, 3)) - +@@= skipped -19, +19 lines =@@ === node_modules/c.js === --exports.a = 10; -->exports.a : Symbol(a, Decl(c.js, 0, 0)) + exports.a = 10; + >exports.a : Symbol(a, Decl(c.js, 0, 0)) ->exports : Symbol(a, Decl(c.js, 0, 0)) -->a : Symbol(a, Decl(c.js, 0, 0)) ++>exports : Symbol("node_modules/c", Decl(c.js, 0, 0)) + >a : Symbol(a, Decl(c.js, 0, 0)) -+exports.a = 10; c = 10; - diff --git a/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.types b/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.types index 77d372576a..214d88cded 100644 --- a/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.types +++ b/testdata/baselines/reference/submodule/compiler/jsFileCompilationExternalPackageError.types @@ -23,9 +23,9 @@ var a = 10; === node_modules/c.js === exports.a = 10; >exports.a = 10 : 10 ->exports.a : any ->exports : any ->a : any +>exports.a : 10 +>exports : typeof import("node_modules/c") +>a : 10 >10 : 10 c = 10; diff --git a/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.errors.txt b/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.errors.txt index 99e0ade31c..5db1b60f68 100644 --- a/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.errors.txt @@ -1,13 +1,13 @@ -a.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +a.js(4,1): error TS2686: 'Puppeteer' refers to a UMD global, but the current file is a module. Consider adding an import instead. ==== a.js (1 errors) ==== const other = require('./other'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** @type {Puppeteer.Keyboard} */ var ppk; Puppeteer.connect; + ~~~~~~~~~ +!!! error TS2686: 'Puppeteer' refers to a UMD global, but the current file is a module. Consider adding an import instead. ==== puppet.d.ts (0 errors) ==== export as namespace Puppeteer; export interface Keyboard { diff --git a/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.symbols b/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.symbols index 9ed3250711..2026d84cff 100644 --- a/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.symbols +++ b/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.symbols @@ -3,6 +3,8 @@ === a.js === const other = require('./other'); >other : Symbol(other, Decl(a.js, 0, 5)) +>require : Symbol(require) +>'./other' : Symbol("other", Decl(other.d.ts, 0, 0)) /** @type {Puppeteer.Keyboard} */ var ppk; diff --git a/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.symbols.diff b/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.symbols.diff index cc29a0c8bc..deea9cc9e0 100644 --- a/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.symbols.diff @@ -1,14 +1,6 @@ --- old.jsdocReferenceGlobalTypeInCommonJs.symbols +++ new.jsdocReferenceGlobalTypeInCommonJs.symbols -@@= skipped -2, +2 lines =@@ - === a.js === - const other = require('./other'); - >other : Symbol(other, Decl(a.js, 0, 5)) -->require : Symbol(require) -->'./other' : Symbol("other", Decl(other.d.ts, 0, 0)) - - /** @type {Puppeteer.Keyboard} */ - var ppk; +@@= skipped -10, +10 lines =@@ >ppk : Symbol(ppk, Decl(a.js, 2, 3)) Puppeteer.connect; @@ -20,7 +12,7 @@ === puppet.d.ts === export as namespace Puppeteer; -@@= skipped -20, +18 lines =@@ +@@= skipped -12, +12 lines =@@ >Keyboard : Symbol(Keyboard, Decl(puppet.d.ts, 0, 30)) key: string diff --git a/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.types b/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.types index 8df103b0e1..c45c1345a3 100644 --- a/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.types +++ b/testdata/baselines/reference/submodule/compiler/jsdocReferenceGlobalTypeInCommonJs.types @@ -2,8 +2,8 @@ === a.js === const other = require('./other'); ->other : any ->require('./other') : any +>other : () => string +>require('./other') : () => string >require : any >'./other' : "./other" diff --git a/testdata/baselines/reference/submodule/compiler/localRequireFunction.errors.txt b/testdata/baselines/reference/submodule/compiler/localRequireFunction.errors.txt new file mode 100644 index 0000000000..34011fa69c --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/localRequireFunction.errors.txt @@ -0,0 +1,15 @@ +app.js(1,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. +app.js(5,20): error TS2307: Cannot find module 'fs' or its corresponding type declarations. + + +==== app.js (2 errors) ==== + function require(a) { + ~~~~~~~ +!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. + return a; + } + + const fs = require("fs"); + ~~~~ +!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations. + const text = fs.readFileSync("/a/b/c"); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.symbols b/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.symbols index 909c682255..17104ab2ab 100644 --- a/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.symbols +++ b/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.symbols @@ -22,3 +22,27 @@ foo.y // ignored from shortid/index.js >foo : Symbol(foo, Decl(index.ts, 1, 6)) +=== /node_modules/shortid/node_modules/z/index.js === +// z will not be found because maxNodeModulesJsDepth: 0 +module.exports = { z: 'no' }; +>module.exports : Symbol(export=, Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 0, 0)) +>z : Symbol(z, Decl(index.js, 1, 18)) + +=== /node_modules/shortid/index.js === +var z = require('z'); +>z : Symbol(z, Decl(index.js, 0, 3)) +>require : Symbol(require) +>'z' : Symbol("/node_modules/shortid/node_modules/z/index", Decl(index.js, 0, 0)) + +var y = { y: 'foo' }; +>y : Symbol(y, Decl(index.js, 1, 3)) +>y : Symbol(y, Decl(index.js, 1, 9)) + +module.exports = y; +>module.exports : Symbol(y, Decl(index.js, 1, 3)) +>module : Symbol(module.exports) +>exports : Symbol(y, Decl(index.js, 1, 3)) +>y : Symbol(y, Decl(index.js, 1, 3)) + diff --git a/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.symbols.diff b/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.symbols.diff index 9c58016d30..f65a01da1c 100644 --- a/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.symbols.diff @@ -12,3 +12,29 @@ foo.y // ignored from shortid/index.js >foo : Symbol(foo, Decl(index.ts, 1, 6)) + + ++=== /node_modules/shortid/node_modules/z/index.js === ++// z will not be found because maxNodeModulesJsDepth: 0 ++module.exports = { z: 'no' }; ++>module.exports : Symbol(export=, Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(index.js, 0, 0)) ++>z : Symbol(z, Decl(index.js, 1, 18)) ++ ++=== /node_modules/shortid/index.js === ++var z = require('z'); ++>z : Symbol(z, Decl(index.js, 0, 3)) ++>require : Symbol(require) ++>'z' : Symbol("/node_modules/shortid/node_modules/z/index", Decl(index.js, 0, 0)) ++ ++var y = { y: 'foo' }; ++>y : Symbol(y, Decl(index.js, 1, 3)) ++>y : Symbol(y, Decl(index.js, 1, 9)) ++ ++module.exports = y; ++>module.exports : Symbol(y, Decl(index.js, 1, 3)) ++>module : Symbol(module.exports) ++>exports : Symbol(y, Decl(index.js, 1, 3)) ++>y : Symbol(y, Decl(index.js, 1, 3)) ++ diff --git a/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.types b/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.types index f46176af2b..04e5662c06 100644 --- a/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.types +++ b/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.types @@ -24,3 +24,34 @@ foo.y // ignored from shortid/index.js >y : any +=== /node_modules/shortid/node_modules/z/index.js === +// z will not be found because maxNodeModulesJsDepth: 0 +module.exports = { z: 'no' }; +>module.exports = { z: 'no' } : { z: string; } +>module.exports : { z: string; } +>module : { export=: { z: string; }; } +>exports : { z: string; } +>{ z: 'no' } : { z: string; } +>z : string +>'no' : "no" + +=== /node_modules/shortid/index.js === +var z = require('z'); +>z : { z: string; } +>require('z') : { z: string; } +>require : any +>'z' : "z" + +var y = { y: 'foo' }; +>y : { y: string; } +>{ y: 'foo' } : { y: string; } +>y : string +>'foo' : "foo" + +module.exports = y; +>module.exports = y : { y: string; } +>module.exports : { y: string; } +>module : { y: { y: string; }; } +>exports : { y: string; } +>y : { y: string; } + diff --git a/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.types.diff b/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.types.diff deleted file mode 100644 index 2db5147350..0000000000 --- a/testdata/baselines/reference/submodule/compiler/maxNodeModuleJsDepthDefaultsToZero.types.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.maxNodeModuleJsDepthDefaultsToZero.types -+++ new.maxNodeModuleJsDepthDefaultsToZero.types -@@= skipped -10, +10 lines =@@ - === /index.ts === - /// - import * as foo from "shortid"; -->foo : typeof foo -+>foo : typeof import("shortid") - - foo.x // found in index.d.ts - >foo.x : number -->foo : typeof foo -+>foo : typeof import("shortid") - >x : number - - foo.y // ignored from shortid/index.js - >foo.y : any -->foo : typeof foo -+>foo : typeof import("shortid") - >y : any - - diff --git a/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.errors.txt b/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.errors.txt index 3e210e2f52..fd2276e9f7 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.errors.txt @@ -1,14 +1,10 @@ -eslint.config.js(1,21): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -eslint.config.js(2,18): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +typescript-eslint.js(12,17): error TS7019: Rest parameter 'configs' implicitly has an 'any[]' type. +typescript-eslint.js(14,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== eslint.config.js (2 errors) ==== +==== eslint.config.js (0 errors) ==== const eslintReact = require('./eslint-plugin-react.js'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. const tseslint = require('./typescript-eslint.js'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. tseslint.config(eslintReact) @@ -30,7 +26,7 @@ eslint.config.js(2,18): error TS2580: Cannot find name 'require'. Do you need to }, }; -==== typescript-eslint.js (0 errors) ==== +==== typescript-eslint.js (2 errors) ==== /** * @typedef {{ rules: Record }} Plugin */ @@ -43,6 +39,10 @@ eslint.config.js(2,18): error TS2580: Cannot find name 'require'. Do you need to * @type {(...configs: Config[]) => void} */ function config(...configs) { } + ~~~~~~~~~~ +!!! error TS7019: Rest parameter 'configs' implicitly has an 'any[]' type. module.exports = { config }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.symbols b/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.symbols index 15103b5452..5ea722d79d 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.symbols +++ b/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.symbols @@ -3,11 +3,76 @@ === eslint.config.js === const eslintReact = require('./eslint-plugin-react.js'); >eslintReact : Symbol(eslintReact, Decl(eslint.config.js, 0, 5)) +>require : Symbol(require) +>'./eslint-plugin-react.js' : Symbol("eslint-plugin-react", Decl(eslint-plugin-react.js, 0, 0)) const tseslint = require('./typescript-eslint.js'); >tseslint : Symbol(tseslint, Decl(eslint.config.js, 1, 5)) +>require : Symbol(require) +>'./typescript-eslint.js' : Symbol("typescript-eslint", Decl(typescript-eslint.js, 0, 0)) tseslint.config(eslintReact) +>tseslint.config : Symbol(config, Decl(typescript-eslint.js, 13, 18)) >tseslint : Symbol(tseslint, Decl(eslint.config.js, 1, 5)) +>config : Symbol(config, Decl(typescript-eslint.js, 13, 18)) >eslintReact : Symbol(eslintReact, Decl(eslint.config.js, 0, 5)) +=== eslint-plugin-react.js === +const deprecatedRules = { +>deprecatedRules : Symbol(deprecatedRules, Decl(eslint-plugin-react.js, 0, 5)) + + "jsx-sort-default-props": true +>"jsx-sort-default-props" : Symbol("jsx-sort-default-props", Decl(eslint-plugin-react.js, 0, 25)) +} + +const allRules = { +>allRules : Symbol(allRules, Decl(eslint-plugin-react.js, 4, 5)) + + 'no-unsafe': true +>'no-unsafe' : Symbol('no-unsafe', Decl(eslint-plugin-react.js, 4, 18)) +} + +module.exports = { +>module.exports : Symbol(export=, Decl(eslint-plugin-react.js, 6, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(eslint-plugin-react.js, 6, 1)) + + plugins: { +>plugins : Symbol(plugins, Decl(eslint-plugin-react.js, 8, 18)) + + react: { +>react : Symbol(react, Decl(eslint-plugin-react.js, 9, 12)) + + deprecatedRules, +>deprecatedRules : Symbol(deprecatedRules, Decl(eslint-plugin-react.js, 10, 12)) + + rules: allRules, +>rules : Symbol(rules, Decl(eslint-plugin-react.js, 11, 22)) +>allRules : Symbol(allRules, Decl(eslint-plugin-react.js, 4, 5)) + + }, + }, +}; + +=== typescript-eslint.js === +/** + * @typedef {{ rules: Record }} Plugin + */ + +/** + * @typedef {{ plugins: Record }} Config + */ + +/** + * @type {(...configs: Config[]) => void} + */ +function config(...configs) { } +>config : Symbol(config, Decl(typescript-eslint.js, 0, 0)) +>configs : Symbol(configs, Decl(typescript-eslint.js, 11, 16)) + +module.exports = { config }; +>module.exports : Symbol(export=, Decl(typescript-eslint.js, 11, 31)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(typescript-eslint.js, 11, 31)) +>config : Symbol(config, Decl(typescript-eslint.js, 13, 18)) + diff --git a/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.symbols.diff b/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.symbols.diff index 5678156400..5850e6b83e 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.symbols.diff @@ -1,79 +1,41 @@ --- old.moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.symbols +++ new.moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.symbols -@@= skipped -2, +2 lines =@@ - === eslint.config.js === - const eslintReact = require('./eslint-plugin-react.js'); - >eslintReact : Symbol(eslintReact, Decl(eslint.config.js, 0, 5)) -->require : Symbol(require) -->'./eslint-plugin-react.js' : Symbol("eslint-plugin-react", Decl(eslint-plugin-react.js, 0, 0)) - +@@= skipped -8, +8 lines =@@ const tseslint = require('./typescript-eslint.js'); >tseslint : Symbol(tseslint, Decl(eslint.config.js, 1, 5)) -->require : Symbol(require) + >require : Symbol(require) ->'./typescript-eslint.js' : Symbol(tseslint, Decl(typescript-eslint.js, 0, 0)) ++>'./typescript-eslint.js' : Symbol("typescript-eslint", Decl(typescript-eslint.js, 0, 0)) tseslint.config(eslintReact) ->tseslint.config : Symbol(tseslint.config, Decl(typescript-eslint.js, 13, 18)) ++>tseslint.config : Symbol(config, Decl(typescript-eslint.js, 13, 18)) >tseslint : Symbol(tseslint, Decl(eslint.config.js, 1, 5)) ->config : Symbol(tseslint.config, Decl(typescript-eslint.js, 13, 18)) ++>config : Symbol(config, Decl(typescript-eslint.js, 13, 18)) >eslintReact : Symbol(eslintReact, Decl(eslint.config.js, 0, 5)) --=== eslint-plugin-react.js === --const deprecatedRules = { -->deprecatedRules : Symbol(deprecatedRules, Decl(eslint-plugin-react.js, 0, 5)) -- -- "jsx-sort-default-props": true -->"jsx-sort-default-props" : Symbol("jsx-sort-default-props", Decl(eslint-plugin-react.js, 0, 25)) --} -- --const allRules = { -->allRules : Symbol(allRules, Decl(eslint-plugin-react.js, 4, 5)) -- -- 'no-unsafe': true -->'no-unsafe' : Symbol('no-unsafe', Decl(eslint-plugin-react.js, 4, 18)) --} -- --module.exports = { + === eslint-plugin-react.js === +@@= skipped -24, +24 lines =@@ + } + + module.exports = { ->module.exports : Symbol(module.exports, Decl(eslint-plugin-react.js, 0, 0)) ->module : Symbol(export=, Decl(eslint-plugin-react.js, 6, 1)) -->exports : Symbol(export=, Decl(eslint-plugin-react.js, 6, 1)) -- -- plugins: { -->plugins : Symbol(plugins, Decl(eslint-plugin-react.js, 8, 18)) -- -- react: { -->react : Symbol(react, Decl(eslint-plugin-react.js, 9, 12)) -- -- deprecatedRules, -->deprecatedRules : Symbol(deprecatedRules, Decl(eslint-plugin-react.js, 10, 12)) -- -- rules: allRules, -->rules : Symbol(rules, Decl(eslint-plugin-react.js, 11, 22)) -->allRules : Symbol(allRules, Decl(eslint-plugin-react.js, 4, 5)) -- -- }, -- }, --}; -- --=== typescript-eslint.js === --/** -- * @typedef {{ rules: Record }} Plugin -- */ -- --/** -- * @typedef {{ plugins: Record }} Config -- */ -- --/** -- * @type {(...configs: Config[]) => void} -- */ --function config(...configs) { } -->config : Symbol(config, Decl(typescript-eslint.js, 0, 0)) -->configs : Symbol(configs, Decl(typescript-eslint.js, 11, 16)) -- --module.exports = { config }; ++>module.exports : Symbol(export=, Decl(eslint-plugin-react.js, 6, 1)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(eslint-plugin-react.js, 6, 1)) + + plugins: { +@@= skipped -38, +38 lines =@@ + >configs : Symbol(configs, Decl(typescript-eslint.js, 11, 16)) + + module.exports = { config }; ->module.exports : Symbol(module.exports, Decl(typescript-eslint.js, 0, 0)) ->module : Symbol(module, Decl(typescript-eslint.js, 11, 31)) ->exports : Symbol(module.exports, Decl(typescript-eslint.js, 0, 0)) -->config : Symbol(config, Decl(typescript-eslint.js, 13, 18)) -- ++>module.exports : Symbol(export=, Decl(typescript-eslint.js, 11, 31)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(typescript-eslint.js, 11, 31)) + >config : Symbol(config, Decl(typescript-eslint.js, 13, 18)) + diff --git a/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.types b/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.types index 464fc0be72..534176a8f3 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.types +++ b/testdata/baselines/reference/submodule/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.types @@ -2,21 +2,90 @@ === eslint.config.js === const eslintReact = require('./eslint-plugin-react.js'); ->eslintReact : any ->require('./eslint-plugin-react.js') : any +>eslintReact : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } +>require('./eslint-plugin-react.js') : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } >require : any >'./eslint-plugin-react.js' : "./eslint-plugin-react.js" const tseslint = require('./typescript-eslint.js'); ->tseslint : any ->require('./typescript-eslint.js') : any +>tseslint : { config: (...configs: any[]) => void; } +>require('./typescript-eslint.js') : { config: (...configs: any[]) => void; } >require : any >'./typescript-eslint.js' : "./typescript-eslint.js" tseslint.config(eslintReact) ->tseslint.config(eslintReact) : any ->tseslint.config : any ->tseslint : any ->config : any ->eslintReact : any +>tseslint.config(eslintReact) : void +>tseslint.config : (...configs: any[]) => void +>tseslint : { config: (...configs: any[]) => void; } +>config : (...configs: any[]) => void +>eslintReact : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } + +=== eslint-plugin-react.js === +const deprecatedRules = { +>deprecatedRules : { "jsx-sort-default-props": boolean; } +>{ "jsx-sort-default-props": true} : { "jsx-sort-default-props": boolean; } + + "jsx-sort-default-props": true +>"jsx-sort-default-props" : boolean +>true : true +} + +const allRules = { +>allRules : { 'no-unsafe': boolean; } +>{ 'no-unsafe': true} : { 'no-unsafe': boolean; } + + 'no-unsafe': true +>'no-unsafe' : boolean +>true : true +} + +module.exports = { +>module.exports = { plugins: { react: { deprecatedRules, rules: allRules, }, },} : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } +>module.exports : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } +>module : { export=: { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; }; } +>exports : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } +>{ plugins: { react: { deprecatedRules, rules: allRules, }, },} : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } + + plugins: { +>plugins : { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; } +>{ react: { deprecatedRules, rules: allRules, }, } : { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; } + + react: { +>react : { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; } +>{ deprecatedRules, rules: allRules, } : { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; } + + deprecatedRules, +>deprecatedRules : { "jsx-sort-default-props": boolean; } + + rules: allRules, +>rules : { 'no-unsafe': boolean; } +>allRules : { 'no-unsafe': boolean; } + + }, + }, +}; + +=== typescript-eslint.js === +/** + * @typedef {{ rules: Record }} Plugin + */ + +/** + * @typedef {{ plugins: Record }} Config + */ + +/** + * @type {(...configs: Config[]) => void} + */ +function config(...configs) { } +>config : (...configs: any[]) => void +>configs : any[] + +module.exports = { config }; +>module.exports = { config } : { config: (...configs: any[]) => void; } +>module.exports : { config: (...configs: any[]) => void; } +>module : { export=: { config: (...configs: any[]) => void; }; } +>exports : { config: (...configs: any[]) => void; } +>{ config } : { config: (...configs: any[]) => void; } +>config : (...configs: any[]) => void diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve2.errors.txt b/testdata/baselines/reference/submodule/compiler/modulePreserve2.errors.txt index 2d57b7fef2..0e9ddf06da 100644 --- a/testdata/baselines/reference/submodule/compiler/modulePreserve2.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve2.errors.txt @@ -1,14 +1,11 @@ /main.js(1,10): error TS2305: Module '"/node_modules/dep/require"' has no exported member 'esm'. -/main.js(2,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== /main.js (2 errors) ==== +==== /main.js (1 errors) ==== import { esm } from "dep"; ~~~ !!! error TS2305: Module '"/node_modules/dep/require"' has no exported member 'esm'. const cjs = require("dep"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== /node_modules/dep/package.json (0 errors) ==== { diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve2.symbols b/testdata/baselines/reference/submodule/compiler/modulePreserve2.symbols index 428574ae8a..dbf47a96fe 100644 --- a/testdata/baselines/reference/submodule/compiler/modulePreserve2.symbols +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve2.symbols @@ -6,6 +6,8 @@ import { esm } from "dep"; const cjs = require("dep"); >cjs : Symbol(cjs, Decl(main.js, 1, 5)) +>require : Symbol(require) +>"dep" : Symbol("/node_modules/dep/require", Decl(require.d.ts, 0, 0)) === /node_modules/dep/require.d.ts === declare const cjs: "cjs"; diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve2.symbols.diff b/testdata/baselines/reference/submodule/compiler/modulePreserve2.symbols.diff index 400fab5042..aaebb392d8 100644 --- a/testdata/baselines/reference/submodule/compiler/modulePreserve2.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve2.symbols.diff @@ -1,11 +1,8 @@ --- old.modulePreserve2.symbols +++ new.modulePreserve2.symbols -@@= skipped -5, +5 lines =@@ - - const cjs = require("dep"); - >cjs : Symbol(cjs, Decl(main.js, 1, 5)) -->require : Symbol(require) -->"dep" : Symbol("/node_modules/dep/require", Decl(require.d.ts, 0, 0)) +@@= skipped -8, +8 lines =@@ + >require : Symbol(require) + >"dep" : Symbol("/node_modules/dep/require", Decl(require.d.ts, 0, 0)) -=== /node_modules/dep/import.d.mts === -export const esm: "esm"; diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve2.types b/testdata/baselines/reference/submodule/compiler/modulePreserve2.types index fee6bac76f..fdb9060a3e 100644 --- a/testdata/baselines/reference/submodule/compiler/modulePreserve2.types +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve2.types @@ -5,8 +5,8 @@ import { esm } from "dep"; >esm : any const cjs = require("dep"); ->cjs : any ->require("dep") : any +>cjs : "cjs" +>require("dep") : "cjs" >require : any >"dep" : "dep" diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt b/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt index 278f546051..7e621b8a24 100644 --- a/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve4.errors.txt @@ -1,40 +1,23 @@ -/a.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /f.cts(1,1): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -/g.js(1,1): error TS2304: Cannot find name 'exports'. -/main1.ts(1,13): error TS2305: Module '"/a"' has no exported member 'y'. /main1.ts(3,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /main1.ts(19,4): error TS2339: Property 'default' does not exist on type '() => void'. -/main1.ts(29,16): error TS2306: File '/g.js' is not a module. -/main1.ts(31,21): error TS2306: File '/g.js' is not a module. -/main2.mts(1,13): error TS2305: Module '"/a"' has no exported member 'y'. +/main1.ts(30,4): error TS2339: Property 'default' does not exist on type '0'. /main2.mts(4,4): error TS2339: Property 'default' does not exist on type 'typeof import("/a")'. /main2.mts(5,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -/main2.mts(19,16): error TS2306: File '/g.js' is not a module. -/main2.mts(20,21): error TS2306: File '/g.js' is not a module. /main3.cjs(1,10): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -/main3.cjs(1,13): error TS2305: Module '"/a"' has no exported member 'y'. -/main3.cjs(3,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/main3.cjs(1,13): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. /main3.cjs(5,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -/main3.cjs(6,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /main3.cjs(8,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -/main3.cjs(9,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /main3.cjs(10,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -/main3.cjs(11,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /main3.cjs(12,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -/main3.cjs(13,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /main3.cjs(14,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -/main3.cjs(15,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -/main3.cjs(17,16): error TS2306: File '/g.js' is not a module. -/main3.cjs(18,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -/main4.cjs(1,1): error TS2304: Cannot find name 'exports'. +/main3.cjs(17,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. /main4.cjs(1,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== /a.js (1 errors) ==== +==== /a.js (0 errors) ==== export const x = 0; module.exports.y = 0; // Error - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== /b.ts (0 errors) ==== export default 0; @@ -55,15 +38,11 @@ ~~~~~~~~~~~~~~~~~ !!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -==== /g.js (1 errors) ==== +==== /g.js (0 errors) ==== exports.default = 0; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. -==== /main1.ts (5 errors) ==== +==== /main1.ts (3 errors) ==== import { x, y } from "./a"; // No y - ~ -!!! error TS2305: Module '"/a"' has no exported member 'y'. import a1 = require("./a"); // { x: 0 } const a2 = require("./a"); // Error in TS ~~~~~~~ @@ -96,18 +75,14 @@ f2.default; import g1 from "./g"; // { default: 0 } - ~~~~~ -!!! error TS2306: File '/g.js' is not a module. g1.default; + ~~~~~~~ +!!! error TS2339: Property 'default' does not exist on type '0'. import g2 = require("./g"); // { default: 0 } - ~~~~~ -!!! error TS2306: File '/g.js' is not a module. g2.default; -==== /main2.mts (5 errors) ==== +==== /main2.mts (2 errors) ==== import { x, y } from "./a"; // No y - ~ -!!! error TS2305: Module '"/a"' has no exported member 'y'. import a1 = require("./a"); // { x: 0 } a1.x; a1.default.x; // Arguably should exist but doesn't @@ -130,66 +105,46 @@ import f2 = require("./f.cjs"); // { default: 0 } import g1 from "./g"; // { default: 0 } - ~~~~~ -!!! error TS2306: File '/g.js' is not a module. import g2 = require("./g"); // { default: 0 } - ~~~~~ -!!! error TS2306: File '/g.js' is not a module. -==== /main3.cjs (15 errors) ==== +==== /main3.cjs (8 errors) ==== import { x, y } from "./a"; // No y ~ !!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. ~ -!!! error TS2305: Module '"/a"' has no exported member 'y'. +!!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. import a1 = require("./a"); // Error in JS const a2 = require("./a"); // { x: 0 } - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import b1 from "./b"; // 0 ~~ !!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const b2 = require("./b"); // { default: 0 } - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import c1 from "./c"; // { default: [Function: default] } ~~ !!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const c2 = require("./c"); // { default: [Function: default] } - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import d1 from "./d"; // [Function: default] ~~ !!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const d2 = require("./d"); // [Function: default] - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import e1 from "./e.mjs"; // 0 ~~ !!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const e2 = require("./e.mjs"); // 0 - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import f1 from "./f.cjs"; // 0 ~~ !!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const f2 = require("./f.cjs"); // { default: 0 } - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import g1 from "./g"; // { default: 0 } - ~~~~~ -!!! error TS2306: File '/g.js' is not a module. + ~~ +!!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const g2 = require("./g"); // { default: 0 } - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== /main4.cjs (2 errors) ==== +==== /main4.cjs (1 errors) ==== exports.x = require("./g"); - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. ~~~~~~~ !!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve4.symbols b/testdata/baselines/reference/submodule/compiler/modulePreserve4.symbols index 02752de3c2..1a6baffedb 100644 --- a/testdata/baselines/reference/submodule/compiler/modulePreserve4.symbols +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve4.symbols @@ -5,6 +5,11 @@ export const x = 0; >x : Symbol(x, Decl(a.js, 0, 12)) module.exports.y = 0; // Error +>module.exports.y : Symbol(y, Decl(a.js, 0, 19)) +>module.exports : Symbol("/a", Decl(a.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("/a", Decl(a.js, 0, 0)) +>y : Symbol(y, Decl(a.js, 0, 19)) === /b.ts === @@ -30,8 +35,10 @@ export = 0; export default 0; === /g.js === - exports.default = 0; +>exports.default : Symbol(default, Decl(g.js, 0, 0)) +>exports : Symbol("/g", Decl(g.js, 0, 0)) +>default : Symbol(default, Decl(g.js, 0, 0)) === /main1.ts === import { x, y } from "./a"; // No y @@ -129,7 +136,9 @@ import g2 = require("./g"); // { default: 0 } >g2 : Symbol(g2, Decl(main1.ts, 29, 11)) g2.default; +>g2.default : Symbol(default, Decl(g.js, 0, 0)) >g2 : Symbol(g2, Decl(main1.ts, 29, 11)) +>default : Symbol(default, Decl(g.js, 0, 0)) === /main2.mts === import { x, y } from "./a"; // No y @@ -196,46 +205,62 @@ import a1 = require("./a"); // Error in JS const a2 = require("./a"); // { x: 0 } >a2 : Symbol(a2, Decl(main3.cjs, 2, 5)) +>require : Symbol(require) +>"./a" : Symbol("/a", Decl(a.js, 0, 0)) import b1 from "./b"; // 0 >b1 : Symbol(b1, Decl(main3.cjs, 4, 6)) const b2 = require("./b"); // { default: 0 } >b2 : Symbol(b2, Decl(main3.cjs, 5, 5)) +>require : Symbol(require) +>"./b" : Symbol("/b", Decl(b.ts, 0, 0)) import c1 from "./c"; // { default: [Function: default] } >c1 : Symbol(c1, Decl(main3.cjs, 7, 6)) const c2 = require("./c"); // { default: [Function: default] } >c2 : Symbol(c2, Decl(main3.cjs, 8, 5)) +>require : Symbol(require) +>"./c" : Symbol("/c", Decl(c.ts, 0, 0)) import d1 from "./d"; // [Function: default] >d1 : Symbol(d1, Decl(main3.cjs, 9, 6)) const d2 = require("./d"); // [Function: default] >d2 : Symbol(d2, Decl(main3.cjs, 10, 5)) +>require : Symbol(require) +>"./d" : Symbol("/d", Decl(d.ts, 0, 0)) import e1 from "./e.mjs"; // 0 >e1 : Symbol(e1, Decl(main3.cjs, 11, 6)) const e2 = require("./e.mjs"); // 0 >e2 : Symbol(e2, Decl(main3.cjs, 12, 5)) +>require : Symbol(require) +>"./e.mjs" : Symbol("/e", Decl(e.mts, 0, 0)) import f1 from "./f.cjs"; // 0 >f1 : Symbol(f1, Decl(main3.cjs, 13, 6)) const f2 = require("./f.cjs"); // { default: 0 } >f2 : Symbol(f2, Decl(main3.cjs, 14, 5)) +>require : Symbol(require) +>"./f.cjs" : Symbol("/f", Decl(f.cts, 0, 0)) import g1 from "./g"; // { default: 0 } >g1 : Symbol(g1, Decl(main3.cjs, 16, 6)) const g2 = require("./g"); // { default: 0 } >g2 : Symbol(g2, Decl(main3.cjs, 17, 5)) +>require : Symbol(require) +>"./g" : Symbol("/g", Decl(g.js, 0, 0)) === /main4.cjs === - exports.x = require("./g"); +>exports.x : Symbol(x, Decl(main4.cjs, 0, 0)) +>exports : Symbol("/main4", Decl(main4.cjs, 0, 0)) +>x : Symbol(x, Decl(main4.cjs, 0, 0)) === /dummy.ts === diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve4.symbols.diff b/testdata/baselines/reference/submodule/compiler/modulePreserve4.symbols.diff index 70b0cdbef7..77d9c94942 100644 --- a/testdata/baselines/reference/submodule/compiler/modulePreserve4.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve4.symbols.diff @@ -1,18 +1,27 @@ --- old.modulePreserve4.symbols +++ new.modulePreserve4.symbols -@@= skipped -29, +29 lines =@@ - export default 0; +@@= skipped -4, +4 lines =@@ + >x : Symbol(x, Decl(a.js, 0, 12)) + module.exports.y = 0; // Error ++>module.exports.y : Symbol(y, Decl(a.js, 0, 19)) ++>module.exports : Symbol("/a", Decl(a.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("/a", Decl(a.js, 0, 0)) ++>y : Symbol(y, Decl(a.js, 0, 19)) + + === /b.ts === + +@@= skipped -27, +32 lines =@@ === /g.js === -+ exports.default = 0; -->exports.default : Symbol(default, Decl(g.js, 0, 0)) + >exports.default : Symbol(default, Decl(g.js, 0, 0)) ->exports : Symbol(default, Decl(g.js, 0, 0)) -->default : Symbol(default, Decl(g.js, 0, 0)) ++>exports : Symbol("/g", Decl(g.js, 0, 0)) + >default : Symbol(default, Decl(g.js, 0, 0)) === /main1.ts === - import { x, y } from "./a"; // No y -@@= skipped -18, +16 lines =@@ +@@= skipped -16, +16 lines =@@ const a3 = await import("./a"); // { x: 0 } >a3 : Symbol(a3, Decl(main1.ts, 3, 5)) @@ -74,72 +83,53 @@ g2.default; ->g2.default : Symbol(g1.default, Decl(g.js, 0, 0)) ++>g2.default : Symbol(default, Decl(g.js, 0, 0)) >g2 : Symbol(g2, Decl(main1.ts, 29, 11)) ->default : Symbol(g1.default, Decl(g.js, 0, 0)) ++>default : Symbol(default, Decl(g.js, 0, 0)) === /main2.mts === import { x, y } from "./a"; // No y -@@= skipped -85, +81 lines =@@ - +@@= skipped -86, +84 lines =@@ const a2 = require("./a"); // { x: 0 } >a2 : Symbol(a2, Decl(main3.cjs, 2, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./a" : Symbol(a1, Decl(a.js, 0, 0)) ++>"./a" : Symbol("/a", Decl(a.js, 0, 0)) import b1 from "./b"; // 0 >b1 : Symbol(b1, Decl(main3.cjs, 4, 6)) - +@@= skipped -8, +8 lines =@@ const b2 = require("./b"); // { default: 0 } >b2 : Symbol(b2, Decl(main3.cjs, 5, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./b" : Symbol(b2, Decl(b.ts, 0, 0)) ++>"./b" : Symbol("/b", Decl(b.ts, 0, 0)) import c1 from "./c"; // { default: [Function: default] } >c1 : Symbol(c1, Decl(main3.cjs, 7, 6)) - - const c2 = require("./c"); // { default: [Function: default] } - >c2 : Symbol(c2, Decl(main3.cjs, 8, 5)) -->require : Symbol(require) -->"./c" : Symbol("/c", Decl(c.ts, 0, 0)) - - import d1 from "./d"; // [Function: default] - >d1 : Symbol(d1, Decl(main3.cjs, 9, 6)) - - const d2 = require("./d"); // [Function: default] - >d2 : Symbol(d2, Decl(main3.cjs, 10, 5)) -->require : Symbol(require) -->"./d" : Symbol("/d", Decl(d.ts, 0, 0)) - - import e1 from "./e.mjs"; // 0 - >e1 : Symbol(e1, Decl(main3.cjs, 11, 6)) - - const e2 = require("./e.mjs"); // 0 - >e2 : Symbol(e2, Decl(main3.cjs, 12, 5)) -->require : Symbol(require) -->"./e.mjs" : Symbol("/e", Decl(e.mts, 0, 0)) - - import f1 from "./f.cjs"; // 0 - >f1 : Symbol(f1, Decl(main3.cjs, 13, 6)) - +@@= skipped -32, +32 lines =@@ const f2 = require("./f.cjs"); // { default: 0 } >f2 : Symbol(f2, Decl(main3.cjs, 14, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./f.cjs" : Symbol(f2, Decl(f.cts, 0, 0)) ++>"./f.cjs" : Symbol("/f", Decl(f.cts, 0, 0)) import g1 from "./g"; // { default: 0 } >g1 : Symbol(g1, Decl(main3.cjs, 16, 6)) - +@@= skipped -8, +8 lines =@@ const g2 = require("./g"); // { default: 0 } >g2 : Symbol(g2, Decl(main3.cjs, 17, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./g" : Symbol(g1, Decl(g.js, 0, 0)) ++>"./g" : Symbol("/g", Decl(g.js, 0, 0)) === /main4.cjs === -+ exports.x = require("./g"); -->exports.x : Symbol(x, Decl(main4.cjs, 0, 0)) + >exports.x : Symbol(x, Decl(main4.cjs, 0, 0)) ->exports : Symbol(x, Decl(main4.cjs, 0, 0)) -->x : Symbol(x, Decl(main4.cjs, 0, 0)) ++>exports : Symbol("/main4", Decl(main4.cjs, 0, 0)) + >x : Symbol(x, Decl(main4.cjs, 0, 0)) ->require : Symbol(require) ->"./g" : Symbol("/g", Decl(g.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/compiler/modulePreserve4.types b/testdata/baselines/reference/submodule/compiler/modulePreserve4.types index 9d260f3529..dbf7e959a2 100644 --- a/testdata/baselines/reference/submodule/compiler/modulePreserve4.types +++ b/testdata/baselines/reference/submodule/compiler/modulePreserve4.types @@ -7,11 +7,11 @@ export const x = 0; module.exports.y = 0; // Error >module.exports.y = 0 : 0 ->module.exports.y : any ->module.exports : any ->module : any ->exports : any ->y : any +>module.exports.y : 0 +>module.exports : typeof import("/a") +>module : { "/a": typeof import("/a"); } +>exports : typeof import("/a") +>y : 0 >0 : 0 === /b.ts === @@ -43,15 +43,15 @@ export default 0; === /g.js === exports.default = 0; >exports.default = 0 : 0 ->exports.default : any ->exports : any ->default : any +>exports.default : 0 +>exports : typeof import("/g") +>default : 0 >0 : 0 === /main1.ts === import { x, y } from "./a"; // No y >x : 0 ->y : any +>y : 0 import a1 = require("./a"); // { x: 0 } >a1 : typeof import("/a") @@ -152,25 +152,25 @@ f2.default; >default : 0 import g1 from "./g"; // { default: 0 } ->g1 : any +>g1 : 0 g1.default; >g1.default : any ->g1 : any +>g1 : 0 >default : any import g2 = require("./g"); // { default: 0 } ->g2 : any +>g2 : typeof import("/g") g2.default; ->g2.default : any ->g2 : any ->default : any +>g2.default : 0 +>g2 : typeof import("/g") +>default : 0 === /main2.mts === import { x, y } from "./a"; // No y >x : 0 ->y : any +>y : 0 import a1 = require("./a"); // { x: 0 } >a1 : typeof import("/a") @@ -224,22 +224,22 @@ import f2 = require("./f.cjs"); // { default: 0 } >f2 : typeof import("/f") import g1 from "./g"; // { default: 0 } ->g1 : any +>g1 : 0 import g2 = require("./g"); // { default: 0 } ->g2 : any +>g2 : typeof import("/g") === /main3.cjs === import { x, y } from "./a"; // No y >x : 0 ->y : any +>y : 0 import a1 = require("./a"); // Error in JS >a1 : typeof import("/a") const a2 = require("./a"); // { x: 0 } ->a2 : any ->require("./a") : any +>a2 : typeof import("/a") +>require("./a") : typeof import("/a") >require : any >"./a" : "./a" @@ -247,8 +247,8 @@ import b1 from "./b"; // 0 >b1 : 0 const b2 = require("./b"); // { default: 0 } ->b2 : any ->require("./b") : any +>b2 : typeof import("/b") +>require("./b") : typeof import("/b") >require : any >"./b" : "./b" @@ -256,8 +256,8 @@ import c1 from "./c"; // { default: [Function: default] } >c1 : { default: () => void; } const c2 = require("./c"); // { default: [Function: default] } ->c2 : any ->require("./c") : any +>c2 : { default: () => void; } +>require("./c") : { default: () => void; } >require : any >"./c" : "./c" @@ -265,8 +265,8 @@ import d1 from "./d"; // [Function: default] >d1 : () => void const d2 = require("./d"); // [Function: default] ->d2 : any ->require("./d") : any +>d2 : () => void +>require("./d") : () => void >require : any >"./d" : "./d" @@ -274,8 +274,8 @@ import e1 from "./e.mjs"; // 0 >e1 : 0 const e2 = require("./e.mjs"); // 0 ->e2 : any ->require("./e.mjs") : any +>e2 : 0 +>require("./e.mjs") : 0 >require : any >"./e.mjs" : "./e.mjs" @@ -283,17 +283,17 @@ import f1 from "./f.cjs"; // 0 >f1 : 0 const f2 = require("./f.cjs"); // { default: 0 } ->f2 : any ->require("./f.cjs") : any +>f2 : typeof import("/f") +>require("./f.cjs") : typeof import("/f") >require : any >"./f.cjs" : "./f.cjs" import g1 from "./g"; // { default: 0 } ->g1 : any +>g1 : 0 const g2 = require("./g"); // { default: 0 } ->g2 : any ->require("./g") : any +>g2 : typeof import("/g") +>require("./g") : typeof import("/g") >require : any >"./g" : "./g" @@ -301,7 +301,7 @@ const g2 = require("./g"); // { default: 0 } exports.x = require("./g"); >exports.x = require("./g") : any >exports.x : any ->exports : any +>exports : typeof import("/main4") >x : any >require("./g") : any >require : any diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.errors.txt b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.errors.txt index 427246e857..6e6ae5a6eb 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.errors.txt @@ -1,8 +1,8 @@ -/a.ts(1,17): error TS2307: Cannot find module './jsx' or its corresponding type declarations. +/a.ts(1,17): error TS2306: File '/jsx.jsx' is not a module. ==== /a.ts (1 errors) ==== import jsx from "./jsx"; ~~~~~~~ -!!! error TS2307: Cannot find module './jsx' or its corresponding type declarations. +!!! error TS2306: File '/jsx.jsx' is not a module. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.symbols b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.symbols index 751d4257d5..d70ba2e735 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.symbols +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.symbols @@ -4,3 +4,5 @@ import jsx from "./jsx"; >jsx : Symbol(jsx, Decl(a.ts, 0, 6)) +=== /jsx.jsx === + diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.symbols.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.symbols.diff new file mode 100644 index 0000000000..f7bcb30bae --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.symbols.diff @@ -0,0 +1,8 @@ +--- old.moduleResolutionWithExtensions_notSupported2.symbols ++++ new.moduleResolutionWithExtensions_notSupported2.symbols +@@= skipped -3, +3 lines =@@ + import jsx from "./jsx"; + >jsx : Symbol(jsx, Decl(a.ts, 0, 6)) + ++=== /jsx.jsx === ++ diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.types b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.types index 495fe1376c..8754c33e0f 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.types +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.types @@ -4,3 +4,5 @@ import jsx from "./jsx"; >jsx : any +=== /jsx.jsx === + diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.errors.txt b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.errors.txt deleted file mode 100644 index 5bb696fadb..0000000000 --- a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.errors.txt +++ /dev/null @@ -1,30 +0,0 @@ -/index.ts(1,21): error TS2306: File '/foo.ios.js' is not a module. - - -==== /tsconfig.json (0 errors) ==== - { - "compilerOptions": { - "allowJs": true, - "checkJs": false, - "outDir": "bin", - "moduleResolution": "node", - "traceResolution": true, - "moduleSuffixes": [".ios"] - } - } - -==== /index.ts (1 errors) ==== - import { ios } from "./foo.js"; - ~~~~~~~~~~ -!!! error TS2306: File '/foo.ios.js' is not a module. -==== /foo.ios.js (0 errors) ==== - "use strict"; - exports.__esModule = true; - function ios() {} - exports.ios = ios; -==== /foo.js (0 errors) ==== - "use strict"; - exports.__esModule = true; - function base() {} - exports.base = base; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.symbols b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.symbols index 2245824a40..983b83441e 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.symbols +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.symbols @@ -7,18 +7,32 @@ import { ios } from "./foo.js"; === /foo.ios.js === "use strict"; exports.__esModule = true; +>exports.__esModule : Symbol(__esModule, Decl(foo.ios.js, 0, 13)) +>exports : Symbol("/foo.ios", Decl(foo.ios.js, 0, 0)) +>__esModule : Symbol(__esModule, Decl(foo.ios.js, 0, 13)) + function ios() {} >ios : Symbol(ios, Decl(foo.ios.js, 1, 26)) exports.ios = ios; +>exports.ios : Symbol(ios, Decl(foo.ios.js, 2, 17)) +>exports : Symbol("/foo.ios", Decl(foo.ios.js, 0, 0)) +>ios : Symbol(ios, Decl(foo.ios.js, 2, 17)) >ios : Symbol(ios, Decl(foo.ios.js, 1, 26)) === /foo.js === "use strict"; exports.__esModule = true; +>exports.__esModule : Symbol(__esModule, Decl(foo.js, 0, 13)) +>exports : Symbol("/foo", Decl(foo.js, 0, 0)) +>__esModule : Symbol(__esModule, Decl(foo.js, 0, 13)) + function base() {} >base : Symbol(base, Decl(foo.js, 1, 26)) exports.base = base; +>exports.base : Symbol(base, Decl(foo.js, 2, 18)) +>exports : Symbol("/foo", Decl(foo.js, 0, 0)) +>base : Symbol(base, Decl(foo.js, 2, 18)) >base : Symbol(base, Decl(foo.js, 1, 26)) diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.symbols.diff b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.symbols.diff index 8cee613435..4e45b0477d 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.symbols.diff @@ -1,35 +1,38 @@ --- old.moduleResolutionWithSuffixes_one_jsModule.symbols +++ new.moduleResolutionWithSuffixes_one_jsModule.symbols -@@= skipped -6, +6 lines =@@ - === /foo.ios.js === +@@= skipped -7, +7 lines =@@ "use strict"; exports.__esModule = true; -->exports.__esModule : Symbol(__esModule, Decl(foo.ios.js, 0, 13)) + >exports.__esModule : Symbol(__esModule, Decl(foo.ios.js, 0, 13)) ->exports : Symbol(__esModule, Decl(foo.ios.js, 0, 13)) -->__esModule : Symbol(__esModule, Decl(foo.ios.js, 0, 13)) -- ++>exports : Symbol("/foo.ios", Decl(foo.ios.js, 0, 0)) + >__esModule : Symbol(__esModule, Decl(foo.ios.js, 0, 13)) + function ios() {} - >ios : Symbol(ios, Decl(foo.ios.js, 1, 26)) +@@= skipped -8, +8 lines =@@ exports.ios = ios; -->exports.ios : Symbol(ios, Decl(foo.ios.js, 2, 17)) + >exports.ios : Symbol(ios, Decl(foo.ios.js, 2, 17)) ->exports : Symbol(ios, Decl(foo.ios.js, 2, 17)) -->ios : Symbol(ios, Decl(foo.ios.js, 2, 17)) ++>exports : Symbol("/foo.ios", Decl(foo.ios.js, 0, 0)) + >ios : Symbol(ios, Decl(foo.ios.js, 2, 17)) >ios : Symbol(ios, Decl(foo.ios.js, 1, 26)) - === /foo.js === +@@= skipped -8, +8 lines =@@ "use strict"; exports.__esModule = true; -->exports.__esModule : Symbol(__esModule, Decl(foo.js, 0, 13)) + >exports.__esModule : Symbol(__esModule, Decl(foo.js, 0, 13)) ->exports : Symbol(__esModule, Decl(foo.js, 0, 13)) -->__esModule : Symbol(__esModule, Decl(foo.js, 0, 13)) -- ++>exports : Symbol("/foo", Decl(foo.js, 0, 0)) + >__esModule : Symbol(__esModule, Decl(foo.js, 0, 13)) + function base() {} - >base : Symbol(base, Decl(foo.js, 1, 26)) +@@= skipped -8, +8 lines =@@ exports.base = base; -->exports.base : Symbol(base, Decl(foo.js, 2, 18)) + >exports.base : Symbol(base, Decl(foo.js, 2, 18)) ->exports : Symbol(base, Decl(foo.js, 2, 18)) -->base : Symbol(base, Decl(foo.js, 2, 18)) ++>exports : Symbol("/foo", Decl(foo.js, 0, 0)) + >base : Symbol(base, Decl(foo.js, 2, 18)) >base : Symbol(base, Decl(foo.js, 1, 26)) diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.types b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.types index ad59491077..8638ec5dbb 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.types +++ b/testdata/baselines/reference/submodule/compiler/moduleResolutionWithSuffixes_one_jsModule.types @@ -2,7 +2,7 @@ === /index.ts === import { ios } from "./foo.js"; ->ios : any +>ios : () => void === /foo.ios.js === "use strict"; @@ -10,9 +10,9 @@ import { ios } from "./foo.js"; exports.__esModule = true; >exports.__esModule = true : true ->exports.__esModule : any ->exports : any ->__esModule : any +>exports.__esModule : true +>exports : typeof import("/foo.ios") +>__esModule : true >true : true function ios() {} @@ -20,9 +20,9 @@ function ios() {} exports.ios = ios; >exports.ios = ios : () => void ->exports.ios : any ->exports : any ->ios : any +>exports.ios : () => void +>exports : typeof import("/foo.ios") +>ios : () => void >ios : () => void === /foo.js === @@ -31,9 +31,9 @@ exports.ios = ios; exports.__esModule = true; >exports.__esModule = true : true ->exports.__esModule : any ->exports : any ->__esModule : any +>exports.__esModule : true +>exports : typeof import("/foo") +>__esModule : true >true : true function base() {} @@ -41,8 +41,8 @@ function base() {} exports.base = base; >exports.base = base : () => void ->exports.base : any ->exports : any ->base : any +>exports.base : () => void +>exports : typeof import("/foo") +>base : () => void >base : () => void diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.errors.txt b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.errors.txt deleted file mode 100644 index b2dedf7255..0000000000 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -/src/index.ts(1,19): error TS2307: Cannot find module '../node_modules/foo' or its corresponding type declarations. - - -==== /src/index.ts (1 errors) ==== - import { x } from "../node_modules/foo"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module '../node_modules/foo' or its corresponding type declarations. - -==== /node_modules/foo/index.js (0 errors) ==== - exports.x = 0; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.errors.txt.diff deleted file mode 100644 index 2009606937..0000000000 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.moduleResolution_explicitNodeModulesImport.errors.txt -+++ new.moduleResolution_explicitNodeModulesImport.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+/src/index.ts(1,19): error TS2307: Cannot find module '../node_modules/foo' or its corresponding type declarations. -+ -+ -+==== /src/index.ts (1 errors) ==== -+ import { x } from "../node_modules/foo"; -+ ~~~~~~~~~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module '../node_modules/foo' or its corresponding type declarations. -+ -+==== /node_modules/foo/index.js (0 errors) ==== -+ exports.x = 0; -+ diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.symbols b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.symbols index f2913b8182..952599a809 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.symbols +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.symbols @@ -4,3 +4,9 @@ import { x } from "../node_modules/foo"; >x : Symbol(x, Decl(index.ts, 0, 8)) +=== /node_modules/foo/index.js === +exports.x = 0; +>exports.x : Symbol(x, Decl(index.js, 0, 0)) +>exports : Symbol("/node_modules/foo/index", Decl(index.js, 0, 0)) +>x : Symbol(x, Decl(index.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.symbols.diff b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.symbols.diff index bcd19ff5e1..189d5b6944 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.symbols.diff @@ -1,12 +1,10 @@ --- old.moduleResolution_explicitNodeModulesImport.symbols +++ new.moduleResolution_explicitNodeModulesImport.symbols -@@= skipped -3, +3 lines =@@ - import { x } from "../node_modules/foo"; - >x : Symbol(x, Decl(index.ts, 0, 8)) - --=== /node_modules/foo/index.js === --exports.x = 0; -->exports.x : Symbol(x, Decl(index.js, 0, 0)) +@@= skipped -6, +6 lines =@@ + === /node_modules/foo/index.js === + exports.x = 0; + >exports.x : Symbol(x, Decl(index.js, 0, 0)) ->exports : Symbol(x, Decl(index.js, 0, 0)) -->x : Symbol(x, Decl(index.js, 0, 0)) -- ++>exports : Symbol("/node_modules/foo/index", Decl(index.js, 0, 0)) + >x : Symbol(x, Decl(index.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.types b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.types index 2a2ce37bc4..a1fe8e0e8a 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.types +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.types @@ -2,5 +2,13 @@ === /src/index.ts === import { x } from "../node_modules/foo"; ->x : any +>x : 0 + +=== /node_modules/foo/index.js === +exports.x = 0; +>exports.x = 0 : 0 +>exports.x : 0 +>exports : typeof import("/node_modules/foo/index") +>x : 0 +>0 : 0 diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.types.diff b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.types.diff deleted file mode 100644 index a9aabce3e2..0000000000 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport.types.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.moduleResolution_explicitNodeModulesImport.types -+++ new.moduleResolution_explicitNodeModulesImport.types -@@= skipped -1, +1 lines =@@ - - === /src/index.ts === - import { x } from "../node_modules/foo"; -->x : 0 -+>x : any - --=== /node_modules/foo/index.js === --exports.x = 0; -->exports.x = 0 : 0 -->exports.x : 0 -->exports : typeof import("/node_modules/foo/index") -->x : 0 -->0 : 0 -- diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.errors.txt b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.errors.txt index 6674c3a30e..b50816d804 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.errors.txt @@ -1,10 +1,10 @@ -/src/index.ts(1,19): error TS2307: Cannot find module '../node_modules/foo' or its corresponding type declarations. +/src/index.ts(1,10): error TS2305: Module '"/node_modules/foo/index"' has no exported member 'y'. ==== /src/index.ts (1 errors) ==== import { y } from "../node_modules/foo"; - ~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module '../node_modules/foo' or its corresponding type declarations. + ~ +!!! error TS2305: Module '"/node_modules/foo/index"' has no exported member 'y'. ==== /node_modules/foo/index.js (0 errors) ==== exports.x = 0; diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.symbols b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.symbols index 55c0dd716d..31b5ce9864 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.symbols +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.symbols @@ -4,3 +4,9 @@ import { y } from "../node_modules/foo"; >y : Symbol(y, Decl(index.ts, 0, 8)) +=== /node_modules/foo/index.js === +exports.x = 0; +>exports.x : Symbol(x, Decl(index.js, 0, 0)) +>exports : Symbol("/node_modules/foo/index", Decl(index.js, 0, 0)) +>x : Symbol(x, Decl(index.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.symbols.diff b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.symbols.diff new file mode 100644 index 0000000000..3d1c373ece --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.symbols.diff @@ -0,0 +1,12 @@ +--- old.moduleResolution_explicitNodeModulesImport_implicitAny.symbols ++++ new.moduleResolution_explicitNodeModulesImport_implicitAny.symbols +@@= skipped -3, +3 lines =@@ + import { y } from "../node_modules/foo"; + >y : Symbol(y, Decl(index.ts, 0, 8)) + ++=== /node_modules/foo/index.js === ++exports.x = 0; ++>exports.x : Symbol(x, Decl(index.js, 0, 0)) ++>exports : Symbol("/node_modules/foo/index", Decl(index.js, 0, 0)) ++>x : Symbol(x, Decl(index.js, 0, 0)) ++ diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.types b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.types index 2637a3b00d..ce8e4f6c1f 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.types +++ b/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.types @@ -4,3 +4,11 @@ import { y } from "../node_modules/foo"; >y : any +=== /node_modules/foo/index.js === +exports.x = 0; +>exports.x = 0 : 0 +>exports.x : 0 +>exports : typeof import("/node_modules/foo/index") +>x : 0 +>0 : 0 + diff --git a/testdata/baselines/reference/submodule/compiler/noCrashOnParameterNamedRequire.errors.txt b/testdata/baselines/reference/submodule/compiler/noCrashOnParameterNamedRequire.errors.txt new file mode 100644 index 0000000000..3e7ef516d0 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/noCrashOnParameterNamedRequire.errors.txt @@ -0,0 +1,10 @@ +index.js(2,25): error TS2307: Cannot find module './mod' or its corresponding type declarations. + + +==== index.js (1 errors) ==== + (function(require, module, exports){ + const mod = require("./mod"); + ~~~~~~~ +!!! error TS2307: Cannot find module './mod' or its corresponding type declarations. + mod.foo; + })(null, null, null); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.errors.txt b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.errors.txt deleted file mode 100644 index 168f53afb1..0000000000 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.errors.txt +++ /dev/null @@ -1,27 +0,0 @@ -/root/a.ts(2,21): error TS2307: Cannot find module '/bar' or its corresponding type declarations. - - -==== /root/tsconfig.json (0 errors) ==== - { - "compilerOptions": { - "baseUrl": ".", - "paths": { - "/*": ["./src/*"] - }, - "allowJs": true, - "outDir": "bin" - } - } - -==== /root/a.ts (1 errors) ==== - import { foo } from "/foo"; - import { bar } from "/bar"; - ~~~~~~ -!!! error TS2307: Cannot find module '/bar' or its corresponding type declarations. - -==== /foo.ts (0 errors) ==== - export function foo() {} - -==== /bar.js (0 errors) ==== - export function bar() {} - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.symbols b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.symbols index 0c7788ec5f..6e0b0e75fc 100644 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.symbols +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.symbols @@ -11,3 +11,7 @@ import { bar } from "/bar"; export function foo() {} >foo : Symbol(foo, Decl(foo.ts, 0, 0)) +=== /bar.js === +export function bar() {} +>bar : Symbol(bar, Decl(bar.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.symbols.diff b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.symbols.diff deleted file mode 100644 index 450c95ad30..0000000000 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.symbols.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.symbols -+++ new.pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.symbols -@@= skipped -10, +10 lines =@@ - export function foo() {} - >foo : Symbol(foo, Decl(foo.ts, 0, 0)) - --=== /bar.js === --export function bar() {} -->bar : Symbol(bar, Decl(bar.js, 0, 0)) -- diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.types b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.types index 8912ae5e8d..e189dff5ab 100644 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.types +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.types @@ -5,9 +5,13 @@ import { foo } from "/foo"; >foo : () => void import { bar } from "/bar"; ->bar : any +>bar : () => void === /foo.ts === export function foo() {} >foo : () => void +=== /bar.js === +export function bar() {} +>bar : () => void + diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.types.diff b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.types.diff deleted file mode 100644 index 41f30cbbe0..0000000000 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.types.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.types -+++ new.pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.types -@@= skipped -4, +4 lines =@@ - >foo : () => void - - import { bar } from "/bar"; -->bar : () => void -+>bar : any - - === /foo.ts === - export function foo() {} - >foo : () => void - --=== /bar.js === --export function bar() {} -->bar : () => void -- diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.errors.txt b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.errors.txt deleted file mode 100644 index 692c8588c6..0000000000 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.errors.txt +++ /dev/null @@ -1,27 +0,0 @@ -/root/a.ts(2,21): error TS2307: Cannot find module '/bar' or its corresponding type declarations. - - -==== /root/tsconfig.json (0 errors) ==== - { - "compilerOptions": { - "baseUrl": ".", - "paths": { - "*": ["./src/*"] - }, - "allowJs": true, - "outDir": "bin" - } - } - -==== /root/a.ts (1 errors) ==== - import { foo } from "/foo"; - import { bar } from "/bar"; - ~~~~~~ -!!! error TS2307: Cannot find module '/bar' or its corresponding type declarations. - -==== /foo.ts (0 errors) ==== - export function foo() {} - -==== /bar.js (0 errors) ==== - export function bar() {} - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.symbols b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.symbols index 24988bbfbe..d048de95e6 100644 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.symbols +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.symbols @@ -11,3 +11,7 @@ import { bar } from "/bar"; export function foo() {} >foo : Symbol(foo, Decl(foo.ts, 0, 0)) +=== /bar.js === +export function bar() {} +>bar : Symbol(bar, Decl(bar.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.symbols.diff b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.symbols.diff deleted file mode 100644 index 11bce82cc1..0000000000 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.symbols.diff +++ /dev/null @@ -1,10 +0,0 @@ ---- old.pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.symbols -+++ new.pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.symbols -@@= skipped -10, +10 lines =@@ - export function foo() {} - >foo : Symbol(foo, Decl(foo.ts, 0, 0)) - --=== /bar.js === --export function bar() {} -->bar : Symbol(bar, Decl(bar.js, 0, 0)) -- diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.types b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.types index b2a131dd24..54630514ac 100644 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.types +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.types @@ -5,9 +5,13 @@ import { foo } from "/foo"; >foo : () => void import { bar } from "/bar"; ->bar : any +>bar : () => void === /foo.ts === export function foo() {} >foo : () => void +=== /bar.js === +export function bar() {} +>bar : () => void + diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.types.diff b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.types.diff deleted file mode 100644 index fafa40a384..0000000000 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.types.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.types -+++ new.pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.types -@@= skipped -4, +4 lines =@@ - >foo : () => void - - import { bar } from "/bar"; -->bar : () => void -+>bar : any - - === /foo.ts === - export function foo() {} - >foo : () => void - --=== /bar.js === --export function bar() {} -->bar : () => void -- diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.errors.txt b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.errors.txt deleted file mode 100644 index 983e251396..0000000000 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.errors.txt +++ /dev/null @@ -1,23 +0,0 @@ -/a.ts(1,20): error TS2307: Cannot find module 'foo/bar/foobar.js' or its corresponding type declarations. - - -==== /tsconfig.json (0 errors) ==== - { - "compilerOptions": { - "baseUrl": ".", - "paths": { - "*": ["node_modules/*", "src/types"] - }, - "allowJs": true, - "outDir": "bin" - } - } - -==== /a.ts (1 errors) ==== - import foobar from "foo/bar/foobar.js"; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'foo/bar/foobar.js' or its corresponding type declarations. - -==== /node_modules/foo/bar/foobar.js (0 errors) ==== - module.exports = { a: 10 }; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.symbols b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.symbols index 14c6b607be..7287c27843 100644 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.symbols +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.symbols @@ -4,3 +4,10 @@ import foobar from "foo/bar/foobar.js"; >foobar : Symbol(foobar, Decl(a.ts, 0, 6)) +=== /node_modules/foo/bar/foobar.js === +module.exports = { a: 10 }; +>module.exports : Symbol(export=, Decl(foobar.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(foobar.js, 0, 0)) +>a : Symbol(a, Decl(foobar.js, 0, 18)) + diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.symbols.diff b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.symbols.diff new file mode 100644 index 0000000000..4941d684fc --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.symbols.diff @@ -0,0 +1,13 @@ +--- old.pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.symbols ++++ new.pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.symbols +@@= skipped -3, +3 lines =@@ + import foobar from "foo/bar/foobar.js"; + >foobar : Symbol(foobar, Decl(a.ts, 0, 6)) + ++=== /node_modules/foo/bar/foobar.js === ++module.exports = { a: 10 }; ++>module.exports : Symbol(export=, Decl(foobar.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(foobar.js, 0, 0)) ++>a : Symbol(a, Decl(foobar.js, 0, 18)) ++ diff --git a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.types b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.types index dcb8d2d2bb..32ab352eaa 100644 --- a/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.types +++ b/testdata/baselines/reference/submodule/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.types @@ -2,5 +2,15 @@ === /a.ts === import foobar from "foo/bar/foobar.js"; ->foobar : any +>foobar : { a: number; } + +=== /node_modules/foo/bar/foobar.js === +module.exports = { a: 10 }; +>module.exports = { a: 10 } : { a: number; } +>module.exports : { a: number; } +>module : { export=: { a: number; }; } +>exports : { a: number; } +>{ a: 10 } : { a: number; } +>a : number +>10 : 10 diff --git a/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.errors.txt b/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.errors.txt index 1bff1db07d..6f9d8230e4 100644 --- a/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.errors.txt @@ -1,14 +1,14 @@ -bar.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -bar.js(2,1): error TS2304: Cannot find name 'exports'. -bar.js(2,16): error TS2304: Cannot find name 'exports'. +bar.js(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +bar.js(2,9): error TS2339: Property 'blah' does not exist on type 'typeof import("bar")'. +bar.js(2,24): error TS2339: Property 'someProp' does not exist on type 'typeof import("bar")'. ==== bar.js (3 errors) ==== module.exports = function () {}; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. exports.blah = exports.someProp; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. \ No newline at end of file + ~~~~ +!!! error TS2339: Property 'blah' does not exist on type 'typeof import("bar")'. + ~~~~~~~~ +!!! error TS2339: Property 'someProp' does not exist on type 'typeof import("bar")'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.symbols b/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.symbols index f12968671a..738988b717 100644 --- a/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.symbols +++ b/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.symbols @@ -1,6 +1,12 @@ //// [tests/cases/compiler/pushTypeGetTypeOfAlias.ts] //// === bar.js === - module.exports = function () {}; +>module.exports : Symbol(export=, Decl(bar.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(bar.js, 0, 0)) + exports.blah = exports.someProp; +>exports : Symbol("bar", Decl(bar.js, 0, 0)) +>exports : Symbol("bar", Decl(bar.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.symbols.diff b/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.symbols.diff index e886ea73ea..0b7418e354 100644 --- a/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.symbols.diff @@ -1,18 +1,19 @@ --- old.pushTypeGetTypeOfAlias.symbols +++ new.pushTypeGetTypeOfAlias.symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/compiler/pushTypeGetTypeOfAlias.ts] //// +@@= skipped -1, +1 lines =@@ === bar.js === --module.exports = function () {}; + module.exports = function () {}; ->module.exports : Symbol(module.exports, Decl(bar.js, 0, 0)) ->module : Symbol(export=, Decl(bar.js, 0, 0)) -->exports : Symbol(export=, Decl(bar.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(bar.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(bar.js, 0, 0)) -+module.exports = function () {}; exports.blah = exports.someProp; ->exports.blah : Symbol(blah, Decl(bar.js, 0, 32)) ->exports : Symbol(blah, Decl(bar.js, 0, 32)) ->blah : Symbol(blah, Decl(bar.js, 0, 32)) -->exports : Symbol("bar", Decl(bar.js, 0, 0)) -- + >exports : Symbol("bar", Decl(bar.js, 0, 0)) ++>exports : Symbol("bar", Decl(bar.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.types b/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.types index 1be4ca3bd0..446e681a92 100644 --- a/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.types +++ b/testdata/baselines/reference/submodule/compiler/pushTypeGetTypeOfAlias.types @@ -3,17 +3,17 @@ === bar.js === module.exports = function () {}; >module.exports = function () {} : () => void ->module.exports : any ->module : any ->exports : any +>module.exports : () => void +>module : { export=: () => void; } +>exports : () => void >function () {} : () => void exports.blah = exports.someProp; >exports.blah = exports.someProp : any >exports.blah : any ->exports : any +>exports : typeof import("bar") >blah : any >exports.someProp : any ->exports : any +>exports : typeof import("bar") >someProp : any diff --git a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.errors.txt b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.errors.txt index b3fe3e4d1a..37268630c0 100644 --- a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.errors.txt @@ -1,14 +1,15 @@ -/user.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/user.js(2,7): error TS2339: Property 'b' does not exist on type '{ a: number; }'. /user.js(5,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -/user.js(8,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/user.js(8,21): error TS2307: Cannot find module './js.js' or its corresponding type declarations. +/user.js(9,7): error TS2339: Property 'b' does not exist on type '{ a: number; }'. /user.js(12,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== /user.js (4 errors) ==== +==== /user.js (5 errors) ==== const json0 = require("./json.json"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. json0.b; // Error (good) + ~ +!!! error TS2339: Property 'b' does not exist on type '{ a: number; }'. /** @type {{ b: number }} */ const json1 = require("./json.json"); // No error (bad) @@ -17,9 +18,11 @@ json1.b; // No error (OK since that's the type annotation) const js0 = require("./js.js"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~ +!!! error TS2307: Cannot find module './js.js' or its corresponding type declarations. json0.b; // Error (good) + ~ +!!! error TS2339: Property 'b' does not exist on type '{ a: number; }'. /** @type {{ b: number }} */ const js1 = require("./js.js"); // Error (good) diff --git a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.symbols b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.symbols index 4d4e83f4f4..659d82185f 100644 --- a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.symbols +++ b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.symbols @@ -3,6 +3,8 @@ === /user.js === const json0 = require("./json.json"); >json0 : Symbol(json0, Decl(user.js, 0, 5)) +>require : Symbol(require) +>"./json.json" : Symbol("/json", Decl(json.json, 0, 0)) json0.b; // Error (good) >json0 : Symbol(json0, Decl(user.js, 0, 5)) @@ -18,6 +20,7 @@ json1.b; // No error (OK since that's the type annotation) const js0 = require("./js.js"); >js0 : Symbol(js0, Decl(user.js, 7, 5)) +>require : Symbol(require) json0.b; // Error (good) >json0 : Symbol(json0, Decl(user.js, 0, 5)) diff --git a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.symbols.diff b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.symbols.diff index 99b69ac56e..ff582be382 100644 --- a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.symbols.diff @@ -1,15 +1,6 @@ --- old.requireOfJsonFileInJsFile.symbols +++ new.requireOfJsonFileInJsFile.symbols -@@= skipped -2, +2 lines =@@ - === /user.js === - const json0 = require("./json.json"); - >json0 : Symbol(json0, Decl(user.js, 0, 5)) -->require : Symbol(require) -->"./json.json" : Symbol("/json", Decl(json.json, 0, 0)) - - json0.b; // Error (good) - >json0 : Symbol(json0, Decl(user.js, 0, 5)) -@@= skipped -9, +7 lines =@@ +@@= skipped -11, +11 lines =@@ /** @type {{ b: number }} */ const json1 = require("./json.json"); // No error (bad) >json1 : Symbol(json1, Decl(user.js, 4, 5)) @@ -18,16 +9,15 @@ json1.b; // No error (OK since that's the type annotation) >json1.b : Symbol(b, Decl(user.js, 3, 12)) -@@= skipped -10, +8 lines =@@ - +@@= skipped -11, +9 lines =@@ const js0 = require("./js.js"); >js0 : Symbol(js0, Decl(user.js, 7, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./js.js" : Symbol("/js", Decl(js.js, 0, 0)) json0.b; // Error (good) >json0 : Symbol(json0, Decl(user.js, 0, 5)) -@@= skipped -9, +7 lines =@@ +@@= skipped -8, +7 lines =@@ /** @type {{ b: number }} */ const js1 = require("./js.js"); // Error (good) >js1 : Symbol(js1, Decl(user.js, 11, 5)) diff --git a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.types b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.types index 4afa7dc442..9022c3d333 100644 --- a/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.types +++ b/testdata/baselines/reference/submodule/compiler/requireOfJsonFileInJsFile.types @@ -2,14 +2,14 @@ === /user.js === const json0 = require("./json.json"); ->json0 : any ->require("./json.json") : any +>json0 : { a: number; } +>require("./json.json") : { a: number; } >require : any >"./json.json" : "./json.json" json0.b; // Error (good) >json0.b : any ->json0 : any +>json0 : { a: number; } >b : any /** @type {{ b: number }} */ @@ -32,7 +32,7 @@ const js0 = require("./js.js"); json0.b; // Error (good) >json0.b : any ->json0 : any +>json0 : { a: number; } >b : any /** @type {{ b: number }} */ diff --git a/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.errors.txt b/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.errors.txt deleted file mode 100644 index a42d2c25d1..0000000000 --- a/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.errors.txt +++ /dev/null @@ -1,25 +0,0 @@ -app.js(1,1): error TS2304: Cannot find name 'exports'. -app.js(2,1): error TS2304: Cannot find name 'exports'. - - -==== node.d.ts (0 errors) ==== - declare function require(moduleName: string): any; - - declare module "assert" { - export function equal(actual: any, expected: any, message?: string | Error): void; - } - -==== ns.ts (0 errors) ==== - /// - namespace myAssert { - export type cool = 'cool' - } - var myAssert = require('assert') - -==== app.js (2 errors) ==== - exports.equal = myAssert.equal - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - exports.equal() - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.symbols b/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.symbols index d506d4e332..b744f9fd3c 100644 --- a/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.symbols +++ b/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.symbols @@ -30,6 +30,13 @@ var myAssert = require('assert') === app.js === exports.equal = myAssert.equal +>exports.equal : Symbol(equal, Decl(app.js, 0, 0)) +>exports : Symbol("app", Decl(app.js, 0, 0)) +>equal : Symbol(equal, Decl(app.js, 0, 0)) >myAssert : Symbol(myAssert, Decl(ns.ts, 0, 0), Decl(ns.ts, 4, 3)) exports.equal() +>exports.equal : Symbol(equal, Decl(app.js, 0, 0)) +>exports : Symbol("app", Decl(app.js, 0, 0)) +>equal : Symbol(equal, Decl(app.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.symbols.diff b/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.symbols.diff index cea3f1574d..c046b6fb3a 100644 --- a/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.symbols.diff @@ -1,16 +1,11 @@ --- old.resolveNameWithNamspace.symbols +++ new.resolveNameWithNamspace.symbols -@@= skipped -29, +29 lines =@@ - +@@= skipped -30, +30 lines =@@ === app.js === exports.equal = myAssert.equal -->exports.equal : Symbol(equal, Decl(app.js, 0, 0)) + >exports.equal : Symbol(equal, Decl(app.js, 0, 0)) ->exports : Symbol(equal, Decl(app.js, 0, 0)) -->equal : Symbol(equal, Decl(app.js, 0, 0)) ++>exports : Symbol("app", Decl(app.js, 0, 0)) + >equal : Symbol(equal, Decl(app.js, 0, 0)) >myAssert : Symbol(myAssert, Decl(ns.ts, 0, 0), Decl(ns.ts, 4, 3)) - exports.equal() -->exports.equal : Symbol(equal, Decl(app.js, 0, 0)) -->exports : Symbol("app", Decl(app.js, 0, 0)) -->equal : Symbol(equal, Decl(app.js, 0, 0)) -- diff --git a/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.types b/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.types index 28a226700d..81b6f49067 100644 --- a/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.types +++ b/testdata/baselines/reference/submodule/compiler/resolveNameWithNamspace.types @@ -31,7 +31,7 @@ var myAssert = require('assert') exports.equal = myAssert.equal >exports.equal = myAssert.equal : any >exports.equal : any ->exports : any +>exports : typeof import("app") >equal : any >myAssert.equal : any >myAssert : any @@ -40,6 +40,6 @@ exports.equal = myAssert.equal exports.equal() >exports.equal() : any >exports.equal : any ->exports : any +>exports : typeof import("app") >equal : any diff --git a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).symbols b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).symbols index 6e5527be87..a14d4bc780 100644 --- a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).symbols +++ b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).symbols @@ -4,3 +4,7 @@ import "server-only"; +=== node_modules/server-only/index.js === +throw new Error(); +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + diff --git a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).symbols.diff b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).symbols.diff new file mode 100644 index 0000000000..a9cd7402f0 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).symbols.diff @@ -0,0 +1,10 @@ +--- old.sideEffectImports4(nouncheckedsideeffectimports=false).symbols ++++ new.sideEffectImports4(nouncheckedsideeffectimports=false).symbols +@@= skipped -3, +3 lines =@@ + + import "server-only"; + ++=== node_modules/server-only/index.js === ++throw new Error(); ++>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++ diff --git a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).types b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).types index 6e5527be87..ed4ceb93b2 100644 --- a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).types +++ b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).types @@ -4,3 +4,8 @@ import "server-only"; +=== node_modules/server-only/index.js === +throw new Error(); +>new Error() : Error +>Error : ErrorConstructor + diff --git a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).errors.txt b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).errors.txt deleted file mode 100644 index 668803d761..0000000000 --- a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).errors.txt +++ /dev/null @@ -1,33 +0,0 @@ -index.ts(1,8): error TS2307: Cannot find module 'server-only' or its corresponding type declarations. - - -==== index.ts (1 errors) ==== - import "server-only"; - ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module 'server-only' or its corresponding type declarations. - -==== node_modules/server-only/package.json (0 errors) ==== - { - "name": "server-only", - "version": "0.0.1", - "main": "index.js", - "exports": { - ".": { - "react-server": "./empty.js", - "default": "./index.js" - } - } - } - -==== node_modules/server-only/index.js (0 errors) ==== - throw new Error(); - -==== node_modules/server-only/empty.js (0 errors) ==== - // Empty - -==== package.json (0 errors) ==== - { - "name": "root", - "type": "module" - } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).errors.txt.diff b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).errors.txt.diff deleted file mode 100644 index 0c4b803b18..0000000000 --- a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).errors.txt.diff +++ /dev/null @@ -1,38 +0,0 @@ ---- old.sideEffectImports4(nouncheckedsideeffectimports=true).errors.txt -+++ new.sideEffectImports4(nouncheckedsideeffectimports=true).errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.ts(1,8): error TS2307: Cannot find module 'server-only' or its corresponding type declarations. -+ -+ -+==== index.ts (1 errors) ==== -+ import "server-only"; -+ ~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module 'server-only' or its corresponding type declarations. -+ -+==== node_modules/server-only/package.json (0 errors) ==== -+ { -+ "name": "server-only", -+ "version": "0.0.1", -+ "main": "index.js", -+ "exports": { -+ ".": { -+ "react-server": "./empty.js", -+ "default": "./index.js" -+ } -+ } -+ } -+ -+==== node_modules/server-only/index.js (0 errors) ==== -+ throw new Error(); -+ -+==== node_modules/server-only/empty.js (0 errors) ==== -+ // Empty -+ -+==== package.json (0 errors) ==== -+ { -+ "name": "root", -+ "type": "module" -+ } -+ diff --git a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).symbols b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).symbols index 6e5527be87..a14d4bc780 100644 --- a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).symbols +++ b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).symbols @@ -4,3 +4,7 @@ import "server-only"; +=== node_modules/server-only/index.js === +throw new Error(); +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + diff --git a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).symbols.diff b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).symbols.diff new file mode 100644 index 0000000000..bcc9d5735d --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).symbols.diff @@ -0,0 +1,10 @@ +--- old.sideEffectImports4(nouncheckedsideeffectimports=true).symbols ++++ new.sideEffectImports4(nouncheckedsideeffectimports=true).symbols +@@= skipped -3, +3 lines =@@ + + import "server-only"; + ++=== node_modules/server-only/index.js === ++throw new Error(); ++>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++ diff --git a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).types b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).types index 6e5527be87..ed4ceb93b2 100644 --- a/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).types +++ b/testdata/baselines/reference/submodule/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).types @@ -4,3 +4,8 @@ import "server-only"; +=== node_modules/server-only/index.js === +throw new Error(); +>new Error() : Error +>Error : ErrorConstructor + diff --git a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt index eb6dadf737..1e6ac9586c 100644 --- a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.errors.txt @@ -1,18 +1,15 @@ a.js(3,12): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -a.js(3,35): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -a.js(4,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +a.js(4,5): error TS1231: An export assignment must be at the top level of a file or module declaration. -==== a.js (3 errors) ==== +==== a.js (2 errors) ==== function fn() {} if (typeof module === 'object' && module.exports) { ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - ~~~~~~ !!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports = fn; ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS1231: An export assignment must be at the top level of a file or module declaration. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.symbols b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.symbols index 684b2aa86d..e7ec94d877 100644 --- a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.symbols +++ b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.symbols @@ -5,7 +5,14 @@ function fn() {} >fn : Symbol(fn, Decl(a.js, 0, 0)) if (typeof module === 'object' && module.exports) { +>module.exports : Symbol(fn, Decl(a.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(fn, Decl(a.js, 0, 0)) + module.exports = fn; +>module.exports : Symbol(fn, Decl(a.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(fn, Decl(a.js, 0, 0)) >fn : Symbol(fn, Decl(a.js, 0, 0)) } diff --git a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.symbols.diff b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.symbols.diff index 2eedcab9d9..542b1b3da3 100644 --- a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.symbols.diff +++ b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.symbols.diff @@ -8,11 +8,17 @@ ->module.exports : Symbol(module.exports, Decl(a.js, 0, 0)) ->module : Symbol(module, Decl(a.js, 2, 51)) ->exports : Symbol(module.exports, Decl(a.js, 0, 0)) -- ++>module.exports : Symbol(fn, Decl(a.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(fn, Decl(a.js, 0, 0)) + module.exports = fn; ->module.exports : Symbol(module.exports, Decl(a.js, 0, 0)) ->module : Symbol(export=, Decl(a.js, 2, 51)) ->exports : Symbol(export=, Decl(a.js, 2, 51)) ++>module.exports : Symbol(fn, Decl(a.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(fn, Decl(a.js, 0, 0)) >fn : Symbol(fn, Decl(a.js, 0, 0)) } diff --git a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.types b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.types index 67c62a258a..86ae1b1225 100644 --- a/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.types +++ b/testdata/baselines/reference/submodule/compiler/truthinessCallExpressionCoercion4.types @@ -5,20 +5,20 @@ function fn() {} >fn : () => void if (typeof module === 'object' && module.exports) { ->typeof module === 'object' && module.exports : any +>typeof module === 'object' && module.exports : false | (() => void) >typeof module === 'object' : boolean >typeof module : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" >module : any >'object' : "object" ->module.exports : any ->module : any ->exports : any +>module.exports : () => void +>module : { fn: () => void; } +>exports : () => void module.exports = fn; >module.exports = fn : () => void ->module.exports : any ->module : any ->exports : any +>module.exports : () => void +>module : { fn: () => void; } +>exports : () => void >fn : () => void } diff --git a/testdata/baselines/reference/submodule/compiler/tslibInJs.errors.txt b/testdata/baselines/reference/submodule/compiler/tslibInJs.errors.txt index bd6bb6b103..b6e9552c1e 100644 --- a/testdata/baselines/reference/submodule/compiler/tslibInJs.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/tslibInJs.errors.txt @@ -1,8 +1,8 @@ -main.js(2,17): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +main.js(2,25): error TS2307: Cannot find module 'bar' or its corresponding type declarations. ==== main.js (1 errors) ==== "use strict"; const { foo } = require("bar"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file + ~~~~~ +!!! error TS2307: Cannot find module 'bar' or its corresponding type declarations. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/tslibInJs.symbols b/testdata/baselines/reference/submodule/compiler/tslibInJs.symbols index e4879a91d8..109f508318 100644 --- a/testdata/baselines/reference/submodule/compiler/tslibInJs.symbols +++ b/testdata/baselines/reference/submodule/compiler/tslibInJs.symbols @@ -4,4 +4,5 @@ "use strict"; const { foo } = require("bar"); >foo : Symbol(foo, Decl(main.js, 1, 7)) +>require : Symbol(require) diff --git a/testdata/baselines/reference/submodule/compiler/tslibInJs.symbols.diff b/testdata/baselines/reference/submodule/compiler/tslibInJs.symbols.diff deleted file mode 100644 index b15a6b85cf..0000000000 --- a/testdata/baselines/reference/submodule/compiler/tslibInJs.symbols.diff +++ /dev/null @@ -1,8 +0,0 @@ ---- old.tslibInJs.symbols -+++ new.tslibInJs.symbols -@@= skipped -3, +3 lines =@@ - "use strict"; - const { foo } = require("bar"); - >foo : Symbol(foo, Decl(main.js, 1, 7)) -->require : Symbol(require) - diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.errors.txt b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.errors.txt index cffe280664..9953bb7f4a 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.errors.txt @@ -1,20 +1,17 @@ -assignmentToVoidZero1.js(2,1): error TS2304: Cannot find name 'exports'. -assignmentToVoidZero1.js(2,13): error TS2304: Cannot find name 'exports'. -assignmentToVoidZero1.js(3,1): error TS2304: Cannot find name 'exports'. -assignmentToVoidZero1.js(4,1): error TS2304: Cannot find name 'exports'. +assignmentToVoidZero1.js(2,1): error TS2323: Cannot redeclare exported variable 'y'. +assignmentToVoidZero1.js(4,1): error TS2322: Type '2' is not assignable to type 'undefined'. +assignmentToVoidZero1.js(4,1): error TS2323: Cannot redeclare exported variable 'y'. -==== assignmentToVoidZero1.js (4 errors) ==== +==== assignmentToVoidZero1.js (3 errors) ==== // #38552 exports.y = exports.x = void 0; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2323: Cannot redeclare exported variable 'y'. exports.x = 1; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. exports.y = 2; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~~~~ +!!! error TS2322: Type '2' is not assignable to type 'undefined'. + ~~~~~~~~~~~~~ +!!! error TS2323: Cannot redeclare exported variable 'y'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.symbols b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.symbols index 414f08f548..f3e4a77b42 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.symbols +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.symbols @@ -1,9 +1,22 @@ //// [tests/cases/conformance/salsa/assignmentToVoidZero1.ts] //// === assignmentToVoidZero1.js === - // #38552 exports.y = exports.x = void 0; +>exports.y : Symbol(y, Decl(assignmentToVoidZero1.js, 0, 0), Decl(assignmentToVoidZero1.js, 2, 14)) +>exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0)) +>y : Symbol(y, Decl(assignmentToVoidZero1.js, 0, 0), Decl(assignmentToVoidZero1.js, 2, 14)) +>exports.x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) +>exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0)) +>x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) + exports.x = 1; +>exports.x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) +>exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0)) +>x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) + exports.y = 2; +>exports.y : Symbol(y, Decl(assignmentToVoidZero1.js, 0, 0), Decl(assignmentToVoidZero1.js, 2, 14)) +>exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0)) +>y : Symbol(y, Decl(assignmentToVoidZero1.js, 0, 0), Decl(assignmentToVoidZero1.js, 2, 14)) diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.symbols.diff b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.symbols.diff index c6a156f5ac..9f3e61c412 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.symbols.diff @@ -1,26 +1,29 @@ --- old.assignmentToVoidZero1.symbols +++ new.assignmentToVoidZero1.symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/conformance/salsa/assignmentToVoidZero1.ts] //// - +@@= skipped -2, +2 lines =@@ === assignmentToVoidZero1.js === -+ // #38552 exports.y = exports.x = void 0; ->exports.y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14)) -->exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0)) ++>exports.y : Symbol(y, Decl(assignmentToVoidZero1.js, 0, 0), Decl(assignmentToVoidZero1.js, 2, 14)) + >exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0)) ->y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14)) -->exports.x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) -->exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0)) -->x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) -- ++>y : Symbol(y, Decl(assignmentToVoidZero1.js, 0, 0), Decl(assignmentToVoidZero1.js, 2, 14)) + >exports.x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) + >exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0)) + >x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) + exports.x = 1; -->exports.x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) + >exports.x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) ->exports : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) -->x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) -- ++>exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0)) + >x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31)) + exports.y = 2; ->exports.y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14)) ->exports : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14)) ->y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14)) ++>exports.y : Symbol(y, Decl(assignmentToVoidZero1.js, 0, 0), Decl(assignmentToVoidZero1.js, 2, 14)) ++>exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0)) ++>y : Symbol(y, Decl(assignmentToVoidZero1.js, 0, 0), Decl(assignmentToVoidZero1.js, 2, 14)) diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.types b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.types index c2e9d92cfd..276508101e 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.types +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero1.types @@ -4,27 +4,27 @@ // #38552 exports.y = exports.x = void 0; >exports.y = exports.x = void 0 : undefined ->exports.y : any ->exports : any ->y : any +>exports.y : undefined +>exports : typeof import("assignmentToVoidZero1") +>y : undefined >exports.x = void 0 : undefined ->exports.x : any ->exports : any ->x : any +>exports.x : 1 +>exports : typeof import("assignmentToVoidZero1") +>x : 1 >void 0 : undefined >0 : 0 exports.x = 1; >exports.x = 1 : 1 ->exports.x : any ->exports : any ->x : any +>exports.x : 1 +>exports : typeof import("assignmentToVoidZero1") +>x : 1 >1 : 1 exports.y = 2; >exports.y = 2 : 2 ->exports.y : any ->exports : any ->y : any +>exports.y : undefined +>exports : typeof import("assignmentToVoidZero1") +>y : undefined >2 : 2 diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.errors.txt b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.errors.txt index 4759e88317..63593f717d 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.errors.txt @@ -1,20 +1,14 @@ -assignmentToVoidZero2.js(1,1): error TS2304: Cannot find name 'exports'. -assignmentToVoidZero2.js(2,1): error TS2304: Cannot find name 'exports'. assignmentToVoidZero2.js(4,3): error TS2339: Property 'x' does not exist on type '{}'. assignmentToVoidZero2.js(5,3): error TS2339: Property 'y' does not exist on type '{}'. assignmentToVoidZero2.js(6,3): error TS2339: Property 'x' does not exist on type '{}'. assignmentToVoidZero2.js(6,9): error TS2339: Property 'y' does not exist on type '{}'. assignmentToVoidZero2.js(12,9): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. -importer.js(1,22): error TS2306: File 'assignmentToVoidZero2.js' is not a module. +importer.js(2,1): error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. -==== assignmentToVoidZero2.js (7 errors) ==== +==== assignmentToVoidZero2.js (5 errors) ==== exports.j = 1; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. exports.k = void 0; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. var o = {} o.x = 1 ~ @@ -39,7 +33,7 @@ importer.js(1,22): error TS2306: File 'assignmentToVoidZero2.js' is not a module ==== importer.js (1 errors) ==== import { j, k } from './assignmentToVoidZero2' - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2306: File 'assignmentToVoidZero2.js' is not a module. j + k + ~~~~~ +!!! error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols index a10237115b..e71bf2034d 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols @@ -2,7 +2,15 @@ === assignmentToVoidZero2.js === exports.j = 1; +>exports.j : Symbol(j, Decl(assignmentToVoidZero2.js, 0, 0)) +>exports : Symbol("assignmentToVoidZero2", Decl(assignmentToVoidZero2.js, 0, 0)) +>j : Symbol(j, Decl(assignmentToVoidZero2.js, 0, 0)) + exports.k = void 0; +>exports.k : Symbol(k, Decl(assignmentToVoidZero2.js, 0, 14)) +>exports : Symbol("assignmentToVoidZero2", Decl(assignmentToVoidZero2.js, 0, 0)) +>k : Symbol(k, Decl(assignmentToVoidZero2.js, 0, 14)) + var o = {} >o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols.diff b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols.diff index 4eda16bc3e..76ec473f84 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.symbols.diff @@ -1,16 +1,18 @@ --- old.assignmentToVoidZero2.symbols +++ new.assignmentToVoidZero2.symbols -@@= skipped -1, +1 lines =@@ - +@@= skipped -2, +2 lines =@@ === assignmentToVoidZero2.js === exports.j = 1; -->exports.j : Symbol(j, Decl(assignmentToVoidZero2.js, 0, 0)) + >exports.j : Symbol(j, Decl(assignmentToVoidZero2.js, 0, 0)) ->exports : Symbol(j, Decl(assignmentToVoidZero2.js, 0, 0)) -->j : Symbol(j, Decl(assignmentToVoidZero2.js, 0, 0)) -- ++>exports : Symbol("assignmentToVoidZero2", Decl(assignmentToVoidZero2.js, 0, 0)) + >j : Symbol(j, Decl(assignmentToVoidZero2.js, 0, 0)) + exports.k = void 0; -->exports : Symbol("assignmentToVoidZero2", Decl(assignmentToVoidZero2.js, 0, 0)) -- ++>exports.k : Symbol(k, Decl(assignmentToVoidZero2.js, 0, 14)) + >exports : Symbol("assignmentToVoidZero2", Decl(assignmentToVoidZero2.js, 0, 0)) ++>k : Symbol(k, Decl(assignmentToVoidZero2.js, 0, 14)) + var o = {} ->o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3), Decl(assignmentToVoidZero2.js, 2, 10)) +>o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.types b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.types index 6d0b7270dc..5b02e0787b 100644 --- a/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.types +++ b/testdata/baselines/reference/submodule/conformance/assignmentToVoidZero2.types @@ -3,16 +3,16 @@ === assignmentToVoidZero2.js === exports.j = 1; >exports.j = 1 : 1 ->exports.j : any ->exports : any ->j : any +>exports.j : 1 +>exports : typeof import("assignmentToVoidZero2") +>j : 1 >1 : 1 exports.k = void 0; >exports.k = void 0 : undefined ->exports.k : any ->exports : any ->k : any +>exports.k : undefined +>exports : typeof import("assignmentToVoidZero2") +>k : undefined >void 0 : undefined >0 : 0 @@ -78,11 +78,11 @@ c.p + c.q === importer.js === import { j, k } from './assignmentToVoidZero2' ->j : any ->k : any +>j : 1 +>k : undefined j + k >j + k : any ->j : any ->k : any +>j : 1 +>k : undefined diff --git a/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.errors.txt b/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.errors.txt deleted file mode 100644 index 0d7fc7ff30..0000000000 --- a/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -loop.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== loop.js (1 errors) ==== - var loop1 = loop2; - var loop2 = loop1; - - module.exports = loop2; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.symbols b/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.symbols index 173fb536dd..cf0725a551 100644 --- a/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.symbols @@ -10,5 +10,8 @@ var loop2 = loop1; >loop1 : Symbol(loop1, Decl(loop.js, 0, 3)) module.exports = loop2; +>module.exports : Symbol(loop2, Decl(loop.js, 1, 3)) +>module : Symbol(module.exports) +>exports : Symbol(loop2, Decl(loop.js, 1, 3)) >loop2 : Symbol(loop2, Decl(loop.js, 1, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.symbols.diff index 4e144b396a..9c22a5dc9c 100644 --- a/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.symbols.diff @@ -7,5 +7,8 @@ ->module.exports : Symbol(module.exports, Decl(loop.js, 0, 0)) ->module : Symbol(export=, Decl(loop.js, 1, 18)) ->exports : Symbol(export=, Decl(loop.js, 1, 18)) ++>module.exports : Symbol(loop2, Decl(loop.js, 1, 3)) ++>module : Symbol(module.exports) ++>exports : Symbol(loop2, Decl(loop.js, 1, 3)) >loop2 : Symbol(loop2, Decl(loop.js, 1, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.types b/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.types index b1a0bc29a6..6724f06fcc 100644 --- a/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/binderUninitializedModuleExportsAssignment.types @@ -12,7 +12,7 @@ var loop2 = loop1; module.exports = loop2; >module.exports = loop2 : any >module.exports : any ->module : any +>module : { loop2: any; } >exports : any >loop2 : any diff --git a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).symbols b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).symbols index 09dc3fdeaa..c93b153aff 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).symbols +++ b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).symbols @@ -36,9 +36,12 @@ import("./a"); const _ = require("./a"); >_ : Symbol(_, Decl(mainJs.js, 2, 5)) >require : Symbol(require, Decl(index.d.ts, 0, 11)) +>"./a" : Symbol("/a", Decl(a.ts, 0, 0)) _.a; // any +>_.a : Symbol(a, Decl(a.ts, 0, 12)) >_ : Symbol(_, Decl(mainJs.js, 2, 5)) +>a : Symbol(a, Decl(a.ts, 0, 12)) === /main.ts === import {} from "./a"; diff --git a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).symbols.diff b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).symbols.diff index 0a80455558..becf9c3ccc 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).symbols.diff @@ -10,11 +10,14 @@ >_ : Symbol(_, Decl(mainJs.js, 2, 5)) >require : Symbol(require, Decl(index.d.ts, 0, 11)) ->"./a" : Symbol(_, Decl(a.ts, 0, 0)) ++>"./a" : Symbol("/a", Decl(a.ts, 0, 0)) _.a; // any ->_.a : Symbol(_.a, Decl(a.ts, 0, 12)) ++>_.a : Symbol(a, Decl(a.ts, 0, 12)) >_ : Symbol(_, Decl(mainJs.js, 2, 5)) ->a : Symbol(_.a, Decl(a.ts, 0, 12)) ++>a : Symbol(a, Decl(a.ts, 0, 12)) === /main.ts === import {} from "./a"; diff --git a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).types b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).types index 05034b42f1..c23a92e7e9 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).types +++ b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=esnext).types @@ -37,15 +37,15 @@ import("./a"); >"./a" : "./a" const _ = require("./a"); ->_ : any ->require("./a") : any +>_ : typeof import("/a") +>require("./a") : typeof import("/a") >require : (...args: any[]) => any >"./a" : "./a" _.a; // any ->_.a : any ->_ : any ->a : any +>_.a : "a" +>_ : typeof import("/a") +>a : "a" === /main.ts === import {} from "./a"; diff --git a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).symbols b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).symbols index 09dc3fdeaa..c93b153aff 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).symbols +++ b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).symbols @@ -36,9 +36,12 @@ import("./a"); const _ = require("./a"); >_ : Symbol(_, Decl(mainJs.js, 2, 5)) >require : Symbol(require, Decl(index.d.ts, 0, 11)) +>"./a" : Symbol("/a", Decl(a.ts, 0, 0)) _.a; // any +>_.a : Symbol(a, Decl(a.ts, 0, 12)) >_ : Symbol(_, Decl(mainJs.js, 2, 5)) +>a : Symbol(a, Decl(a.ts, 0, 12)) === /main.ts === import {} from "./a"; diff --git a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).symbols.diff b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).symbols.diff index 7dab315f39..9302abca10 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).symbols.diff @@ -10,11 +10,14 @@ >_ : Symbol(_, Decl(mainJs.js, 2, 5)) >require : Symbol(require, Decl(index.d.ts, 0, 11)) ->"./a" : Symbol(_, Decl(a.ts, 0, 0)) ++>"./a" : Symbol("/a", Decl(a.ts, 0, 0)) _.a; // any ->_.a : Symbol(_.a, Decl(a.ts, 0, 12)) ++>_.a : Symbol(a, Decl(a.ts, 0, 12)) >_ : Symbol(_, Decl(mainJs.js, 2, 5)) ->a : Symbol(_.a, Decl(a.ts, 0, 12)) ++>a : Symbol(a, Decl(a.ts, 0, 12)) === /main.ts === import {} from "./a"; diff --git a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).types b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).types index 05034b42f1..c23a92e7e9 100644 --- a/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).types +++ b/testdata/baselines/reference/submodule/conformance/bundlerSyntaxRestrictions(module=preserve).types @@ -37,15 +37,15 @@ import("./a"); >"./a" : "./a" const _ = require("./a"); ->_ : any ->require("./a") : any +>_ : typeof import("/a") +>require("./a") : typeof import("/a") >require : (...args: any[]) => any >"./a" : "./a" _.a; // any ->_.a : any ->_ : any ->a : any +>_.a : "a" +>_ : typeof import("/a") +>a : "a" === /main.ts === import {} from "./a"; diff --git a/testdata/baselines/reference/submodule/conformance/callbackCrossModule.errors.txt b/testdata/baselines/reference/submodule/conformance/callbackCrossModule.errors.txt index dbbbe1f34c..d1c4231be8 100644 --- a/testdata/baselines/reference/submodule/conformance/callbackCrossModule.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/callbackCrossModule.errors.txt @@ -1,23 +1,20 @@ -mod1.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -use.js(1,20): error TS2306: File 'mod1.js' is not a module. +use.js(1,30): error TS2694: Namespace 'C' has no exported member 'Con'. -==== mod1.js (1 errors) ==== +==== mod1.js (0 errors) ==== /** @callback Con - some kind of continuation * @param {object | undefined} error * @return {any} I don't even know what this should return */ module.exports = C - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. function C() { this.p = 1 } ==== use.js (1 errors) ==== /** @param {import('./mod1').Con} k */ - ~~~~~~~~ -!!! error TS2306: File 'mod1.js' is not a module. + ~~~ +!!! error TS2694: Namespace 'C' has no exported member 'Con'. function f(k) { if (1 === 2 - 1) { // I guess basic math works! diff --git a/testdata/baselines/reference/submodule/conformance/callbackCrossModule.symbols b/testdata/baselines/reference/submodule/conformance/callbackCrossModule.symbols index cf7f25ac43..a3c308ae21 100644 --- a/testdata/baselines/reference/submodule/conformance/callbackCrossModule.symbols +++ b/testdata/baselines/reference/submodule/conformance/callbackCrossModule.symbols @@ -6,6 +6,9 @@ * @return {any} I don't even know what this should return */ module.exports = C +>module.exports : Symbol(C, Decl(mod1.js, 4, 18)) +>module : Symbol(module.exports) +>exports : Symbol(C, Decl(mod1.js, 4, 18)) >C : Symbol(C, Decl(mod1.js, 4, 18)) function C() { diff --git a/testdata/baselines/reference/submodule/conformance/callbackCrossModule.symbols.diff b/testdata/baselines/reference/submodule/conformance/callbackCrossModule.symbols.diff index f7dd3bda6f..d6547a6d1a 100644 --- a/testdata/baselines/reference/submodule/conformance/callbackCrossModule.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/callbackCrossModule.symbols.diff @@ -7,6 +7,9 @@ ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 0, 0)) ->exports : Symbol(export=, Decl(mod1.js, 0, 0)) ++>module.exports : Symbol(C, Decl(mod1.js, 4, 18)) ++>module : Symbol(module.exports) ++>exports : Symbol(C, Decl(mod1.js, 4, 18)) >C : Symbol(C, Decl(mod1.js, 4, 18)) function C() { diff --git a/testdata/baselines/reference/submodule/conformance/callbackCrossModule.types b/testdata/baselines/reference/submodule/conformance/callbackCrossModule.types index 3e1c80c725..f014c62629 100644 --- a/testdata/baselines/reference/submodule/conformance/callbackCrossModule.types +++ b/testdata/baselines/reference/submodule/conformance/callbackCrossModule.types @@ -7,9 +7,9 @@ */ module.exports = C >module.exports = C : () => void ->module.exports : any ->module : any ->exports : any +>module.exports : () => void +>module : { C: () => void; } +>exports : () => void >C : () => void function C() { diff --git a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.errors.txt b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.errors.txt new file mode 100644 index 0000000000..54fcff7501 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.errors.txt @@ -0,0 +1,36 @@ +use.js(3,9): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. +use.js(4,9): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. + + +==== use.js (2 errors) ==== + /// + var mod = require('./mod'); + var a = new mod.A() + ~~~~~~~~~~~ +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. + var b = new mod.B() + ~~~~~~~~~~~ +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. + a.m('nope') + b.m('not really') + +==== types.d.ts (0 errors) ==== + declare function require(name: string): any; + declare var exports: any; +==== mod.js (0 errors) ==== + /// + var A = function A() { + this.a = 1 + } + var B = function B() { + this.b = 2 + } + exports.A = A + exports.B = B + A.prototype = B.prototype = { + /** @param {number} n */ + m(n) { + return n + 1 + } + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols index 791a5288d2..ba8fe2ff41 100644 --- a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols @@ -5,14 +5,19 @@ var mod = require('./mod'); >mod : Symbol(mod, Decl(use.js, 1, 3)) >require : Symbol(require, Decl(types.d.ts, 0, 0)) +>'./mod' : Symbol("mod", Decl(mod.js, 0, 0)) var a = new mod.A() >a : Symbol(a, Decl(use.js, 2, 3)) +>mod.A : Symbol(A, Decl(mod.js, 6, 1)) >mod : Symbol(mod, Decl(use.js, 1, 3)) +>A : Symbol(A, Decl(mod.js, 6, 1)) var b = new mod.B() >b : Symbol(b, Decl(use.js, 3, 3)) +>mod.B : Symbol(B, Decl(mod.js, 7, 13)) >mod : Symbol(mod, Decl(use.js, 1, 3)) +>B : Symbol(B, Decl(mod.js, 7, 13)) a.m('nope') >a : Symbol(a, Decl(use.js, 2, 3)) @@ -28,3 +33,47 @@ declare function require(name: string): any; declare var exports: any; >exports : Symbol(exports, Decl(types.d.ts, 1, 11)) +=== mod.js === +/// +var A = function A() { +>A : Symbol(A, Decl(mod.js, 1, 3)) +>A : Symbol(A, Decl(mod.js, 1, 7)) + + this.a = 1 +} +var B = function B() { +>B : Symbol(B, Decl(mod.js, 4, 3)) +>B : Symbol(B, Decl(mod.js, 4, 7)) + + this.b = 2 +} +exports.A = A +>exports.A : Symbol(A, Decl(mod.js, 6, 1)) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>A : Symbol(A, Decl(mod.js, 6, 1)) +>A : Symbol(A, Decl(mod.js, 1, 3)) + +exports.B = B +>exports.B : Symbol(B, Decl(mod.js, 7, 13)) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>B : Symbol(B, Decl(mod.js, 7, 13)) +>B : Symbol(B, Decl(mod.js, 4, 3)) + +A.prototype = B.prototype = { +>A.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>A : Symbol(A, Decl(mod.js, 1, 3)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>B.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>B : Symbol(B, Decl(mod.js, 4, 3)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + + /** @param {number} n */ + m(n) { +>m : Symbol(m, Decl(mod.js, 9, 29)) +>n : Symbol(n, Decl(mod.js, 11, 6)) + + return n + 1 +>n : Symbol(n, Decl(mod.js, 11, 6)) + } +} + diff --git a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols.diff index d8edf4b12e..01bc93a204 100644 --- a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.symbols.diff @@ -5,18 +5,23 @@ >mod : Symbol(mod, Decl(use.js, 1, 3)) >require : Symbol(require, Decl(types.d.ts, 0, 0)) ->'./mod' : Symbol(mod, Decl(mod.js, 0, 0)) ++>'./mod' : Symbol("mod", Decl(mod.js, 0, 0)) var a = new mod.A() >a : Symbol(a, Decl(use.js, 2, 3)) ->mod.A : Symbol(mod.A, Decl(mod.js, 6, 1)) ++>mod.A : Symbol(A, Decl(mod.js, 6, 1)) >mod : Symbol(mod, Decl(use.js, 1, 3)) ->A : Symbol(mod.A, Decl(mod.js, 6, 1)) ++>A : Symbol(A, Decl(mod.js, 6, 1)) var b = new mod.B() >b : Symbol(b, Decl(use.js, 3, 3)) ->mod.B : Symbol(mod.B, Decl(mod.js, 7, 13)) ++>mod.B : Symbol(B, Decl(mod.js, 7, 13)) >mod : Symbol(mod, Decl(use.js, 1, 3)) ->B : Symbol(mod.B, Decl(mod.js, 7, 13)) ++>B : Symbol(B, Decl(mod.js, 7, 13)) a.m('nope') ->a.m : Symbol(m, Decl(mod.js, 9, 29)) @@ -30,57 +35,58 @@ === types.d.ts === declare function require(name: string): any; -@@= skipped -32, +23 lines =@@ - declare var exports: any; - >exports : Symbol(exports, Decl(types.d.ts, 1, 11)) - --=== mod.js === --/// --var A = function A() { +@@= skipped -35, +31 lines =@@ + === mod.js === + /// + var A = function A() { ->A : Symbol(A, Decl(mod.js, 1, 3), Decl(mod.js, 8, 13)) -->A : Symbol(A, Decl(mod.js, 1, 7)) -- -- this.a = 1 ++>A : Symbol(A, Decl(mod.js, 1, 3)) + >A : Symbol(A, Decl(mod.js, 1, 7)) + + this.a = 1 ->this.a : Symbol(A.a, Decl(mod.js, 1, 22)) ->this : Symbol(A, Decl(mod.js, 1, 7)) ->a : Symbol(A.a, Decl(mod.js, 1, 22)) --} --var B = function B() { + } + var B = function B() { ->B : Symbol(B, Decl(mod.js, 4, 3), Decl(mod.js, 9, 13)) -->B : Symbol(B, Decl(mod.js, 4, 7)) -- -- this.b = 2 ++>B : Symbol(B, Decl(mod.js, 4, 3)) + >B : Symbol(B, Decl(mod.js, 4, 7)) + + this.b = 2 ->this.b : Symbol(B.b, Decl(mod.js, 4, 22)) ->this : Symbol(B, Decl(mod.js, 4, 7)) ->b : Symbol(B.b, Decl(mod.js, 4, 22)) --} --exports.A = A -->exports.A : Symbol(A, Decl(mod.js, 6, 1)) + } + exports.A = A + >exports.A : Symbol(A, Decl(mod.js, 6, 1)) ->exports : Symbol(A, Decl(mod.js, 6, 1)) -->A : Symbol(A, Decl(mod.js, 6, 1)) ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) + >A : Symbol(A, Decl(mod.js, 6, 1)) ->A : Symbol(A, Decl(mod.js, 1, 3), Decl(mod.js, 8, 13)) -- --exports.B = B -->exports.B : Symbol(B, Decl(mod.js, 7, 13)) ++>A : Symbol(A, Decl(mod.js, 1, 3)) + + exports.B = B + >exports.B : Symbol(B, Decl(mod.js, 7, 13)) ->exports : Symbol(B, Decl(mod.js, 7, 13)) -->B : Symbol(B, Decl(mod.js, 7, 13)) ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) + >B : Symbol(B, Decl(mod.js, 7, 13)) ->B : Symbol(B, Decl(mod.js, 4, 3), Decl(mod.js, 9, 13)) -- --A.prototype = B.prototype = { ++>B : Symbol(B, Decl(mod.js, 4, 3)) + + A.prototype = B.prototype = { ->A.prototype : Symbol(A.prototype, Decl(mod.js, 8, 13)) ->A : Symbol(A, Decl(mod.js, 1, 3), Decl(mod.js, 8, 13)) ->prototype : Symbol(A.prototype, Decl(mod.js, 8, 13)) ->B.prototype : Symbol(B.prototype, Decl(mod.js, 9, 13)) ->B : Symbol(B, Decl(mod.js, 4, 3), Decl(mod.js, 9, 13)) ->prototype : Symbol(B.prototype, Decl(mod.js, 9, 13)) -- -- /** @param {number} n */ -- m(n) { -->m : Symbol(m, Decl(mod.js, 9, 29)) -->n : Symbol(n, Decl(mod.js, 11, 6)) -- -- return n + 1 -->n : Symbol(n, Decl(mod.js, 11, 6)) -- } --} -- ++>A.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>A : Symbol(A, Decl(mod.js, 1, 3)) ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>B.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>B : Symbol(B, Decl(mod.js, 4, 3)) ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + + /** @param {number} n */ + m(n) { diff --git a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.types b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.types index a3627f661a..9982353065 100644 --- a/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/chainedPrototypeAssignment.types @@ -3,24 +3,24 @@ === use.js === /// var mod = require('./mod'); ->mod : any ->require('./mod') : any +>mod : typeof import("mod") +>require('./mod') : typeof import("mod") >require : (name: string) => any >'./mod' : "./mod" var a = new mod.A() >a : any >new mod.A() : any ->mod.A : any ->mod : any ->A : any +>mod.A : () => void +>mod : typeof import("mod") +>A : () => void var b = new mod.B() >b : any >new mod.B() : any ->mod.B : any ->mod : any ->B : any +>mod.B : () => void +>mod : typeof import("mod") +>B : () => void a.m('nope') >a.m('nope') : any @@ -44,3 +44,66 @@ declare function require(name: string): any; declare var exports: any; >exports : any +=== mod.js === +/// +var A = function A() { +>A : () => void +>function A() { this.a = 1} : () => void +>A : () => void + + this.a = 1 +>this.a = 1 : 1 +>this.a : any +>this : any +>a : any +>1 : 1 +} +var B = function B() { +>B : () => void +>function B() { this.b = 2} : () => void +>B : () => void + + this.b = 2 +>this.b = 2 : 2 +>this.b : any +>this : any +>b : any +>2 : 2 +} +exports.A = A +>exports.A = A : () => void +>exports.A : () => void +>exports : typeof import("mod") +>A : () => void +>A : () => void + +exports.B = B +>exports.B = B : () => void +>exports.B : () => void +>exports : typeof import("mod") +>B : () => void +>B : () => void + +A.prototype = B.prototype = { +>A.prototype = B.prototype = { /** @param {number} n */ m(n) { return n + 1 }} : { m: (n: number) => number; } +>A.prototype : any +>A : () => void +>prototype : any +>B.prototype = { /** @param {number} n */ m(n) { return n + 1 }} : { m: (n: number) => number; } +>B.prototype : any +>B : () => void +>prototype : any +>{ /** @param {number} n */ m(n) { return n + 1 }} : { m: (n: number) => number; } + + /** @param {number} n */ + m(n) { +>m : (n: number) => number +>n : number + + return n + 1 +>n + 1 : number +>n : number +>1 : 1 + } +} + diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.errors.txt b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.errors.txt index 26a4533441..6f9e480e14 100644 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.errors.txt @@ -1,5 +1,17 @@ -validator.ts(3,21): error TS2307: Cannot find module './mod1' or its corresponding type declarations. -validator.ts(23,21): error TS2307: Cannot find module './mod2' or its corresponding type declarations. +index.js(4,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(9,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod1.js(1,23): error TS2304: Cannot find name 'exports'. +mod1.js(2,23): error TS2304: Cannot find name 'exports'. +mod1.js(3,23): error TS2304: Cannot find name 'exports'. +mod1.js(4,23): error TS2304: Cannot find name 'exports'. +mod1.js(5,23): error TS2304: Cannot find name 'exports'. +mod2.js(1,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod2.js(2,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod2.js(3,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod2.js(4,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod2.js(5,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +validator.ts(3,21): error TS2306: File 'mod1.js' is not a module. +validator.ts(23,21): error TS2306: File 'mod2.js' is not a module. ==== validator.ts (2 errors) ==== @@ -7,7 +19,7 @@ validator.ts(23,21): error TS2307: Cannot find module './mod2' or its correspond import m1 = require("./mod1"); ~~~~~~~~ -!!! error TS2307: Cannot find module './mod1' or its corresponding type declarations. +!!! error TS2306: File 'mod1.js' is not a module. m1.thing; m1.readonlyProp; @@ -29,7 +41,7 @@ validator.ts(23,21): error TS2307: Cannot find module './mod2' or its correspond import m2 = require("./mod2"); ~~~~~~~~ -!!! error TS2307: Cannot find module './mod2' or its corresponding type declarations. +!!! error TS2306: File 'mod2.js' is not a module. m2.thing; m2.readonlyProp; @@ -49,38 +61,62 @@ validator.ts(23,21): error TS2307: Cannot find module './mod2' or its correspond m2.rwAccessors = "no"; m2.setonlyAccessor = 0; -==== mod1.js (0 errors) ==== +==== mod1.js (5 errors) ==== Object.defineProperty(exports, "thing", { value: 42, writable: true }); + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. Object.defineProperty(exports, "setonlyAccessor", { + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. /** @param {string} str */ set(str) { this.rwAccessors = Number(str) } }); -==== mod2.js (0 errors) ==== +==== mod2.js (5 errors) ==== Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }); + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }); + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }); + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. Object.defineProperty(module.exports, "setonlyAccessor", { + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** @param {string} str */ set(str) { this.rwAccessors = Number(str) } }); -==== index.js (0 errors) ==== +==== index.js (2 errors) ==== /** * @type {number} */ const q = require("./mod1").thing; + ~~~~~~~ +!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** * @type {string} */ const u = require("./mod2").thing; + ~~~~~~~ +!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.errors.txt.diff deleted file mode 100644 index a90c0dac90..0000000000 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.errors.txt.diff +++ /dev/null @@ -1,73 +0,0 @@ ---- old.checkExportsObjectAssignProperty.errors.txt -+++ new.checkExportsObjectAssignProperty.errors.txt -@@= skipped -0, +0 lines =@@ --validator.ts(17,4): error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. --validator.ts(18,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. --validator.ts(19,1): error TS2322: Type 'string' is not assignable to type 'number'. --validator.ts(20,1): error TS2322: Type 'string' is not assignable to type 'number'. --validator.ts(21,1): error TS2322: Type 'number' is not assignable to type 'string'. --validator.ts(37,4): error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. --validator.ts(38,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. --validator.ts(39,1): error TS2322: Type 'number' is not assignable to type 'string'. --validator.ts(40,1): error TS2322: Type 'string' is not assignable to type 'number'. --validator.ts(41,1): error TS2322: Type 'number' is not assignable to type 'string'. -+validator.ts(3,21): error TS2307: Cannot find module './mod1' or its corresponding type declarations. -+validator.ts(23,21): error TS2307: Cannot find module './mod2' or its corresponding type declarations. - - --==== validator.ts (10 errors) ==== -+==== validator.ts (2 errors) ==== - import "./"; - - import m1 = require("./mod1"); -+ ~~~~~~~~ -+!!! error TS2307: Cannot find module './mod1' or its corresponding type declarations. - - m1.thing; - m1.readonlyProp; -@@= skipped -27, +21 lines =@@ - - // disallowed assignments - m1.readonlyProp = "name"; -- ~~~~~~~~~~~~ --!!! error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. - m1.readonlyAccessor = 12; -- ~~~~~~~~~~~~~~~~ --!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. - m1.thing = "no"; -- ~~~~~~~~ --!!! error TS2322: Type 'string' is not assignable to type 'number'. - m1.rwAccessors = "no"; -- ~~~~~~~~~~~~~~ --!!! error TS2322: Type 'string' is not assignable to type 'number'. - m1.setonlyAccessor = 0; -- ~~~~~~~~~~~~~~~~~~ --!!! error TS2322: Type 'number' is not assignable to type 'string'. - - import m2 = require("./mod2"); -+ ~~~~~~~~ -+!!! error TS2307: Cannot find module './mod2' or its corresponding type declarations. - - m2.thing; - m2.readonlyProp; -@@= skipped -30, +22 lines =@@ - - // disallowed assignments - m2.readonlyProp = "name"; -- ~~~~~~~~~~~~ --!!! error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. - m2.readonlyAccessor = 12; -- ~~~~~~~~~~~~~~~~ --!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. - m2.thing = 0; -- ~~~~~~~~ --!!! error TS2322: Type 'number' is not assignable to type 'string'. - m2.rwAccessors = "no"; -- ~~~~~~~~~~~~~~ --!!! error TS2322: Type 'string' is not assignable to type 'number'. - m2.setonlyAccessor = 0; -- ~~~~~~~~~~~~~~~~~~ --!!! error TS2322: Type 'number' is not assignable to type 'string'. - - ==== mod1.js (0 errors) ==== - Object.defineProperty(exports, "thing", { value: 42, writable: true }); diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.symbols b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.symbols index 88e351f6fc..c36aa106e9 100644 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.symbols +++ b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.symbols @@ -91,3 +91,106 @@ m2.rwAccessors = "no"; m2.setonlyAccessor = 0; >m2 : Symbol(m2, Decl(validator.ts, 20, 23)) +=== mod1.js === +Object.defineProperty(exports, "thing", { value: 42, writable: true }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>value : Symbol(value, Decl(mod1.js, 0, 41)) +>writable : Symbol(writable, Decl(mod1.js, 0, 52)) + +Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>value : Symbol(value, Decl(mod1.js, 1, 48)) +>writable : Symbol(writable, Decl(mod1.js, 1, 64)) + +Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>get : Symbol(get, Decl(mod1.js, 2, 47)) +>set : Symbol(set, Decl(mod1.js, 2, 71)) +>_ : Symbol(_, Decl(mod1.js, 2, 76)) + +Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>get : Symbol(get, Decl(mod1.js, 3, 52)) + +Object.defineProperty(exports, "setonlyAccessor", { +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + + /** @param {string} str */ + set(str) { +>set : Symbol(set, Decl(mod1.js, 4, 51)) +>str : Symbol(str, Decl(mod1.js, 6, 8)) + + this.rwAccessors = Number(str) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>str : Symbol(str, Decl(mod1.js, 6, 8)) + } +}); + +=== mod2.js === +Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>value : Symbol(value, Decl(mod2.js, 0, 48)) +>writable : Symbol(writable, Decl(mod2.js, 0, 62)) + +Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>value : Symbol(value, Decl(mod2.js, 1, 55)) +>writable : Symbol(writable, Decl(mod2.js, 1, 71)) + +Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>get : Symbol(get, Decl(mod2.js, 2, 54)) +>set : Symbol(set, Decl(mod2.js, 2, 78)) +>_ : Symbol(_, Decl(mod2.js, 2, 83)) + +Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>get : Symbol(get, Decl(mod2.js, 3, 59)) + +Object.defineProperty(module.exports, "setonlyAccessor", { +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + + /** @param {string} str */ + set(str) { +>set : Symbol(set, Decl(mod2.js, 4, 58)) +>str : Symbol(str, Decl(mod2.js, 6, 8)) + + this.rwAccessors = Number(str) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>str : Symbol(str, Decl(mod2.js, 6, 8)) + } +}); + +=== index.js === +/** + * @type {number} + */ +const q = require("./mod1").thing; +>q : Symbol(q, Decl(index.js, 3, 5)) + +/** + * @type {string} + */ +const u = require("./mod2").thing; +>u : Symbol(u, Decl(index.js, 8, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.symbols.diff b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.symbols.diff index 959f093ae5..32b4e7eabe 100644 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.symbols.diff @@ -140,146 +140,162 @@ >m2 : Symbol(m2, Decl(validator.ts, 20, 23)) ->setonlyAccessor : Symbol(m2.setonlyAccessor, Decl(mod2.js, 3, 86)) --=== mod1.js === --Object.defineProperty(exports, "thing", { value: 42, writable: true }); + === mod1.js === + Object.defineProperty(exports, "thing", { value: 42, writable: true }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ->"thing" : Symbol(thing, Decl(mod1.js, 0, 0)) -->value : Symbol(value, Decl(mod1.js, 0, 41)) -->writable : Symbol(writable, Decl(mod1.js, 0, 52)) -- --Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >value : Symbol(value, Decl(mod1.js, 0, 41)) + >writable : Symbol(writable, Decl(mod1.js, 0, 52)) + + Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ->"readonlyProp" : Symbol(readonlyProp, Decl(mod1.js, 0, 71)) -->value : Symbol(value, Decl(mod1.js, 1, 48)) -->writable : Symbol(writable, Decl(mod1.js, 1, 64)) -- --Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >value : Symbol(value, Decl(mod1.js, 1, 48)) + >writable : Symbol(writable, Decl(mod1.js, 1, 64)) + + Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ->"rwAccessors" : Symbol(rwAccessors, Decl(mod1.js, 1, 84)) -->get : Symbol(get, Decl(mod1.js, 2, 47)) -->set : Symbol(set, Decl(mod1.js, 2, 71)) -->_ : Symbol(_, Decl(mod1.js, 2, 76)) -- --Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >get : Symbol(get, Decl(mod1.js, 2, 47)) + >set : Symbol(set, Decl(mod1.js, 2, 71)) + >_ : Symbol(_, Decl(mod1.js, 2, 76)) + + Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ->"readonlyAccessor" : Symbol(readonlyAccessor, Decl(mod1.js, 2, 97)) -->get : Symbol(get, Decl(mod1.js, 3, 52)) -- --Object.defineProperty(exports, "setonlyAccessor", { ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >get : Symbol(get, Decl(mod1.js, 3, 52)) + + Object.defineProperty(exports, "setonlyAccessor", { ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ->"setonlyAccessor" : Symbol(setonlyAccessor, Decl(mod1.js, 3, 79)) -- -- /** @param {string} str */ -- set(str) { -->set : Symbol(set, Decl(mod1.js, 4, 51)) -->str : Symbol(str, Decl(mod1.js, 6, 8)) -- -- this.rwAccessors = Number(str) ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + + /** @param {string} str */ + set(str) { +@@= skipped -186, +124 lines =@@ + >str : Symbol(str, Decl(mod1.js, 6, 8)) + + this.rwAccessors = Number(str) ->rwAccessors : Symbol(rwAccessors, Decl(mod1.js, 6, 14)) -->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) -->str : Symbol(str, Decl(mod1.js, 6, 8)) -- } --}); -- --=== mod2.js === --Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }); + >Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + >str : Symbol(str, Decl(mod1.js, 6, 8)) + } +@@= skipped -8, +7 lines =@@ + + === mod2.js === + Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->module.exports : Symbol(module.exports, Decl(mod2.js, 0, 0)) ->module : Symbol(module, Decl(mod2.js, 0, 22)) ->exports : Symbol(module.exports, Decl(mod2.js, 0, 0)) ->"thing" : Symbol(thing, Decl(mod2.js, 0, 0)) -->value : Symbol(value, Decl(mod2.js, 0, 48)) -->writable : Symbol(writable, Decl(mod2.js, 0, 62)) -- --Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >value : Symbol(value, Decl(mod2.js, 0, 48)) + >writable : Symbol(writable, Decl(mod2.js, 0, 62)) + + Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->module.exports : Symbol(module.exports, Decl(mod2.js, 0, 0)) ->module : Symbol(module, Decl(mod2.js, 0, 22)) ->exports : Symbol(module.exports, Decl(mod2.js, 0, 0)) ->"readonlyProp" : Symbol(readonlyProp, Decl(mod2.js, 0, 81)) -->value : Symbol(value, Decl(mod2.js, 1, 55)) -->writable : Symbol(writable, Decl(mod2.js, 1, 71)) -- --Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >value : Symbol(value, Decl(mod2.js, 1, 55)) + >writable : Symbol(writable, Decl(mod2.js, 1, 71)) + + Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->module.exports : Symbol(module.exports, Decl(mod2.js, 0, 0)) ->module : Symbol(module, Decl(mod2.js, 0, 22)) ->exports : Symbol(module.exports, Decl(mod2.js, 0, 0)) ->"rwAccessors" : Symbol(rwAccessors, Decl(mod2.js, 1, 91)) -->get : Symbol(get, Decl(mod2.js, 2, 54)) -->set : Symbol(set, Decl(mod2.js, 2, 78)) -->_ : Symbol(_, Decl(mod2.js, 2, 83)) -- --Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >get : Symbol(get, Decl(mod2.js, 2, 54)) + >set : Symbol(set, Decl(mod2.js, 2, 78)) + >_ : Symbol(_, Decl(mod2.js, 2, 83)) + + Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->module.exports : Symbol(module.exports, Decl(mod2.js, 0, 0)) ->module : Symbol(module, Decl(mod2.js, 0, 22)) ->exports : Symbol(module.exports, Decl(mod2.js, 0, 0)) ->"readonlyAccessor" : Symbol(readonlyAccessor, Decl(mod2.js, 2, 104)) -->get : Symbol(get, Decl(mod2.js, 3, 59)) -- --Object.defineProperty(module.exports, "setonlyAccessor", { ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >get : Symbol(get, Decl(mod2.js, 3, 59)) + + Object.defineProperty(module.exports, "setonlyAccessor", { ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->module.exports : Symbol(module.exports, Decl(mod2.js, 0, 0)) ->module : Symbol(module, Decl(mod2.js, 0, 22)) ->exports : Symbol(module.exports, Decl(mod2.js, 0, 0)) ->"setonlyAccessor" : Symbol(setonlyAccessor, Decl(mod2.js, 3, 86)) -- -- /** @param {string} str */ -- set(str) { -->set : Symbol(set, Decl(mod2.js, 4, 58)) -->str : Symbol(str, Decl(mod2.js, 6, 8)) -- -- this.rwAccessors = Number(str) ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + + /** @param {string} str */ + set(str) { +@@= skipped -58, +38 lines =@@ + >str : Symbol(str, Decl(mod2.js, 6, 8)) + + this.rwAccessors = Number(str) ->rwAccessors : Symbol(rwAccessors, Decl(mod2.js, 6, 14)) -->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) -->str : Symbol(str, Decl(mod2.js, 6, 8)) -- } --}); -- --=== index.js === --/** -- * @type {number} -- */ --const q = require("./mod1").thing; -->q : Symbol(q, Decl(index.js, 3, 5)) + >Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + >str : Symbol(str, Decl(mod2.js, 6, 8)) + } +@@= skipped -12, +11 lines =@@ + */ + const q = require("./mod1").thing; + >q : Symbol(q, Decl(index.js, 3, 5)) ->require("./mod1").thing : Symbol(thing, Decl(mod1.js, 0, 0)) ->require : Symbol(require) ->"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) ->thing : Symbol(thing, Decl(mod1.js, 0, 0)) -- --/** -- * @type {string} -- */ --const u = require("./mod2").thing; -->u : Symbol(u, Decl(index.js, 8, 5)) + + /** + * @type {string} + */ + const u = require("./mod2").thing; + >u : Symbol(u, Decl(index.js, 8, 5)) ->require("./mod2").thing : Symbol(thing, Decl(mod2.js, 0, 0)) ->require : Symbol(require) ->"./mod2" : Symbol("mod2", Decl(mod2.js, 0, 0)) ->thing : Symbol(thing, Decl(mod2.js, 0, 0)) -- + diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.types b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.types index f054d833a8..ceeec75ab8 100644 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.types +++ b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.types @@ -175,3 +175,188 @@ m2.setonlyAccessor = 0; >setonlyAccessor : any >0 : 0 +=== mod1.js === +Object.defineProperty(exports, "thing", { value: 42, writable: true }); +>Object.defineProperty(exports, "thing", { value: 42, writable: true }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : any +>"thing" : "thing" +>{ value: 42, writable: true } : { value: number; writable: true; } +>value : number +>42 : 42 +>writable : true +>true : true + +Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); +>Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : any +>"readonlyProp" : "readonlyProp" +>{ value: "Smith", writable: false } : { value: string; writable: false; } +>value : string +>"Smith" : "Smith" +>writable : false +>false : false + +Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); +>Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : any +>"rwAccessors" : "rwAccessors" +>{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get: () => number; set: (_: any) => void; } +>get : () => number +>98122 : 98122 +>set : (_: any) => void +>_ : any + +Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); +>Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : any +>"readonlyAccessor" : "readonlyAccessor" +>{ get() { return 21.75 } } : { get: () => number; } +>get : () => number +>21.75 : 21.75 + +Object.defineProperty(exports, "setonlyAccessor", { +>Object.defineProperty(exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : any +>"setonlyAccessor" : "setonlyAccessor" +>{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set: (str: string) => void; } + + /** @param {string} str */ + set(str) { +>set : (str: string) => void +>str : string + + this.rwAccessors = Number(str) +>this.rwAccessors = Number(str) : number +>this.rwAccessors : any +>this : any +>rwAccessors : any +>Number(str) : number +>Number : NumberConstructor +>str : string + } +}); + +=== mod2.js === +Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }); +>Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>module.exports : any +>module : any +>exports : any +>"thing" : "thing" +>{ value: "yes", writable: true } : { value: string; writable: true; } +>value : string +>"yes" : "yes" +>writable : true +>true : true + +Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }); +>Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>module.exports : any +>module : any +>exports : any +>"readonlyProp" : "readonlyProp" +>{ value: "Smith", writable: false } : { value: string; writable: false; } +>value : string +>"Smith" : "Smith" +>writable : false +>false : false + +Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); +>Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>module.exports : any +>module : any +>exports : any +>"rwAccessors" : "rwAccessors" +>{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get: () => number; set: (_: any) => void; } +>get : () => number +>98122 : 98122 +>set : (_: any) => void +>_ : any + +Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }); +>Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>module.exports : any +>module : any +>exports : any +>"readonlyAccessor" : "readonlyAccessor" +>{ get() { return 21.75 } } : { get: () => number; } +>get : () => number +>21.75 : 21.75 + +Object.defineProperty(module.exports, "setonlyAccessor", { +>Object.defineProperty(module.exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>module.exports : any +>module : any +>exports : any +>"setonlyAccessor" : "setonlyAccessor" +>{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set: (str: string) => void; } + + /** @param {string} str */ + set(str) { +>set : (str: string) => void +>str : string + + this.rwAccessors = Number(str) +>this.rwAccessors = Number(str) : number +>this.rwAccessors : any +>this : any +>rwAccessors : any +>Number(str) : number +>Number : NumberConstructor +>str : string + } +}); + +=== index.js === +/** + * @type {number} + */ +const q = require("./mod1").thing; +>q : number +>require("./mod1").thing : any +>require("./mod1") : any +>require : any +>"./mod1" : "./mod1" +>thing : any + +/** + * @type {string} + */ +const u = require("./mod2").thing; +>u : string +>require("./mod2").thing : any +>require("./mod2") : any +>require : any +>"./mod2" : "./mod2" +>thing : any + diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.errors.txt b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.errors.txt index 8dd536c41d..15c06af9b4 100644 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.errors.txt @@ -1,14 +1,15 @@ -validator.ts(3,25): error TS2307: Cannot find module './mod1' or its corresponding type declarations. +mod1.js(6,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. +validator.ts(5,12): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. ==== validator.ts (1 errors) ==== import "./"; import Person = require("./mod1"); - ~~~~~~~~ -!!! error TS2307: Cannot find module './mod1' or its corresponding type declarations. const m1 = new Person("Name") + ~~~~~~~~~~~~~~~~~~ +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. m1.thing; m1.readonlyProp; @@ -29,13 +30,15 @@ validator.ts(3,25): error TS2307: Cannot find module './mod1' or its correspondi m1.setonlyAccessor = 0; -==== mod1.js (0 errors) ==== +==== mod1.js (1 errors) ==== /** * @constructor * @param {string} name */ function Person(name) { this.name = name; + ~~~~ +!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. } Person.prototype.describe = function () { return "Person called " + this.name; diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.symbols b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.symbols index 38e3c7f227..6b6cc08719 100644 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.symbols +++ b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.symbols @@ -52,3 +52,86 @@ m1.setonlyAccessor = 0; >m1 : Symbol(m1, Decl(validator.ts, 4, 5)) +=== mod1.js === +/** + * @constructor + * @param {string} name + */ +function Person(name) { +>Person : Symbol(Person, Decl(mod1.js, 0, 0)) +>name : Symbol(name, Decl(mod1.js, 4, 16)) + + this.name = name; +>name : Symbol(name, Decl(mod1.js, 4, 16)) +} +Person.prototype.describe = function () { +>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Person : Symbol(Person, Decl(mod1.js, 0, 0)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + + return "Person called " + this.name; +}; +Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Person : Symbol(Person, Decl(mod1.js, 0, 0)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>value : Symbol(value, Decl(mod1.js, 10, 50)) +>writable : Symbol(writable, Decl(mod1.js, 10, 61)) + +Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Person : Symbol(Person, Decl(mod1.js, 0, 0)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>value : Symbol(value, Decl(mod1.js, 11, 57)) +>writable : Symbol(writable, Decl(mod1.js, 11, 73)) + +Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Person : Symbol(Person, Decl(mod1.js, 0, 0)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>get : Symbol(get, Decl(mod1.js, 12, 56)) +>set : Symbol(set, Decl(mod1.js, 12, 80)) +>_ : Symbol(_, Decl(mod1.js, 12, 85)) + +Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Person : Symbol(Person, Decl(mod1.js, 0, 0)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>get : Symbol(get, Decl(mod1.js, 13, 61)) + +Object.defineProperty(Person.prototype, "setonlyAccessor", { +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>Person : Symbol(Person, Decl(mod1.js, 0, 0)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + + /** @param {string} str */ + set(str) { +>set : Symbol(set, Decl(mod1.js, 14, 60)) +>str : Symbol(str, Decl(mod1.js, 16, 8)) + + this.rwAccessors = Number(str) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>str : Symbol(str, Decl(mod1.js, 16, 8)) + } +}); +module.exports = Person; +>module.exports : Symbol(Person, Decl(mod1.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(Person, Decl(mod1.js, 0, 0)) +>Person : Symbol(Person, Decl(mod1.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.symbols.diff b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.symbols.diff index 27289f8e69..a09b927c21 100644 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.symbols.diff @@ -71,102 +71,122 @@ ->setonlyAccessor : Symbol(Person.setonlyAccessor, Decl(mod1.js, 13, 88)) --=== mod1.js === --/** -- * @constructor -- * @param {string} name -- */ --function Person(name) { -->Person : Symbol(Person, Decl(mod1.js, 0, 0)) -->name : Symbol(name, Decl(mod1.js, 4, 16)) -- -- this.name = name; + === mod1.js === +@@= skipped -77, +51 lines =@@ + >name : Symbol(name, Decl(mod1.js, 4, 16)) + + this.name = name; ->this.name : Symbol(Person.name, Decl(mod1.js, 4, 23)) ->this : Symbol(Person, Decl(mod1.js, 0, 0)) ->name : Symbol(Person.name, Decl(mod1.js, 4, 23)) -->name : Symbol(name, Decl(mod1.js, 4, 16)) --} --Person.prototype.describe = function () { + >name : Symbol(name, Decl(mod1.js, 4, 16)) + } + Person.prototype.describe = function () { ->Person.prototype : Symbol(Person.describe, Decl(mod1.js, 6, 1)) -->Person : Symbol(Person, Decl(mod1.js, 0, 0)) ++>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >Person : Symbol(Person, Decl(mod1.js, 0, 0)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) ->describe : Symbol(Person.describe, Decl(mod1.js, 6, 1)) -- -- return "Person called " + this.name; ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + + return "Person called " + this.name; ->this.name : Symbol(Person.name, Decl(mod1.js, 4, 23)) ->this : Symbol(Person, Decl(mod1.js, 0, 0)) ->name : Symbol(Person.name, Decl(mod1.js, 4, 23)) - --}; --Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); + }; + Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->Person.prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->Person : Symbol(Person, Decl(mod1.js, 0, 0)) ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >Person : Symbol(Person, Decl(mod1.js, 0, 0)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) ->"thing" : Symbol(Person.thing, Decl(mod1.js, 9, 2)) -->value : Symbol(value, Decl(mod1.js, 10, 50)) -->writable : Symbol(writable, Decl(mod1.js, 10, 61)) -- --Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }); ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >value : Symbol(value, Decl(mod1.js, 10, 50)) + >writable : Symbol(writable, Decl(mod1.js, 10, 61)) + + Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->Person.prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->Person : Symbol(Person, Decl(mod1.js, 0, 0)) ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >Person : Symbol(Person, Decl(mod1.js, 0, 0)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) ->"readonlyProp" : Symbol(Person.readonlyProp, Decl(mod1.js, 10, 80)) -->value : Symbol(value, Decl(mod1.js, 11, 57)) -->writable : Symbol(writable, Decl(mod1.js, 11, 73)) -- --Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >value : Symbol(value, Decl(mod1.js, 11, 57)) + >writable : Symbol(writable, Decl(mod1.js, 11, 73)) + + Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->Person.prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->Person : Symbol(Person, Decl(mod1.js, 0, 0)) ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >Person : Symbol(Person, Decl(mod1.js, 0, 0)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) ->"rwAccessors" : Symbol(Person.rwAccessors, Decl(mod1.js, 11, 93)) -->get : Symbol(get, Decl(mod1.js, 12, 56)) -->set : Symbol(set, Decl(mod1.js, 12, 80)) -->_ : Symbol(_, Decl(mod1.js, 12, 85)) -- --Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }); ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >get : Symbol(get, Decl(mod1.js, 12, 56)) + >set : Symbol(set, Decl(mod1.js, 12, 80)) + >_ : Symbol(_, Decl(mod1.js, 12, 85)) + + Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->Person.prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->Person : Symbol(Person, Decl(mod1.js, 0, 0)) ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >Person : Symbol(Person, Decl(mod1.js, 0, 0)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) ->"readonlyAccessor" : Symbol(Person.readonlyAccessor, Decl(mod1.js, 12, 106)) -->get : Symbol(get, Decl(mod1.js, 13, 61)) -- --Object.defineProperty(Person.prototype, "setonlyAccessor", { ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >get : Symbol(get, Decl(mod1.js, 13, 61)) + + Object.defineProperty(Person.prototype, "setonlyAccessor", { ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->Person.prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->Person : Symbol(Person, Decl(mod1.js, 0, 0)) ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>Person.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >Person : Symbol(Person, Decl(mod1.js, 0, 0)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) ->"setonlyAccessor" : Symbol(Person.setonlyAccessor, Decl(mod1.js, 13, 88)) -- -- /** @param {string} str */ -- set(str) { -->set : Symbol(set, Decl(mod1.js, 14, 60)) -->str : Symbol(str, Decl(mod1.js, 16, 8)) -- -- this.rwAccessors = Number(str) ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + + /** @param {string} str */ + set(str) { +@@= skipped -76, +63 lines =@@ + >str : Symbol(str, Decl(mod1.js, 16, 8)) + + this.rwAccessors = Number(str) ->this.rwAccessors : Symbol(Person.rwAccessors, Decl(mod1.js, 11, 93)) ->this : Symbol(Person, Decl(mod1.js, 0, 0)) ->rwAccessors : Symbol(rwAccessors, Decl(mod1.js, 16, 14)) -->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) -->str : Symbol(str, Decl(mod1.js, 16, 8)) -- } --}); --module.exports = Person; + >Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + >str : Symbol(str, Decl(mod1.js, 16, 8)) + } + }); + module.exports = Person; ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 19, 3)) ->exports : Symbol(export=, Decl(mod1.js, 19, 3)) -->Person : Symbol(Person, Decl(mod1.js, 0, 0)) -- ++>module.exports : Symbol(Person, Decl(mod1.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(Person, Decl(mod1.js, 0, 0)) + >Person : Symbol(Person, Decl(mod1.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.types b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.types index 9f5d4aaaa0..3fe63091c2 100644 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.types +++ b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.types @@ -4,12 +4,12 @@ import "./"; import Person = require("./mod1"); ->Person : any +>Person : (name: string) => void const m1 = new Person("Name") >m1 : any >new Person("Name") : any ->Person : any +>Person : (name: string) => void >"Name" : "Name" m1.thing; @@ -96,3 +96,127 @@ m1.setonlyAccessor = 0; >0 : 0 +=== mod1.js === +/** + * @constructor + * @param {string} name + */ +function Person(name) { +>Person : (name: string) => void +>name : string + + this.name = name; +>this.name = name : string +>this.name : any +>this : any +>name : any +>name : string +} +Person.prototype.describe = function () { +>Person.prototype.describe = function () { return "Person called " + this.name;} : () => string +>Person.prototype.describe : any +>Person.prototype : any +>Person : (name: string) => void +>prototype : any +>describe : any +>function () { return "Person called " + this.name;} : () => string + + return "Person called " + this.name; +>"Person called " + this.name : string +>"Person called " : "Person called " +>this.name : any +>this : any +>name : any + +}; +Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); +>Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Person.prototype : any +>Person : (name: string) => void +>prototype : any +>"thing" : "thing" +>{ value: 42, writable: true } : { value: number; writable: true; } +>value : number +>42 : 42 +>writable : true +>true : true + +Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }); +>Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Person.prototype : any +>Person : (name: string) => void +>prototype : any +>"readonlyProp" : "readonlyProp" +>{ value: "Smith", writable: false } : { value: string; writable: false; } +>value : string +>"Smith" : "Smith" +>writable : false +>false : false + +Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); +>Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Person.prototype : any +>Person : (name: string) => void +>prototype : any +>"rwAccessors" : "rwAccessors" +>{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get: () => number; set: (_: any) => void; } +>get : () => number +>98122 : 98122 +>set : (_: any) => void +>_ : any + +Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }); +>Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Person.prototype : any +>Person : (name: string) => void +>prototype : any +>"readonlyAccessor" : "readonlyAccessor" +>{ get() { return 21.75 } } : { get: () => number; } +>get : () => number +>21.75 : 21.75 + +Object.defineProperty(Person.prototype, "setonlyAccessor", { +>Object.defineProperty(Person.prototype, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Person.prototype : any +>Person : (name: string) => void +>prototype : any +>"setonlyAccessor" : "setonlyAccessor" +>{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set: (str: string) => void; } + + /** @param {string} str */ + set(str) { +>set : (str: string) => void +>str : string + + this.rwAccessors = Number(str) +>this.rwAccessors = Number(str) : number +>this.rwAccessors : any +>this : any +>rwAccessors : any +>Number(str) : number +>Number : NumberConstructor +>str : string + } +}); +module.exports = Person; +>module.exports = Person : (name: string) => void +>module.exports : (name: string) => void +>module : { Person: (name: string) => void; } +>exports : (name: string) => void +>Person : (name: string) => void + diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.types.diff b/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.types.diff deleted file mode 100644 index 0ca241cee3..0000000000 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.types.diff +++ /dev/null @@ -1,261 +0,0 @@ ---- old.checkExportsObjectAssignPrototypeProperty.types -+++ new.checkExportsObjectAssignPrototypeProperty.types -@@= skipped -3, +3 lines =@@ - import "./"; - - import Person = require("./mod1"); -->Person : typeof Person -+>Person : any - - const m1 = new Person("Name") -->m1 : Person -->new Person("Name") : Person -->Person : typeof Person -+>m1 : any -+>new Person("Name") : any -+>Person : any - >"Name" : "Name" - - m1.thing; -->m1.thing : number -->m1 : Person -->thing : number -+>m1.thing : any -+>m1 : any -+>thing : any - - m1.readonlyProp; -->m1.readonlyProp : string -->m1 : Person -->readonlyProp : string -+>m1.readonlyProp : any -+>m1 : any -+>readonlyProp : any - - m1.rwAccessors; -->m1.rwAccessors : number -->m1 : Person -->rwAccessors : number -+>m1.rwAccessors : any -+>m1 : any -+>rwAccessors : any - - m1.readonlyAccessor; -->m1.readonlyAccessor : number -->m1 : Person -->readonlyAccessor : number -+>m1.readonlyAccessor : any -+>m1 : any -+>readonlyAccessor : any - - m1.setonlyAccessor; -->m1.setonlyAccessor : string -->m1 : Person -->setonlyAccessor : string -+>m1.setonlyAccessor : any -+>m1 : any -+>setonlyAccessor : any - - // allowed assignments - m1.thing = 10; - >m1.thing = 10 : 10 -->m1.thing : number -->m1 : Person -->thing : number -+>m1.thing : any -+>m1 : any -+>thing : any - >10 : 10 - - m1.rwAccessors = 11; - >m1.rwAccessors = 11 : 11 -->m1.rwAccessors : number -->m1 : Person -->rwAccessors : number -+>m1.rwAccessors : any -+>m1 : any -+>rwAccessors : any - >11 : 11 - - m1.setonlyAccessor = "yes"; - >m1.setonlyAccessor = "yes" : "yes" -->m1.setonlyAccessor : string -->m1 : Person -->setonlyAccessor : string -+>m1.setonlyAccessor : any -+>m1 : any -+>setonlyAccessor : any - >"yes" : "yes" - - // disallowed assignments - m1.readonlyProp = "name"; - >m1.readonlyProp = "name" : "name" - >m1.readonlyProp : any -->m1 : Person -+>m1 : any - >readonlyProp : any - >"name" : "name" - - m1.readonlyAccessor = 12; - >m1.readonlyAccessor = 12 : 12 - >m1.readonlyAccessor : any -->m1 : Person -+>m1 : any - >readonlyAccessor : any - >12 : 12 - - m1.thing = "no"; - >m1.thing = "no" : "no" -->m1.thing : number -->m1 : Person -->thing : number -+>m1.thing : any -+>m1 : any -+>thing : any - >"no" : "no" - - m1.rwAccessors = "no"; - >m1.rwAccessors = "no" : "no" -->m1.rwAccessors : number -->m1 : Person -->rwAccessors : number -+>m1.rwAccessors : any -+>m1 : any -+>rwAccessors : any - >"no" : "no" - - m1.setonlyAccessor = 0; - >m1.setonlyAccessor = 0 : 0 -->m1.setonlyAccessor : string -->m1 : Person -->setonlyAccessor : string -+>m1.setonlyAccessor : any -+>m1 : any -+>setonlyAccessor : any - >0 : 0 - - --=== mod1.js === --/** -- * @constructor -- * @param {string} name -- */ --function Person(name) { -->Person : typeof Person -->name : string -- -- this.name = name; -->this.name = name : string -->this.name : any -->this : this -->name : any -->name : string --} --Person.prototype.describe = function () { -->Person.prototype.describe = function () { return "Person called " + this.name;} : () => string -->Person.prototype.describe : any -->Person.prototype : any -->Person : typeof Person -->prototype : any -->describe : any -->function () { return "Person called " + this.name;} : () => string -- -- return "Person called " + this.name; -->"Person called " + this.name : string -->"Person called " : "Person called " -->this.name : string -->this : this -->name : string -- --}; --Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); -->Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }) : any -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Person.prototype : any -->Person : typeof Person -->prototype : any -->"thing" : "thing" -->{ value: 42, writable: true } : { value: number; writable: true; } -->value : number -->42 : 42 -->writable : true -->true : true -- --Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }); -->Object.defineProperty(Person.prototype, "readonlyProp", { value: "Smith", writable: false }) : any -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Person.prototype : any -->Person : typeof Person -->prototype : any -->"readonlyProp" : "readonlyProp" -->{ value: "Smith", writable: false } : { value: string; writable: false; } -->value : string -->"Smith" : "Smith" -->writable : false -->false : false -- --Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); -->Object.defineProperty(Person.prototype, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Person.prototype : any -->Person : typeof Person -->prototype : any -->"rwAccessors" : "rwAccessors" -->{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } -->get : () => number -->98122 : 98122 -->set : (_: any) => void -->_ : any -- --Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }); -->Object.defineProperty(Person.prototype, "readonlyAccessor", { get() { return 21.75 } }) : any -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Person.prototype : any -->Person : typeof Person -->prototype : any -->"readonlyAccessor" : "readonlyAccessor" -->{ get() { return 21.75 } } : { get(): number; } -->get : () => number -->21.75 : 21.75 -- --Object.defineProperty(Person.prototype, "setonlyAccessor", { -->Object.defineProperty(Person.prototype, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Person.prototype : any -->Person : typeof Person -->prototype : any -->"setonlyAccessor" : "setonlyAccessor" -->{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set(str: string): void; } -- -- /** @param {string} str */ -- set(str) { -->set : (str: string) => void -->str : string -- -- this.rwAccessors = Number(str) -->this.rwAccessors = Number(str) : number -->this.rwAccessors : number -->this : this -->rwAccessors : number -->Number(str) : number -->Number : NumberConstructor -->str : string -- } --}); --module.exports = Person; -->module.exports = Person : typeof Person -->module.exports : typeof Person -->module : { exports: typeof Person; } -->exports : typeof Person -->Person : typeof Person -- diff --git a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.errors.txt b/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.errors.txt index f73586e723..26d070eca5 100644 --- a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.errors.txt @@ -1,28 +1,67 @@ -validate.ts(2,20): error TS2307: Cannot find module './' or its corresponding type declarations. +index.js(19,10): error TS2741: Property 'name' is missing in type '{}' but required in type '{ name: string; }'. +index.js(23,11): error TS2339: Property 'zip' does not exist on type '{}'. +index.js(28,11): error TS2339: Property 'houseNumber' does not exist on type '{}'. +validate.ts(3,3): error TS2339: Property 'name' does not exist on type '{}'. +validate.ts(4,3): error TS2339: Property 'middleInit' does not exist on type '{}'. +validate.ts(5,3): error TS2339: Property 'lastName' does not exist on type '{}'. +validate.ts(6,3): error TS2339: Property 'zip' does not exist on type '{}'. +validate.ts(7,3): error TS2339: Property 'houseNumber' does not exist on type '{}'. +validate.ts(8,3): error TS2339: Property 'zipStr' does not exist on type '{}'. +validate.ts(10,3): error TS2339: Property 'name' does not exist on type '{}'. +validate.ts(11,3): error TS2339: Property 'zip' does not exist on type '{}'. +validate.ts(12,3): error TS2339: Property 'zipStr' does not exist on type '{}'. +validate.ts(14,3): error TS2339: Property 'lastName' does not exist on type '{}'. +validate.ts(15,3): error TS2339: Property 'houseNumber' does not exist on type '{}'. +validate.ts(16,3): error TS2339: Property 'zipStr' does not exist on type '{}'. +validate.ts(17,3): error TS2339: Property 'middleInit' does not exist on type '{}'. -==== validate.ts (1 errors) ==== +==== validate.ts (13 errors) ==== // Validate in TS as simple validations would usually be interpreted as more special assignments import x = require("./"); - ~~~~ -!!! error TS2307: Cannot find module './' or its corresponding type declarations. x.name; + ~~~~ +!!! error TS2339: Property 'name' does not exist on type '{}'. x.middleInit; + ~~~~~~~~~~ +!!! error TS2339: Property 'middleInit' does not exist on type '{}'. x.lastName; + ~~~~~~~~ +!!! error TS2339: Property 'lastName' does not exist on type '{}'. x.zip; + ~~~ +!!! error TS2339: Property 'zip' does not exist on type '{}'. x.houseNumber; + ~~~~~~~~~~~ +!!! error TS2339: Property 'houseNumber' does not exist on type '{}'. x.zipStr; + ~~~~~~ +!!! error TS2339: Property 'zipStr' does not exist on type '{}'. x.name = "Another"; + ~~~~ +!!! error TS2339: Property 'name' does not exist on type '{}'. x.zip = 98123; + ~~~ +!!! error TS2339: Property 'zip' does not exist on type '{}'. x.zipStr = "OK"; + ~~~~~~ +!!! error TS2339: Property 'zipStr' does not exist on type '{}'. x.lastName = "should fail"; + ~~~~~~~~ +!!! error TS2339: Property 'lastName' does not exist on type '{}'. x.houseNumber = 12; // should also fail + ~~~~~~~~~~~ +!!! error TS2339: Property 'houseNumber' does not exist on type '{}'. x.zipStr = 12; // should fail + ~~~~~~ +!!! error TS2339: Property 'zipStr' does not exist on type '{}'. x.middleInit = "R"; // should also fail + ~~~~~~~~~~ +!!! error TS2339: Property 'middleInit' does not exist on type '{}'. -==== index.js (0 errors) ==== +==== index.js (3 errors) ==== const x = {}; Object.defineProperty(x, "name", { value: "Charles", writable: true }); Object.defineProperty(x, "middleInit", { value: "H" }); @@ -42,15 +81,22 @@ validate.ts(2,20): error TS2307: Cannot find module './' or its corresponding ty function takeName(named) { return named.name; } takeName(x); + ~ +!!! error TS2741: Property 'name' is missing in type '{}' but required in type '{ name: string; }'. +!!! related TS2728 index.js:15:13: 'name' is declared here. /** * @type {number} */ var a = x.zip; + ~~~ +!!! error TS2339: Property 'zip' does not exist on type '{}'. /** * @type {number} */ var b = x.houseNumber; + ~~~~~~~~~~~ +!!! error TS2339: Property 'houseNumber' does not exist on type '{}'. const returnExemplar = () => x; const needsExemplar = (_ = x) => void 0; diff --git a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.errors.txt.diff deleted file mode 100644 index 8aa36ef9d4..0000000000 --- a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.errors.txt.diff +++ /dev/null @@ -1,37 +0,0 @@ ---- old.checkObjectDefineProperty.errors.txt -+++ new.checkObjectDefineProperty.errors.txt -@@= skipped -0, +0 lines =@@ --validate.ts(14,3): error TS2540: Cannot assign to 'lastName' because it is a read-only property. --validate.ts(15,3): error TS2540: Cannot assign to 'houseNumber' because it is a read-only property. --validate.ts(16,1): error TS2322: Type 'number' is not assignable to type 'string'. --validate.ts(17,3): error TS2540: Cannot assign to 'middleInit' because it is a read-only property. -+validate.ts(2,20): error TS2307: Cannot find module './' or its corresponding type declarations. - - --==== validate.ts (4 errors) ==== -+==== validate.ts (1 errors) ==== - // Validate in TS as simple validations would usually be interpreted as more special assignments - import x = require("./"); -+ ~~~~ -+!!! error TS2307: Cannot find module './' or its corresponding type declarations. - x.name; - x.middleInit; - x.lastName; -@@= skipped -18, +17 lines =@@ - x.zipStr = "OK"; - - x.lastName = "should fail"; -- ~~~~~~~~ --!!! error TS2540: Cannot assign to 'lastName' because it is a read-only property. - x.houseNumber = 12; // should also fail -- ~~~~~~~~~~~ --!!! error TS2540: Cannot assign to 'houseNumber' because it is a read-only property. - x.zipStr = 12; // should fail -- ~~~~~~~~ --!!! error TS2322: Type 'number' is not assignable to type 'string'. - x.middleInit = "R"; // should also fail -- ~~~~~~~~~~ --!!! error TS2540: Cannot assign to 'middleInit' because it is a read-only property. - - ==== index.js (0 errors) ==== - const x = {}; diff --git a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.symbols b/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.symbols index af5cca6dd2..fb8fb1c8c0 100644 --- a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.symbols +++ b/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.symbols @@ -44,3 +44,125 @@ x.zipStr = 12; // should fail x.middleInit = "R"; // should also fail >x : Symbol(x, Decl(validate.ts, 0, 0)) +=== index.js === +const x = {}; +>x : Symbol(x, Decl(index.js, 0, 5)) + +Object.defineProperty(x, "name", { value: "Charles", writable: true }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(index.js, 0, 5)) +>value : Symbol(value, Decl(index.js, 1, 34)) +>writable : Symbol(writable, Decl(index.js, 1, 52)) + +Object.defineProperty(x, "middleInit", { value: "H" }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(index.js, 0, 5)) +>value : Symbol(value, Decl(index.js, 2, 40)) + +Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(index.js, 0, 5)) +>value : Symbol(value, Decl(index.js, 3, 38)) +>writable : Symbol(writable, Decl(index.js, 3, 54)) + +Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(index.js, 0, 5)) +>get : Symbol(get, Decl(index.js, 4, 33)) +>set : Symbol(set, Decl(index.js, 4, 57)) +>_ : Symbol(_, Decl(index.js, 4, 62)) + +Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(index.js, 0, 5)) +>get : Symbol(get, Decl(index.js, 5, 41)) + +Object.defineProperty(x, "zipStr", { +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>x : Symbol(x, Decl(index.js, 0, 5)) + + /** @param {string} str */ + set(str) { +>set : Symbol(set, Decl(index.js, 6, 36)) +>str : Symbol(str, Decl(index.js, 8, 8)) + + this.zip = Number(str) +>Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>str : Symbol(str, Decl(index.js, 8, 8)) + } +}); + +/** + * @param {{name: string}} named + */ +function takeName(named) { return named.name; } +>takeName : Symbol(takeName, Decl(index.js, 11, 3)) +>named : Symbol(named, Decl(index.js, 16, 18)) +>named.name : Symbol(name, Decl(index.js, 14, 12)) +>named : Symbol(named, Decl(index.js, 16, 18)) +>name : Symbol(name, Decl(index.js, 14, 12)) + +takeName(x); +>takeName : Symbol(takeName, Decl(index.js, 11, 3)) +>x : Symbol(x, Decl(index.js, 0, 5)) + +/** + * @type {number} + */ +var a = x.zip; +>a : Symbol(a, Decl(index.js, 22, 3)) +>x : Symbol(x, Decl(index.js, 0, 5)) + +/** + * @type {number} + */ +var b = x.houseNumber; +>b : Symbol(b, Decl(index.js, 27, 3)) +>x : Symbol(x, Decl(index.js, 0, 5)) + +const returnExemplar = () => x; +>returnExemplar : Symbol(returnExemplar, Decl(index.js, 29, 5)) +>x : Symbol(x, Decl(index.js, 0, 5)) + +const needsExemplar = (_ = x) => void 0; +>needsExemplar : Symbol(needsExemplar, Decl(index.js, 30, 5)) +>_ : Symbol(_, Decl(index.js, 30, 23)) +>x : Symbol(x, Decl(index.js, 0, 5)) + +const expected = /** @type {{name: string, readonly middleInit: string, readonly lastName: string, zip: number, readonly houseNumber: number, zipStr: string}} */(/** @type {*} */(null)); +>expected : Symbol(expected, Decl(index.js, 32, 5)) + +/** + * + * @param {typeof returnExemplar} a + * @param {typeof needsExemplar} b + */ +function match(a, b) {} +>match : Symbol(match, Decl(index.js, 32, 186)) +>a : Symbol(a, Decl(index.js, 39, 15)) +>b : Symbol(b, Decl(index.js, 39, 17)) + +match(() => expected, (x = expected) => void 0); +>match : Symbol(match, Decl(index.js, 32, 186)) +>expected : Symbol(expected, Decl(index.js, 32, 5)) +>x : Symbol(x, Decl(index.js, 41, 23)) +>expected : Symbol(expected, Decl(index.js, 32, 5)) + +module.exports = x; +>module.exports : Symbol(x, Decl(index.js, 0, 5)) +>module : Symbol(module.exports) +>exports : Symbol(x, Decl(index.js, 0, 5)) +>x : Symbol(x, Decl(index.js, 0, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.symbols.diff b/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.symbols.diff index 1845b9c5f6..58073b8baa 100644 --- a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.symbols.diff @@ -68,136 +68,140 @@ >x : Symbol(x, Decl(validate.ts, 0, 0)) ->middleInit : Symbol(x.middleInit, Decl(index.js, 1, 71)) --=== index.js === --const x = {}; + === index.js === + const x = {}; ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) -- --Object.defineProperty(x, "name", { value: "Charles", writable: true }); ++>x : Symbol(x, Decl(index.js, 0, 5)) + + Object.defineProperty(x, "name", { value: "Charles", writable: true }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) ->"name" : Symbol(x.name, Decl(index.js, 0, 13)) -->value : Symbol(value, Decl(index.js, 1, 34)) -->writable : Symbol(writable, Decl(index.js, 1, 52)) -- --Object.defineProperty(x, "middleInit", { value: "H" }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>x : Symbol(x, Decl(index.js, 0, 5)) + >value : Symbol(value, Decl(index.js, 1, 34)) + >writable : Symbol(writable, Decl(index.js, 1, 52)) + + Object.defineProperty(x, "middleInit", { value: "H" }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) ->"middleInit" : Symbol(x.middleInit, Decl(index.js, 1, 71)) -->value : Symbol(value, Decl(index.js, 2, 40)) -- --Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>x : Symbol(x, Decl(index.js, 0, 5)) + >value : Symbol(value, Decl(index.js, 2, 40)) + + Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) ->"lastName" : Symbol(x.lastName, Decl(index.js, 2, 55)) -->value : Symbol(value, Decl(index.js, 3, 38)) -->writable : Symbol(writable, Decl(index.js, 3, 54)) -- --Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>x : Symbol(x, Decl(index.js, 0, 5)) + >value : Symbol(value, Decl(index.js, 3, 38)) + >writable : Symbol(writable, Decl(index.js, 3, 54)) + + Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) ->"zip" : Symbol(x.zip, Decl(index.js, 3, 74)) -->get : Symbol(get, Decl(index.js, 4, 33)) -->set : Symbol(set, Decl(index.js, 4, 57)) -->_ : Symbol(_, Decl(index.js, 4, 62)) -- --Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>x : Symbol(x, Decl(index.js, 0, 5)) + >get : Symbol(get, Decl(index.js, 4, 33)) + >set : Symbol(set, Decl(index.js, 4, 57)) + >_ : Symbol(_, Decl(index.js, 4, 62)) + + Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) ->"houseNumber" : Symbol(x.houseNumber, Decl(index.js, 4, 83)) -->get : Symbol(get, Decl(index.js, 5, 41)) -- --Object.defineProperty(x, "zipStr", { ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>x : Symbol(x, Decl(index.js, 0, 5)) + >get : Symbol(get, Decl(index.js, 5, 41)) + + Object.defineProperty(x, "zipStr", { ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) ->"zipStr" : Symbol(x.zipStr, Decl(index.js, 5, 68)) -- -- /** @param {string} str */ -- set(str) { -->set : Symbol(set, Decl(index.js, 6, 36)) -->str : Symbol(str, Decl(index.js, 8, 8)) -- -- this.zip = Number(str) ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>x : Symbol(x, Decl(index.js, 0, 5)) + + /** @param {string} str */ + set(str) { +@@= skipped -125, +93 lines =@@ + >str : Symbol(str, Decl(index.js, 8, 8)) + + this.zip = Number(str) ->zip : Symbol(zip, Decl(index.js, 8, 14)) -->Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) -->str : Symbol(str, Decl(index.js, 8, 8)) -- } --}); -- --/** -- * @param {{name: string}} named -- */ --function takeName(named) { return named.name; } -->takeName : Symbol(takeName, Decl(index.js, 11, 3)) -->named : Symbol(named, Decl(index.js, 16, 18)) -->named.name : Symbol(name, Decl(index.js, 14, 12)) -->named : Symbol(named, Decl(index.js, 16, 18)) -->name : Symbol(name, Decl(index.js, 14, 12)) -- --takeName(x); -->takeName : Symbol(takeName, Decl(index.js, 11, 3)) + >Number : Symbol(Number, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + >str : Symbol(str, Decl(index.js, 8, 8)) + } +@@= skipped -18, +17 lines =@@ + + takeName(x); + >takeName : Symbol(takeName, Decl(index.js, 11, 3)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) -- --/** -- * @type {number} -- */ --var a = x.zip; -->a : Symbol(a, Decl(index.js, 22, 3)) ++>x : Symbol(x, Decl(index.js, 0, 5)) + + /** + * @type {number} + */ + var a = x.zip; + >a : Symbol(a, Decl(index.js, 22, 3)) ->x.zip : Symbol(x.zip, Decl(index.js, 3, 74)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) ->zip : Symbol(x.zip, Decl(index.js, 3, 74)) -- --/** -- * @type {number} -- */ --var b = x.houseNumber; -->b : Symbol(b, Decl(index.js, 27, 3)) ++>x : Symbol(x, Decl(index.js, 0, 5)) + + /** + * @type {number} + */ + var b = x.houseNumber; + >b : Symbol(b, Decl(index.js, 27, 3)) ->x.houseNumber : Symbol(x.houseNumber, Decl(index.js, 4, 83)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) ->houseNumber : Symbol(x.houseNumber, Decl(index.js, 4, 83)) -- --const returnExemplar = () => x; -->returnExemplar : Symbol(returnExemplar, Decl(index.js, 29, 5)) ++>x : Symbol(x, Decl(index.js, 0, 5)) + + const returnExemplar = () => x; + >returnExemplar : Symbol(returnExemplar, Decl(index.js, 29, 5)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) -- --const needsExemplar = (_ = x) => void 0; -->needsExemplar : Symbol(needsExemplar, Decl(index.js, 30, 5)) -->_ : Symbol(_, Decl(index.js, 30, 23)) ++>x : Symbol(x, Decl(index.js, 0, 5)) + + const needsExemplar = (_ = x) => void 0; + >needsExemplar : Symbol(needsExemplar, Decl(index.js, 30, 5)) + >_ : Symbol(_, Decl(index.js, 30, 23)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) -- --const expected = /** @type {{name: string, readonly middleInit: string, readonly lastName: string, zip: number, readonly houseNumber: number, zipStr: string}} */(/** @type {*} */(null)); -->expected : Symbol(expected, Decl(index.js, 32, 5)) -- --/** -- * -- * @param {typeof returnExemplar} a -- * @param {typeof needsExemplar} b -- */ --function match(a, b) {} -->match : Symbol(match, Decl(index.js, 32, 186)) -->a : Symbol(a, Decl(index.js, 39, 15)) -->b : Symbol(b, Decl(index.js, 39, 17)) -- --match(() => expected, (x = expected) => void 0); -->match : Symbol(match, Decl(index.js, 32, 186)) -->expected : Symbol(expected, Decl(index.js, 32, 5)) -->x : Symbol(x, Decl(index.js, 41, 23)) -->expected : Symbol(expected, Decl(index.js, 32, 5)) -- --module.exports = x; ++>x : Symbol(x, Decl(index.js, 0, 5)) + + const expected = /** @type {{name: string, readonly middleInit: string, readonly lastName: string, zip: number, readonly houseNumber: number, zipStr: string}} */(/** @type {*} */(null)); + >expected : Symbol(expected, Decl(index.js, 32, 5)) +@@= skipped -49, +45 lines =@@ + >expected : Symbol(expected, Decl(index.js, 32, 5)) + + module.exports = x; ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 41, 48)) ->exports : Symbol(export=, Decl(index.js, 41, 48)) ->x : Symbol(x, Decl(index.js, 0, 5), Decl(index.js, 1, 22), Decl(index.js, 2, 22), Decl(index.js, 3, 22), Decl(index.js, 4, 22) ... and 2 more) -- ++>module.exports : Symbol(x, Decl(index.js, 0, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(x, Decl(index.js, 0, 5)) ++>x : Symbol(x, Decl(index.js, 0, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.types b/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.types index cf53736a27..7a23ea5f67 100644 --- a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.types +++ b/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.types @@ -3,84 +3,256 @@ === validate.ts === // Validate in TS as simple validations would usually be interpreted as more special assignments import x = require("./"); ->x : any +>x : {} x.name; >x.name : any ->x : any +>x : {} >name : any x.middleInit; >x.middleInit : any ->x : any +>x : {} >middleInit : any x.lastName; >x.lastName : any ->x : any +>x : {} >lastName : any x.zip; >x.zip : any ->x : any +>x : {} >zip : any x.houseNumber; >x.houseNumber : any ->x : any +>x : {} >houseNumber : any x.zipStr; >x.zipStr : any ->x : any +>x : {} >zipStr : any x.name = "Another"; >x.name = "Another" : "Another" >x.name : any ->x : any +>x : {} >name : any >"Another" : "Another" x.zip = 98123; >x.zip = 98123 : 98123 >x.zip : any ->x : any +>x : {} >zip : any >98123 : 98123 x.zipStr = "OK"; >x.zipStr = "OK" : "OK" >x.zipStr : any ->x : any +>x : {} >zipStr : any >"OK" : "OK" x.lastName = "should fail"; >x.lastName = "should fail" : "should fail" >x.lastName : any ->x : any +>x : {} >lastName : any >"should fail" : "should fail" x.houseNumber = 12; // should also fail >x.houseNumber = 12 : 12 >x.houseNumber : any ->x : any +>x : {} >houseNumber : any >12 : 12 x.zipStr = 12; // should fail >x.zipStr = 12 : 12 >x.zipStr : any ->x : any +>x : {} >zipStr : any >12 : 12 x.middleInit = "R"; // should also fail >x.middleInit = "R" : "R" >x.middleInit : any ->x : any +>x : {} >middleInit : any >"R" : "R" +=== index.js === +const x = {}; +>x : {} +>{} : {} + +Object.defineProperty(x, "name", { value: "Charles", writable: true }); +>Object.defineProperty(x, "name", { value: "Charles", writable: true }) : {} +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>x : {} +>"name" : "name" +>{ value: "Charles", writable: true } : { value: string; writable: true; } +>value : string +>"Charles" : "Charles" +>writable : true +>true : true + +Object.defineProperty(x, "middleInit", { value: "H" }); +>Object.defineProperty(x, "middleInit", { value: "H" }) : {} +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>x : {} +>"middleInit" : "middleInit" +>{ value: "H" } : { value: string; } +>value : string +>"H" : "H" + +Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); +>Object.defineProperty(x, "lastName", { value: "Smith", writable: false }) : {} +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>x : {} +>"lastName" : "lastName" +>{ value: "Smith", writable: false } : { value: string; writable: false; } +>value : string +>"Smith" : "Smith" +>writable : false +>false : false + +Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }); +>Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }) : {} +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>x : {} +>"zip" : "zip" +>{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get: () => number; set: (_: any) => void; } +>get : () => number +>98122 : 98122 +>set : (_: any) => void +>_ : any + +Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); +>Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }) : {} +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>x : {} +>"houseNumber" : "houseNumber" +>{ get() { return 21.75 } } : { get: () => number; } +>get : () => number +>21.75 : 21.75 + +Object.defineProperty(x, "zipStr", { +>Object.defineProperty(x, "zipStr", { /** @param {string} str */ set(str) { this.zip = Number(str) }}) : {} +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>x : {} +>"zipStr" : "zipStr" +>{ /** @param {string} str */ set(str) { this.zip = Number(str) }} : { set: (str: string) => void; } + + /** @param {string} str */ + set(str) { +>set : (str: string) => void +>str : string + + this.zip = Number(str) +>this.zip = Number(str) : number +>this.zip : any +>this : any +>zip : any +>Number(str) : number +>Number : NumberConstructor +>str : string + } +}); + +/** + * @param {{name: string}} named + */ +function takeName(named) { return named.name; } +>takeName : (named: { name: string; }) => string +>named : { name: string; } +>named.name : string +>named : { name: string; } +>name : string + +takeName(x); +>takeName(x) : string +>takeName : (named: { name: string; }) => string +>x : {} + +/** + * @type {number} + */ +var a = x.zip; +>a : number +>x.zip : any +>x : {} +>zip : any + +/** + * @type {number} + */ +var b = x.houseNumber; +>b : number +>x.houseNumber : any +>x : {} +>houseNumber : any + +const returnExemplar = () => x; +>returnExemplar : () => {} +>() => x : () => {} +>x : {} + +const needsExemplar = (_ = x) => void 0; +>needsExemplar : (_?: {}) => undefined +>(_ = x) => void 0 : (_?: {}) => undefined +>_ : {} +>x : {} +>void 0 : undefined +>0 : 0 + +const expected = /** @type {{name: string, readonly middleInit: string, readonly lastName: string, zip: number, readonly houseNumber: number, zipStr: string}} */(/** @type {*} */(null)); +>expected : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } +>(/** @type {*} */(null)) : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } +>(null) : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } +>(null) : any +>null : any + +/** + * + * @param {typeof returnExemplar} a + * @param {typeof needsExemplar} b + */ +function match(a, b) {} +>match : (a: () => {}, b: (_?: {}) => undefined) => void +>a : () => {} +>b : (_?: {}) => undefined + +match(() => expected, (x = expected) => void 0); +>match(() => expected, (x = expected) => void 0) : void +>match : (a: () => {}, b: (_?: {}) => undefined) => void +>() => expected : () => { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } +>expected : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } +>(x = expected) => void 0 : (x?: {} | undefined) => undefined +>x : {} | undefined +>expected : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } +>void 0 : undefined +>0 : 0 + +module.exports = x; +>module.exports = x : {} +>module.exports : {} +>module : { readonly x: {}; } +>exports : {} +>x : {} + diff --git a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.types.diff b/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.types.diff deleted file mode 100644 index 2baba30198..0000000000 --- a/testdata/baselines/reference/submodule/conformance/checkObjectDefineProperty.types.diff +++ /dev/null @@ -1,291 +0,0 @@ ---- old.checkObjectDefineProperty.types -+++ new.checkObjectDefineProperty.types -@@= skipped -2, +2 lines =@@ - === validate.ts === - // Validate in TS as simple validations would usually be interpreted as more special assignments - import x = require("./"); -->x : typeof x -+>x : any - - x.name; -->x.name : string -->x : typeof x -->name : string -+>x.name : any -+>x : any -+>name : any - - x.middleInit; -->x.middleInit : string -->x : typeof x -->middleInit : string -+>x.middleInit : any -+>x : any -+>middleInit : any - - x.lastName; -->x.lastName : string -->x : typeof x -->lastName : string -+>x.lastName : any -+>x : any -+>lastName : any - - x.zip; -->x.zip : number -->x : typeof x -->zip : number -+>x.zip : any -+>x : any -+>zip : any - - x.houseNumber; -->x.houseNumber : number -->x : typeof x -->houseNumber : number -+>x.houseNumber : any -+>x : any -+>houseNumber : any - - x.zipStr; -->x.zipStr : string -->x : typeof x -->zipStr : string -+>x.zipStr : any -+>x : any -+>zipStr : any - - x.name = "Another"; - >x.name = "Another" : "Another" -->x.name : string -->x : typeof x -->name : string -+>x.name : any -+>x : any -+>name : any - >"Another" : "Another" - - x.zip = 98123; - >x.zip = 98123 : 98123 -->x.zip : number -->x : typeof x -->zip : number -+>x.zip : any -+>x : any -+>zip : any - >98123 : 98123 - - x.zipStr = "OK"; - >x.zipStr = "OK" : "OK" -->x.zipStr : string -->x : typeof x -->zipStr : string -+>x.zipStr : any -+>x : any -+>zipStr : any - >"OK" : "OK" - - x.lastName = "should fail"; - >x.lastName = "should fail" : "should fail" - >x.lastName : any -->x : typeof x -+>x : any - >lastName : any - >"should fail" : "should fail" - - x.houseNumber = 12; // should also fail - >x.houseNumber = 12 : 12 - >x.houseNumber : any -->x : typeof x -+>x : any - >houseNumber : any - >12 : 12 - - x.zipStr = 12; // should fail - >x.zipStr = 12 : 12 -->x.zipStr : string -->x : typeof x -->zipStr : string -+>x.zipStr : any -+>x : any -+>zipStr : any - >12 : 12 - - x.middleInit = "R"; // should also fail - >x.middleInit = "R" : "R" - >x.middleInit : any -->x : typeof x -+>x : any - >middleInit : any - >"R" : "R" - --=== index.js === --const x = {}; -->x : typeof x -->{} : {} -- --Object.defineProperty(x, "name", { value: "Charles", writable: true }); -->Object.defineProperty(x, "name", { value: "Charles", writable: true }) : typeof x -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->x : typeof x -->"name" : "name" -->{ value: "Charles", writable: true } : { value: string; writable: true; } -->value : string -->"Charles" : "Charles" -->writable : true -->true : true -- --Object.defineProperty(x, "middleInit", { value: "H" }); -->Object.defineProperty(x, "middleInit", { value: "H" }) : typeof x -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->x : typeof x -->"middleInit" : "middleInit" -->{ value: "H" } : { value: string; } -->value : string -->"H" : "H" -- --Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); -->Object.defineProperty(x, "lastName", { value: "Smith", writable: false }) : typeof x -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->x : typeof x -->"lastName" : "lastName" -->{ value: "Smith", writable: false } : { value: string; writable: false; } -->value : string -->"Smith" : "Smith" -->writable : false -->false : false -- --Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }); -->Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof x -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->x : typeof x -->"zip" : "zip" -->{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } -->get : () => number -->98122 : 98122 -->set : (_: any) => void -->_ : any -- --Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); -->Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }) : typeof x -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->x : typeof x -->"houseNumber" : "houseNumber" -->{ get() { return 21.75 } } : { get(): number; } -->get : () => number -->21.75 : 21.75 -- --Object.defineProperty(x, "zipStr", { -->Object.defineProperty(x, "zipStr", { /** @param {string} str */ set(str) { this.zip = Number(str) }}) : typeof x -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->x : typeof x -->"zipStr" : "zipStr" -->{ /** @param {string} str */ set(str) { this.zip = Number(str) }} : { set(str: string): void; } -- -- /** @param {string} str */ -- set(str) { -->set : (str: string) => void -->str : string -- -- this.zip = Number(str) -->this.zip = Number(str) : number -->this.zip : any -->this : any -->zip : any -->Number(str) : number -->Number : NumberConstructor -->str : string -- } --}); -- --/** -- * @param {{name: string}} named -- */ --function takeName(named) { return named.name; } -->takeName : (named: { name: string; }) => string -->named : { name: string; } -->named.name : string -->named : { name: string; } -->name : string -- --takeName(x); -->takeName(x) : string -->takeName : (named: { name: string; }) => string -->x : typeof x -- --/** -- * @type {number} -- */ --var a = x.zip; -->a : number -->x.zip : number -->x : typeof x -->zip : number -- --/** -- * @type {number} -- */ --var b = x.houseNumber; -->b : number -->x.houseNumber : number -->x : typeof x -->houseNumber : number -- --const returnExemplar = () => x; -->returnExemplar : () => typeof x -->() => x : () => typeof x -->x : typeof x -- --const needsExemplar = (_ = x) => void 0; -->needsExemplar : (_?: typeof x) => undefined -->(_ = x) => void 0 : (_?: typeof x) => undefined -->_ : typeof x -->x : typeof x -->void 0 : undefined -->0 : 0 -- --const expected = /** @type {{name: string, readonly middleInit: string, readonly lastName: string, zip: number, readonly houseNumber: number, zipStr: string}} */(/** @type {*} */(null)); -->expected : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } -->(/** @type {*} */(null)) : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } -->(null) : any -- --/** -- * -- * @param {typeof returnExemplar} a -- * @param {typeof needsExemplar} b -- */ --function match(a, b) {} -->match : (a: typeof returnExemplar, b: typeof needsExemplar) => void -->a : () => typeof x -->b : (_?: typeof x) => undefined -- --match(() => expected, (x = expected) => void 0); -->match(() => expected, (x = expected) => void 0) : void -->match : (a: typeof returnExemplar, b: typeof needsExemplar) => void -->() => expected : () => { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } -->expected : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } -->(x = expected) => void 0 : (x?: typeof x | undefined) => undefined -->x : typeof x | undefined -->expected : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } -->void 0 : undefined -->0 : 0 -- --module.exports = x; -->module.exports = x : typeof x -->module.exports : typeof x -->module : { exports: typeof x; } -->exports : typeof x -->x : typeof x -- diff --git a/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.errors.txt b/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.errors.txt index 4178a954b9..b339a4e9ee 100644 --- a/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.errors.txt @@ -1,10 +1,16 @@ -importer.js(1,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +importer.js(1,21): error TS2306: File 'mod1.js' is not a module. +mod1.js(2,23): error TS2304: Cannot find name 'exports'. +mod1.js(8,23): error TS2304: Cannot find name 'exports'. +mod1.js(11,23): error TS2304: Cannot find name 'exports'. +mod1.js(14,23): error TS2304: Cannot find name 'exports'. +mod1.js(15,23): error TS2304: Cannot find name 'exports'. +mod1.js(16,23): error TS2304: Cannot find name 'exports'. ==== importer.js (1 errors) ==== const mod = require("./mod1"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~ +!!! error TS2306: File 'mod1.js' is not a module. mod.thing; mod.other; mod.prop; @@ -20,21 +26,33 @@ importer.js(1,13): error TS2580: Cannot find name 'require'. Do you need to inst mod.bad2 = 0; mod.bad3 = 0; -==== mod1.js (0 errors) ==== +==== mod1.js (6 errors) ==== const obj = { value: 42, writable: true }; Object.defineProperty(exports, "thing", obj); + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. /** * @type {string} */ let str = /** @type {string} */("other"); Object.defineProperty(exports, str, { value: 42, writable: true }); + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. const propName = "prop" Object.defineProperty(exports, propName, { value: 42, writable: true }); + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. Object.defineProperty(exports, "bad1", { }); + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. Object.defineProperty(exports, "bad3", { writable: true }); + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.symbols b/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.symbols index 70545c8198..a395d22191 100644 --- a/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.symbols +++ b/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.symbols @@ -3,6 +3,7 @@ === importer.js === const mod = require("./mod1"); >mod : Symbol(mod, Decl(importer.js, 0, 5)) +>require : Symbol(require) mod.thing; >mod : Symbol(mod, Decl(importer.js, 0, 5)) @@ -41,3 +42,59 @@ mod.bad2 = 0; mod.bad3 = 0; >mod : Symbol(mod, Decl(importer.js, 0, 5)) +=== mod1.js === +const obj = { value: 42, writable: true }; +>obj : Symbol(obj, Decl(mod1.js, 0, 5)) +>value : Symbol(value, Decl(mod1.js, 0, 13)) +>writable : Symbol(writable, Decl(mod1.js, 0, 24)) + +Object.defineProperty(exports, "thing", obj); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>obj : Symbol(obj, Decl(mod1.js, 0, 5)) + +/** + * @type {string} + */ +let str = /** @type {string} */("other"); +>str : Symbol(str, Decl(mod1.js, 6, 3)) + +Object.defineProperty(exports, str, { value: 42, writable: true }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>str : Symbol(str, Decl(mod1.js, 6, 3)) +>value : Symbol(value, Decl(mod1.js, 7, 37)) +>writable : Symbol(writable, Decl(mod1.js, 7, 48)) + +const propName = "prop" +>propName : Symbol(propName, Decl(mod1.js, 9, 5)) + +Object.defineProperty(exports, propName, { value: 42, writable: true }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>propName : Symbol(propName, Decl(mod1.js, 9, 5)) +>value : Symbol(value, Decl(mod1.js, 10, 42)) +>writable : Symbol(writable, Decl(mod1.js, 10, 53)) + + +Object.defineProperty(exports, "bad1", { }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + +Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>get : Symbol(get, Decl(mod1.js, 14, 40)) +>value : Symbol(value, Decl(mod1.js, 14, 61)) + +Object.defineProperty(exports, "bad3", { writable: true }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>writable : Symbol(writable, Decl(mod1.js, 15, 40)) + diff --git a/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.symbols.diff b/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.symbols.diff index 70498f1695..ceb4e3a03d 100644 --- a/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.symbols.diff @@ -1,10 +1,9 @@ --- old.checkOtherObjectAssignProperty.symbols +++ new.checkOtherObjectAssignProperty.symbols -@@= skipped -2, +2 lines =@@ - === importer.js === +@@= skipped -3, +3 lines =@@ const mod = require("./mod1"); >mod : Symbol(mod, Decl(importer.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./mod1" : Symbol(mod, Decl(mod1.js, 0, 0)) mod.thing; @@ -14,7 +13,7 @@ mod.other; >mod : Symbol(mod, Decl(importer.js, 0, 5)) -@@= skipped -15, +11 lines =@@ +@@= skipped -14, +11 lines =@@ >mod : Symbol(mod, Decl(importer.js, 0, 5)) mod.bad1; @@ -58,69 +57,77 @@ >mod : Symbol(mod, Decl(importer.js, 0, 5)) ->bad3 : Symbol(mod.bad3, Decl(mod1.js, 14, 77)) --=== mod1.js === --const obj = { value: 42, writable: true }; -->obj : Symbol(obj, Decl(mod1.js, 0, 5)) -->value : Symbol(value, Decl(mod1.js, 0, 13)) -->writable : Symbol(writable, Decl(mod1.js, 0, 24)) -- --Object.defineProperty(exports, "thing", obj); + === mod1.js === + const obj = { value: 42, writable: true }; +@@= skipped -21, +15 lines =@@ + >writable : Symbol(writable, Decl(mod1.js, 0, 24)) + + Object.defineProperty(exports, "thing", obj); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ->"thing" : Symbol(thing, Decl(mod1.js, 0, 42)) -->obj : Symbol(obj, Decl(mod1.js, 0, 5)) -- --/** -- * @type {string} -- */ --let str = /** @type {string} */("other"); -->str : Symbol(str, Decl(mod1.js, 6, 3)) -- --Object.defineProperty(exports, str, { value: 42, writable: true }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >obj : Symbol(obj, Decl(mod1.js, 0, 5)) + + /** +@@= skipped -14, +12 lines =@@ + >str : Symbol(str, Decl(mod1.js, 6, 3)) + + Object.defineProperty(exports, str, { value: 42, writable: true }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) -->str : Symbol(str, Decl(mod1.js, 6, 3)) -->value : Symbol(value, Decl(mod1.js, 7, 37)) -->writable : Symbol(writable, Decl(mod1.js, 7, 48)) -- --const propName = "prop" -->propName : Symbol(propName, Decl(mod1.js, 9, 5)) -- --Object.defineProperty(exports, propName, { value: 42, writable: true }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >str : Symbol(str, Decl(mod1.js, 6, 3)) + >value : Symbol(value, Decl(mod1.js, 7, 37)) + >writable : Symbol(writable, Decl(mod1.js, 7, 48)) +@@= skipped -12, +11 lines =@@ + >propName : Symbol(propName, Decl(mod1.js, 9, 5)) + + Object.defineProperty(exports, propName, { value: 42, writable: true }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) -->propName : Symbol(propName, Decl(mod1.js, 9, 5)) -->value : Symbol(value, Decl(mod1.js, 10, 42)) -->writable : Symbol(writable, Decl(mod1.js, 10, 53)) -- -- --Object.defineProperty(exports, "bad1", { }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >propName : Symbol(propName, Decl(mod1.js, 9, 5)) + >value : Symbol(value, Decl(mod1.js, 10, 42)) + >writable : Symbol(writable, Decl(mod1.js, 10, 53)) + + + Object.defineProperty(exports, "bad1", { }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ->"bad1" : Symbol(bad1, Decl(mod1.js, 10, 72)) -- --Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + + Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ->"bad2" : Symbol(bad2, Decl(mod1.js, 13, 44)) -->get : Symbol(get, Decl(mod1.js, 14, 40)) -->value : Symbol(value, Decl(mod1.js, 14, 61)) -- --Object.defineProperty(exports, "bad3", { writable: true }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >get : Symbol(get, Decl(mod1.js, 14, 40)) + >value : Symbol(value, Decl(mod1.js, 14, 61)) + + Object.defineProperty(exports, "bad3", { writable: true }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ->"bad3" : Symbol(bad3, Decl(mod1.js, 14, 77)) -->writable : Symbol(writable, Decl(mod1.js, 15, 40)) -- ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >writable : Symbol(writable, Decl(mod1.js, 15, 40)) + diff --git a/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.types b/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.types index a465cf600e..617a3b96ee 100644 --- a/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.types +++ b/testdata/baselines/reference/submodule/conformance/checkOtherObjectAssignProperty.types @@ -80,3 +80,94 @@ mod.bad3 = 0; >bad3 : any >0 : 0 +=== mod1.js === +const obj = { value: 42, writable: true }; +>obj : { value: number; writable: boolean; } +>{ value: 42, writable: true } : { value: number; writable: boolean; } +>value : number +>42 : 42 +>writable : boolean +>true : true + +Object.defineProperty(exports, "thing", obj); +>Object.defineProperty(exports, "thing", obj) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : any +>"thing" : "thing" +>obj : { value: number; writable: boolean; } + +/** + * @type {string} + */ +let str = /** @type {string} */("other"); +>str : string +>("other") : string +>"other" : string +>"other" : "other" + +Object.defineProperty(exports, str, { value: 42, writable: true }); +>Object.defineProperty(exports, str, { value: 42, writable: true }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : any +>str : string +>{ value: 42, writable: true } : { value: number; writable: true; } +>value : number +>42 : 42 +>writable : true +>true : true + +const propName = "prop" +>propName : "prop" +>"prop" : "prop" + +Object.defineProperty(exports, propName, { value: 42, writable: true }); +>Object.defineProperty(exports, propName, { value: 42, writable: true }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : any +>propName : "prop" +>{ value: 42, writable: true } : { value: number; writable: true; } +>value : number +>42 : 42 +>writable : true +>true : true + + +Object.defineProperty(exports, "bad1", { }); +>Object.defineProperty(exports, "bad1", { }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : any +>"bad1" : "bad1" +>{ } : {} + +Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); +>Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : any +>"bad2" : "bad2" +>{ get() { return 12 }, value: "no" } : { get: () => number; value: string; } +>get : () => number +>12 : 12 +>value : string +>"no" : "no" + +Object.defineProperty(exports, "bad3", { writable: true }); +>Object.defineProperty(exports, "bad3", { writable: true }) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>exports : any +>"bad3" : "bad3" +>{ writable: true } : { writable: true; } +>writable : true +>true : true + diff --git a/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.errors.txt b/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.errors.txt index d85b3dae4d..6641484655 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.errors.txt @@ -1,10 +1,10 @@ -bug43713.js(1,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +bug43713.js(1,27): error TS2307: Cannot find module './commonJSAliasedExport' or its corresponding type declarations. ==== bug43713.js (1 errors) ==== const { funky } = require('./commonJSAliasedExport'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './commonJSAliasedExport' or its corresponding type declarations. /** @type {boolean} */ var diddy var diddy = funky(1) diff --git a/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.symbols b/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.symbols index 1c40429976..b7748b291e 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.symbols +++ b/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.symbols @@ -3,6 +3,7 @@ === bug43713.js === const { funky } = require('./commonJSAliasedExport'); >funky : Symbol(funky, Decl(bug43713.js, 0, 7)) +>require : Symbol(require) /** @type {boolean} */ var diddy diff --git a/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.symbols.diff b/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.symbols.diff index e97484fa28..452e300243 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/commonJSAliasedExport.symbols.diff @@ -1,15 +1,14 @@ --- old.commonJSAliasedExport.symbols +++ new.commonJSAliasedExport.symbols -@@= skipped -2, +2 lines =@@ - === bug43713.js === +@@= skipped -3, +3 lines =@@ const { funky } = require('./commonJSAliasedExport'); >funky : Symbol(funky, Decl(bug43713.js, 0, 7)) -->require : Symbol(require) + >require : Symbol(require) ->'./commonJSAliasedExport' : Symbol("commonJSAliasedExport", Decl(commonJSAliasedExport.js, 0, 0)) /** @type {boolean} */ var diddy -@@= skipped -12, +10 lines =@@ +@@= skipped -11, +10 lines =@@ >funky : Symbol(funky, Decl(bug43713.js, 0, 7)) diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.errors.txt b/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.errors.txt index 04d5cfd894..c197d18d54 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.errors.txt @@ -1,17 +1,8 @@ -main.js(1,9): error TS2451: Cannot redeclare block-scoped variable 'K'. -main.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. main.js(2,13): error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? -mod1.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'K'. -mod1.js(6,1): error TS2304: Cannot find name 'exports'. -==== main.js (3 errors) ==== +==== main.js (1 errors) ==== const { K } = require("./mod1"); - ~ -!!! error TS2451: Cannot redeclare block-scoped variable 'K'. -!!! related TS6203 mod1.js:1:7: 'K' was also declared here. - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** @param {K} k */ ~ !!! error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? @@ -19,16 +10,11 @@ mod1.js(6,1): error TS2304: Cannot find name 'exports'. k.values() } -==== mod1.js (2 errors) ==== +==== mod1.js (0 errors) ==== class K { - ~ -!!! error TS2451: Cannot redeclare block-scoped variable 'K'. -!!! related TS6203 main.js:1:9: 'K' was also declared here. values() { return new K() } } exports.K = K; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.symbols b/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.symbols index 0f25d7c56a..2688a3f6c6 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.symbols +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.symbols @@ -3,6 +3,8 @@ === main.js === const { K } = require("./mod1"); >K : Symbol(K, Decl(main.js, 0, 7)) +>require : Symbol(require) +>"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) /** @param {K} k */ function f(k) { @@ -21,9 +23,12 @@ class K { >values : Symbol(values, Decl(mod1.js, 0, 9)) return new K() ->K : Symbol(K, Decl(main.js, 0, 7)) +>K : Symbol(K, Decl(mod1.js, 0, 0)) } } exports.K = K; ->K : Symbol(K, Decl(main.js, 0, 7)) +>exports.K : Symbol(K, Decl(mod1.js, 4, 1)) +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>K : Symbol(K, Decl(mod1.js, 4, 1)) +>K : Symbol(K, Decl(mod1.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.symbols.diff b/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.symbols.diff index 49533228e2..d58f4ebfed 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.symbols.diff @@ -1,15 +1,6 @@ --- old.commonJSImportClassTypeReference.symbols +++ new.commonJSImportClassTypeReference.symbols -@@= skipped -2, +2 lines =@@ - === main.js === - const { K } = require("./mod1"); - >K : Symbol(K, Decl(main.js, 0, 7)) -->require : Symbol(require) -->"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) - - /** @param {K} k */ - function f(k) { -@@= skipped -9, +7 lines =@@ +@@= skipped -11, +11 lines =@@ >k : Symbol(k, Decl(main.js, 2, 11)) k.values() @@ -27,14 +18,13 @@ +>values : Symbol(values, Decl(mod1.js, 0, 9)) return new K() -->K : Symbol(K, Decl(mod1.js, 0, 0)) -+>K : Symbol(K, Decl(main.js, 0, 7)) - } + >K : Symbol(K, Decl(mod1.js, 0, 0)) +@@= skipped -8, +8 lines =@@ } exports.K = K; -->exports.K : Symbol(K, Decl(mod1.js, 4, 1)) + >exports.K : Symbol(K, Decl(mod1.js, 4, 1)) ->exports : Symbol(K, Decl(mod1.js, 4, 1)) -->K : Symbol(K, Decl(mod1.js, 4, 1)) -->K : Symbol(K, Decl(mod1.js, 0, 0)) -+>K : Symbol(K, Decl(main.js, 0, 7)) ++>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) + >K : Symbol(K, Decl(mod1.js, 4, 1)) + >K : Symbol(K, Decl(mod1.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.types b/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.types index 03ded8a6a7..7c31947da1 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.types +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportClassTypeReference.types @@ -2,8 +2,8 @@ === main.js === const { K } = require("./mod1"); ->K : any ->require("./mod1") : any +>K : typeof K +>require("./mod1") : typeof import("mod1") >require : any >"./mod1" : "./mod1" @@ -24,17 +24,17 @@ class K { >K : K values() { ->values : () => any +>values : () => K return new K() ->new K() : any ->K : any +>new K() : K +>K : typeof K } } exports.K = K; ->exports.K = K : any ->exports.K : any ->exports : any ->K : any ->K : any +>exports.K = K : typeof K +>exports.K : typeof K +>exports : typeof import("mod1") +>K : typeof K +>K : typeof K diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.errors.txt b/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.errors.txt index eb50cc5891..6b47881065 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.errors.txt @@ -1,12 +1,8 @@ -main.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. main.js(2,13): error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? -mod1.js(1,1): error TS2304: Cannot find name 'exports'. -==== main.js (2 errors) ==== +==== main.js (1 errors) ==== const { K } = require("./mod1"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** @param {K} k */ ~ !!! error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? @@ -14,10 +10,8 @@ mod1.js(1,1): error TS2304: Cannot find name 'exports'. k.values() } -==== mod1.js (1 errors) ==== +==== mod1.js (0 errors) ==== exports.K = class K { - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. values() { } }; diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.symbols b/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.symbols index b660b040b6..7107389dec 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.symbols +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.symbols @@ -3,6 +3,8 @@ === main.js === const { K } = require("./mod1"); >K : Symbol(K, Decl(main.js, 0, 7)) +>require : Symbol(require) +>"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) /** @param {K} k */ function f(k) { @@ -15,6 +17,9 @@ function f(k) { === mod1.js === exports.K = class K { +>exports.K : Symbol(K, Decl(mod1.js, 0, 0)) +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>K : Symbol(K, Decl(mod1.js, 0, 0)) >K : Symbol(K, Decl(mod1.js, 0, 11)) values() { diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.symbols.diff b/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.symbols.diff index f912b20063..d22451b308 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.symbols.diff @@ -1,15 +1,6 @@ --- old.commonJSImportExportedClassExpression.symbols +++ new.commonJSImportExportedClassExpression.symbols -@@= skipped -2, +2 lines =@@ - === main.js === - const { K } = require("./mod1"); - >K : Symbol(K, Decl(main.js, 0, 7)) -->require : Symbol(require) -->"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) - - /** @param {K} k */ - function f(k) { -@@= skipped -9, +7 lines =@@ +@@= skipped -11, +11 lines =@@ >k : Symbol(k, Decl(main.js, 2, 11)) k.values() @@ -20,9 +11,10 @@ === mod1.js === exports.K = class K { -->exports.K : Symbol(K, Decl(mod1.js, 0, 0)) + >exports.K : Symbol(K, Decl(mod1.js, 0, 0)) ->exports : Symbol(K, Decl(mod1.js, 0, 0)) -->K : Symbol(K, Decl(mod1.js, 0, 0)) ++>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) + >K : Symbol(K, Decl(mod1.js, 0, 0)) >K : Symbol(K, Decl(mod1.js, 0, 11)) values() { diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.types b/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.types index 271bca849a..00dcff55ca 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.types +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportExportedClassExpression.types @@ -2,8 +2,8 @@ === main.js === const { K } = require("./mod1"); ->K : any ->require("./mod1") : any +>K : typeof K +>require("./mod1") : typeof import("mod1") >require : any >"./mod1" : "./mod1" @@ -22,9 +22,9 @@ function f(k) { === mod1.js === exports.K = class K { >exports.K = class K { values() { }} : typeof K ->exports.K : any ->exports : any ->K : any +>exports.K : typeof K +>exports : typeof import("mod1") +>K : typeof K >class K { values() { }} : typeof K >K : typeof K diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.errors.txt b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.errors.txt index 0444e83a7f..1e22d63b93 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.errors.txt @@ -1,15 +1,11 @@ -main.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. main.js(2,13): error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? mod1.js(2,4): error TS2339: Property 'K' does not exist on type '{}'. mod1.js(4,23): error TS2339: Property 'K' does not exist on type '{}'. -mod1.js(7,1): error TS2304: Cannot find name 'exports'. mod1.js(7,16): error TS2339: Property 'K' does not exist on type '{}'. -==== main.js (2 errors) ==== +==== main.js (1 errors) ==== const { K } = require("./mod1"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** @param {K} k */ ~ !!! error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? @@ -17,7 +13,7 @@ mod1.js(7,16): error TS2339: Property 'K' does not exist on type '{}'. k.values() } -==== mod1.js (4 errors) ==== +==== mod1.js (3 errors) ==== var NS = {} NS.K =class { ~ @@ -29,8 +25,6 @@ mod1.js(7,16): error TS2339: Property 'K' does not exist on type '{}'. } } exports.K = NS.K; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. ~ !!! error TS2339: Property 'K' does not exist on type '{}'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols index 8aae8aa0c7..db7c82a286 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols @@ -3,6 +3,8 @@ === main.js === const { K } = require("./mod1"); >K : Symbol(K, Decl(main.js, 0, 7)) +>require : Symbol(require) +>"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) /** @param {K} k */ function f(k) { @@ -28,5 +30,8 @@ NS.K =class { } } exports.K = NS.K; +>exports.K : Symbol(K, Decl(mod1.js, 5, 1)) +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>K : Symbol(K, Decl(mod1.js, 5, 1)) >NS : Symbol(NS, Decl(mod1.js, 0, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols.diff b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols.diff index c39b01f21d..cb7a9c3be8 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.symbols.diff @@ -1,15 +1,6 @@ --- old.commonJSImportNestedClassTypeReference.symbols +++ new.commonJSImportNestedClassTypeReference.symbols -@@= skipped -2, +2 lines =@@ - === main.js === - const { K } = require("./mod1"); - >K : Symbol(K, Decl(main.js, 0, 7)) -->require : Symbol(require) -->"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) - - /** @param {K} k */ - function f(k) { -@@= skipped -9, +7 lines =@@ +@@= skipped -11, +11 lines =@@ >k : Symbol(k, Decl(main.js, 2, 11)) k.values() @@ -41,9 +32,10 @@ } } exports.K = NS.K; -->exports.K : Symbol(K, Decl(mod1.js, 5, 1)) + >exports.K : Symbol(K, Decl(mod1.js, 5, 1)) ->exports : Symbol(K, Decl(mod1.js, 5, 1)) -->K : Symbol(K, Decl(mod1.js, 5, 1)) ++>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) + >K : Symbol(K, Decl(mod1.js, 5, 1)) ->NS.K : Symbol(K, Decl(mod1.js, 0, 11)) ->NS : Symbol(NS, Decl(mod1.js, 0, 3), Decl(mod1.js, 0, 11)) ->K : Symbol(K, Decl(mod1.js, 0, 11)) diff --git a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.types b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.types index 7176fdf016..417be9ccc8 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.types +++ b/testdata/baselines/reference/submodule/conformance/commonJSImportNestedClassTypeReference.types @@ -3,7 +3,7 @@ === main.js === const { K } = require("./mod1"); >K : any ->require("./mod1") : any +>require("./mod1") : typeof import("mod1") >require : any >"./mod1" : "./mod1" @@ -44,7 +44,7 @@ NS.K =class { exports.K = NS.K; >exports.K = NS.K : any >exports.K : any ->exports : any +>exports : typeof import("mod1") >K : any >NS.K : any >NS : {} diff --git a/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.errors.txt b/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.errors.txt deleted file mode 100644 index 4235c9fcd9..0000000000 --- a/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.errors.txt +++ /dev/null @@ -1,13 +0,0 @@ -/bar.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== /bar.js (1 errors) ==== - const { a } = require("./foo"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - if (a) { - var x = a + 1; - } -==== /foo.d.ts (0 errors) ==== - export const a: number | null; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.symbols b/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.symbols index 1159545272..8b821ca105 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.symbols +++ b/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.symbols @@ -3,6 +3,8 @@ === /bar.js === const { a } = require("./foo"); >a : Symbol(a, Decl(bar.js, 0, 7)) +>require : Symbol(require) +>"./foo" : Symbol("/foo", Decl(foo.d.ts, 0, 0)) if (a) { >a : Symbol(a, Decl(bar.js, 0, 7)) diff --git a/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.symbols.diff b/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.symbols.diff deleted file mode 100644 index 1ffe20107b..0000000000 --- a/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.symbols.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- old.commonJsImportBindingElementNarrowType.symbols -+++ new.commonJsImportBindingElementNarrowType.symbols -@@= skipped -2, +2 lines =@@ - === /bar.js === - const { a } = require("./foo"); - >a : Symbol(a, Decl(bar.js, 0, 7)) -->require : Symbol(require) -->"./foo" : Symbol("/foo", Decl(foo.d.ts, 0, 0)) - - if (a) { - >a : Symbol(a, Decl(bar.js, 0, 7)) diff --git a/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.types b/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.types index dcf08ce7b2..218b36ccf9 100644 --- a/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.types +++ b/testdata/baselines/reference/submodule/conformance/commonJsImportBindingElementNarrowType.types @@ -2,18 +2,18 @@ === /bar.js === const { a } = require("./foo"); ->a : any ->require("./foo") : any +>a : number | null +>require("./foo") : typeof import("/foo") >require : any >"./foo" : "./foo" if (a) { ->a : any +>a : number | null var x = a + 1; ->x : any ->a + 1 : any ->a : any +>x : number +>a + 1 : number +>a : number >1 : 1 } === /foo.d.ts === diff --git a/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.errors.txt b/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.errors.txt index 755baa04ea..57cc9ec89f 100644 --- a/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.errors.txt @@ -1,12 +1,15 @@ -bug24934.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +bug24934.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +use.js(1,21): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. ==== bug24934.js (1 errors) ==== export function abc(a, b, c) { return 5; } module.exports = { abc }; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== use.js (0 errors) ==== + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. +==== use.js (1 errors) ==== import { abc } from './bug24934'; + ~~~~~~~~~~~~ +!!! error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. abc(1, 2, 3); \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.symbols b/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.symbols index 3bb19fc697..183b4d35fd 100644 --- a/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.symbols +++ b/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.symbols @@ -8,6 +8,9 @@ export function abc(a, b, c) { return 5; } >c : Symbol(c, Decl(bug24934.js, 0, 25)) module.exports = { abc }; +>module.exports : Symbol(export=, Decl(bug24934.js, 0, 42)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(bug24934.js, 0, 42)) >abc : Symbol(abc, Decl(bug24934.js, 1, 18)) === use.js === diff --git a/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.symbols.diff b/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.symbols.diff new file mode 100644 index 0000000000..6eea7299e8 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.symbols.diff @@ -0,0 +1,12 @@ +--- old.conflictingCommonJSES2015Exports.symbols ++++ new.conflictingCommonJSES2015Exports.symbols +@@= skipped -7, +7 lines =@@ + >c : Symbol(c, Decl(bug24934.js, 0, 25)) + + module.exports = { abc }; ++>module.exports : Symbol(export=, Decl(bug24934.js, 0, 42)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(bug24934.js, 0, 42)) + >abc : Symbol(abc, Decl(bug24934.js, 1, 18)) + + === use.js === diff --git a/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.types b/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.types index e598ff40c9..5d420ed365 100644 --- a/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.types +++ b/testdata/baselines/reference/submodule/conformance/conflictingCommonJSES2015Exports.types @@ -10,9 +10,9 @@ export function abc(a, b, c) { return 5; } module.exports = { abc }; >module.exports = { abc } : { abc: (a: any, b: any, c: any) => number; } ->module.exports : any ->module : any ->exports : any +>module.exports : { abc: (a: any, b: any, c: any) => number; } +>module : { export=: { abc: (a: any, b: any, c: any) => number; }; } +>exports : { abc: (a: any, b: any, c: any) => number; } >{ abc } : { abc: (a: any, b: any, c: any) => number; } >abc : (a: any, b: any, c: any) => number diff --git a/testdata/baselines/reference/submodule/conformance/constructorFunctions2.errors.txt b/testdata/baselines/reference/submodule/conformance/constructorFunctions2.errors.txt deleted file mode 100644 index c1b921a3ec..0000000000 --- a/testdata/baselines/reference/submodule/conformance/constructorFunctions2.errors.txt +++ /dev/null @@ -1,27 +0,0 @@ -index.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'A'. -other.js(1,10): error TS2451: Cannot redeclare block-scoped variable 'A'. - - -==== node.d.ts (0 errors) ==== - declare function require(id: string): any; - declare var module: any, exports: any; - -==== index.js (1 errors) ==== - const A = require("./other"); - ~ -!!! error TS2451: Cannot redeclare block-scoped variable 'A'. -!!! related TS6203 other.js:1:10: 'A' was also declared here. - const a = new A().id; - - const B = function() { this.id = 1; } - B.prototype.m = function() { this.x = 2; } - const b = new B(); - b.id; - b.x; - -==== other.js (1 errors) ==== - function A() { this.id = 1; } - ~ -!!! error TS2451: Cannot redeclare block-scoped variable 'A'. -!!! related TS6203 index.js:1:7: 'A' was also declared here. - module.exports = A; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/constructorFunctions2.symbols b/testdata/baselines/reference/submodule/conformance/constructorFunctions2.symbols index c698ea6f1b..6f2ed5343e 100644 --- a/testdata/baselines/reference/submodule/conformance/constructorFunctions2.symbols +++ b/testdata/baselines/reference/submodule/conformance/constructorFunctions2.symbols @@ -13,6 +13,7 @@ declare var module: any, exports: any; const A = require("./other"); >A : Symbol(A, Decl(index.js, 0, 5)) >require : Symbol(require, Decl(node.d.ts, 0, 0)) +>"./other" : Symbol("other", Decl(other.js, 0, 0)) const a = new A().id; >a : Symbol(a, Decl(index.js, 1, 5)) @@ -41,6 +42,8 @@ function A() { this.id = 1; } >A : Symbol(A, Decl(other.js, 0, 0)) module.exports = A; ->module : Symbol(module, Decl(node.d.ts, 1, 11)) ->A : Symbol(A, Decl(index.js, 0, 5)) +>module.exports : Symbol(A, Decl(other.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(A, Decl(other.js, 0, 0)) +>A : Symbol(A, Decl(other.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/constructorFunctions2.symbols.diff b/testdata/baselines/reference/submodule/conformance/constructorFunctions2.symbols.diff index 812b184e8e..6784d0c9f5 100644 --- a/testdata/baselines/reference/submodule/conformance/constructorFunctions2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/constructorFunctions2.symbols.diff @@ -1,10 +1,6 @@ --- old.constructorFunctions2.symbols +++ new.constructorFunctions2.symbols -@@= skipped -12, +12 lines =@@ - const A = require("./other"); - >A : Symbol(A, Decl(index.js, 0, 5)) - >require : Symbol(require, Decl(node.d.ts, 0, 0)) -->"./other" : Symbol("other", Decl(other.js, 0, 0)) +@@= skipped -16, +16 lines =@@ const a = new A().id; >a : Symbol(a, Decl(index.js, 1, 5)) @@ -54,7 +50,8 @@ ->module.exports : Symbol(module.exports, Decl(other.js, 0, 0)) ->module : Symbol(export=, Decl(other.js, 0, 29)) ->exports : Symbol(export=, Decl(other.js, 0, 29)) -->A : Symbol(A, Decl(other.js, 0, 0)) -+>module : Symbol(module, Decl(node.d.ts, 1, 11)) -+>A : Symbol(A, Decl(index.js, 0, 5)) ++>module.exports : Symbol(A, Decl(other.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(A, Decl(other.js, 0, 0)) + >A : Symbol(A, Decl(other.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/constructorFunctions2.types b/testdata/baselines/reference/submodule/conformance/constructorFunctions2.types index 770414a643..f513861801 100644 --- a/testdata/baselines/reference/submodule/conformance/constructorFunctions2.types +++ b/testdata/baselines/reference/submodule/conformance/constructorFunctions2.types @@ -11,8 +11,8 @@ declare var module: any, exports: any; === index.js === const A = require("./other"); ->A : any ->require("./other") : any +>A : () => void +>require("./other") : () => void >require : (id: string) => any >"./other" : "./other" @@ -20,7 +20,7 @@ const a = new A().id; >a : any >new A().id : any >new A() : any ->A : any +>A : () => void >id : any const B = function() { this.id = 1; } @@ -71,9 +71,9 @@ function A() { this.id = 1; } >1 : 1 module.exports = A; ->module.exports = A : any ->module.exports : any ->module : any ->exports : any ->A : any +>module.exports = A : () => void +>module.exports : () => void +>module : { A: () => void; } +>exports : () => void +>A : () => void diff --git a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.errors.txt b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.errors.txt index 4a0abbb1ef..170c786adf 100644 --- a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.errors.txt @@ -1,4 +1,3 @@ -mod.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. mod.js(5,7): error TS7006: Parameter 'n' implicitly has an 'any' type. test.js(9,4): error TS2339: Property 'x' does not exist on type '{}'. test.js(11,7): error TS7006: Parameter 'n' implicitly has an 'any' type. @@ -9,19 +8,17 @@ test.js(25,14): error TS2339: Property 's' does not exist on type 'Thing'. test.js(27,15): error TS7006: Parameter 'n' implicitly has an 'any' type. test.js(32,14): error TS2339: Property 's' does not exist on type 'Thing'. test.js(34,15): error TS7006: Parameter 'n' implicitly has an 'any' type. -test.js(42,1): error TS2304: Cannot find name 'exports'. +test.js(42,1): error TS7022: 'x' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. test.js(44,7): error TS7006: Parameter 'n' implicitly has an 'any' type. -test.js(46,1): error TS2304: Cannot find name 'exports'. -test.js(49,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +test.js(49,1): error TS7022: 'y' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. test.js(51,7): error TS7006: Parameter 'n' implicitly has an 'any' type. -test.js(53,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. test.js(57,17): error TS2339: Property 'x' does not exist on type 'Thing'. test.js(59,7): error TS7006: Parameter 'n' implicitly has an 'any' type. test.js(61,17): error TS2339: Property 'x' does not exist on type 'Thing'. test.js(69,7): error TS7006: Parameter 'n' implicitly has an 'any' type. -==== test.js (19 errors) ==== +==== test.js (17 errors) ==== /** @typedef {{ status: 'done' m(n: number): void @@ -82,29 +79,31 @@ test.js(69,7): error TS7006: Parameter 'n' implicitly has an 'any' type. /** @type {DoneStatus} */ exports.x = { - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~~~~~~~~ status: "done", + ~~~~~~~~~~~~~~~~~~~ m(n) { } + ~~~~~~~~~~~~ ~ !!! error TS7006: Parameter 'n' implicitly has an 'any' type. } + ~ +!!! error TS7022: 'x' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. exports.x - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. /** @type {DoneStatus} */ module.exports.y = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~ status: "done", + ~~~~~~~~~~~~~~~~~~~ m(n) { } + ~~~~~~~~~~~~ ~ !!! error TS7006: Parameter 'n' implicitly has an 'any' type. } + ~ +!!! error TS7022: 'y' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. module.exports.y - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. // prototype-property assignment /** @type {DoneStatus} */ @@ -131,12 +130,10 @@ test.js(69,7): error TS7006: Parameter 'n' implicitly has an 'any' type. !!! error TS7006: Parameter 'n' implicitly has an 'any' type. } -==== mod.js (2 errors) ==== +==== mod.js (1 errors) ==== // module.exports assignment /** @type {{ status: 'done', m(n: number): void }} */ module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. status: "done", m(n) { } ~ diff --git a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols index cb6013b96f..41184f59b1 100644 --- a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols @@ -74,6 +74,10 @@ class Thing { /** @type {DoneStatus} */ exports.x = { +>exports.x : Symbol(x, Decl(test.js, 36, 1)) +>exports : Symbol("test", Decl(test.js, 0, 0)) +>x : Symbol(x, Decl(test.js, 36, 1)) + status: "done", >status : Symbol(status, Decl(test.js, 41, 13)) @@ -82,9 +86,18 @@ exports.x = { >n : Symbol(n, Decl(test.js, 43, 6)) } exports.x +>exports.x : Symbol(x, Decl(test.js, 36, 1)) +>exports : Symbol("test", Decl(test.js, 0, 0)) +>x : Symbol(x, Decl(test.js, 36, 1)) /** @type {DoneStatus} */ module.exports.y = { +>module.exports.y : Symbol(y, Decl(test.js, 45, 9)) +>module.exports : Symbol("test", Decl(test.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("test", Decl(test.js, 0, 0)) +>y : Symbol(y, Decl(test.js, 45, 9)) + status: "done", >status : Symbol(status, Decl(test.js, 48, 20)) @@ -93,6 +106,11 @@ module.exports.y = { >n : Symbol(n, Decl(test.js, 50, 6)) } module.exports.y +>module.exports.y : Symbol(y, Decl(test.js, 45, 9)) +>module.exports : Symbol("test", Decl(test.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("test", Decl(test.js, 0, 0)) +>y : Symbol(y, Decl(test.js, 45, 9)) // prototype-property assignment /** @type {DoneStatus} */ @@ -135,6 +153,10 @@ F.prototype = { // module.exports assignment /** @type {{ status: 'done', m(n: number): void }} */ module.exports = { +>module.exports : Symbol(export=, Decl(mod.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod.js, 0, 0)) + status: "done", >status : Symbol(status, Decl(mod.js, 2, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols.diff index 593b1bee8f..db95ee40cb 100644 --- a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.symbols.diff @@ -62,45 +62,39 @@ status: 'done', >status : Symbol(status, Decl(test.js, 31, 18)) -@@= skipped -21, +19 lines =@@ - +@@= skipped -22, +20 lines =@@ /** @type {DoneStatus} */ exports.x = { -->exports.x : Symbol(x, Decl(test.js, 36, 1)) + >exports.x : Symbol(x, Decl(test.js, 36, 1)) ->exports : Symbol(x, Decl(test.js, 36, 1)) -->x : Symbol(x, Decl(test.js, 36, 1)) -- - status: "done", - >status : Symbol(status, Decl(test.js, 41, 13)) - -@@= skipped -12, +8 lines =@@ - >n : Symbol(n, Decl(test.js, 43, 6)) - } - exports.x -->exports.x : Symbol(x, Decl(test.js, 36, 1)) -->exports : Symbol("test", Decl(test.js, 0, 0)) -->x : Symbol(x, Decl(test.js, 36, 1)) ++>exports : Symbol("test", Decl(test.js, 0, 0)) + >x : Symbol(x, Decl(test.js, 36, 1)) + status: "done", +@@= skipped -18, +18 lines =@@ /** @type {DoneStatus} */ module.exports.y = { -->module.exports.y : Symbol(y, Decl(test.js, 45, 9)) + >module.exports.y : Symbol(y, Decl(test.js, 45, 9)) ->module.exports : Symbol(y, Decl(test.js, 45, 9)) ->module : Symbol(module, Decl(test.js, 45, 9)) ->exports : Symbol(module.exports, Decl(test.js, 0, 0)) -->y : Symbol(y, Decl(test.js, 45, 9)) -- - status: "done", - >status : Symbol(status, Decl(test.js, 48, 20)) ++>module.exports : Symbol("test", Decl(test.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("test", Decl(test.js, 0, 0)) + >y : Symbol(y, Decl(test.js, 45, 9)) -@@= skipped -20, +11 lines =@@ - >n : Symbol(n, Decl(test.js, 50, 6)) + status: "done", +@@= skipped -14, +14 lines =@@ } module.exports.y -->module.exports.y : Symbol(y, Decl(test.js, 45, 9)) + >module.exports.y : Symbol(y, Decl(test.js, 45, 9)) ->module.exports : Symbol(module.exports, Decl(test.js, 0, 0)) ->module : Symbol(module, Decl(test.js, 45, 9)) ->exports : Symbol(module.exports, Decl(test.js, 0, 0)) -->y : Symbol(y, Decl(test.js, 45, 9)) ++>module.exports : Symbol("test", Decl(test.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("test", Decl(test.js, 0, 0)) + >y : Symbol(y, Decl(test.js, 45, 9)) // prototype-property assignment /** @type {DoneStatus} */ @@ -115,7 +109,7 @@ status: 'done', >status : Symbol(status, Decl(test.js, 56, 21)) -@@= skipped -23, +16 lines =@@ +@@= skipped -22, +20 lines =@@ >n : Symbol(n, Decl(test.js, 58, 6)) } Thing.prototype.x @@ -149,8 +143,8 @@ module.exports = { ->module.exports : Symbol(module.exports, Decl(mod.js, 0, 0)) ->module : Symbol(export=, Decl(mod.js, 0, 0)) -->exports : Symbol(export=, Decl(mod.js, 0, 0)) -- - status: "done", - >status : Symbol(status, Decl(mod.js, 2, 18)) ++>module.exports : Symbol(export=, Decl(mod.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(mod.js, 0, 0)) + status: "done", diff --git a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.types b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.types index 1a662b4fb9..4cc8ca007c 100644 --- a/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/contextualTypedSpecialAssignment.types @@ -99,7 +99,7 @@ class Thing { exports.x = { >exports.x = { status: "done", m(n) { }} : { status: string; m: (n: any) => void; } >exports.x : any ->exports : any +>exports : typeof import("test") >x : any >{ status: "done", m(n) { }} : { status: string; m: (n: any) => void; } @@ -113,16 +113,16 @@ exports.x = { } exports.x >exports.x : any ->exports : any +>exports : typeof import("test") >x : any /** @type {DoneStatus} */ module.exports.y = { >module.exports.y = { status: "done", m(n) { }} : { status: string; m: (n: any) => void; } >module.exports.y : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("test") +>module : { "test": typeof import("test"); } +>exports : typeof import("test") >y : any >{ status: "done", m(n) { }} : { status: string; m: (n: any) => void; } @@ -136,9 +136,9 @@ module.exports.y = { } module.exports.y >module.exports.y : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("test") +>module : { "test": typeof import("test"); } +>exports : typeof import("test") >y : any // prototype-property assignment @@ -193,9 +193,9 @@ F.prototype = { /** @type {{ status: 'done', m(n: number): void }} */ module.exports = { >module.exports = { status: "done", m(n) { }} : { status: string; m: (n: any) => void; } ->module.exports : any ->module : any ->exports : any +>module.exports : { status: string; m: (n: any) => void; } +>module : { export=: { status: string; m: (n: any) => void; }; } +>exports : { status: string; m: (n: any) => void; } >{ status: "done", m(n) { }} : { status: string; m: (n: any) => void; } status: "done", diff --git a/testdata/baselines/reference/submodule/conformance/enumTagOnExports.errors.txt b/testdata/baselines/reference/submodule/conformance/enumTagOnExports.errors.txt deleted file mode 100644 index 0dabe508fb..0000000000 --- a/testdata/baselines/reference/submodule/conformance/enumTagOnExports.errors.txt +++ /dev/null @@ -1,15 +0,0 @@ -enumTagOnExports.js(2,1): error TS2304: Cannot find name 'exports'. -enumTagOnExports.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== enumTagOnExports.js (2 errors) ==== - /** @enum {number} */ - exports.a = {}; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - - /** @enum {string} */ - module.exports.b = {}; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/enumTagOnExports.symbols b/testdata/baselines/reference/submodule/conformance/enumTagOnExports.symbols index e7fd4bc1ee..fb9a7f22ad 100644 --- a/testdata/baselines/reference/submodule/conformance/enumTagOnExports.symbols +++ b/testdata/baselines/reference/submodule/conformance/enumTagOnExports.symbols @@ -1,10 +1,17 @@ //// [tests/cases/conformance/jsdoc/enumTagOnExports.ts] //// === enumTagOnExports.js === - /** @enum {number} */ exports.a = {}; +>exports.a : Symbol(a, Decl(enumTagOnExports.js, 0, 0)) +>exports : Symbol("enumTagOnExports", Decl(enumTagOnExports.js, 0, 0)) +>a : Symbol(a, Decl(enumTagOnExports.js, 0, 0)) /** @enum {string} */ module.exports.b = {}; +>module.exports.b : Symbol(b, Decl(enumTagOnExports.js, 1, 15)) +>module.exports : Symbol("enumTagOnExports", Decl(enumTagOnExports.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("enumTagOnExports", Decl(enumTagOnExports.js, 0, 0)) +>b : Symbol(b, Decl(enumTagOnExports.js, 1, 15)) diff --git a/testdata/baselines/reference/submodule/conformance/enumTagOnExports.symbols.diff b/testdata/baselines/reference/submodule/conformance/enumTagOnExports.symbols.diff index cdea45c1fb..9c269606fd 100644 --- a/testdata/baselines/reference/submodule/conformance/enumTagOnExports.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/enumTagOnExports.symbols.diff @@ -1,15 +1,15 @@ --- old.enumTagOnExports.symbols +++ new.enumTagOnExports.symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/conformance/jsdoc/enumTagOnExports.ts] //// - +@@= skipped -2, +2 lines =@@ === enumTagOnExports.js === -+ /** @enum {number} */ exports.a = {}; ->exports.a : Symbol(a, Decl(enumTagOnExports.js, 0, 0), Decl(enumTagOnExports.js, 1, 8), Decl(enumTagOnExports.js, 0, 4)) ->exports : Symbol(a, Decl(enumTagOnExports.js, 0, 0), Decl(enumTagOnExports.js, 1, 8), Decl(enumTagOnExports.js, 0, 4)) ->a : Symbol(a, Decl(enumTagOnExports.js, 0, 0), Decl(enumTagOnExports.js, 1, 8), Decl(enumTagOnExports.js, 0, 4)) ++>exports.a : Symbol(a, Decl(enumTagOnExports.js, 0, 0)) ++>exports : Symbol("enumTagOnExports", Decl(enumTagOnExports.js, 0, 0)) ++>a : Symbol(a, Decl(enumTagOnExports.js, 0, 0)) /** @enum {string} */ module.exports.b = {}; @@ -18,4 +18,9 @@ ->module : Symbol(module, Decl(enumTagOnExports.js, 1, 15)) ->exports : Symbol(module.exports, Decl(enumTagOnExports.js, 0, 0)) ->b : Symbol(b, Decl(enumTagOnExports.js, 1, 15), Decl(enumTagOnExports.js, 4, 15), Decl(enumTagOnExports.js, 3, 4)) ++>module.exports.b : Symbol(b, Decl(enumTagOnExports.js, 1, 15)) ++>module.exports : Symbol("enumTagOnExports", Decl(enumTagOnExports.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("enumTagOnExports", Decl(enumTagOnExports.js, 0, 0)) ++>b : Symbol(b, Decl(enumTagOnExports.js, 1, 15)) diff --git a/testdata/baselines/reference/submodule/conformance/enumTagOnExports.types b/testdata/baselines/reference/submodule/conformance/enumTagOnExports.types index a80c55cac2..47df75f2a4 100644 --- a/testdata/baselines/reference/submodule/conformance/enumTagOnExports.types +++ b/testdata/baselines/reference/submodule/conformance/enumTagOnExports.types @@ -5,7 +5,7 @@ exports.a = {}; >exports.a = {} : {} >exports.a : any ->exports : any +>exports : typeof import("enumTagOnExports") >a : any >{} : {} @@ -13,9 +13,9 @@ exports.a = {}; module.exports.b = {}; >module.exports.b = {} : {} >module.exports.b : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("enumTagOnExports") +>module : { "enumTagOnExports": typeof import("enumTagOnExports"); } +>exports : typeof import("enumTagOnExports") >b : any >{} : {} diff --git a/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.errors.txt b/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.errors.txt deleted file mode 100644 index 85e9487465..0000000000 --- a/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -enumTagOnExports.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== enumTagOnExports.js (1 errors) ==== - /** @enum {string} */ - module.exports = {}; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.symbols b/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.symbols index 13f7f5e455..740a47d149 100644 --- a/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.symbols +++ b/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.symbols @@ -1,7 +1,9 @@ //// [tests/cases/conformance/jsdoc/enumTagOnExports2.ts] //// === enumTagOnExports.js === - /** @enum {string} */ module.exports = {}; +>module.exports : Symbol(export=, Decl(enumTagOnExports.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(enumTagOnExports.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.symbols.diff b/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.symbols.diff index eab2277e01..a4225c171a 100644 --- a/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.symbols.diff @@ -1,13 +1,13 @@ --- old.enumTagOnExports2.symbols +++ new.enumTagOnExports2.symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/conformance/jsdoc/enumTagOnExports2.ts] //// - +@@= skipped -2, +2 lines =@@ === enumTagOnExports.js === -+ /** @enum {string} */ module.exports = {}; ->module.exports : Symbol(module.exports, Decl(enumTagOnExports.js, 0, 0)) ->module : Symbol(module, Decl(enumTagOnExports.js, 0, 0)) ->exports : Symbol(module.exports, Decl(enumTagOnExports.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(enumTagOnExports.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(enumTagOnExports.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.types b/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.types index 2ad3b83cdf..c8e2cd068e 100644 --- a/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.types +++ b/testdata/baselines/reference/submodule/conformance/enumTagOnExports2.types @@ -4,8 +4,8 @@ /** @enum {string} */ module.exports = {}; >module.exports = {} : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >{} : {} diff --git a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.errors.txt b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.errors.txt index 8fd71fa57e..b96ad08101 100644 --- a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.errors.txt @@ -1,22 +1,14 @@ -mod.js(1,1): error TS2304: Cannot find name 'exports'. -mod.js(2,1): error TS2304: Cannot find name 'exports'. -mod.js(5,1): error TS2304: Cannot find name 'exports'. mod.js(7,14): error TS2339: Property 'p' does not exist on type 'Classic'. -use.js(1,20): error TS2306: File 'mod.js' is not a module. +use.js(8,15): error TS2694: Namespace '"mod"' has no exported member 'n'. +use.js(9,13): error TS2749: 's.Classic' refers to a value, but is being used as a type here. Did you mean 'typeof s.Classic'? -==== mod.js (4 errors) ==== +==== mod.js (1 errors) ==== exports.n = {}; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. exports.n.K = function () { - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. this.x = 10; } exports.Classic = class { - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. constructor() { this.p = 1 ~ @@ -24,10 +16,8 @@ use.js(1,20): error TS2306: File 'mod.js' is not a module. } } -==== use.js (1 errors) ==== +==== use.js (2 errors) ==== import * as s from './mod' - ~~~~~~~ -!!! error TS2306: File 'mod.js' is not a module. var k = new s.n.K() k.x @@ -35,7 +25,11 @@ use.js(1,20): error TS2306: File 'mod.js' is not a module. /** @param {s.n.K} c + ~ +!!! error TS2694: Namespace '"mod"' has no exported member 'n'. @param {s.Classic} classic */ + ~~~~~~~~~ +!!! error TS2749: 's.Classic' refers to a value, but is being used as a type here. Did you mean 'typeof s.Classic'? function f(c, classic) { c.x classic.p diff --git a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.symbols b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.symbols index eb4893a3f0..f6d5296284 100644 --- a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.symbols +++ b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.symbols @@ -2,10 +2,22 @@ === mod.js === exports.n = {}; +>exports.n : Symbol(n, Decl(mod.js, 0, 0)) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>n : Symbol(n, Decl(mod.js, 0, 0)) + exports.n.K = function () { +>exports.n : Symbol(n, Decl(mod.js, 0, 0)) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>n : Symbol(n, Decl(mod.js, 0, 0)) + this.x = 10; } exports.Classic = class { +>exports.Classic : Symbol(Classic, Decl(mod.js, 3, 1)) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>Classic : Symbol(Classic, Decl(mod.js, 3, 1)) + constructor() { this.p = 1 >this : Symbol(Classic, Decl(mod.js, 4, 17)) @@ -18,14 +30,18 @@ import * as s from './mod' var k = new s.n.K() >k : Symbol(k, Decl(use.js, 2, 3)) +>s.n : Symbol(n, Decl(mod.js, 0, 0)) >s : Symbol(s, Decl(use.js, 0, 6)) +>n : Symbol(n, Decl(mod.js, 0, 0)) k.x >k : Symbol(k, Decl(use.js, 2, 3)) var classic = new s.Classic() >classic : Symbol(classic, Decl(use.js, 4, 3)) +>s.Classic : Symbol(Classic, Decl(mod.js, 3, 1)) >s : Symbol(s, Decl(use.js, 0, 6)) +>Classic : Symbol(Classic, Decl(mod.js, 3, 1)) /** @param {s.n.K} c diff --git a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.symbols.diff b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.symbols.diff index a2a429e605..a2a8856e4d 100644 --- a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.symbols.diff @@ -7,24 +7,30 @@ ->exports.n : Symbol(n, Decl(mod.js, 0, 0), Decl(mod.js, 1, 8)) ->exports : Symbol(n, Decl(mod.js, 0, 0), Decl(mod.js, 1, 8)) ->n : Symbol(n, Decl(mod.js, 0, 0), Decl(mod.js, 1, 8)) -- ++>exports.n : Symbol(n, Decl(mod.js, 0, 0)) ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) ++>n : Symbol(n, Decl(mod.js, 0, 0)) + exports.n.K = function () { ->exports.n.K : Symbol(n.K, Decl(mod.js, 0, 15)) ->exports.n : Symbol(n.K, Decl(mod.js, 0, 15)) -->exports : Symbol("mod", Decl(mod.js, 0, 0)) ++>exports.n : Symbol(n, Decl(mod.js, 0, 0)) + >exports : Symbol("mod", Decl(mod.js, 0, 0)) ->n : Symbol(n, Decl(mod.js, 0, 0), Decl(mod.js, 1, 8)) ->K : Symbol(n.K, Decl(mod.js, 0, 15)) -- ++>n : Symbol(n, Decl(mod.js, 0, 0)) + this.x = 10; ->this.x : Symbol(K.x, Decl(mod.js, 1, 27)) ->this : Symbol(K, Decl(mod.js, 1, 13)) ->x : Symbol(K.x, Decl(mod.js, 1, 27)) } exports.Classic = class { -->exports.Classic : Symbol(Classic, Decl(mod.js, 3, 1)) + >exports.Classic : Symbol(Classic, Decl(mod.js, 3, 1)) ->exports : Symbol(Classic, Decl(mod.js, 3, 1)) -->Classic : Symbol(Classic, Decl(mod.js, 3, 1)) -- ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) + >Classic : Symbol(Classic, Decl(mod.js, 3, 1)) + constructor() { this.p = 1 ->this.p : Symbol(Classic.p, Decl(mod.js, 5, 19)) @@ -33,15 +39,17 @@ } } -@@= skipped -35, +16 lines =@@ +@@= skipped -35, +28 lines =@@ var k = new s.n.K() >k : Symbol(k, Decl(use.js, 2, 3)) ->s.n.K : Symbol(s.n.K, Decl(mod.js, 0, 15)) ->s.n : Symbol(s.n, Decl(mod.js, 0, 0), Decl(mod.js, 1, 8)) ++>s.n : Symbol(n, Decl(mod.js, 0, 0)) >s : Symbol(s, Decl(use.js, 0, 6)) ->n : Symbol(s.n, Decl(mod.js, 0, 0), Decl(mod.js, 1, 8)) ->K : Symbol(s.n.K, Decl(mod.js, 0, 15)) ++>n : Symbol(n, Decl(mod.js, 0, 0)) k.x ->k.x : Symbol(K.x, Decl(mod.js, 1, 27)) @@ -51,12 +59,14 @@ var classic = new s.Classic() >classic : Symbol(classic, Decl(use.js, 4, 3)) ->s.Classic : Symbol(s.Classic, Decl(mod.js, 3, 1)) ++>s.Classic : Symbol(Classic, Decl(mod.js, 3, 1)) >s : Symbol(s, Decl(use.js, 0, 6)) ->Classic : Symbol(s.Classic, Decl(mod.js, 3, 1)) ++>Classic : Symbol(Classic, Decl(mod.js, 3, 1)) /** @param {s.n.K} c -@@= skipped -26, +18 lines =@@ +@@= skipped -26, +22 lines =@@ >classic : Symbol(classic, Decl(use.js, 9, 13)) c.x diff --git a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.types b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.types index b984114ef5..681339429e 100644 --- a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.types +++ b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces.types @@ -4,7 +4,7 @@ exports.n = {}; >exports.n = {} : {} >exports.n : any ->exports : any +>exports : typeof import("mod") >n : any >{} : {} @@ -12,7 +12,7 @@ exports.n.K = function () { >exports.n.K = function () { this.x = 10;} : () => void >exports.n.K : any >exports.n : any ->exports : any +>exports : typeof import("mod") >n : any >K : any >function () { this.x = 10;} : () => void @@ -26,9 +26,9 @@ exports.n.K = function () { } exports.Classic = class { >exports.Classic = class { constructor() { this.p = 1 }} : typeof Classic ->exports.Classic : any ->exports : any ->Classic : any +>exports.Classic : typeof Classic +>exports : typeof import("mod") +>Classic : typeof Classic >class { constructor() { this.p = 1 }} : typeof Classic constructor() { @@ -43,14 +43,14 @@ exports.Classic = class { === use.js === import * as s from './mod' ->s : any +>s : typeof import("mod") var k = new s.n.K() >k : any >new s.n.K() : any >s.n.K : any >s.n : any ->s : any +>s : typeof import("mod") >n : any >K : any @@ -60,11 +60,11 @@ k.x >x : any var classic = new s.Classic() ->classic : any ->new s.Classic() : any ->s.Classic : any ->s : any ->Classic : any +>classic : Classic +>new s.Classic() : Classic +>s.Classic : typeof Classic +>s : typeof import("mod") +>Classic : typeof Classic /** @param {s.n.K} c diff --git a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.errors.txt b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.errors.txt index 7449cbab94..67b03a3c01 100644 --- a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.errors.txt @@ -1,18 +1,14 @@ first.js(1,1): error TS2304: Cannot find name 'exports'. first.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. first.js(2,1): error TS2304: Cannot find name 'exports'. -mod.js(2,1): error TS2304: Cannot find name 'exports'. second.js(1,1): error TS2304: Cannot find name 'exports'. second.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. second.js(2,1): error TS2304: Cannot find name 'exports'. -use.js(1,24): error TS2306: File 'mod.js' is not a module. -==== mod.js (1 errors) ==== +==== mod.js (0 errors) ==== // Based on a pattern from adonis exports.formatters = {} - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. ==== first.js (3 errors) ==== exports = require('./mod') ~~~~~~~ @@ -36,10 +32,8 @@ use.js(1,24): error TS2306: File 'mod.js' is not a module. return v } -==== use.js (1 errors) ==== +==== use.js (0 errors) ==== import * as debug from './mod' - ~~~~~~~ -!!! error TS2306: File 'mod.js' is not a module. debug.formatters.j var one = debug.formatters.o(1) diff --git a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.symbols b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.symbols index cb76f4806f..4f2c466f89 100644 --- a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.symbols +++ b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.symbols @@ -1,9 +1,12 @@ //// [tests/cases/conformance/salsa/exportNestedNamespaces2.ts] //// === mod.js === - // Based on a pattern from adonis exports.formatters = {} +>exports.formatters : Symbol(formatters, Decl(mod.js, 0, 0)) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>formatters : Symbol(formatters, Decl(mod.js, 0, 0)) + === first.js === exports = require('./mod') exports.formatters.j = function (v) { @@ -26,9 +29,13 @@ import * as debug from './mod' >debug : Symbol(debug, Decl(use.js, 0, 6)) debug.formatters.j +>debug.formatters : Symbol(formatters, Decl(mod.js, 0, 0)) >debug : Symbol(debug, Decl(use.js, 0, 6)) +>formatters : Symbol(formatters, Decl(mod.js, 0, 0)) var one = debug.formatters.o(1) >one : Symbol(one, Decl(use.js, 3, 3)) +>debug.formatters : Symbol(formatters, Decl(mod.js, 0, 0)) >debug : Symbol(debug, Decl(use.js, 0, 6)) +>formatters : Symbol(formatters, Decl(mod.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.symbols.diff b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.symbols.diff index f47ecf5517..ee38e0886c 100644 --- a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.symbols.diff @@ -1,16 +1,13 @@ --- old.exportNestedNamespaces2.symbols +++ new.exportNestedNamespaces2.symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/conformance/salsa/exportNestedNamespaces2.ts] //// - - === mod.js === -+ +@@= skipped -3, +3 lines =@@ // Based on a pattern from adonis exports.formatters = {} -->exports.formatters : Symbol(formatters, Decl(mod.js, 0, 0)) + >exports.formatters : Symbol(formatters, Decl(mod.js, 0, 0)) ->exports : Symbol(formatters, Decl(mod.js, 0, 0)) -->formatters : Symbol(formatters, Decl(mod.js, 0, 0)) -- ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) + >formatters : Symbol(formatters, Decl(mod.js, 0, 0)) + === first.js === exports = require('./mod') ->exports : Symbol("first", Decl(first.js, 0, 0)) @@ -22,7 +19,7 @@ >v : Symbol(v, Decl(first.js, 1, 33)) return v -@@= skipped -21, +13 lines =@@ +@@= skipped -18, +13 lines =@@ } === second.js === exports = require('./mod') @@ -40,12 +37,16 @@ debug.formatters.j ->debug.formatters : Symbol(debug.formatters, Decl(mod.js, 0, 0)) ++>debug.formatters : Symbol(formatters, Decl(mod.js, 0, 0)) >debug : Symbol(debug, Decl(use.js, 0, 6)) ->formatters : Symbol(debug.formatters, Decl(mod.js, 0, 0)) ++>formatters : Symbol(formatters, Decl(mod.js, 0, 0)) var one = debug.formatters.o(1) >one : Symbol(one, Decl(use.js, 3, 3)) ->debug.formatters : Symbol(debug.formatters, Decl(mod.js, 0, 0)) ++>debug.formatters : Symbol(formatters, Decl(mod.js, 0, 0)) >debug : Symbol(debug, Decl(use.js, 0, 6)) ->formatters : Symbol(debug.formatters, Decl(mod.js, 0, 0)) ++>formatters : Symbol(formatters, Decl(mod.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.types b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.types index 708a6b58f1..da22cb32dc 100644 --- a/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.types +++ b/testdata/baselines/reference/submodule/conformance/exportNestedNamespaces2.types @@ -5,7 +5,7 @@ exports.formatters = {} >exports.formatters = {} : {} >exports.formatters : any ->exports : any +>exports : typeof import("mod") >formatters : any >{} : {} @@ -54,12 +54,12 @@ exports.formatters.o = function (v) { === use.js === import * as debug from './mod' ->debug : any +>debug : typeof import("mod") debug.formatters.j >debug.formatters.j : any >debug.formatters : any ->debug : any +>debug : typeof import("mod") >formatters : any >j : any @@ -68,7 +68,7 @@ var one = debug.formatters.o(1) >debug.formatters.o(1) : any >debug.formatters.o : any >debug.formatters : any ->debug : any +>debug : typeof import("mod") >formatters : any >o : any >1 : 1 diff --git a/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.errors.txt b/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.errors.txt deleted file mode 100644 index ba4e6b6820..0000000000 --- a/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -bug24492.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -bug24492.js(2,5): error TS2304: Cannot find name 'D'. - - -==== bug24492.js (2 errors) ==== - module.exports.D = class { } - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - new D() - ~ -!!! error TS2304: Cannot find name 'D'. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.symbols b/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.symbols index 180db38078..84112b66c1 100644 --- a/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.symbols +++ b/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.symbols @@ -1,7 +1,13 @@ //// [tests/cases/conformance/salsa/exportPropertyAssignmentNameResolution.ts] //// === bug24492.js === - module.exports.D = class { } +>module.exports.D : Symbol(D, Decl(bug24492.js, 0, 0)) +>module.exports : Symbol("bug24492", Decl(bug24492.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("bug24492", Decl(bug24492.js, 0, 0)) +>D : Symbol(D, Decl(bug24492.js, 0, 0)) + new D() +>D : Symbol(D, Decl(bug24492.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.symbols.diff b/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.symbols.diff index d0d6ca7633..981986bb58 100644 --- a/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.symbols.diff @@ -1,16 +1,17 @@ --- old.exportPropertyAssignmentNameResolution.symbols +++ new.exportPropertyAssignmentNameResolution.symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/conformance/salsa/exportPropertyAssignmentNameResolution.ts] //// - +@@= skipped -2, +2 lines =@@ === bug24492.js === --module.exports.D = class { } -->module.exports.D : Symbol(D, Decl(bug24492.js, 0, 0)) + module.exports.D = class { } + >module.exports.D : Symbol(D, Decl(bug24492.js, 0, 0)) ->module.exports : Symbol(D, Decl(bug24492.js, 0, 0)) ->module : Symbol(module, Decl(bug24492.js, 0, 0)) ->exports : Symbol(module.exports, Decl(bug24492.js, 0, 0)) -->D : Symbol(D, Decl(bug24492.js, 0, 0)) ++>module.exports : Symbol("bug24492", Decl(bug24492.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("bug24492", Decl(bug24492.js, 0, 0)) + >D : Symbol(D, Decl(bug24492.js, 0, 0)) -+module.exports.D = class { } new D() ++>D : Symbol(D, Decl(bug24492.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.types b/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.types index 785547dd81..112acdbad3 100644 --- a/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.types +++ b/testdata/baselines/reference/submodule/conformance/exportPropertyAssignmentNameResolution.types @@ -3,14 +3,14 @@ === bug24492.js === module.exports.D = class { } >module.exports.D = class { } : typeof D ->module.exports.D : any ->module.exports : any ->module : any ->exports : any ->D : any +>module.exports.D : typeof D +>module.exports : typeof import("bug24492") +>module : { "bug24492": typeof import("bug24492"); } +>exports : typeof import("bug24492") +>D : typeof D >class { } : typeof D new D() ->new D() : any ->D : any +>new D() : D +>D : typeof D diff --git a/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.errors.txt b/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.errors.txt index c104c3d27c..783e2bdb69 100644 --- a/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.errors.txt @@ -1,14 +1,11 @@ bug27099.js(1,1): error TS2322: Type 'number' is not assignable to type 'string'. -bug27099.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== bug27099.js (2 errors) ==== +==== bug27099.js (1 errors) ==== window.name = 1; ~~~~~~~~~~~ !!! error TS2322: Type 'number' is not assignable to type 'string'. window.console; // should not have error: Property 'console' does not exist on type 'typeof window'. module.exports = 'anything'; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.symbols b/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.symbols index 4eb720a79f..452535a0d7 100644 --- a/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.symbols +++ b/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.symbols @@ -12,5 +12,8 @@ window.console; // should not have error: Property 'console' does not exist on t >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) module.exports = 'anything'; +>module.exports : Symbol(export=, Decl(bug27099.js, 1, 15)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(bug27099.js, 1, 15)) diff --git a/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.symbols.diff b/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.symbols.diff index 83adcba694..f92605b4f2 100644 --- a/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.symbols.diff @@ -20,6 +20,8 @@ module.exports = 'anything'; ->module.exports : Symbol(module.exports, Decl(bug27099.js, 0, 0)) ->module : Symbol(export=, Decl(bug27099.js, 1, 15)) -->exports : Symbol(export=, Decl(bug27099.js, 1, 15)) ++>module.exports : Symbol(export=, Decl(bug27099.js, 1, 15)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(bug27099.js, 1, 15)) diff --git a/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.types b/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.types index a3772dfac7..e1c08a7e4a 100644 --- a/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.types +++ b/testdata/baselines/reference/submodule/conformance/globalMergeWithCommonJSAssignmentDeclaration.types @@ -15,9 +15,9 @@ window.console; // should not have error: Property 'console' does not exist on t module.exports = 'anything'; >module.exports = 'anything' : "anything" ->module.exports : any ->module : any ->exports : any +>module.exports : "anything" +>module : { export=: "anything"; } +>exports : "anything" >'anything' : "anything" diff --git a/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.errors.txt b/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.errors.txt index 6c7d32bddd..e9cd10abf6 100644 --- a/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.errors.txt @@ -1,24 +1,33 @@ -main.js(1,15): error TS2306: File 'mod1.js' is not a module. -mod1.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +main.js(2,13): error TS2339: Property 'foo' does not exist on type 'Alias'. +main.js(3,13): error TS2339: Property 'func' does not exist on type 'Alias'. +main.js(6,9): error TS2339: Property 'foo' does not exist on type 'Alias'. +main.js(7,9): error TS2339: Property 'func' does not exist on type 'Alias'. +main.js(8,9): error TS2339: Property 'def' does not exist on type 'Alias'. -==== mod1.js (1 errors) ==== +==== mod1.js (0 errors) ==== class Alias { bar() { return 1 } } module.exports = Alias; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== main.js (1 errors) ==== +==== main.js (5 errors) ==== import A from './mod1' - ~~~~~~~~ -!!! error TS2306: File 'mod1.js' is not a module. A.prototype.foo = 0 + ~~~ +!!! error TS2339: Property 'foo' does not exist on type 'Alias'. A.prototype.func = function() { this._func = 0; } + ~~~~ +!!! error TS2339: Property 'func' does not exist on type 'Alias'. Object.defineProperty(A.prototype, "def", { value: 0 }); new A().bar new A().foo + ~~~ +!!! error TS2339: Property 'foo' does not exist on type 'Alias'. new A().func() + ~~~~ +!!! error TS2339: Property 'func' does not exist on type 'Alias'. new A().def + ~~~ +!!! error TS2339: Property 'def' does not exist on type 'Alias'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.symbols b/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.symbols index a9877d733a..304a0ff5e1 100644 --- a/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.symbols +++ b/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.symbols @@ -8,6 +8,9 @@ class Alias { >bar : Symbol(bar, Decl(mod1.js, 0, 13)) } module.exports = Alias; +>module.exports : Symbol(Alias, Decl(mod1.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(Alias, Decl(mod1.js, 0, 0)) >Alias : Symbol(Alias, Decl(mod1.js, 0, 0)) === main.js === @@ -15,20 +18,28 @@ import A from './mod1' >A : Symbol(A, Decl(main.js, 0, 6)) A.prototype.foo = 0 +>A.prototype : Symbol(prototype) >A : Symbol(A, Decl(main.js, 0, 6)) +>prototype : Symbol(prototype) A.prototype.func = function() { this._func = 0; } +>A.prototype : Symbol(prototype) >A : Symbol(A, Decl(main.js, 0, 6)) +>prototype : Symbol(prototype) Object.defineProperty(A.prototype, "def", { value: 0 }); >Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>A.prototype : Symbol(prototype) >A : Symbol(A, Decl(main.js, 0, 6)) +>prototype : Symbol(prototype) >value : Symbol(value, Decl(main.js, 3, 43)) new A().bar +>new A().bar : Symbol(bar, Decl(mod1.js, 0, 13)) >A : Symbol(A, Decl(main.js, 0, 6)) +>bar : Symbol(bar, Decl(mod1.js, 0, 13)) new A().foo >A : Symbol(A, Decl(main.js, 0, 6)) diff --git a/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.symbols.diff b/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.symbols.diff index fe079f963c..0a7bebfb48 100644 --- a/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.symbols.diff @@ -11,22 +11,29 @@ ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 2, 1)) ->exports : Symbol(export=, Decl(mod1.js, 2, 1)) ++>module.exports : Symbol(Alias, Decl(mod1.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(Alias, Decl(mod1.js, 0, 0)) >Alias : Symbol(Alias, Decl(mod1.js, 0, 0)) === main.js === -@@= skipped -13, +10 lines =@@ +@@= skipped -13, +13 lines =@@ >A : Symbol(A, Decl(main.js, 0, 6)) A.prototype.foo = 0 ->A.prototype : Symbol(A.prototype) ++>A.prototype : Symbol(prototype) >A : Symbol(A, Decl(main.js, 0, 6)) ->prototype : Symbol(A.prototype) ++>prototype : Symbol(prototype) A.prototype.func = function() { this._func = 0; } ->A.prototype : Symbol(A.prototype) ++>A.prototype : Symbol(prototype) >A : Symbol(A, Decl(main.js, 0, 6)) ->prototype : Symbol(A.prototype) ->this : Symbol(A, Decl(mod1.js, 0, 0)) ++>prototype : Symbol(prototype) Object.defineProperty(A.prototype, "def", { value: 0 }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) @@ -35,14 +42,18 @@ ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->A.prototype : Symbol(A.prototype) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>A.prototype : Symbol(prototype) >A : Symbol(A, Decl(main.js, 0, 6)) ->prototype : Symbol(A.prototype) ++>prototype : Symbol(prototype) >value : Symbol(value, Decl(main.js, 3, 43)) new A().bar ->new A().bar : Symbol(A.bar, Decl(mod1.js, 0, 13)) ++>new A().bar : Symbol(bar, Decl(mod1.js, 0, 13)) >A : Symbol(A, Decl(main.js, 0, 6)) ->bar : Symbol(A.bar, Decl(mod1.js, 0, 13)) ++>bar : Symbol(bar, Decl(mod1.js, 0, 13)) new A().foo >A : Symbol(A, Decl(main.js, 0, 6)) diff --git a/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.types b/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.types index 86b75b5fe9..35aaf499c6 100644 --- a/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.types +++ b/testdata/baselines/reference/submodule/conformance/importAliasModuleExports.types @@ -10,30 +10,30 @@ class Alias { } module.exports = Alias; >module.exports = Alias : typeof Alias ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Alias +>module : { Alias: typeof Alias; } +>exports : typeof Alias >Alias : typeof Alias === main.js === import A from './mod1' ->A : any +>A : typeof Alias A.prototype.foo = 0 >A.prototype.foo = 0 : 0 >A.prototype.foo : any ->A.prototype : any ->A : any ->prototype : any +>A.prototype : Alias +>A : typeof Alias +>prototype : Alias >foo : any >0 : 0 A.prototype.func = function() { this._func = 0; } >A.prototype.func = function() { this._func = 0; } : () => void >A.prototype.func : any ->A.prototype : any ->A : any ->prototype : any +>A.prototype : Alias +>A : typeof Alias +>prototype : Alias >func : any >function() { this._func = 0; } : () => void >this._func = 0 : 0 @@ -43,40 +43,40 @@ A.prototype.func = function() { this._func = 0; } >0 : 0 Object.defineProperty(A.prototype, "def", { value: 0 }); ->Object.defineProperty(A.prototype, "def", { value: 0 }) : any +>Object.defineProperty(A.prototype, "def", { value: 0 }) : Alias >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->A.prototype : any ->A : any ->prototype : any +>A.prototype : Alias +>A : typeof Alias +>prototype : Alias >"def" : "def" >{ value: 0 } : { value: number; } >value : number >0 : 0 new A().bar ->new A().bar : any ->new A() : any ->A : any ->bar : any +>new A().bar : () => number +>new A() : Alias +>A : typeof Alias +>bar : () => number new A().foo >new A().foo : any ->new A() : any ->A : any +>new A() : Alias +>A : typeof Alias >foo : any new A().func() >new A().func() : any >new A().func : any ->new A() : any ->A : any +>new A() : Alias +>A : typeof Alias >func : any new A().def >new A().def : any ->new A() : any ->A : any +>new A() : Alias +>A : typeof Alias >def : any diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.errors.txt index af1d5ddf75..cbb4b6d57d 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.errors.txt @@ -1,23 +1,20 @@ -cls.js(1,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -cls.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -cls.js(8,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +cls.js(7,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +cls.js(8,16): error TS2339: Property 'Strings' does not exist on type 'typeof Foo'. -==== cls.js (3 errors) ==== +==== cls.js (2 errors) ==== const Bar = require("./bar"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. const Strings = { a: "A", b: "B" }; class Foo extends Bar {} module.exports = Foo; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.Strings = Strings; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~ +!!! error TS2339: Property 'Strings' does not exist on type 'typeof Foo'. ==== bar.js (0 errors) ==== class Bar {} module.exports = Bar; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.symbols index 991ed3cce8..bd1cc110ec 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.symbols @@ -3,6 +3,8 @@ === cls.js === const Bar = require("./bar"); >Bar : Symbol(Bar, Decl(cls.js, 0, 5)) +>require : Symbol(require) +>"./bar" : Symbol("bar", Decl(bar.js, 0, 0)) const Strings = { >Strings : Symbol(Strings, Decl(cls.js, 1, 5)) @@ -19,8 +21,24 @@ class Foo extends Bar {} >Bar : Symbol(Bar, Decl(cls.js, 0, 5)) module.exports = Foo; +>module.exports : Symbol(Foo, Decl(cls.js, 4, 2)) +>module : Symbol(module.exports) +>exports : Symbol(Foo, Decl(cls.js, 4, 2)) >Foo : Symbol(Foo, Decl(cls.js, 4, 2)) module.exports.Strings = Strings; +>module.exports : Symbol(Foo, Decl(cls.js, 4, 2)) +>module : Symbol(module.exports) +>exports : Symbol(Foo, Decl(cls.js, 4, 2)) >Strings : Symbol(Strings, Decl(cls.js, 1, 5)) +=== bar.js === +class Bar {} +>Bar : Symbol(Bar, Decl(bar.js, 0, 0)) + +module.exports = Bar; +>module.exports : Symbol(Bar, Decl(bar.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(Bar, Decl(bar.js, 0, 0)) +>Bar : Symbol(Bar, Decl(bar.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.symbols.diff index 83571ea70e..e18c727ca3 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.symbols.diff @@ -1,21 +1,15 @@ --- old.jsDeclarationsClassExtendsVisibility.symbols +++ new.jsDeclarationsClassExtendsVisibility.symbols -@@= skipped -2, +2 lines =@@ - === cls.js === - const Bar = require("./bar"); - >Bar : Symbol(Bar, Decl(cls.js, 0, 5)) -->require : Symbol(require) -->"./bar" : Symbol("bar", Decl(bar.js, 0, 0)) - - const Strings = { - >Strings : Symbol(Strings, Decl(cls.js, 1, 5)) -@@= skipped -18, +16 lines =@@ +@@= skipped -20, +20 lines =@@ >Bar : Symbol(Bar, Decl(cls.js, 0, 5)) module.exports = Foo; ->module.exports : Symbol(module.exports, Decl(cls.js, 0, 0)) ->module : Symbol(export=, Decl(cls.js, 5, 24)) ->exports : Symbol(export=, Decl(cls.js, 5, 24)) ++>module.exports : Symbol(Foo, Decl(cls.js, 4, 2)) ++>module : Symbol(module.exports) ++>exports : Symbol(Foo, Decl(cls.js, 4, 2)) >Foo : Symbol(Foo, Decl(cls.js, 4, 2)) module.exports.Strings = Strings; @@ -24,15 +18,21 @@ ->module : Symbol(module, Decl(cls.js, 5, 24)) ->exports : Symbol(module.exports, Decl(cls.js, 0, 0)) ->Strings : Symbol(Strings, Decl(cls.js, 6, 21)) ++>module.exports : Symbol(Foo, Decl(cls.js, 4, 2)) ++>module : Symbol(module.exports) ++>exports : Symbol(Foo, Decl(cls.js, 4, 2)) >Strings : Symbol(Strings, Decl(cls.js, 1, 5)) --=== bar.js === --class Bar {} -->Bar : Symbol(Bar, Decl(bar.js, 0, 0)) -- --module.exports = Bar; + === bar.js === +@@= skipped -18, +16 lines =@@ + >Bar : Symbol(Bar, Decl(bar.js, 0, 0)) + + module.exports = Bar; ->module.exports : Symbol(module.exports, Decl(bar.js, 0, 0)) ->module : Symbol(export=, Decl(bar.js, 0, 12)) ->exports : Symbol(export=, Decl(bar.js, 0, 12)) -->Bar : Symbol(Bar, Decl(bar.js, 0, 0)) -- ++>module.exports : Symbol(Bar, Decl(bar.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(Bar, Decl(bar.js, 0, 0)) + >Bar : Symbol(Bar, Decl(bar.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.types index dae15b2110..d2474b76c9 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassExtendsVisibility.types @@ -2,8 +2,8 @@ === cls.js === const Bar = require("./bar"); ->Bar : any ->require("./bar") : any +>Bar : typeof Bar +>require("./bar") : typeof Bar >require : any >"./bar" : "./bar" @@ -22,21 +22,32 @@ const Strings = { }; class Foo extends Bar {} >Foo : Foo ->Bar : any +>Bar : Bar module.exports = Foo; >module.exports = Foo : typeof Foo ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Foo +>module : { Foo: typeof Foo; } +>exports : typeof Foo >Foo : typeof Foo module.exports.Strings = Strings; >module.exports.Strings = Strings : { a: string; b: string; } >module.exports.Strings : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Foo +>module : { Foo: typeof Foo; } +>exports : typeof Foo >Strings : any >Strings : { a: string; b: string; } +=== bar.js === +class Bar {} +>Bar : Bar + +module.exports = Bar; +>module.exports = Bar : typeof Bar +>module.exports : typeof Bar +>module : { Bar: typeof Bar; } +>exports : typeof Bar +>Bar : typeof Bar + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.errors.txt index 1fd625a50d..ca8208ac52 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.errors.txt @@ -1,6 +1,6 @@ source.js(9,9): error TS2339: Property 'statische' does not exist on type 'typeof Handler'. -source.js(15,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -source.js(16,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +source.js(15,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +source.js(16,16): error TS2339: Property 'Strings' does not exist on type 'typeof Handler'. ==== source.js (3 errors) ==== @@ -21,11 +21,11 @@ source.js(16,1): error TS2580: Cannot find name 'module'. Do you need to install } module.exports = Handler; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.Strings = Strings - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~ +!!! error TS2339: Property 'Strings' does not exist on type 'typeof Handler'. /** * @typedef {Object} HandlerOptions diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols index 0562d87648..899a405f27 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols @@ -28,9 +28,15 @@ const Strings = { } module.exports = Handler; +>module.exports : Symbol(Handler, Decl(source.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(Handler, Decl(source.js, 0, 0)) >Handler : Symbol(Handler, Decl(source.js, 0, 0)) module.exports.Strings = Strings +>module.exports : Symbol(Handler, Decl(source.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(Handler, Decl(source.js, 0, 0)) >Strings : Symbol(Strings, Decl(source.js, 9, 5)) /** diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols.diff index a3ee700ecd..3d495c8667 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.symbols.diff @@ -35,6 +35,9 @@ ->module : Symbol(export=, Decl(source.js, 12, 1)) ->exports : Symbol(export=, Decl(source.js, 12, 1)) ->Handler : Symbol(Handler, Decl(source.js, 0, 0), Decl(source.js, 7, 1)) ++>module.exports : Symbol(Handler, Decl(source.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(Handler, Decl(source.js, 0, 0)) +>Handler : Symbol(Handler, Decl(source.js, 0, 0)) module.exports.Strings = Strings @@ -43,6 +46,9 @@ ->module : Symbol(module, Decl(source.js, 12, 1)) ->exports : Symbol(module.exports, Decl(source.js, 0, 0)) ->Strings : Symbol(Strings, Decl(source.js, 14, 25)) ++>module.exports : Symbol(Handler, Decl(source.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(Handler, Decl(source.js, 0, 0)) >Strings : Symbol(Strings, Decl(source.js, 9, 5)) /** diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.types index 64b7cfa239..732245046e 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsClassStatic.types @@ -37,17 +37,17 @@ const Strings = { module.exports = Handler; >module.exports = Handler : typeof Handler ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Handler +>module : { Handler: typeof Handler; } +>exports : typeof Handler >Handler : typeof Handler module.exports.Strings = Strings >module.exports.Strings = Strings : { a: string; b: string; } >module.exports.Strings : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Handler +>module : { Handler: typeof Handler; } +>exports : typeof Handler >Strings : any >Strings : { a: string; b: string; } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.errors.txt index 66706195e5..f7cd5bdca8 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.errors.txt @@ -1,15 +1,12 @@ reexport.js(2,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -reexport.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== reexport.js (2 errors) ==== +==== reexport.js (1 errors) ==== 'use strict'; const Thing = require('./thing').Thing ~~~~~~~ !!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports = { Thing } - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== thing.js (0 errors) ==== 'use strict'; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.symbols index e89a7619ad..22b06dac5b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.symbols @@ -6,5 +6,8 @@ const Thing = require('./thing').Thing >Thing : Symbol(Thing, Decl(reexport.js, 1, 5)) module.exports = { Thing } +>module.exports : Symbol(export=, Decl(reexport.js, 1, 38)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(reexport.js, 1, 38)) >Thing : Symbol(Thing, Decl(reexport.js, 2, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.symbols.diff index 1c227ba164..e01d3fa125 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.symbols.diff @@ -13,6 +13,9 @@ ->module.exports : Symbol(module.exports, Decl(reexport.js, 0, 0)) ->module : Symbol(module, Decl(reexport.js, 1, 38)) ->exports : Symbol(module.exports, Decl(reexport.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(reexport.js, 1, 38)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(reexport.js, 1, 38)) >Thing : Symbol(Thing, Decl(reexport.js, 2, 18)) -=== thing.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.types index 3b367b6341..1375b5948f 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCommonjsRelativePath.types @@ -14,9 +14,9 @@ const Thing = require('./thing').Thing module.exports = { Thing } >module.exports = { Thing } : { Thing: any; } ->module.exports : any ->module : any ->exports : any +>module.exports : { Thing: any; } +>module : { export=: { Thing: any; }; } +>exports : { Thing: any; } >{ Thing } : { Thing: any; } >Thing : any diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.errors.txt deleted file mode 100644 index f7aa1da39e..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.errors.txt +++ /dev/null @@ -1,32 +0,0 @@ -index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== index.js (1 errors) ==== - const TopLevelSym = Symbol(); - const InnerSym = Symbol(); - module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - [TopLevelSym](x = 12) { - return x; - }, - items: { - [InnerSym]: (arg = {x: 12}) => arg.x - } - } - -==== index2.js (0 errors) ==== - const TopLevelSym = Symbol(); - const InnerSym = Symbol(); - - export class MyClass { - static [TopLevelSym] = 12; - [InnerSym] = "ok"; - /** - * @param {typeof TopLevelSym | typeof InnerSym} _p - */ - constructor(_p = InnerSym) { - // switch on _p - } - } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.symbols index bd1e6dab1d..33699938b6 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.symbols @@ -10,6 +10,10 @@ const InnerSym = Symbol(); >Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) module.exports = { +>module.exports : Symbol(export=, Decl(index.js, 1, 26)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 1, 26)) + [TopLevelSym](x = 12) { >[TopLevelSym] : Symbol([TopLevelSym], Decl(index.js, 2, 18)) >TopLevelSym : Symbol(TopLevelSym, Decl(index.js, 0, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.symbols.diff index d4ba0d6fdb..8c52165a3e 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.symbols.diff @@ -6,12 +6,12 @@ module.exports = { ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 1, 26)) -->exports : Symbol(export=, Decl(index.js, 1, 26)) -- ++>module.exports : Symbol(export=, Decl(index.js, 1, 26)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(index.js, 1, 26)) + [TopLevelSym](x = 12) { - >[TopLevelSym] : Symbol([TopLevelSym], Decl(index.js, 2, 18)) - >TopLevelSym : Symbol(TopLevelSym, Decl(index.js, 0, 5)) -@@= skipped -40, +36 lines =@@ +@@= skipped -40, +40 lines =@@ >MyClass : Symbol(MyClass, Decl(index2.js, 1, 26)) static [TopLevelSym] = 12; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.types index 9365514b93..880e6834f9 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsComputedNames.types @@ -13,9 +13,9 @@ const InnerSym = Symbol(); module.exports = { >module.exports = { [TopLevelSym](x = 12) { return x; }, items: { [InnerSym]: (arg = {x: 12}) => arg.x }} : { [TopLevelSym]: (x?: number) => number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; } ->module.exports : any ->module : any ->exports : any +>module.exports : { [TopLevelSym]: (x?: number) => number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; } +>module : { export=: { [TopLevelSym]: (x?: number) => number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; }; } +>exports : { [TopLevelSym]: (x?: number) => number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; } >{ [TopLevelSym](x = 12) { return x; }, items: { [InnerSym]: (arg = {x: 12}) => arg.x }} : { [TopLevelSym]: (x?: number) => number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; } [TopLevelSym](x = 12) { diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.errors.txt index 369f322e0c..1c5461dbd3 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.errors.txt @@ -1,19 +1,16 @@ -index.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(3,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +index.js(4,16): error TS2339: Property 'memberName' does not exist on type '() => void'. -==== index.js (3 errors) ==== +==== index.js (2 errors) ==== const m = require("./exporter"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports = m.default; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.memberName = "thing"; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~ +!!! error TS2339: Property 'memberName' does not exist on type '() => void'. ==== exporter.js (0 errors) ==== function validate() {} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.symbols index 69a6686310..2ae3cd50da 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.symbols @@ -3,11 +3,21 @@ === index.js === const m = require("./exporter"); >m : Symbol(m, Decl(index.js, 0, 5)) +>require : Symbol(require) +>"./exporter" : Symbol("exporter", Decl(exporter.js, 0, 0)) module.exports = m.default; +>module.exports : Symbol(validate, Decl(exporter.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(validate, Decl(exporter.js, 0, 0)) +>m.default : Symbol(default, Decl(exporter.js, 0, 22)) >m : Symbol(m, Decl(index.js, 0, 5)) +>default : Symbol(default, Decl(exporter.js, 0, 22)) module.exports.memberName = "thing"; +>module.exports : Symbol(validate, Decl(exporter.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(validate, Decl(exporter.js, 0, 0)) === exporter.js === function validate() {} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.symbols.diff index 3182581cf9..29a0eb2572 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.symbols.diff @@ -1,19 +1,24 @@ --- old.jsDeclarationsCrossfileMerge.symbols +++ new.jsDeclarationsCrossfileMerge.symbols -@@= skipped -2, +2 lines =@@ - === index.js === +@@= skipped -3, +3 lines =@@ const m = require("./exporter"); >m : Symbol(m, Decl(index.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./exporter" : Symbol(m, Decl(exporter.js, 0, 0)) ++>"./exporter" : Symbol("exporter", Decl(exporter.js, 0, 0)) module.exports = m.default; ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 32)) ->exports : Symbol(export=, Decl(index.js, 0, 32)) ->m.default : Symbol(m.default, Decl(exporter.js, 0, 22)) ++>module.exports : Symbol(validate, Decl(exporter.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(validate, Decl(exporter.js, 0, 0)) ++>m.default : Symbol(default, Decl(exporter.js, 0, 22)) >m : Symbol(m, Decl(index.js, 0, 5)) ->default : Symbol(m.default, Decl(exporter.js, 0, 22)) ++>default : Symbol(default, Decl(exporter.js, 0, 22)) module.exports.memberName = "thing"; ->module.exports.memberName : Symbol(memberName, Decl(index.js, 2, 27)) @@ -21,6 +26,9 @@ ->module : Symbol(module, Decl(index.js, 0, 32)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->memberName : Symbol(memberName, Decl(index.js, 2, 27)) ++>module.exports : Symbol(validate, Decl(exporter.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(validate, Decl(exporter.js, 0, 0)) === exporter.js === function validate() {} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.types index a8a68ebf88..b7fe7ad365 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsCrossfileMerge.types @@ -2,26 +2,26 @@ === index.js === const m = require("./exporter"); ->m : any ->require("./exporter") : any +>m : typeof import("exporter") +>require("./exporter") : typeof import("exporter") >require : any >"./exporter" : "./exporter" module.exports = m.default; ->module.exports = m.default : any ->module.exports : any ->module : any ->exports : any ->m.default : any ->m : any ->default : any +>module.exports = m.default : () => void +>module.exports : () => void +>module : { validate: () => void; } +>exports : () => void +>m.default : () => void +>m : typeof import("exporter") +>default : () => void module.exports.memberName = "thing"; >module.exports.memberName = "thing" : "thing" >module.exports.memberName : any ->module.exports : any ->module : any ->exports : any +>module.exports : () => void +>module : { validate: () => void; } +>exports : () => void >memberName : any >"thing" : "thing" diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.errors.txt deleted file mode 100644 index b6125a7db6..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.errors.txt +++ /dev/null @@ -1,21 +0,0 @@ -index1.js(15,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== index1.js (1 errors) ==== - /** - * const doc comment - */ - const x = (a) => { - return ''; - }; - - /** - * function doc comment - */ - function b() { - return 0; - } - - module.exports = {x, b} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.symbols index aaaee553ec..de1c0f5ef2 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.symbols @@ -21,6 +21,9 @@ function b() { } module.exports = {x, b} +>module.exports : Symbol(export=, Decl(index1.js, 12, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index1.js, 12, 1)) >x : Symbol(x, Decl(index1.js, 14, 18)) >b : Symbol(b, Decl(index1.js, 14, 20)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.symbols.diff index 64c051c579..d03d313047 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.symbols.diff @@ -7,6 +7,9 @@ ->module.exports : Symbol(module.exports, Decl(index1.js, 0, 0)) ->module : Symbol(module, Decl(index1.js, 12, 1)) ->exports : Symbol(module.exports, Decl(index1.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(index1.js, 12, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(index1.js, 12, 1)) >x : Symbol(x, Decl(index1.js, 14, 18)) >b : Symbol(b, Decl(index1.js, 14, 20)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.types index 59fe00d97c..574e9b0c38 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsDocCommentsOnConsts.types @@ -26,9 +26,9 @@ function b() { module.exports = {x, b} >module.exports = {x, b} : { x: (a: any) => string; b: () => number; } ->module.exports : any ->module : any ->exports : any +>module.exports : { x: (a: any) => string; b: () => number; } +>module : { export=: { x: (a: any) => string; b: () => number; }; } +>exports : { x: (a: any) => string; b: () => number; } >{x, b} : { x: (a: any) => string; b: () => number; } >x : (a: any) => string >b : () => number diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.errors.txt index ff203ef220..3d2adf9d83 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.errors.txt @@ -1,11 +1,8 @@ -index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. index.js(6,14): error TS2339: Property 't' does not exist on type 'Thing'. -==== index.js (2 errors) ==== +==== index.js (1 errors) ==== module.exports = class Thing { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** * @param {number} p */ diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.symbols index dfa6676527..83a3a7a016 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.symbols @@ -2,6 +2,9 @@ === index.js === module.exports = class Thing { +>module.exports : Symbol(Thing, Decl(index.js, 0, 16)) +>module : Symbol(module.exports) +>exports : Symbol(Thing, Decl(index.js, 0, 16)) >Thing : Symbol(Thing, Decl(index.js, 0, 16)) /** diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.symbols.diff index 6a558b8642..bd0fd254b3 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.symbols.diff @@ -7,10 +7,13 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 0)) ->exports : Symbol(export=, Decl(index.js, 0, 0)) ++>module.exports : Symbol(Thing, Decl(index.js, 0, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(Thing, Decl(index.js, 0, 16)) >Thing : Symbol(Thing, Decl(index.js, 0, 16)) /** -@@= skipped -12, +9 lines =@@ +@@= skipped -12, +12 lines =@@ >p : Symbol(p, Decl(index.js, 4, 16)) this.t = 12 + p; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.types index a2ae5632d8..6c07169ce3 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpression.types @@ -3,9 +3,9 @@ === index.js === module.exports = class Thing { >module.exports = class Thing { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof Thing ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Thing +>module : { Thing: typeof Thing; } +>exports : typeof Thing >class Thing { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof Thing >Thing : typeof Thing diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.errors.txt index 40a6eb9c62..3f74bfb462 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.errors.txt @@ -1,11 +1,8 @@ -index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. index.js(6,14): error TS2339: Property 't' does not exist on type 'exports'. -==== index.js (2 errors) ==== +==== index.js (1 errors) ==== module.exports = class { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** * @param {number} p */ diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.symbols index fe4251ff2f..35054e8bcc 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.symbols @@ -2,6 +2,10 @@ === index.js === module.exports = class { +>module.exports : Symbol(exports, Decl(index.js, 0, 16)) +>module : Symbol(module.exports) +>exports : Symbol(exports, Decl(index.js, 0, 16)) + /** * @param {number} p */ diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.symbols.diff index 016c23b56f..bbf1ef9d75 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.symbols.diff @@ -7,11 +7,13 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 0)) ->exports : Symbol(export=, Decl(index.js, 0, 0)) -- ++>module.exports : Symbol(exports, Decl(index.js, 0, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(exports, Decl(index.js, 0, 16)) + /** * @param {number} p - */ -@@= skipped -11, +7 lines =@@ +@@= skipped -11, +11 lines =@@ >p : Symbol(p, Decl(index.js, 4, 16)) this.t = 12 + p; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.types index 5974c5c456..2e87e5ddee 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.types @@ -3,9 +3,9 @@ === index.js === module.exports = class { >module.exports = class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof exports ->module.exports : any ->module : any ->exports : any +>module.exports : typeof exports +>module : { exports: typeof exports; } +>exports : typeof exports >class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof exports /** diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.errors.txt index be6353d870..67f1f520d4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.errors.txt @@ -1,32 +1,36 @@ -index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements. index.js(6,14): error TS2339: Property 't' does not exist on type 'exports'. -index.js(9,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(9,16): error TS2339: Property 'Sub' does not exist on type 'typeof exports'. index.js(11,14): error TS2339: Property 'instance' does not exist on type 'Sub'. -index.js(11,29): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== index.js (5 errors) ==== +==== index.js (4 errors) ==== module.exports = class { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~ /** + ~~~~~~~ * @param {number} p + ~~~~~~~~~~~~~~~~~~~~~~~~ */ + ~~~~~~~ constructor(p) { + ~~~~~~~~~~~~~~~~~~~~ this.t = 12 + p; + ~~~~~~~~~~~~~~~~~~~~~~~~ ~ !!! error TS2339: Property 't' does not exist on type 'exports'. } + ~~~~~ } + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.Sub = class { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~ +!!! error TS2339: Property 'Sub' does not exist on type 'typeof exports'. constructor() { this.instance = new module.exports(10); ~~~~~~~~ !!! error TS2339: Property 'instance' does not exist on type 'Sub'. - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. } } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.symbols index cca58cd469..e3f9777c61 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.symbols @@ -2,6 +2,10 @@ === index.js === module.exports = class { +>module.exports : Symbol(exports, Decl(index.js, 0, 16)) +>module : Symbol(module.exports) +>exports : Symbol(exports, Decl(index.js, 0, 16)) + /** * @param {number} p */ @@ -14,9 +18,16 @@ module.exports = class { } } module.exports.Sub = class { +>module.exports : Symbol(exports, Decl(index.js, 0, 16)) +>module : Symbol(module.exports) +>exports : Symbol(exports, Decl(index.js, 0, 16)) + constructor() { this.instance = new module.exports(10); >this : Symbol(Sub, Decl(index.js, 8, 20)) +>module.exports : Symbol(exports, Decl(index.js, 0, 16)) +>module : Symbol(module.exports) +>exports : Symbol(exports, Decl(index.js, 0, 16)) } } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.symbols.diff index ab4e2bb805..58e1fc86c6 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.symbols.diff @@ -7,11 +7,13 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 0)) ->exports : Symbol(export=, Decl(index.js, 0, 0)) -- ++>module.exports : Symbol(exports, Decl(index.js, 0, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(exports, Decl(index.js, 0, 16)) + /** * @param {number} p - */ -@@= skipped -11, +7 lines =@@ +@@= skipped -11, +11 lines =@@ >p : Symbol(p, Decl(index.js, 4, 16)) this.t = 12 + p; @@ -27,7 +29,10 @@ ->module : Symbol(module, Decl(index.js, 0, 0), Decl(index.js, 10, 27)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->Sub : Symbol(Sub, Decl(index.js, 7, 1)) -- ++>module.exports : Symbol(exports, Decl(index.js, 0, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(exports, Decl(index.js, 0, 16)) + constructor() { this.instance = new module.exports(10); ->this.instance : Symbol(Sub.instance, Decl(index.js, 9, 19)) @@ -36,6 +41,9 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(module, Decl(index.js, 0, 0), Decl(index.js, 10, 27)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ++>module.exports : Symbol(exports, Decl(index.js, 0, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(exports, Decl(index.js, 0, 16)) } } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.types index 42c61e6f57..f60baf73c8 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.types @@ -3,9 +3,9 @@ === index.js === module.exports = class { >module.exports = class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof exports ->module.exports : any ->module : any ->exports : any +>module.exports : typeof exports +>module : { exports: typeof exports; } +>exports : typeof exports >class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof exports /** @@ -27,22 +27,22 @@ module.exports = class { module.exports.Sub = class { >module.exports.Sub = class { constructor() { this.instance = new module.exports(10); }} : typeof Sub >module.exports.Sub : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof exports +>module : { exports: typeof exports; } +>exports : typeof exports >Sub : any >class { constructor() { this.instance = new module.exports(10); }} : typeof Sub constructor() { this.instance = new module.exports(10); ->this.instance = new module.exports(10) : any +>this.instance = new module.exports(10) : exports >this.instance : any >this : this >instance : any ->new module.exports(10) : any ->module.exports : any ->module : any ->exports : any +>new module.exports(10) : exports +>module.exports : typeof exports +>module : { exports: typeof exports; } +>exports : typeof exports >10 : 10 } } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.errors.txt index eaf0e4cf5b..e044c86ea0 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.errors.txt @@ -1,6 +1,6 @@ -index.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(7,1): error TS2309: An export assignment cannot be used in a module with other exported elements. index.js(9,14): error TS2339: Property 'x' does not exist on type 'Q'. -index.js(12,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(12,16): error TS2339: Property 'Another' does not exist on type 'typeof Q'. ==== index.js (3 errors) ==== @@ -11,15 +11,19 @@ index.js(12,1): error TS2580: Cannot find name 'module'. Do you need to install x = 42; } module.exports = class Q { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ constructor() { + ~~~~~~~~~~~~~~~~~~~ this.x = new A(); + ~~~~~~~~~~~~~~~~~~~~~~~~~ ~ !!! error TS2339: Property 'x' does not exist on type 'Q'. } + ~~~~~ } + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.Another = Q; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~ +!!! error TS2339: Property 'Another' does not exist on type 'typeof Q'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.symbols index b3dd9f5111..805429bac6 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.symbols @@ -15,6 +15,9 @@ class Q { >x : Symbol(x, Decl(index.js, 3, 9)) } module.exports = class Q { +>module.exports : Symbol(Q, Decl(index.js, 6, 16)) +>module : Symbol(module.exports) +>exports : Symbol(Q, Decl(index.js, 6, 16)) >Q : Symbol(Q, Decl(index.js, 6, 16)) constructor() { @@ -24,5 +27,8 @@ module.exports = class Q { } } module.exports.Another = Q; +>module.exports : Symbol(Q, Decl(index.js, 6, 16)) +>module : Symbol(module.exports) +>exports : Symbol(Q, Decl(index.js, 6, 16)) >Q : Symbol(Q, Decl(index.js, 2, 1)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.symbols.diff index a65132c4f5..609960e85b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.symbols.diff @@ -19,6 +19,9 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 5, 1)) ->exports : Symbol(export=, Decl(index.js, 5, 1)) ++>module.exports : Symbol(Q, Decl(index.js, 6, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(Q, Decl(index.js, 6, 16)) >Q : Symbol(Q, Decl(index.js, 6, 16)) constructor() { @@ -35,5 +38,8 @@ ->module : Symbol(module, Decl(index.js, 5, 1)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->Another : Symbol(Another, Decl(index.js, 10, 1)) ++>module.exports : Symbol(Q, Decl(index.js, 6, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(Q, Decl(index.js, 6, 16)) >Q : Symbol(Q, Decl(index.js, 2, 1)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.types index efa9db42fb..319c1a7127 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.types @@ -18,9 +18,9 @@ class Q { } module.exports = class Q { >module.exports = class Q { constructor() { this.x = new A(); }} : typeof Q ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Q +>module : { Q: typeof Q; } +>exports : typeof Q >class Q { constructor() { this.x = new A(); }} : typeof Q >Q : typeof Q @@ -37,9 +37,9 @@ module.exports = class Q { module.exports.Another = Q; >module.exports.Another = Q : typeof Q >module.exports.Another : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Q +>module : { Q: typeof Q; } +>exports : typeof Q >Another : any >Q : typeof Q diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.errors.txt deleted file mode 100644 index 01c38e52c8..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== index.js (1 errors) ==== - class Foo {} - - module.exports = new Foo(); - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.symbols index 0f09a253e6..b70cc9e426 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.symbols @@ -5,5 +5,8 @@ class Foo {} >Foo : Symbol(Foo, Decl(index.js, 0, 0)) module.exports = new Foo(); +>module.exports : Symbol(export=, Decl(index.js, 0, 12)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 0, 12)) >Foo : Symbol(Foo, Decl(index.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.symbols.diff index d467bc00c9..1575c16211 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.symbols.diff @@ -6,6 +6,8 @@ module.exports = new Foo(); ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 12)) -->exports : Symbol(export=, Decl(index.js, 0, 12)) ++>module.exports : Symbol(export=, Decl(index.js, 0, 12)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(index.js, 0, 12)) >Foo : Symbol(Foo, Decl(index.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.types index 4867574e65..0512be1582 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance1.types @@ -6,9 +6,9 @@ class Foo {} module.exports = new Foo(); >module.exports = new Foo() : Foo ->module.exports : any ->module : any ->exports : any +>module.exports : Foo +>module : { export=: Foo; } +>exports : Foo >new Foo() : Foo >Foo : typeof Foo diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.errors.txt deleted file mode 100644 index d0e547e52f..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -index.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== index.js (1 errors) ==== - class Foo { - static stat = 10; - member = 10; - } - - module.exports = new Foo(); - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.symbols index da3e11cb19..e45069c21e 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.symbols @@ -12,5 +12,8 @@ class Foo { } module.exports = new Foo(); +>module.exports : Symbol(export=, Decl(index.js, 3, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 3, 1)) >Foo : Symbol(Foo, Decl(index.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.symbols.diff index 1e06689b82..b9845dcc35 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.symbols.diff @@ -15,6 +15,8 @@ module.exports = new Foo(); ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 3, 1)) -->exports : Symbol(export=, Decl(index.js, 3, 1)) ++>module.exports : Symbol(export=, Decl(index.js, 3, 1)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(index.js, 3, 1)) >Foo : Symbol(Foo, Decl(index.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.types index b43d824651..37525ed15a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance2.types @@ -15,9 +15,9 @@ class Foo { module.exports = new Foo(); >module.exports = new Foo() : Foo ->module.exports : any ->module : any ->exports : any +>module.exports : Foo +>module : { export=: Foo; } +>exports : Foo >new Foo() : Foo >Foo : typeof Foo diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.errors.txt index acab779dd7..46f3413868 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.errors.txt @@ -1,5 +1,5 @@ -index.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(8,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +index.js(8,16): error TS2339: Property 'additional' does not exist on type 'Foo'. ==== index.js (2 errors) ==== @@ -9,9 +9,9 @@ index.js(8,1): error TS2580: Cannot find name 'module'. Do you need to install t } module.exports = new Foo(); - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.additional = 20; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file + ~~~~~~~~~~ +!!! error TS2339: Property 'additional' does not exist on type 'Foo'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.symbols index 2fcb73dd00..7d970daaef 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.symbols @@ -12,6 +12,13 @@ class Foo { } module.exports = new Foo(); +>module.exports : Symbol(export=, Decl(index.js, 3, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 3, 1)) >Foo : Symbol(Foo, Decl(index.js, 0, 0)) module.exports.additional = 20; +>module.exports : Symbol(export=, Decl(index.js, 3, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 3, 1)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.symbols.diff index 61dba055f5..4083cef7e2 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.symbols.diff @@ -15,7 +15,9 @@ module.exports = new Foo(); ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 3, 1)) -->exports : Symbol(export=, Decl(index.js, 3, 1)) ++>module.exports : Symbol(export=, Decl(index.js, 3, 1)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(index.js, 3, 1)) >Foo : Symbol(Foo, Decl(index.js, 0, 0)) module.exports.additional = 20; @@ -24,4 +26,7 @@ ->module : Symbol(module, Decl(index.js, 3, 1)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->additional : Symbol(additional, Decl(index.js, 5, 27)) -- ++>module.exports : Symbol(export=, Decl(index.js, 3, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(index.js, 3, 1)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.types index 2006b5024f..ff61c982ef 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedClassInstance3.types @@ -15,18 +15,18 @@ class Foo { module.exports = new Foo(); >module.exports = new Foo() : Foo ->module.exports : any ->module : any ->exports : any +>module.exports : Foo +>module : { export=: Foo; } +>exports : Foo >new Foo() : Foo >Foo : typeof Foo module.exports.additional = 20; >module.exports.additional = 20 : 20 >module.exports.additional : any ->module.exports : any ->module : any ->exports : any +>module.exports : Foo +>module : { export=: Foo; } +>exports : Foo >additional : any >20 : 20 diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.errors.txt deleted file mode 100644 index 1baac767f3..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.errors.txt +++ /dev/null @@ -1,18 +0,0 @@ -jsDeclarationsExportAssignedConstructorFunction.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -jsDeclarationsExportAssignedConstructorFunction.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== jsDeclarationsExportAssignedConstructorFunction.js (2 errors) ==== - /** @constructor */ - module.exports.MyClass = function() { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - this.x = 1 - } - module.exports.MyClass.prototype = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - a: function() { - } - } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.symbols index defbcc0932..f0c785a0b4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.symbols @@ -3,9 +3,21 @@ === jsDeclarationsExportAssignedConstructorFunction.js === /** @constructor */ module.exports.MyClass = function() { +>module.exports.MyClass : Symbol(MyClass, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) +>module.exports : Symbol("jsDeclarationsExportAssignedConstructorFunction", Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("jsDeclarationsExportAssignedConstructorFunction", Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) +>MyClass : Symbol(MyClass, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) + this.x = 1 } module.exports.MyClass.prototype = { +>module.exports.MyClass : Symbol(MyClass, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) +>module.exports : Symbol("jsDeclarationsExportAssignedConstructorFunction", Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("jsDeclarationsExportAssignedConstructorFunction", Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) +>MyClass : Symbol(MyClass, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) + a: function() { >a : Symbol(a, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 4, 36)) } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.symbols.diff index b46dd3dd01..8546978854 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.symbols.diff @@ -9,7 +9,12 @@ ->module : Symbol(module, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) ->exports : Symbol(module.exports, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) ->MyClass : Symbol(MyClass, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0), Decl(jsDeclarationsExportAssignedConstructorFunction.js, 4, 15)) -- ++>module.exports.MyClass : Symbol(MyClass, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) ++>module.exports : Symbol("jsDeclarationsExportAssignedConstructorFunction", Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("jsDeclarationsExportAssignedConstructorFunction", Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) ++>MyClass : Symbol(MyClass, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) + this.x = 1 ->this.x : Symbol(MyClass.x, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 1, 37)) ->this : Symbol(MyClass, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 1, 24)) @@ -23,7 +28,11 @@ ->exports : Symbol(module.exports, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) ->MyClass : Symbol(MyClass, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0), Decl(jsDeclarationsExportAssignedConstructorFunction.js, 4, 15)) ->prototype : Symbol(MyClass.prototype, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 3, 1)) -- ++>module.exports.MyClass : Symbol(MyClass, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) ++>module.exports : Symbol("jsDeclarationsExportAssignedConstructorFunction", Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("jsDeclarationsExportAssignedConstructorFunction", Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) ++>MyClass : Symbol(MyClass, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 0, 0)) + a: function() { >a : Symbol(a, Decl(jsDeclarationsExportAssignedConstructorFunction.js, 4, 36)) - } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.types index 6cb4035273..f51807c49a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunction.types @@ -5,9 +5,9 @@ module.exports.MyClass = function() { >module.exports.MyClass = function() { this.x = 1} : () => void >module.exports.MyClass : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("jsDeclarationsExportAssignedConstructorFunction") +>module : { "jsDeclarationsExportAssignedConstructorFunction": typeof import("jsDeclarationsExportAssignedConstructorFunction"); } +>exports : typeof import("jsDeclarationsExportAssignedConstructorFunction") >MyClass : any >function() { this.x = 1} : () => void @@ -22,9 +22,9 @@ module.exports.MyClass.prototype = { >module.exports.MyClass.prototype = { a: function() { }} : { a: () => void; } >module.exports.MyClass.prototype : any >module.exports.MyClass : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("jsDeclarationsExportAssignedConstructorFunction") +>module : { "jsDeclarationsExportAssignedConstructorFunction": typeof import("jsDeclarationsExportAssignedConstructorFunction"); } +>exports : typeof import("jsDeclarationsExportAssignedConstructorFunction") >MyClass : any >prototype : any >{ a: function() { }} : { a: () => void; } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.errors.txt index b97e422472..bdcd1428a7 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.errors.txt @@ -1,26 +1,25 @@ -jsDeclarationsExportAssignedConstructorFunctionWithSub.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -jsDeclarationsExportAssignedConstructorFunctionWithSub.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -jsDeclarationsExportAssignedConstructorFunctionWithSub.js(8,25): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -jsDeclarationsExportAssignedConstructorFunctionWithSub.js(10,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +jsDeclarationsExportAssignedConstructorFunctionWithSub.js(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +jsDeclarationsExportAssignedConstructorFunctionWithSub.js(7,16): error TS2339: Property 'Sub' does not exist on type '(p: any) => void'. +jsDeclarationsExportAssignedConstructorFunctionWithSub.js(10,16): error TS2339: Property 'Sub' does not exist on type '(p: any) => void'. -==== jsDeclarationsExportAssignedConstructorFunctionWithSub.js (4 errors) ==== +==== jsDeclarationsExportAssignedConstructorFunctionWithSub.js (3 errors) ==== /** * @param {number} p */ module.exports = function (p) { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ this.t = 12 + p; + ~~~~~~~~~~~~~~~~~~~~ } + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.Sub = function() { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~ +!!! error TS2339: Property 'Sub' does not exist on type '(p: any) => void'. this.instance = new module.exports(10); - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. } module.exports.Sub.prototype = { } - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~ +!!! error TS2339: Property 'Sub' does not exist on type '(p: any) => void'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.symbols index be63c7222d..472779ff9e 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.symbols @@ -5,13 +5,26 @@ * @param {number} p */ module.exports = function (p) { +>module.exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) >p : Symbol(p, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 3, 27)) this.t = 12 + p; >p : Symbol(p, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 3, 27)) } module.exports.Sub = function() { +>module.exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) + this.instance = new module.exports(10); +>module.exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) } module.exports.Sub.prototype = { } +>module.exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.symbols.diff index 966203648f..39b803f313 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.symbols.diff @@ -6,7 +6,9 @@ module.exports = function (p) { ->module.exports : Symbol(module.exports, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) ->module : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) -->exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) >p : Symbol(p, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 3, 27)) this.t = 12 + p; @@ -21,7 +23,10 @@ ->module : Symbol(module, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0), Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 7, 23)) ->exports : Symbol(module.exports, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) ->Sub : Symbol(Sub, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 5, 1), Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 9, 15)) -- ++>module.exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) + this.instance = new module.exports(10); ->this.instance : Symbol(Sub.instance, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 6, 33)) ->this : Symbol(Sub, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 6, 20)) @@ -29,6 +34,9 @@ ->module.exports : Symbol(module.exports, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) ->module : Symbol(module, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0), Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 7, 23)) ->exports : Symbol(module.exports, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) } module.exports.Sub.prototype = { } ->module.exports.Sub.prototype : Symbol(Sub.prototype, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 8, 1)) @@ -38,4 +46,7 @@ ->exports : Symbol(module.exports, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) ->Sub : Symbol(Sub, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 5, 1), Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 9, 15)) ->prototype : Symbol(Sub.prototype, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 8, 1)) ++>module.exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(jsDeclarationsExportAssignedConstructorFunctionWithSub.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.types index b318e77725..19f1ccb6e9 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.types @@ -6,9 +6,9 @@ */ module.exports = function (p) { >module.exports = function (p) { this.t = 12 + p;} : (p: any) => void ->module.exports : any ->module : any ->exports : any +>module.exports : (p: any) => void +>module : { export=: (p: any) => void; } +>exports : (p: any) => void >function (p) { this.t = 12 + p;} : (p: any) => void >p : any @@ -24,9 +24,9 @@ module.exports = function (p) { module.exports.Sub = function() { >module.exports.Sub = function() { this.instance = new module.exports(10);} : () => void >module.exports.Sub : any ->module.exports : any ->module : any ->exports : any +>module.exports : (p: any) => void +>module : { export=: (p: any) => void; } +>exports : (p: any) => void >Sub : any >function() { this.instance = new module.exports(10);} : () => void @@ -36,18 +36,18 @@ module.exports.Sub = function() { >this : any >instance : any >new module.exports(10) : any ->module.exports : any ->module : any ->exports : any +>module.exports : (p: any) => void +>module : { export=: (p: any) => void; } +>exports : (p: any) => void >10 : 10 } module.exports.Sub.prototype = { } >module.exports.Sub.prototype = { } : {} >module.exports.Sub.prototype : any >module.exports.Sub : any ->module.exports : any ->module : any ->exports : any +>module.exports : (p: any) => void +>module : { export=: (p: any) => void; } +>exports : (p: any) => void >Sub : any >prototype : any >{ } : {} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.errors.txt index 54abfd5600..6843f37be4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.errors.txt @@ -1,12 +1,9 @@ -index.js(1,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. index.js(5,14): error TS2339: Property 'usage' does not exist on type 'Container'. -index.js(9,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +obj.js(3,14): error TS2339: Property 'x' does not exist on type 'Obj'. -==== index.js (3 errors) ==== +==== index.js (1 errors) ==== const Obj = require("./obj"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. class Container { constructor() { @@ -17,11 +14,11 @@ index.js(9,1): error TS2580: Cannot find name 'module'. Do you need to install t } module.exports = Container; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== obj.js (0 errors) ==== +==== obj.js (1 errors) ==== module.exports = class Obj { constructor() { this.x = 12; + ~ +!!! error TS2339: Property 'x' does not exist on type 'Obj'. } } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.symbols index 6fdaef6a58..89d7829634 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.symbols @@ -3,6 +3,8 @@ === index.js === const Obj = require("./obj"); >Obj : Symbol(Obj, Decl(index.js, 0, 5)) +>require : Symbol(require) +>"./obj" : Symbol("obj", Decl(obj.js, 0, 0)) class Container { >Container : Symbol(Container, Decl(index.js, 0, 29)) @@ -15,5 +17,20 @@ class Container { } module.exports = Container; +>module.exports : Symbol(Container, Decl(index.js, 0, 29)) +>module : Symbol(module.exports) +>exports : Symbol(Container, Decl(index.js, 0, 29)) >Container : Symbol(Container, Decl(index.js, 0, 29)) +=== obj.js === +module.exports = class Obj { +>module.exports : Symbol(Obj, Decl(obj.js, 0, 16)) +>module : Symbol(module.exports) +>exports : Symbol(Obj, Decl(obj.js, 0, 16)) +>Obj : Symbol(Obj, Decl(obj.js, 0, 16)) + + constructor() { + this.x = 12; +>this : Symbol(Obj, Decl(obj.js, 0, 16)) + } +} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.symbols.diff index d6a8a6888f..1e3e65d778 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.symbols.diff @@ -1,14 +1,6 @@ --- old.jsDeclarationsExportAssignedVisibility.symbols +++ new.jsDeclarationsExportAssignedVisibility.symbols -@@= skipped -2, +2 lines =@@ - === index.js === - const Obj = require("./obj"); - >Obj : Symbol(Obj, Decl(index.js, 0, 5)) -->require : Symbol(require) -->"./obj" : Symbol("obj", Decl(obj.js, 0, 0)) - - class Container { - >Container : Symbol(Container, Decl(index.js, 0, 29)) +@@= skipped -10, +10 lines =@@ constructor() { this.usage = new Obj(); @@ -23,19 +15,25 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 6, 1)) ->exports : Symbol(export=, Decl(index.js, 6, 1)) ++>module.exports : Symbol(Container, Decl(index.js, 0, 29)) ++>module : Symbol(module.exports) ++>exports : Symbol(Container, Decl(index.js, 0, 29)) >Container : Symbol(Container, Decl(index.js, 0, 29)) --=== obj.js === --module.exports = class Obj { + === obj.js === + module.exports = class Obj { ->module.exports : Symbol(module.exports, Decl(obj.js, 0, 0)) ->module : Symbol(export=, Decl(obj.js, 0, 0)) ->exports : Symbol(export=, Decl(obj.js, 0, 0)) -->Obj : Symbol(Obj, Decl(obj.js, 0, 16)) -- -- constructor() { -- this.x = 12; ++>module.exports : Symbol(Obj, Decl(obj.js, 0, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(Obj, Decl(obj.js, 0, 16)) + >Obj : Symbol(Obj, Decl(obj.js, 0, 16)) + + constructor() { + this.x = 12; ->this.x : Symbol(Obj.x, Decl(obj.js, 1, 19)) -->this : Symbol(Obj, Decl(obj.js, 0, 16)) + >this : Symbol(Obj, Decl(obj.js, 0, 16)) ->x : Symbol(Obj.x, Decl(obj.js, 1, 19)) -- } --} + } + } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.types index 75e8dd4290..1b123a62e8 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignedVisibility.types @@ -2,8 +2,8 @@ === index.js === const Obj = require("./obj"); ->Obj : any ->require("./obj") : any +>Obj : typeof Obj +>require("./obj") : typeof Obj >require : any >"./obj" : "./obj" @@ -12,19 +12,37 @@ class Container { constructor() { this.usage = new Obj(); ->this.usage = new Obj() : any +>this.usage = new Obj() : Obj >this.usage : any >this : this >usage : any ->new Obj() : any ->Obj : any +>new Obj() : Obj +>Obj : typeof Obj } } module.exports = Container; >module.exports = Container : typeof Container ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Container +>module : { Container: typeof Container; } +>exports : typeof Container >Container : typeof Container +=== obj.js === +module.exports = class Obj { +>module.exports = class Obj { constructor() { this.x = 12; }} : typeof Obj +>module.exports : typeof Obj +>module : { Obj: typeof Obj; } +>exports : typeof Obj +>class Obj { constructor() { this.x = 12; }} : typeof Obj +>Obj : typeof Obj + + constructor() { + this.x = 12; +>this.x = 12 : 12 +>this.x : any +>this : this +>x : any +>12 : 12 + } +} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.errors.txt index cc6a367c5f..c381a8cc32 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.errors.txt @@ -1,5 +1,5 @@ -index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(12,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(5,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +index.js(12,16): error TS2339: Property 'Strings' does not exist on type '{ thing: string; also: string; desc: { item: string; }; }'. ==== index.js (2 errors) ==== @@ -8,15 +8,21 @@ index.js(12,1): error TS2580: Cannot find name 'module'. Do you need to install b: "B" }; module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~ thing: "ok", + ~~~~~~~~~~~~~~~~ also: "ok", + ~~~~~~~~~~~~~~~ desc: { + ~~~~~~~~~~~ item: "ok" + ~~~~~~~~~~~~~~~~~~ } + ~~~~~ }; + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.Strings = Strings; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~ +!!! error TS2339: Property 'Strings' does not exist on type '{ thing: string; also: string; desc: { item: string; }; }'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.symbols index b496c8c266..b2e68c2f07 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.symbols @@ -12,6 +12,10 @@ const Strings = { }; module.exports = { +>module.exports : Symbol(export=, Decl(index.js, 3, 2)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 3, 2)) + thing: "ok", >thing : Symbol(thing, Decl(index.js, 4, 18)) @@ -26,5 +30,8 @@ module.exports = { } }; module.exports.Strings = Strings; +>module.exports : Symbol(export=, Decl(index.js, 3, 2)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 3, 2)) >Strings : Symbol(Strings, Decl(index.js, 0, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.symbols.diff index 29a9693663..9c352d8d8f 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.symbols.diff @@ -6,12 +6,12 @@ module.exports = { ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 3, 2)) -->exports : Symbol(export=, Decl(index.js, 3, 2)) -- - thing: "ok", - >thing : Symbol(thing, Decl(index.js, 4, 18)) ++>module.exports : Symbol(export=, Decl(index.js, 3, 2)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(index.js, 3, 2)) -@@= skipped -18, +14 lines =@@ + thing: "ok", +@@= skipped -18, +18 lines =@@ } }; module.exports.Strings = Strings; @@ -20,5 +20,8 @@ ->module : Symbol(module, Decl(index.js, 3, 2)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->Strings : Symbol(Strings, Decl(index.js, 10, 2)) ++>module.exports : Symbol(export=, Decl(index.js, 3, 2)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(index.js, 3, 2)) >Strings : Symbol(Strings, Decl(index.js, 0, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.types index 8e1210146e..77fd061e5a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.types @@ -16,9 +16,9 @@ const Strings = { }; module.exports = { >module.exports = { thing: "ok", also: "ok", desc: { item: "ok" }} : { thing: string; also: string; desc: { item: string; }; } ->module.exports : any ->module : any ->exports : any +>module.exports : { thing: string; also: string; desc: { item: string; }; } +>module : { export=: { thing: string; also: string; desc: { item: string; }; }; } +>exports : { thing: string; also: string; desc: { item: string; }; } >{ thing: "ok", also: "ok", desc: { item: "ok" }} : { thing: string; also: string; desc: { item: string; }; } thing: "ok", @@ -41,9 +41,9 @@ module.exports = { module.exports.Strings = Strings; >module.exports.Strings = Strings : { a: string; b: string; } >module.exports.Strings : any ->module.exports : any ->module : any ->exports : any +>module.exports : { thing: string; also: string; desc: { item: string; }; } +>module : { export=: { thing: string; also: string; desc: { item: string; }; }; } +>exports : { thing: string; also: string; desc: { item: string; }; } >Strings : any >Strings : { a: string; b: string; } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.errors.txt deleted file mode 100644 index 24dc8480eb..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -index.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== index.js (1 errors) ==== - var x = 12; - module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - extends: 'base', - more: { - others: ['strs'] - }, - x - }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.symbols index d3d48d16af..cf7d4d171d 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.symbols @@ -5,6 +5,10 @@ var x = 12; >x : Symbol(x, Decl(index.js, 0, 3)) module.exports = { +>module.exports : Symbol(export=, Decl(index.js, 0, 11)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 0, 11)) + extends: 'base', >extends : Symbol(extends, Decl(index.js, 1, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.symbols.diff index cef33c33ef..845ce9b4d2 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.symbols.diff @@ -6,8 +6,8 @@ module.exports = { ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 11)) -->exports : Symbol(export=, Decl(index.js, 0, 11)) -- - extends: 'base', - >extends : Symbol(extends, Decl(index.js, 1, 18)) ++>module.exports : Symbol(export=, Decl(index.js, 0, 11)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(index.js, 0, 11)) + extends: 'base', diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.types index f87dd446ab..9657f19b1a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportAssignmentWithKeywordName.types @@ -7,9 +7,9 @@ var x = 12; module.exports = { >module.exports = { extends: 'base', more: { others: ['strs'] }, x} : { extends: string; more: { others: string[]; }; x: number; } ->module.exports : any ->module : any ->exports : any +>module.exports : { extends: string; more: { others: string[]; }; x: number; } +>module : { export=: { extends: string; more: { others: string[]; }; x: number; }; } +>exports : { extends: string; more: { others: string[]; }; x: number; } >{ extends: 'base', more: { others: ['strs'] }, x} : { extends: string; more: { others: string[]; }; x: number; } extends: 'base', diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.symbols index 26a7aee097..d03e2da5ce 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.symbols @@ -6,6 +6,10 @@ function foo() { >foo : Symbol(foo, Decl(index.js, 0, 0)) module.exports = exports = function (o) { +>module.exports : Symbol(export=, Decl(index.js, 1, 16)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 1, 16)) +>exports : Symbol("index", Decl(index.js, 0, 0)) >o : Symbol(o, Decl(index.js, 2, 41)) return (o == null) ? create(base) : defineProperties(Object(o), descriptors); @@ -20,6 +24,7 @@ function foo() { // I have no idea what to put here } exports.methods = m; +>exports : Symbol("index", Decl(index.js, 0, 0)) >m : Symbol(m, Decl(index.js, 5, 9)) } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.symbols.diff index a993417664..76cb776681 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.symbols.diff @@ -6,17 +6,18 @@ module.exports = exports = function (o) { ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 1, 16)) -->exports : Symbol(export=, Decl(index.js, 1, 16)) -->exports : Symbol("index", Decl(index.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(index.js, 1, 16)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(index.js, 1, 16)) + >exports : Symbol("index", Decl(index.js, 0, 0)) >o : Symbol(o, Decl(index.js, 2, 41)) - - return (o == null) ? create(base) : defineProperties(Object(o), descriptors); -@@= skipped -18, +14 lines =@@ +@@= skipped -18, +18 lines =@@ // I have no idea what to put here } exports.methods = m; ->exports : Symbol(methods, Decl(index.js, 7, 5)) ->methods : Symbol(methods, Decl(index.js, 7, 5)) ++>exports : Symbol("index", Decl(index.js, 0, 0)) >m : Symbol(m, Decl(index.js, 5, 9)) } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.types index 382c8aae8a..121c240790 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportDoubleAssignmentInClosure.types @@ -7,9 +7,9 @@ function foo() { module.exports = exports = function (o) { >module.exports = exports = function (o) { return (o == null) ? create(base) : defineProperties(Object(o), descriptors); } : (o: any) => any ->module.exports : any ->module : any ->exports : any +>module.exports : (o: any) => any +>module : { export=: (o: any) => any; } +>exports : (o: any) => any >exports = function (o) { return (o == null) ? create(base) : defineProperties(Object(o), descriptors); } : (o: any) => any >exports : any >function (o) { return (o == null) ? create(base) : defineProperties(Object(o), descriptors); } : (o: any) => any @@ -40,7 +40,7 @@ function foo() { exports.methods = m; >exports.methods = m : () => void >exports.methods : any ->exports : any +>exports : typeof import("index") >methods : any >m : () => void } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.errors.txt deleted file mode 100644 index 0b86e27db9..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.errors.txt +++ /dev/null @@ -1,101 +0,0 @@ -cjs.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'ns'. -cjs.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -cjs.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -cjs2.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'ns'. -cjs2.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -cjs2.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -cjs3.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'ns'. -cjs3.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -cjs3.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -cjs4.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'ns'. -cjs4.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -cjs4.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== cls.js (0 errors) ==== - export class Foo {} - -==== func.js (0 errors) ==== - export function func() {} - -==== bar.js (0 errors) ==== - export * from "./cls"; - -==== bar2.js (0 errors) ==== - export * from "./func"; - export * from "./cls"; - -==== baz.js (0 errors) ==== - import {Foo} from "./cls"; - export {Foo}; - -==== bat.js (0 errors) ==== - import * as ns from "./cls"; - export default ns; - -==== ban.js (0 errors) ==== - import * as ns from "./cls"; - export {ns}; - -==== bol.js (0 errors) ==== - import * as ns from "./cls"; - export { ns as classContainer }; - -==== cjs.js (3 errors) ==== - const ns = require("./cls"); - ~~ -!!! error TS2451: Cannot redeclare block-scoped variable 'ns'. -!!! related TS6203 cjs2.js:1:7: 'ns' was also declared here. -!!! related TS6203 cjs3.js:1:7: 'ns' was also declared here. -!!! related TS6203 cjs4.js:1:7: 'ns' was also declared here. - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - module.exports = { ns }; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - -==== cjs2.js (3 errors) ==== - const ns = require("./cls"); - ~~ -!!! error TS2451: Cannot redeclare block-scoped variable 'ns'. -!!! related TS6203 cjs.js:1:7: 'ns' was also declared here. - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - module.exports = ns; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - -==== cjs3.js (3 errors) ==== - const ns = require("./cls"); - ~~ -!!! error TS2451: Cannot redeclare block-scoped variable 'ns'. -!!! related TS6203 cjs.js:1:7: 'ns' was also declared here. - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - module.exports.ns = ns; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - -==== cjs4.js (3 errors) ==== - const ns = require("./cls"); - ~~ -!!! error TS2451: Cannot redeclare block-scoped variable 'ns'. -!!! related TS6203 cjs.js:1:7: 'ns' was also declared here. - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - module.exports.names = ns; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - -==== includeAll.js (0 errors) ==== - import "./cjs4"; - import "./cjs3"; - import "./cjs2"; - import "./cjs"; - import "./bol"; - import "./ban"; - import "./bat"; - import "./baz"; - import "./bar"; - import "./bar2"; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.symbols index 040e9993e8..716a94e9ae 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.symbols @@ -49,30 +49,54 @@ export { ns as classContainer }; === cjs.js === const ns = require("./cls"); >ns : Symbol(ns, Decl(cjs.js, 0, 5)) +>require : Symbol(require) +>"./cls" : Symbol("cls", Decl(cls.js, 0, 0)) module.exports = { ns }; +>module.exports : Symbol(export=, Decl(cjs.js, 0, 28)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(cjs.js, 0, 28)) >ns : Symbol(ns, Decl(cjs.js, 1, 18)) === cjs2.js === const ns = require("./cls"); >ns : Symbol(ns, Decl(cjs2.js, 0, 5)) +>require : Symbol(require) +>"./cls" : Symbol("cls", Decl(cls.js, 0, 0)) module.exports = ns; ->ns : Symbol(ns, Decl(cjs.js, 0, 5)) +>module.exports : Symbol("cls", Decl(cls.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("cls", Decl(cls.js, 0, 0)) +>ns : Symbol(ns, Decl(cjs2.js, 0, 5)) === cjs3.js === const ns = require("./cls"); >ns : Symbol(ns, Decl(cjs3.js, 0, 5)) +>require : Symbol(require) +>"./cls" : Symbol("cls", Decl(cls.js, 0, 0)) module.exports.ns = ns; ->ns : Symbol(ns, Decl(cjs.js, 0, 5)) +>module.exports.ns : Symbol(ns, Decl(cjs3.js, 0, 28)) +>module.exports : Symbol("cjs3", Decl(cjs3.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("cjs3", Decl(cjs3.js, 0, 0)) +>ns : Symbol(ns, Decl(cjs3.js, 0, 28)) +>ns : Symbol(ns, Decl(cjs3.js, 0, 5)) === cjs4.js === const ns = require("./cls"); >ns : Symbol(ns, Decl(cjs4.js, 0, 5)) +>require : Symbol(require) +>"./cls" : Symbol("cls", Decl(cls.js, 0, 0)) module.exports.names = ns; ->ns : Symbol(ns, Decl(cjs.js, 0, 5)) +>module.exports.names : Symbol(names, Decl(cjs4.js, 0, 28)) +>module.exports : Symbol("cjs4", Decl(cjs4.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("cjs4", Decl(cjs4.js, 0, 0)) +>names : Symbol(names, Decl(cjs4.js, 0, 28)) +>ns : Symbol(ns, Decl(cjs4.js, 0, 5)) === includeAll.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.symbols.diff index 282eafbceb..b302986532 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.symbols.diff @@ -1,60 +1,70 @@ --- old.jsDeclarationsExportForms.symbols +++ new.jsDeclarationsExportForms.symbols -@@= skipped -48, +48 lines =@@ - === cjs.js === +@@= skipped -49, +49 lines =@@ const ns = require("./cls"); >ns : Symbol(ns, Decl(cjs.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./cls" : Symbol(ns, Decl(cls.js, 0, 0)) ++>"./cls" : Symbol("cls", Decl(cls.js, 0, 0)) module.exports = { ns }; ->module.exports : Symbol(module.exports, Decl(cjs.js, 0, 0)) ->module : Symbol(module, Decl(cjs.js, 0, 28)) ->exports : Symbol(module.exports, Decl(cjs.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(cjs.js, 0, 28)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(cjs.js, 0, 28)) >ns : Symbol(ns, Decl(cjs.js, 1, 18)) === cjs2.js === const ns = require("./cls"); >ns : Symbol(ns, Decl(cjs2.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./cls" : Symbol(ns, Decl(cls.js, 0, 0)) ++>"./cls" : Symbol("cls", Decl(cls.js, 0, 0)) module.exports = ns; ->module.exports : Symbol(module.exports, Decl(cjs2.js, 0, 0)) ->module : Symbol(export=, Decl(cjs2.js, 0, 28)) ->exports : Symbol(export=, Decl(cjs2.js, 0, 28)) -->ns : Symbol(ns, Decl(cjs2.js, 0, 5)) -+>ns : Symbol(ns, Decl(cjs.js, 0, 5)) ++>module.exports : Symbol("cls", Decl(cls.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("cls", Decl(cls.js, 0, 0)) + >ns : Symbol(ns, Decl(cjs2.js, 0, 5)) === cjs3.js === const ns = require("./cls"); >ns : Symbol(ns, Decl(cjs3.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./cls" : Symbol(ns, Decl(cls.js, 0, 0)) ++>"./cls" : Symbol("cls", Decl(cls.js, 0, 0)) module.exports.ns = ns; -->module.exports.ns : Symbol(ns, Decl(cjs3.js, 0, 28)) + >module.exports.ns : Symbol(ns, Decl(cjs3.js, 0, 28)) ->module.exports : Symbol(ns, Decl(cjs3.js, 0, 28)) ->module : Symbol(module, Decl(cjs3.js, 0, 28)) ->exports : Symbol(module.exports, Decl(cjs3.js, 0, 0)) -->ns : Symbol(ns, Decl(cjs3.js, 0, 28)) -->ns : Symbol(ns, Decl(cjs3.js, 0, 5)) -+>ns : Symbol(ns, Decl(cjs.js, 0, 5)) ++>module.exports : Symbol("cjs3", Decl(cjs3.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("cjs3", Decl(cjs3.js, 0, 0)) + >ns : Symbol(ns, Decl(cjs3.js, 0, 28)) + >ns : Symbol(ns, Decl(cjs3.js, 0, 5)) - === cjs4.js === +@@= skipped -38, +38 lines =@@ const ns = require("./cls"); >ns : Symbol(ns, Decl(cjs4.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./cls" : Symbol(ns, Decl(cls.js, 0, 0)) ++>"./cls" : Symbol("cls", Decl(cls.js, 0, 0)) module.exports.names = ns; -->module.exports.names : Symbol(names, Decl(cjs4.js, 0, 28)) + >module.exports.names : Symbol(names, Decl(cjs4.js, 0, 28)) ->module.exports : Symbol(names, Decl(cjs4.js, 0, 28)) ->module : Symbol(module, Decl(cjs4.js, 0, 28)) ->exports : Symbol(module.exports, Decl(cjs4.js, 0, 0)) -->names : Symbol(names, Decl(cjs4.js, 0, 28)) -->ns : Symbol(ns, Decl(cjs4.js, 0, 5)) -+>ns : Symbol(ns, Decl(cjs.js, 0, 5)) - - === includeAll.js === ++>module.exports : Symbol("cjs4", Decl(cjs4.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("cjs4", Decl(cjs4.js, 0, 0)) + >names : Symbol(names, Decl(cjs4.js, 0, 28)) + >ns : Symbol(ns, Decl(cjs4.js, 0, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.types index bbab02e783..0d9eaa2848 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportForms.types @@ -48,64 +48,64 @@ export { ns as classContainer }; === cjs.js === const ns = require("./cls"); ->ns : any ->require("./cls") : any +>ns : typeof import("cls") +>require("./cls") : typeof import("cls") >require : any >"./cls" : "./cls" module.exports = { ns }; ->module.exports = { ns } : { ns: any; } ->module.exports : any ->module : any ->exports : any ->{ ns } : { ns: any; } ->ns : any +>module.exports = { ns } : { ns: typeof import("cls"); } +>module.exports : { ns: typeof import("cls"); } +>module : { export=: { ns: typeof import("cls"); }; } +>exports : { ns: typeof import("cls"); } +>{ ns } : { ns: typeof import("cls"); } +>ns : typeof import("cls") === cjs2.js === const ns = require("./cls"); ->ns : any ->require("./cls") : any +>ns : typeof import("cls") +>require("./cls") : typeof import("cls") >require : any >"./cls" : "./cls" module.exports = ns; ->module.exports = ns : any ->module.exports : any ->module : any ->exports : any ->ns : any +>module.exports = ns : typeof import("cls") +>module.exports : typeof import("cls") +>module : { "cls": typeof import("cls"); } +>exports : typeof import("cls") +>ns : typeof import("cls") === cjs3.js === const ns = require("./cls"); ->ns : any ->require("./cls") : any +>ns : typeof import("cls") +>require("./cls") : typeof import("cls") >require : any >"./cls" : "./cls" module.exports.ns = ns; ->module.exports.ns = ns : any ->module.exports.ns : any ->module.exports : any ->module : any ->exports : any ->ns : any ->ns : any +>module.exports.ns = ns : typeof import("cls") +>module.exports.ns : typeof import("cls") +>module.exports : typeof import("cjs3") +>module : { "cjs3": typeof import("cjs3"); } +>exports : typeof import("cjs3") +>ns : typeof import("cls") +>ns : typeof import("cls") === cjs4.js === const ns = require("./cls"); ->ns : any ->require("./cls") : any +>ns : typeof import("cls") +>require("./cls") : typeof import("cls") >require : any >"./cls" : "./cls" module.exports.names = ns; ->module.exports.names = ns : any ->module.exports.names : any ->module.exports : any ->module : any ->exports : any ->names : any ->ns : any +>module.exports.names = ns : typeof import("cls") +>module.exports.names : typeof import("cls") +>module.exports : typeof import("cjs4") +>module : { "cjs4": typeof import("cjs4"); } +>exports : typeof import("cjs4") +>names : typeof import("cls") +>ns : typeof import("cls") === includeAll.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.errors.txt index 58ee99e94d..8bc742d706 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.errors.txt @@ -1,4 +1,3 @@ -bin.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. globalNs.js(2,1): error TS1315: Global module exports may only appear in declaration files. @@ -9,11 +8,9 @@ globalNs.js(2,1): error TS1315: Global module exports may only appear in declara import ns = require("./cls"); export = ns; // TS Only -==== bin.js (1 errors) ==== +==== bin.js (0 errors) ==== import * as ns from "./cls"; module.exports = ns; // We refuse to bind cjs module exports assignments in the same file we find an import in - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== globalNs.js (1 errors) ==== export * from "./cls"; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.symbols index a737c018ce..34204ffe6a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.symbols @@ -16,6 +16,9 @@ import * as ns from "./cls"; >ns : Symbol(ns, Decl(bin.js, 0, 6)) module.exports = ns; // We refuse to bind cjs module exports assignments in the same file we find an import in +>module.exports : Symbol("cls", Decl(cls.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("cls", Decl(cls.js, 0, 0)) >ns : Symbol(ns, Decl(bin.js, 0, 6)) === globalNs.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.symbols.diff new file mode 100644 index 0000000000..6706cd8bd1 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.symbols.diff @@ -0,0 +1,12 @@ +--- old.jsDeclarationsExportFormsErr.symbols ++++ new.jsDeclarationsExportFormsErr.symbols +@@= skipped -15, +15 lines =@@ + >ns : Symbol(ns, Decl(bin.js, 0, 6)) + + module.exports = ns; // We refuse to bind cjs module exports assignments in the same file we find an import in ++>module.exports : Symbol("cls", Decl(cls.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("cls", Decl(cls.js, 0, 0)) + >ns : Symbol(ns, Decl(bin.js, 0, 6)) + + === globalNs.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.types index f3c32dd9fe..e641d5289b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportFormsErr.types @@ -17,9 +17,9 @@ import * as ns from "./cls"; module.exports = ns; // We refuse to bind cjs module exports assignments in the same file we find an import in >module.exports = ns : typeof import("cls") ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("cls") +>module : { "cls": typeof import("cls"); } +>exports : typeof import("cls") >ns : typeof import("cls") === globalNs.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.errors.txt index 60542c7a08..3c8079cefa 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.errors.txt @@ -1,5 +1,5 @@ -cls.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -cls.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +cls.js(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +cls.js(7,16): error TS2339: Property 'Strings' does not exist on type 'typeof Foo'. ==== cls.js (2 errors) ==== @@ -9,8 +9,8 @@ cls.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install typ }; class Foo {} module.exports = Foo; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.Strings = Strings; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file + ~~~~~~~ +!!! error TS2339: Property 'Strings' does not exist on type 'typeof Foo'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.symbols index 4476947bcf..b68cc7cae5 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.symbols @@ -15,8 +15,14 @@ class Foo {} >Foo : Symbol(Foo, Decl(cls.js, 3, 2)) module.exports = Foo; +>module.exports : Symbol(Foo, Decl(cls.js, 3, 2)) +>module : Symbol(module.exports) +>exports : Symbol(Foo, Decl(cls.js, 3, 2)) >Foo : Symbol(Foo, Decl(cls.js, 3, 2)) module.exports.Strings = Strings; +>module.exports : Symbol(Foo, Decl(cls.js, 3, 2)) +>module : Symbol(module.exports) +>exports : Symbol(Foo, Decl(cls.js, 3, 2)) >Strings : Symbol(Strings, Decl(cls.js, 0, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.symbols.diff index ca8ae23b82..1b0ce33d43 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.symbols.diff @@ -7,6 +7,9 @@ ->module.exports : Symbol(module.exports, Decl(cls.js, 0, 0)) ->module : Symbol(export=, Decl(cls.js, 4, 12)) ->exports : Symbol(export=, Decl(cls.js, 4, 12)) ++>module.exports : Symbol(Foo, Decl(cls.js, 3, 2)) ++>module : Symbol(module.exports) ++>exports : Symbol(Foo, Decl(cls.js, 3, 2)) >Foo : Symbol(Foo, Decl(cls.js, 3, 2)) module.exports.Strings = Strings; @@ -15,5 +18,8 @@ ->module : Symbol(module, Decl(cls.js, 4, 12)) ->exports : Symbol(module.exports, Decl(cls.js, 0, 0)) ->Strings : Symbol(Strings, Decl(cls.js, 5, 21)) ++>module.exports : Symbol(Foo, Decl(cls.js, 3, 2)) ++>module : Symbol(module.exports) ++>exports : Symbol(Foo, Decl(cls.js, 3, 2)) >Strings : Symbol(Strings, Decl(cls.js, 0, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.types index 3f06208e07..2bc348dc16 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportSubAssignments.types @@ -19,17 +19,17 @@ class Foo {} module.exports = Foo; >module.exports = Foo : typeof Foo ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Foo +>module : { Foo: typeof Foo; } +>exports : typeof Foo >Foo : typeof Foo module.exports.Strings = Strings; >module.exports.Strings = Strings : { a: string; b: string; } >module.exports.Strings : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Foo +>module : { Foo: typeof Foo; } +>exports : typeof Foo >Strings : any >Strings : { a: string; b: string; } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.errors.txt deleted file mode 100644 index 5822acfc29..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.errors.txt +++ /dev/null @@ -1,26 +0,0 @@ -utils/index.js(2,16): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -utils/index.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== utils/index.js (2 errors) ==== - // issue arises here on compilation - const errors = require("./errors"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - errors - }; -==== utils/errors.js (0 errors) ==== - class FancyError extends Error { - constructor(status) { - super(`error with status ${status}`); - } - } - - module.exports = { - FancyError - }; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.symbols index 8183065838..6a59046478 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.symbols @@ -4,9 +4,39 @@ // issue arises here on compilation const errors = require("./errors"); >errors : Symbol(errors, Decl(index.js, 1, 5)) +>require : Symbol(require) +>"./errors" : Symbol("utils/errors", Decl(errors.js, 0, 0)) module.exports = { +>module.exports : Symbol(export=, Decl(index.js, 1, 35)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 1, 35)) + errors >errors : Symbol(errors, Decl(index.js, 3, 18)) }; +=== utils/errors.js === +class FancyError extends Error { +>FancyError : Symbol(FancyError, Decl(errors.js, 0, 0)) +>Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) + + constructor(status) { +>status : Symbol(status, Decl(errors.js, 1, 16)) + + super(`error with status ${status}`); +>super : Symbol(ErrorConstructor, Decl(lib.es5.d.ts, --, --)) +>status : Symbol(status, Decl(errors.js, 1, 16)) + } +} + +module.exports = { +>module.exports : Symbol(export=, Decl(errors.js, 4, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(errors.js, 4, 1)) + + FancyError +>FancyError : Symbol(FancyError, Decl(errors.js, 6, 18)) + +}; + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.symbols.diff index a7e5b0f1d5..7720b2a0d0 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.symbols.diff @@ -1,42 +1,32 @@ --- old.jsDeclarationsExportedClassAliases.symbols +++ new.jsDeclarationsExportedClassAliases.symbols -@@= skipped -3, +3 lines =@@ - // issue arises here on compilation +@@= skipped -4, +4 lines =@@ const errors = require("./errors"); >errors : Symbol(errors, Decl(index.js, 1, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./errors" : Symbol(errors, Decl(errors.js, 0, 0)) ++>"./errors" : Symbol("utils/errors", Decl(errors.js, 0, 0)) module.exports = { ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(module, Decl(index.js, 1, 35)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(index.js, 1, 35)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(index.js, 1, 35)) + errors >errors : Symbol(errors, Decl(index.js, 3, 18)) +@@= skipped -26, +26 lines =@@ + } - }; --=== utils/errors.js === --class FancyError extends Error { -->FancyError : Symbol(FancyError, Decl(errors.js, 0, 0)) -->Error : Symbol(Error, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) -- -- constructor(status) { -->status : Symbol(status, Decl(errors.js, 1, 16)) -- -- super(`error with status ${status}`); -->super : Symbol(ErrorConstructor, Decl(lib.es5.d.ts, --, --)) -->status : Symbol(status, Decl(errors.js, 1, 16)) -- } --} -- --module.exports = { + module.exports = { ->module.exports : Symbol(module.exports, Decl(errors.js, 0, 0)) ->module : Symbol(module, Decl(errors.js, 4, 1)) ->exports : Symbol(module.exports, Decl(errors.js, 0, 0)) -- -- FancyError -->FancyError : Symbol(FancyError, Decl(errors.js, 6, 18)) -- --}; -- ++>module.exports : Symbol(export=, Decl(errors.js, 4, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(errors.js, 4, 1)) + + FancyError + >FancyError : Symbol(FancyError, Decl(errors.js, 6, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.types index 8582182a3a..00ad4c4e77 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsExportedClassAliases.types @@ -3,19 +3,47 @@ === utils/index.js === // issue arises here on compilation const errors = require("./errors"); ->errors : any ->require("./errors") : any +>errors : { FancyError: typeof FancyError; } +>require("./errors") : { FancyError: typeof FancyError; } >require : any >"./errors" : "./errors" module.exports = { ->module.exports = { errors} : { errors: any; } ->module.exports : any ->module : any ->exports : any ->{ errors} : { errors: any; } +>module.exports = { errors} : { errors: { FancyError: typeof FancyError; }; } +>module.exports : { errors: { FancyError: typeof FancyError; }; } +>module : { export=: { errors: { FancyError: typeof FancyError; }; }; } +>exports : { errors: { FancyError: typeof FancyError; }; } +>{ errors} : { errors: { FancyError: typeof FancyError; }; } errors ->errors : any +>errors : { FancyError: typeof FancyError; } }; +=== utils/errors.js === +class FancyError extends Error { +>FancyError : FancyError +>Error : Error + + constructor(status) { +>status : any + + super(`error with status ${status}`); +>super(`error with status ${status}`) : void +>super : ErrorConstructor +>`error with status ${status}` : string +>status : any + } +} + +module.exports = { +>module.exports = { FancyError} : { FancyError: typeof FancyError; } +>module.exports : { FancyError: typeof FancyError; } +>module : { export=: { FancyError: typeof FancyError; }; } +>exports : { FancyError: typeof FancyError; } +>{ FancyError} : { FancyError: typeof FancyError; } + + FancyError +>FancyError : typeof FancyError + +}; + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.errors.txt index e7e6110d7a..3331f7cf27 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.errors.txt @@ -1,13 +1,13 @@ -context.js(4,21): error TS2306: File 'timer.js' is not a module. +context.js(4,14): error TS1340: Module './timer' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./timer')'? context.js(5,14): error TS1340: Module './hook' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./hook')'? +context.js(6,31): error TS2694: Namespace 'Hook' has no exported member 'HookHandler'. context.js(34,14): error TS2350: Only a void function can be called with the 'new' keyword. -context.js(48,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +context.js(48,1): error TS2309: An export assignment cannot be used in a module with other exported elements. hook.js(2,20): error TS1340: Module './context' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./context')'? -hook.js(10,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -timer.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +hook.js(10,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== timer.js (1 errors) ==== +==== timer.js (0 errors) ==== /** * @param {number} timeout */ @@ -15,8 +15,6 @@ timer.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install t this.timeout = timeout; } module.exports = Timer; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== hook.js (2 errors) ==== /** * @typedef {(arg: import("./context")) => void} HookHandler @@ -30,20 +28,22 @@ timer.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install t this.handle = handle; } module.exports = Hook; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. -==== context.js (4 errors) ==== +==== context.js (5 errors) ==== /** * Imports * * @typedef {import("./timer")} Timer - ~~~~~~~~~ -!!! error TS2306: File 'timer.js' is not a module. + ~~~~~~~~~~~~~~~~~ +!!! error TS1340: Module './timer' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./timer')'? * @typedef {import("./hook")} Hook ~~~~~~~~~~~~~~~~ !!! error TS1340: Module './hook' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./hook')'? * @typedef {import("./hook").HookHandler} HookHandler + ~~~~~~~~~~~ +!!! error TS2694: Namespace 'Hook' has no exported member 'HookHandler'. */ /** @@ -88,6 +88,6 @@ timer.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install t } } module.exports = Context; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.symbols index f27ae66370..015b3ca595 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.symbols @@ -12,6 +12,9 @@ function Timer(timeout) { >timeout : Symbol(timeout, Decl(timer.js, 3, 15)) } module.exports = Timer; +>module.exports : Symbol(Timer, Decl(timer.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(Timer, Decl(timer.js, 0, 0)) >Timer : Symbol(Timer, Decl(timer.js, 0, 0)) === hook.js === @@ -29,6 +32,9 @@ function Hook(handle) { >handle : Symbol(handle, Decl(hook.js, 6, 14)) } module.exports = Hook; +>module.exports : Symbol(Hook, Decl(hook.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(Hook, Decl(hook.js, 0, 0)) >Hook : Symbol(Hook, Decl(hook.js, 0, 0)) === context.js === @@ -97,5 +103,8 @@ Context.prototype = { } } module.exports = Context; +>module.exports : Symbol(Context, Decl(context.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(Context, Decl(context.js, 0, 0)) >Context : Symbol(Context, Decl(context.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.symbols.diff index 02b65ce5ed..6090b4fc1c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.symbols.diff @@ -13,10 +13,13 @@ ->module.exports : Symbol(module.exports, Decl(timer.js, 0, 0)) ->module : Symbol(export=, Decl(timer.js, 5, 1)) ->exports : Symbol(export=, Decl(timer.js, 5, 1)) ++>module.exports : Symbol(Timer, Decl(timer.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(Timer, Decl(timer.js, 0, 0)) >Timer : Symbol(Timer, Decl(timer.js, 0, 0)) === hook.js === -@@= skipped -23, +17 lines =@@ +@@= skipped -23, +20 lines =@@ >handle : Symbol(handle, Decl(hook.js, 6, 14)) this.handle = handle; @@ -29,10 +32,13 @@ ->module.exports : Symbol(module.exports, Decl(hook.js, 0, 0)) ->module : Symbol(export=, Decl(hook.js, 8, 1)) ->exports : Symbol(export=, Decl(hook.js, 8, 1)) ++>module.exports : Symbol(Hook, Decl(hook.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(Hook, Decl(hook.js, 0, 0)) >Hook : Symbol(Hook, Decl(hook.js, 0, 0)) === context.js === -@@= skipped -44, +38 lines =@@ +@@= skipped -44, +41 lines =@@ */ function Context(input) { @@ -75,5 +81,8 @@ ->module : Symbol(export=, Decl(context.js, 46, 1)) ->exports : Symbol(export=, Decl(context.js, 46, 1)) ->Context : Symbol(Context, Decl(context.js, 0, 0), Decl(context.js, 36, 1)) ++>module.exports : Symbol(Context, Decl(context.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(Context, Decl(context.js, 0, 0)) +>Context : Symbol(Context, Decl(context.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.types index 3fc5508b7f..7433c03608 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.types @@ -17,9 +17,9 @@ function Timer(timeout) { } module.exports = Timer; >module.exports = Timer : (timeout: number) => void ->module.exports : any ->module : any ->exports : any +>module.exports : (timeout: number) => void +>module : { Timer: (timeout: number) => void; } +>exports : (timeout: number) => void >Timer : (timeout: number) => void === hook.js === @@ -42,9 +42,9 @@ function Hook(handle) { } module.exports = Hook; >module.exports = Hook : (handle: HookHandler) => void ->module.exports : any ->module : any ->exports : any +>module.exports : (handle: HookHandler) => void +>module : { Hook: (handle: HookHandler) => void; } +>exports : (handle: HookHandler) => void >Hook : (handle: HookHandler) => void === context.js === @@ -80,7 +80,7 @@ module.exports = Hook; */ function Context(input) { ->Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } +>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } >input : Input if (!(this instanceof Context)) { @@ -88,11 +88,11 @@ function Context(input) { >(this instanceof Context) : boolean >this instanceof Context : boolean >this : any ->Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } +>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } return new Context(input) >new Context(input) : any ->Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } +>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } >input : Input } this.state = this.construct(input); @@ -107,11 +107,11 @@ function Context(input) { >input : Input } Context.prototype = { ->Context.prototype = { /** * @param {Input} input * @param {HookHandler=} handle * @returns {State} */ construct(input, handle = () => void 0) { return input; }} : { construct: (input: Input, handle?: HookHandler) => State; } ->Context.prototype : { construct: (input: Input, handle?: HookHandler) => State; } ->Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } ->prototype : { construct: (input: Input, handle?: HookHandler) => State; } ->{ /** * @param {Input} input * @param {HookHandler=} handle * @returns {State} */ construct(input, handle = () => void 0) { return input; }} : { construct: (input: Input, handle?: HookHandler) => State; } +>Context.prototype = { /** * @param {Input} input * @param {HookHandler=} handle * @returns {State} */ construct(input, handle = () => void 0) { return input; }} : { construct: (input: Input, handle?: any) => State; } +>Context.prototype : { construct: (input: Input, handle?: any) => State; } +>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } +>prototype : { construct: (input: Input, handle?: any) => State; } +>{ /** * @param {Input} input * @param {HookHandler=} handle * @returns {State} */ construct(input, handle = () => void 0) { return input; }} : { construct: (input: Input, handle?: any) => State; } /** * @param {Input} input @@ -119,9 +119,9 @@ Context.prototype = { * @returns {State} */ construct(input, handle = () => void 0) { ->construct : (input: Input, handle?: HookHandler) => State +>construct : (input: Input, handle?: any) => State >input : Input ->handle : HookHandler +>handle : any >() => void 0 : () => any >void 0 : undefined >0 : 0 @@ -131,9 +131,9 @@ Context.prototype = { } } module.exports = Context; ->module.exports = Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } ->module.exports : any ->module : any ->exports : any ->Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } +>module.exports = Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } +>module.exports : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } +>module : { Context: { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; }; } +>exports : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } +>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.errors.txt deleted file mode 100644 index 24c938c25a..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.errors.txt +++ /dev/null @@ -1,19 +0,0 @@ -source.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== source.js (1 errors) ==== - module.exports = MyClass; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - function MyClass() {} - MyClass.staticMethod = function() {} - MyClass.prototype.method = function() {} - MyClass.staticProperty = 123; - - /** - * Callback to be invoked when test execution is complete. - * - * @callback DoneCB - * @param {number} failures - Number of failures that occurred. - */ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.symbols index f8150e5383..c192b9ad18 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.symbols @@ -2,6 +2,9 @@ === source.js === module.exports = MyClass; +>module.exports : Symbol(MyClass, Decl(source.js, 0, 25)) +>module : Symbol(module.exports) +>exports : Symbol(MyClass, Decl(source.js, 0, 25)) >MyClass : Symbol(MyClass, Decl(source.js, 0, 25)) function MyClass() {} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.symbols.diff index f4f40c6613..649df7c51c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.symbols.diff @@ -8,6 +8,9 @@ ->module : Symbol(export=, Decl(source.js, 0, 0)) ->exports : Symbol(export=, Decl(source.js, 0, 0)) ->MyClass : Symbol(MyClass, Decl(source.js, 0, 25), Decl(source.js, 2, 21), Decl(source.js, 4, 40)) ++>module.exports : Symbol(MyClass, Decl(source.js, 0, 25)) ++>module : Symbol(module.exports) ++>exports : Symbol(MyClass, Decl(source.js, 0, 25)) +>MyClass : Symbol(MyClass, Decl(source.js, 0, 25)) function MyClass() {} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.types index 9f03d5e3b1..63d7a95b46 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionPrototypeStatic.types @@ -3,9 +3,9 @@ === source.js === module.exports = MyClass; >module.exports = MyClass : { (): void; staticMethod: () => void; staticProperty: number; } ->module.exports : any ->module : any ->exports : any +>module.exports : { (): void; staticMethod: () => void; staticProperty: number; } +>module : { MyClass: { (): void; staticMethod: () => void; staticProperty: number; }; } +>exports : { (): void; staticMethod: () => void; staticProperty: number; } >MyClass : { (): void; staticMethod: () => void; staticProperty: number; } function MyClass() {} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.errors.txt deleted file mode 100644 index 4a6143f5e5..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== index.js (1 errors) ==== - function foo() {} - - foo.foo = foo; - foo.default = foo; - module.exports = foo; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.symbols index 5593c41523..5d9024d83e 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.symbols @@ -17,5 +17,8 @@ foo.default = foo; >foo : Symbol(foo, Decl(index.js, 0, 0)) module.exports = foo; +>module.exports : Symbol(foo, Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(foo, Decl(index.js, 0, 0)) >foo : Symbol(foo, Decl(index.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.symbols.diff index f0c7590898..1447d1d8b4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.symbols.diff @@ -32,5 +32,8 @@ ->module : Symbol(export=, Decl(index.js, 3, 18)) ->exports : Symbol(export=, Decl(index.js, 3, 18)) ->foo : Symbol(foo, Decl(index.js, 0, 0), Decl(index.js, 0, 17), Decl(index.js, 2, 14)) ++>module.exports : Symbol(foo, Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(foo, Decl(index.js, 0, 0)) +>foo : Symbol(foo, Decl(index.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.types index ab77f9468d..3a3a17dfee 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.types @@ -20,8 +20,8 @@ foo.default = foo; module.exports = foo; >module.exports = foo : { (): void; foo: ???; default: ???; } ->module.exports : any ->module : any ->exports : any +>module.exports : { (): void; foo: ???; default: ???; } +>module : { foo: { (): void; foo: ???; default: ???; }; } +>exports : { (): void; foo: ???; default: ???; } >foo : { (): void; foo: ???; default: ???; } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.errors.txt index 263140ef38..a435838ea1 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.errors.txt @@ -1,43 +1,15 @@ -index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(14,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(22,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(28,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(31,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(31,25): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. index.js(35,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(41,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. index.js(45,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(51,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(53,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(54,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(54,21): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(57,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(57,21): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(58,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== index.js (20 errors) ==== +==== index.js (2 errors) ==== module.exports.a = function a() {} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports.b = function b() {} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports.b.cat = "cat"; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports.c = function c() {} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports.c.Cls = class {} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** * @param {number} a @@ -45,8 +17,6 @@ index.js(58,1): error TS2580: Cannot find name 'module'. Do you need to install * @return {string} */ module.exports.d = function d(a, b) { return /** @type {*} */(null); } - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** * @template T,U @@ -55,23 +25,15 @@ index.js(58,1): error TS2580: Cannot find name 'module'. Do you need to install * @return {T & U} */ module.exports.e = function e(a, b) { return /** @type {*} */(null); } - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** * @template T * @param {T} a */ module.exports.f = function f(a) { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. return a; } module.exports.f.self = module.exports.f; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** * @param {{x: string}} a @@ -84,8 +46,6 @@ index.js(58,1): error TS2580: Cannot find name 'module'. Do you need to install } module.exports.g = g; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** * @param {{x: string}} a @@ -98,25 +58,11 @@ index.js(58,1): error TS2580: Cannot find name 'module'. Do you need to install } module.exports.h = hh; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports.i = function i() {} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports.ii = module.exports.i; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. // note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings module.exports.jj = module.exports.j; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports.j = function j() {} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.symbols index 2d71c847d6..d198a27aee 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.symbols @@ -2,17 +2,42 @@ === index.js === module.exports.a = function a() {} +>module.exports.a : Symbol(a, Decl(index.js, 0, 0)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>a : Symbol(a, Decl(index.js, 0, 0)) >a : Symbol(a, Decl(index.js, 0, 18)) module.exports.b = function b() {} +>module.exports.b : Symbol(b, Decl(index.js, 0, 34)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>b : Symbol(b, Decl(index.js, 0, 34)) >b : Symbol(b, Decl(index.js, 2, 18)) module.exports.b.cat = "cat"; +>module.exports.b : Symbol(b, Decl(index.js, 0, 34)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>b : Symbol(b, Decl(index.js, 0, 34)) module.exports.c = function c() {} +>module.exports.c : Symbol(c, Decl(index.js, 3, 29)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>c : Symbol(c, Decl(index.js, 3, 29)) >c : Symbol(c, Decl(index.js, 5, 18)) module.exports.c.Cls = class {} +>module.exports.c : Symbol(c, Decl(index.js, 3, 29)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>c : Symbol(c, Decl(index.js, 3, 29)) /** * @param {number} a @@ -20,6 +45,11 @@ module.exports.c.Cls = class {} * @return {string} */ module.exports.d = function d(a, b) { return /** @type {*} */(null); } +>module.exports.d : Symbol(d, Decl(index.js, 6, 31)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>d : Symbol(d, Decl(index.js, 6, 31)) >d : Symbol(d, Decl(index.js, 13, 18)) >a : Symbol(a, Decl(index.js, 13, 30)) >b : Symbol(b, Decl(index.js, 13, 32)) @@ -31,6 +61,11 @@ module.exports.d = function d(a, b) { return /** @type {*} */(null); } * @return {T & U} */ module.exports.e = function e(a, b) { return /** @type {*} */(null); } +>module.exports.e : Symbol(e, Decl(index.js, 13, 70)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>e : Symbol(e, Decl(index.js, 13, 70)) >e : Symbol(e, Decl(index.js, 21, 18)) >a : Symbol(a, Decl(index.js, 21, 30)) >b : Symbol(b, Decl(index.js, 21, 32)) @@ -40,6 +75,11 @@ module.exports.e = function e(a, b) { return /** @type {*} */(null); } * @param {T} a */ module.exports.f = function f(a) { +>module.exports.f : Symbol(f, Decl(index.js, 21, 70)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>f : Symbol(f, Decl(index.js, 21, 70)) >f : Symbol(f, Decl(index.js, 27, 18)) >a : Symbol(a, Decl(index.js, 27, 30)) @@ -47,6 +87,16 @@ module.exports.f = function f(a) { >a : Symbol(a, Decl(index.js, 27, 30)) } module.exports.f.self = module.exports.f; +>module.exports.f : Symbol(f, Decl(index.js, 21, 70)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>f : Symbol(f, Decl(index.js, 21, 70)) +>module.exports.f : Symbol(f, Decl(index.js, 21, 70)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>f : Symbol(f, Decl(index.js, 21, 70)) /** * @param {{x: string}} a @@ -67,6 +117,11 @@ function g(a, b) { } module.exports.g = g; +>module.exports.g : Symbol(g, Decl(index.js, 38, 1)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>g : Symbol(g, Decl(index.js, 38, 1)) >g : Symbol(g, Decl(index.js, 30, 41)) /** @@ -88,15 +143,51 @@ function hh(a, b) { } module.exports.h = hh; +>module.exports.h : Symbol(h, Decl(index.js, 48, 1)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>h : Symbol(h, Decl(index.js, 48, 1)) >hh : Symbol(hh, Decl(index.js, 40, 21)) module.exports.i = function i() {} +>module.exports.i : Symbol(i, Decl(index.js, 50, 22)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>i : Symbol(i, Decl(index.js, 50, 22)) >i : Symbol(i, Decl(index.js, 52, 18)) module.exports.ii = module.exports.i; +>module.exports.ii : Symbol(ii, Decl(index.js, 52, 34)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>ii : Symbol(ii, Decl(index.js, 52, 34)) +>module.exports.i : Symbol(i, Decl(index.js, 50, 22)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>i : Symbol(i, Decl(index.js, 50, 22)) // note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings module.exports.jj = module.exports.j; +>module.exports.jj : Symbol(jj, Decl(index.js, 53, 37)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>jj : Symbol(jj, Decl(index.js, 53, 37)) +>module.exports.j : Symbol(j, Decl(index.js, 56, 37)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>j : Symbol(j, Decl(index.js, 56, 37)) + module.exports.j = function j() {} +>module.exports.j : Symbol(j, Decl(index.js, 56, 37)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>j : Symbol(j, Decl(index.js, 56, 37)) >j : Symbol(j, Decl(index.js, 57, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.symbols.diff index 495b153c83..d1df60c7c4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.symbols.diff @@ -1,14 +1,16 @@ --- old.jsDeclarationsFunctionsCjs.symbols +++ new.jsDeclarationsFunctionsCjs.symbols -@@= skipped -1, +1 lines =@@ - +@@= skipped -2, +2 lines =@@ === index.js === module.exports.a = function a() {} -->module.exports.a : Symbol(a, Decl(index.js, 0, 0)) + >module.exports.a : Symbol(a, Decl(index.js, 0, 0)) ->module.exports : Symbol(a, Decl(index.js, 0, 0)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->a : Symbol(a, Decl(index.js, 0, 0)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >a : Symbol(a, Decl(index.js, 0, 0)) >a : Symbol(a, Decl(index.js, 0, 18)) module.exports.b = function b() {} @@ -17,6 +19,11 @@ ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->b : Symbol(b, Decl(index.js, 0, 34), Decl(index.js, 3, 15)) ++>module.exports.b : Symbol(b, Decl(index.js, 0, 34)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) ++>b : Symbol(b, Decl(index.js, 0, 34)) >b : Symbol(b, Decl(index.js, 2, 18)) module.exports.b.cat = "cat"; @@ -27,6 +34,11 @@ ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->b : Symbol(b, Decl(index.js, 0, 34), Decl(index.js, 3, 15)) ->cat : Symbol(b.cat, Decl(index.js, 2, 34)) ++>module.exports.b : Symbol(b, Decl(index.js, 0, 34)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) ++>b : Symbol(b, Decl(index.js, 0, 34)) module.exports.c = function c() {} ->module.exports.c : Symbol(c, Decl(index.js, 3, 29), Decl(index.js, 6, 15)) @@ -34,6 +46,11 @@ ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->c : Symbol(c, Decl(index.js, 3, 29), Decl(index.js, 6, 15)) ++>module.exports.c : Symbol(c, Decl(index.js, 3, 29)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) ++>c : Symbol(c, Decl(index.js, 3, 29)) >c : Symbol(c, Decl(index.js, 5, 18)) module.exports.c.Cls = class {} @@ -44,34 +61,41 @@ ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->c : Symbol(c, Decl(index.js, 3, 29), Decl(index.js, 6, 15)) ->Cls : Symbol(c.Cls, Decl(index.js, 5, 34)) ++>module.exports.c : Symbol(c, Decl(index.js, 3, 29)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) ++>c : Symbol(c, Decl(index.js, 3, 29)) /** * @param {number} a -@@= skipped -47, +18 lines =@@ - * @return {string} +@@= skipped -47, +43 lines =@@ */ module.exports.d = function d(a, b) { return /** @type {*} */(null); } -->module.exports.d : Symbol(d, Decl(index.js, 6, 31)) + >module.exports.d : Symbol(d, Decl(index.js, 6, 31)) ->module.exports : Symbol(d, Decl(index.js, 6, 31)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->d : Symbol(d, Decl(index.js, 6, 31)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >d : Symbol(d, Decl(index.js, 6, 31)) >d : Symbol(d, Decl(index.js, 13, 18)) >a : Symbol(a, Decl(index.js, 13, 30)) - >b : Symbol(b, Decl(index.js, 13, 32)) -@@= skipped -16, +11 lines =@@ - * @return {T & U} +@@= skipped -16, +16 lines =@@ */ module.exports.e = function e(a, b) { return /** @type {*} */(null); } -->module.exports.e : Symbol(e, Decl(index.js, 13, 70)) + >module.exports.e : Symbol(e, Decl(index.js, 13, 70)) ->module.exports : Symbol(e, Decl(index.js, 13, 70)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->e : Symbol(e, Decl(index.js, 13, 70)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >e : Symbol(e, Decl(index.js, 13, 70)) >e : Symbol(e, Decl(index.js, 21, 18)) >a : Symbol(a, Decl(index.js, 21, 30)) - >b : Symbol(b, Decl(index.js, 21, 32)) -@@= skipped -14, +9 lines =@@ +@@= skipped -13, +13 lines =@@ * @param {T} a */ module.exports.f = function f(a) { @@ -80,10 +104,15 @@ ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->f : Symbol(f, Decl(index.js, 21, 70), Decl(index.js, 30, 15)) ++>module.exports.f : Symbol(f, Decl(index.js, 21, 70)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) ++>f : Symbol(f, Decl(index.js, 21, 70)) >f : Symbol(f, Decl(index.js, 27, 18)) >a : Symbol(a, Decl(index.js, 27, 30)) -@@= skipped -12, +7 lines =@@ +@@= skipped -12, +12 lines =@@ >a : Symbol(a, Decl(index.js, 27, 30)) } module.exports.f.self = module.exports.f; @@ -99,70 +128,101 @@ ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->f : Symbol(f, Decl(index.js, 21, 70), Decl(index.js, 30, 15)) ++>module.exports.f : Symbol(f, Decl(index.js, 21, 70)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) ++>f : Symbol(f, Decl(index.js, 21, 70)) ++>module.exports.f : Symbol(f, Decl(index.js, 21, 70)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) ++>f : Symbol(f, Decl(index.js, 21, 70)) /** * @param {{x: string}} a -@@= skipped -32, +20 lines =@@ - } +@@= skipped -33, +31 lines =@@ module.exports.g = g; -->module.exports.g : Symbol(g, Decl(index.js, 38, 1)) + >module.exports.g : Symbol(g, Decl(index.js, 38, 1)) ->module.exports : Symbol(g, Decl(index.js, 38, 1)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->g : Symbol(g, Decl(index.js, 38, 1)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >g : Symbol(g, Decl(index.js, 38, 1)) >g : Symbol(g, Decl(index.js, 30, 41)) - /** -@@= skipped -26, +21 lines =@@ - } +@@= skipped -26, +26 lines =@@ module.exports.h = hh; -->module.exports.h : Symbol(h, Decl(index.js, 48, 1)) + >module.exports.h : Symbol(h, Decl(index.js, 48, 1)) ->module.exports : Symbol(h, Decl(index.js, 48, 1)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->h : Symbol(h, Decl(index.js, 48, 1)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >h : Symbol(h, Decl(index.js, 48, 1)) >hh : Symbol(hh, Decl(index.js, 40, 21)) module.exports.i = function i() {} -->module.exports.i : Symbol(i, Decl(index.js, 50, 22)) + >module.exports.i : Symbol(i, Decl(index.js, 50, 22)) ->module.exports : Symbol(i, Decl(index.js, 50, 22)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->i : Symbol(i, Decl(index.js, 50, 22)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >i : Symbol(i, Decl(index.js, 50, 22)) >i : Symbol(i, Decl(index.js, 52, 18)) module.exports.ii = module.exports.i; -->module.exports.ii : Symbol(ii, Decl(index.js, 52, 34)) + >module.exports.ii : Symbol(ii, Decl(index.js, 52, 34)) ->module.exports : Symbol(ii, Decl(index.js, 52, 34)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->ii : Symbol(ii, Decl(index.js, 52, 34)) -->module.exports.i : Symbol(i, Decl(index.js, 50, 22)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >ii : Symbol(ii, Decl(index.js, 52, 34)) + >module.exports.i : Symbol(i, Decl(index.js, 50, 22)) ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->i : Symbol(i, Decl(index.js, 50, 22)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >i : Symbol(i, Decl(index.js, 50, 22)) // note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings module.exports.jj = module.exports.j; -->module.exports.jj : Symbol(jj, Decl(index.js, 53, 37)) + >module.exports.jj : Symbol(jj, Decl(index.js, 53, 37)) ->module.exports : Symbol(jj, Decl(index.js, 53, 37)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->jj : Symbol(jj, Decl(index.js, 53, 37)) -->module.exports.j : Symbol(j, Decl(index.js, 56, 37)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >jj : Symbol(jj, Decl(index.js, 53, 37)) + >module.exports.j : Symbol(j, Decl(index.js, 56, 37)) ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->j : Symbol(j, Decl(index.js, 56, 37)) -- ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >j : Symbol(j, Decl(index.js, 56, 37)) + module.exports.j = function j() {} -->module.exports.j : Symbol(j, Decl(index.js, 56, 37)) + >module.exports.j : Symbol(j, Decl(index.js, 56, 37)) ->module.exports : Symbol(j, Decl(index.js, 56, 37)) ->module : Symbol(module, Decl(index.js, 0, 0)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->j : Symbol(j, Decl(index.js, 56, 37)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) + >j : Symbol(j, Decl(index.js, 56, 37)) >j : Symbol(j, Decl(index.js, 57, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.types index 12fca3dd8f..1bdd4f4235 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsFunctionsCjs.types @@ -4,9 +4,9 @@ module.exports.a = function a() {} >module.exports.a = function a() {} : () => void >module.exports.a : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >a : any >function a() {} : () => void >a : () => void @@ -14,9 +14,9 @@ module.exports.a = function a() {} module.exports.b = function b() {} >module.exports.b = function b() {} : () => void >module.exports.b : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >b : any >function b() {} : () => void >b : () => void @@ -25,9 +25,9 @@ module.exports.b.cat = "cat"; >module.exports.b.cat = "cat" : "cat" >module.exports.b.cat : any >module.exports.b : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >b : any >cat : any >"cat" : "cat" @@ -35,9 +35,9 @@ module.exports.b.cat = "cat"; module.exports.c = function c() {} >module.exports.c = function c() {} : () => void >module.exports.c : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >c : any >function c() {} : () => void >c : () => void @@ -46,9 +46,9 @@ module.exports.c.Cls = class {} >module.exports.c.Cls = class {} : typeof Cls >module.exports.c.Cls : any >module.exports.c : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >c : any >Cls : any >class {} : typeof Cls @@ -61,9 +61,9 @@ module.exports.c.Cls = class {} module.exports.d = function d(a, b) { return /** @type {*} */(null); } >module.exports.d = function d(a, b) { return /** @type {*} */(null); } : (a: any, b: any) => any >module.exports.d : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >d : any >function d(a, b) { return /** @type {*} */(null); } : (a: any, b: any) => any >d : (a: any, b: any) => any @@ -81,9 +81,9 @@ module.exports.d = function d(a, b) { return /** @type {*} */(null); } module.exports.e = function e(a, b) { return /** @type {*} */(null); } >module.exports.e = function e(a, b) { return /** @type {*} */(null); } : (a: any, b: any) => any >module.exports.e : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >e : any >function e(a, b) { return /** @type {*} */(null); } : (a: any, b: any) => any >e : (a: any, b: any) => any @@ -99,9 +99,9 @@ module.exports.e = function e(a, b) { return /** @type {*} */(null); } module.exports.f = function f(a) { >module.exports.f = function f(a) { return a;} : (a: any) => any >module.exports.f : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >f : any >function f(a) { return a;} : (a: any) => any >f : (a: any) => any @@ -114,15 +114,15 @@ module.exports.f.self = module.exports.f; >module.exports.f.self = module.exports.f : any >module.exports.f.self : any >module.exports.f : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >f : any >self : any >module.exports.f : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >f : any /** @@ -147,11 +147,11 @@ function g(a, b) { module.exports.g = g; >module.exports.g = g : (a: { x: string; }, b: { y: any; }) => any ->module.exports.g : any ->module.exports : any ->module : any ->exports : any ->g : any +>module.exports.g : (a: { x: string; }, b: { y: any; }) => any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") +>g : (a: { x: string; }, b: { y: any; }) => any >g : (a: { x: string; }, b: { y: any; }) => any /** @@ -176,19 +176,19 @@ function hh(a, b) { module.exports.h = hh; >module.exports.h = hh : (a: { x: string; }, b: { y: any; }) => any ->module.exports.h : any ->module.exports : any ->module : any ->exports : any ->h : any +>module.exports.h : (a: { x: string; }, b: { y: any; }) => any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") +>h : (a: { x: string; }, b: { y: any; }) => any >hh : (a: { x: string; }, b: { y: any; }) => any module.exports.i = function i() {} >module.exports.i = function i() {} : () => void >module.exports.i : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >i : any >function i() {} : () => void >i : () => void @@ -196,36 +196,36 @@ module.exports.i = function i() {} module.exports.ii = module.exports.i; >module.exports.ii = module.exports.i : any >module.exports.ii : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >ii : any >module.exports.i : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >i : any // note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings module.exports.jj = module.exports.j; >module.exports.jj = module.exports.j : any >module.exports.jj : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >jj : any >module.exports.j : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >j : any module.exports.j = function j() {} >module.exports.j = function j() {} : () => void >module.exports.j : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >j : any >function j() {} : () => void >j : () => void diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.errors.txt index f3c038d0f7..b12f06b6fa 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.errors.txt @@ -1,14 +1,16 @@ -file2.js(1,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +file.js(4,11): error TS2315: Type 'Object' is not generic. +file.js(10,51): error TS2300: Duplicate identifier 'myTypes'. +file.js(13,13): error TS2300: Duplicate identifier 'myTypes'. +file.js(18,15): error TS2702: 'myTypes' only refers to a type, but is being used as a namespace here. +file.js(18,39): error TS2300: Duplicate identifier 'myTypes'. file2.js(6,11): error TS2315: Type 'Object' is not generic. -file2.js(12,23): error TS2503: Cannot find namespace 'myTypes'. +file2.js(12,23): error TS2702: 'myTypes' only refers to a type, but is being used as a namespace here. file2.js(17,12): error TS2702: 'testFnTypes' only refers to a type, but is being used as a namespace here. -file2.js(28,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +file2.js(28,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== file2.js (5 errors) ==== +==== file2.js (4 errors) ==== const {myTypes} = require('./file.js'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** * @namespace testFnTypes @@ -23,7 +25,7 @@ file2.js(28,1): error TS2580: Cannot find name 'module'. Do you need to install /** @typedef {boolean|myTypes.typeC} testFnTypes.input */ ~~~~~~~ -!!! error TS2503: Cannot find namespace 'myTypes'. +!!! error TS2702: 'myTypes' only refers to a type, but is being used as a namespace here. /** * @function testFn @@ -42,26 +44,36 @@ file2.js(28,1): error TS2580: Cannot find name 'module'. Do you need to install } module.exports = {testFn, testFnTypes}; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== file.js (0 errors) ==== + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. +==== file.js (5 errors) ==== /** * @namespace myTypes * @global * @type {Object} + ~~~~~~~~~~~~~~~~ +!!! error TS2315: Type 'Object' is not generic. */ const myTypes = { // SOME PROPS HERE }; /** @typedef {string|RegExp|Array} myTypes.typeA */ + ~~~~~~~ +!!! error TS2300: Duplicate identifier 'myTypes'. /** * @typedef myTypes.typeB + ~~~~~~~ +!!! error TS2300: Duplicate identifier 'myTypes'. * @property {myTypes.typeA} prop1 - Prop 1. * @property {string} prop2 - Prop 2. */ /** @typedef {myTypes.typeB|Function} myTypes.typeC */ + ~~~~~~~ +!!! error TS2702: 'myTypes' only refers to a type, but is being used as a namespace here. + ~~~~~~~ +!!! error TS2300: Duplicate identifier 'myTypes'. exports.myTypes = myTypes; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.symbols index 2ee8b34843..3882b91669 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.symbols @@ -3,6 +3,8 @@ === file2.js === const {myTypes} = require('./file.js'); >myTypes : Symbol(myTypes, Decl(file2.js, 0, 7)) +>require : Symbol(require) +>'./file.js' : Symbol("file", Decl(file.js, 0, 0)) /** * @namespace testFnTypes @@ -39,6 +41,37 @@ function testFn(input) { } module.exports = {testFn, testFnTypes}; +>module.exports : Symbol(export=, Decl(file2.js, 25, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(file2.js, 25, 1)) >testFn : Symbol(testFn, Decl(file2.js, 27, 18)) >testFnTypes : Symbol(testFnTypes, Decl(file2.js, 27, 25)) +=== file.js === +/** + * @namespace myTypes + * @global + * @type {Object} + */ +const myTypes = { +>myTypes : Symbol(myTypes, Decl(file.js, 5, 5), Decl(file.js, 9, 4), Decl(file.js, 12, 3), Decl(file.js, 17, 4)) + + // SOME PROPS HERE +}; + +/** @typedef {string|RegExp|Array} myTypes.typeA */ + +/** + * @typedef myTypes.typeB + * @property {myTypes.typeA} prop1 - Prop 1. + * @property {string} prop2 - Prop 2. + */ + +/** @typedef {myTypes.typeB|Function} myTypes.typeC */ + +exports.myTypes = myTypes; +>exports.myTypes : Symbol(myTypes, Decl(file.js, 9, 4), Decl(file.js, 7, 2)) +>exports : Symbol("file", Decl(file.js, 0, 0)) +>myTypes : Symbol(myTypes, Decl(file.js, 9, 4), Decl(file.js, 7, 2)) +>myTypes : Symbol(myTypes, Decl(file.js, 5, 5), Decl(file.js, 9, 4), Decl(file.js, 12, 3), Decl(file.js, 17, 4)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.symbols.diff index 2dac9e6ef4..8f346643c9 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.symbols.diff @@ -1,15 +1,6 @@ --- old.jsDeclarationsImportAliasExposedWithinNamespaceCjs.symbols +++ new.jsDeclarationsImportAliasExposedWithinNamespaceCjs.symbols -@@= skipped -2, +2 lines =@@ - === file2.js === - const {myTypes} = require('./file.js'); - >myTypes : Symbol(myTypes, Decl(file2.js, 0, 7)) -->require : Symbol(require) -->'./file.js' : Symbol("file", Decl(file.js, 0, 0)) - - /** - * @namespace testFnTypes -@@= skipped -9, +7 lines =@@ +@@= skipped -11, +11 lines =@@ * @type {Object} */ const testFnTypes = { @@ -25,34 +16,31 @@ ->module.exports : Symbol(module.exports, Decl(file2.js, 0, 0)) ->module : Symbol(module, Decl(file2.js, 25, 1)) ->exports : Symbol(module.exports, Decl(file2.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(file2.js, 25, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(file2.js, 25, 1)) >testFn : Symbol(testFn, Decl(file2.js, 27, 18)) >testFnTypes : Symbol(testFnTypes, Decl(file2.js, 27, 25)) --=== file.js === --/** -- * @namespace myTypes -- * @global -- * @type {Object} -- */ --const myTypes = { +@@= skipped -13, +13 lines =@@ + * @type {Object} + */ + const myTypes = { ->myTypes : Symbol(myTypes, Decl(file.js, 5, 5), Decl(file.js, 9, 50), Decl(file.js, 12, 12), Decl(file.js, 17, 38)) -- -- // SOME PROPS HERE --}; -- --/** @typedef {string|RegExp|Array} myTypes.typeA */ -- --/** -- * @typedef myTypes.typeB -- * @property {myTypes.typeA} prop1 - Prop 1. -- * @property {string} prop2 - Prop 2. -- */ -- --/** @typedef {myTypes.typeB|Function} myTypes.typeC */ -- --exports.myTypes = myTypes; ++>myTypes : Symbol(myTypes, Decl(file.js, 5, 5), Decl(file.js, 9, 4), Decl(file.js, 12, 3), Decl(file.js, 17, 4)) + + // SOME PROPS HERE + }; +@@= skipped -16, +16 lines =@@ + /** @typedef {myTypes.typeB|Function} myTypes.typeC */ + + exports.myTypes = myTypes; ->exports.myTypes : Symbol(myTypes, Decl(file.js, 7, 2)) ->exports : Symbol(myTypes, Decl(file.js, 7, 2)) ->myTypes : Symbol(myTypes, Decl(file.js, 7, 2)) ->myTypes : Symbol(myTypes, Decl(file.js, 5, 5), Decl(file.js, 9, 50), Decl(file.js, 12, 12), Decl(file.js, 17, 38)) -- ++>exports.myTypes : Symbol(myTypes, Decl(file.js, 9, 4), Decl(file.js, 7, 2)) ++>exports : Symbol("file", Decl(file.js, 0, 0)) ++>myTypes : Symbol(myTypes, Decl(file.js, 9, 4), Decl(file.js, 7, 2)) ++>myTypes : Symbol(myTypes, Decl(file.js, 5, 5), Decl(file.js, 9, 4), Decl(file.js, 12, 3), Decl(file.js, 17, 4)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types index f3b4df0bf2..92df7ca3bd 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types @@ -3,7 +3,7 @@ === file2.js === const {myTypes} = require('./file.js'); >myTypes : any ->require('./file.js') : any +>require('./file.js') : typeof import("file") >require : any >'./file.js' : "./file.js" @@ -49,10 +49,40 @@ function testFn(input) { module.exports = {testFn, testFnTypes}; >module.exports = {testFn, testFnTypes} : { testFn: (input: input) => number; testFnTypes: any; } ->module.exports : any ->module : any ->exports : any +>module.exports : { testFn: (input: input) => number; testFnTypes: any; } +>module : { export=: { testFn: (input: input) => number; testFnTypes: any; }; } +>exports : { testFn: (input: input) => number; testFnTypes: any; } >{testFn, testFnTypes} : { testFn: (input: input) => number; testFnTypes: any; } >testFn : (input: input) => number >testFnTypes : any +=== file.js === +/** + * @namespace myTypes + * @global + * @type {Object} + */ +const myTypes = { +>myTypes : any +>{ // SOME PROPS HERE} : {} + + // SOME PROPS HERE +}; + +/** @typedef {string|RegExp|Array} myTypes.typeA */ + +/** + * @typedef myTypes.typeB + * @property {myTypes.typeA} prop1 - Prop 1. + * @property {string} prop2 - Prop 2. + */ + +/** @typedef {myTypes.typeB|Function} myTypes.typeC */ + +exports.myTypes = myTypes; +>exports.myTypes = myTypes : any +>exports.myTypes : any +>exports : typeof import("file") +>myTypes : any +>myTypes : any + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.errors.txt index 46cd155399..2368c88fd4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.errors.txt @@ -1,5 +1,4 @@ -folder/mod1.js(8,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +folder/mod1.js(8,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ==== folder/mod1.js (1 errors) ==== @@ -11,11 +10,9 @@ index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install t */ const x = {x: 12}; module.exports = x; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== index.js (1 errors) ==== + ~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. +==== index.js (0 errors) ==== /** @type {(typeof import("./folder/mod1"))[]} */ const items = [{x: 12}]; - module.exports = items; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file + module.exports = items; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.symbols index da7ddca71e..8368b6c6a0 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.symbols @@ -12,6 +12,9 @@ const x = {x: 12}; >x : Symbol(x, Decl(mod1.js, 6, 11)) module.exports = x; +>module.exports : Symbol(x, Decl(mod1.js, 6, 5)) +>module : Symbol(module.exports) +>exports : Symbol(x, Decl(mod1.js, 6, 5)) >x : Symbol(x, Decl(mod1.js, 6, 5)) === index.js === @@ -21,5 +24,8 @@ const items = [{x: 12}]; >x : Symbol(x, Decl(index.js, 1, 16)) module.exports = items; +>module.exports : Symbol(items, Decl(index.js, 1, 5)) +>module : Symbol(module.exports) +>exports : Symbol(items, Decl(index.js, 1, 5)) >items : Symbol(items, Decl(index.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.symbols.diff index 4b85a14daa..0ece6b780b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.symbols.diff @@ -7,15 +7,21 @@ ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 6, 18)) ->exports : Symbol(export=, Decl(mod1.js, 6, 18)) ++>module.exports : Symbol(x, Decl(mod1.js, 6, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(x, Decl(mod1.js, 6, 5)) >x : Symbol(x, Decl(mod1.js, 6, 5)) === index.js === -@@= skipped -12, +9 lines =@@ +@@= skipped -12, +12 lines =@@ >x : Symbol(x, Decl(index.js, 1, 16)) module.exports = items; ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 1, 24)) ->exports : Symbol(export=, Decl(index.js, 1, 24)) ++>module.exports : Symbol(items, Decl(index.js, 1, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(items, Decl(index.js, 1, 5)) >items : Symbol(items, Decl(index.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.types index c066349aef..4eb595b0e1 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsImportTypeBundled.types @@ -15,24 +15,24 @@ const x = {x: 12}; module.exports = x; >module.exports = x : { x: number; } ->module.exports : any ->module : any ->exports : any +>module.exports : { x: number; } +>module : { readonly x: { x: number; }; } +>exports : { x: number; } >x : { x: number; } === index.js === /** @type {(typeof import("./folder/mod1"))[]} */ const items = [{x: 12}]; ->items : typeof import("folder/mod1")[] +>items : { x: number; }[] >[{x: 12}] : { x: number; }[] >{x: 12} : { x: number; } >x : number >12 : 12 module.exports = items; ->module.exports = items : typeof import("folder/mod1")[] ->module.exports : any ->module : any ->exports : any ->items : typeof import("folder/mod1")[] +>module.exports = items : { x: number; }[] +>module.exports : { x: number; }[] +>module : { readonly items: { x: number; }[]; } +>exports : { x: number; }[] +>items : { x: number; }[] diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.errors.txt deleted file mode 100644 index 8cb6ab2fd2..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.errors.txt +++ /dev/null @@ -1,19 +0,0 @@ -index.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== index.js (2 errors) ==== - const j = require("./obj.json"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - module.exports = j; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== obj.json (0 errors) ==== - { - "x": 12, - "y": 12, - "obj": { - "items": [{"x": 12}, {"x": 12, "y": 12}, {"x": 0}, {"x": -1, "err": true}] - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.symbols index a8109b3261..b174264e65 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.symbols @@ -3,8 +3,13 @@ === index.js === const j = require("./obj.json"); >j : Symbol(j, Decl(index.js, 0, 5)) +>require : Symbol(require) +>"./obj.json" : Symbol("obj", Decl(obj.json, 0, 0)) module.exports = j; +>module.exports : Symbol(export=, Decl(obj.json, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(obj.json, 0, 0)) >j : Symbol(j, Decl(index.js, 0, 5)) === obj.json === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.symbols.diff index 85a8646fd9..bad8351c2f 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.symbols.diff @@ -1,16 +1,15 @@ --- old.jsDeclarationsJson.symbols +++ new.jsDeclarationsJson.symbols -@@= skipped -2, +2 lines =@@ - === index.js === - const j = require("./obj.json"); - >j : Symbol(j, Decl(index.js, 0, 5)) -->require : Symbol(require) -->"./obj.json" : Symbol("obj", Decl(obj.json, 0, 0)) +@@= skipped -6, +6 lines =@@ + >"./obj.json" : Symbol("obj", Decl(obj.json, 0, 0)) module.exports = j; ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 32)) ->exports : Symbol(export=, Decl(index.js, 0, 32)) ++>module.exports : Symbol(export=, Decl(obj.json, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(obj.json, 0, 0)) >j : Symbol(j, Decl(index.js, 0, 5)) === obj.json === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.types index c8355cfa55..ce3292755b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsJson.types @@ -2,17 +2,17 @@ === index.js === const j = require("./obj.json"); ->j : any ->require("./obj.json") : any +>j : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } +>require("./obj.json") : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } >require : any >"./obj.json" : "./obj.json" module.exports = j; ->module.exports = j : any ->module.exports : any ->module : any ->exports : any ->j : any +>module.exports = j : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } +>module.exports : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } +>module : { export=: { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; }; } +>exports : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } +>j : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } === obj.json === { diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.errors.txt deleted file mode 100644 index 5b3e9a957d..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.errors.txt +++ /dev/null @@ -1,44 +0,0 @@ -index.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== index.js (2 errors) ==== - const j = require("./package.json"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - module.exports = j; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== package.json (0 errors) ==== - { - "name": "pkg", - "version": "0.1.0", - "description": "A package", - "main": "./dist/index.js", - "bin": { - "cli": "./bin/cli.js", - }, - "engines": { - "node": ">=0" - }, - "scripts": { - "scriptname": "run && run again", - }, - "devDependencies": { - "@ns/dep": "0.1.2", - }, - "dependencies": { - "dep": "1.2.3", - }, - "repository": "microsoft/TypeScript", - "keywords": [ - "kw" - ], - "author": "Auth", - "license": "See Licensce", - "homepage": "https://site", - "config": { - "o": ["a"] - } - } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.symbols index 14ce43d890..023ee18f3d 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.symbols @@ -3,8 +3,13 @@ === index.js === const j = require("./package.json"); >j : Symbol(j, Decl(index.js, 0, 5)) +>require : Symbol(require) +>"./package.json" : Symbol("package", Decl(package.json, 0, 0)) module.exports = j; +>module.exports : Symbol(export=, Decl(package.json, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(package.json, 0, 0)) >j : Symbol(j, Decl(index.js, 0, 5)) === package.json === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.symbols.diff index 55e09799ca..cc31c515e9 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.symbols.diff @@ -1,16 +1,15 @@ --- old.jsDeclarationsPackageJson.symbols +++ new.jsDeclarationsPackageJson.symbols -@@= skipped -2, +2 lines =@@ - === index.js === - const j = require("./package.json"); - >j : Symbol(j, Decl(index.js, 0, 5)) -->require : Symbol(require) -->"./package.json" : Symbol("package", Decl(package.json, 0, 0)) +@@= skipped -6, +6 lines =@@ + >"./package.json" : Symbol("package", Decl(package.json, 0, 0)) module.exports = j; ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 36)) ->exports : Symbol(export=, Decl(index.js, 0, 36)) ++>module.exports : Symbol(export=, Decl(package.json, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(package.json, 0, 0)) >j : Symbol(j, Decl(index.js, 0, 5)) === package.json === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.types index 165966108b..0feebff08b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsPackageJson.types @@ -2,17 +2,17 @@ === index.js === const j = require("./package.json"); ->j : any ->require("./package.json") : any +>j : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } +>require("./package.json") : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } >require : any >"./package.json" : "./package.json" module.exports = j; ->module.exports = j : any ->module.exports : any ->module : any ->exports : any ->j : any +>module.exports = j : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } +>module.exports : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } +>module : { export=: { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; }; } +>exports : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } +>j : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } === package.json === { diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.errors.txt index df03f90c0b..eb9ed27e87 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.errors.txt @@ -1,5 +1,5 @@ -base.js(11,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -file.js(1,22): error TS2306: File 'base.js' is not a module. +base.js(11,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. +file.js(1,15): error TS1340: Module './base' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./base')'? ==== base.js (1 errors) ==== @@ -14,13 +14,13 @@ file.js(1,22): error TS2306: File 'base.js' is not a module. BaseFactory.Base = Base; module.exports = BaseFactory; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. ==== file.js (1 errors) ==== /** @typedef {import('./base')} BaseFactory */ - ~~~~~~~~ -!!! error TS2306: File 'base.js' is not a module. + ~~~~~~~~~~~~~~~~ +!!! error TS1340: Module './base' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./base')'? /** * @callback BaseFactoryFactory * @param {import('./base')} factory diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.symbols index dd99fb1352..61b3252118 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.symbols @@ -22,6 +22,9 @@ BaseFactory.Base = Base; >Base : Symbol(Base, Decl(base.js, 0, 0)) module.exports = BaseFactory; +>module.exports : Symbol(BaseFactory, Decl(base.js, 4, 5)) +>module : Symbol(module.exports) +>exports : Symbol(BaseFactory, Decl(base.js, 4, 5)) >BaseFactory : Symbol(BaseFactory, Decl(base.js, 4, 5)) === file.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.symbols.diff index d66b28cede..89eef0156e 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.symbols.diff @@ -26,11 +26,14 @@ ->module : Symbol(export=, Decl(base.js, 8, 24)) ->exports : Symbol(export=, Decl(base.js, 8, 24)) ->BaseFactory : Symbol(BaseFactory, Decl(base.js, 4, 5), Decl(base.js, 6, 2)) ++>module.exports : Symbol(BaseFactory, Decl(base.js, 4, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(BaseFactory, Decl(base.js, 4, 5)) +>BaseFactory : Symbol(BaseFactory, Decl(base.js, 4, 5)) === file.js === /** @typedef {import('./base')} BaseFactory */ -@@= skipped -19, +16 lines =@@ +@@= skipped -19, +19 lines =@@ */ /** @enum {import('./base')} */ const couldntThinkOfAny = {} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.types index 706b7ca980..9431695150 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.types @@ -26,9 +26,9 @@ BaseFactory.Base = Base; module.exports = BaseFactory; >module.exports = BaseFactory : { (): Base; Base: typeof Base; } ->module.exports : any ->module : any ->exports : any +>module.exports : { (): Base; Base: typeof Base; } +>module : { readonly BaseFactory: { (): Base; Base: typeof Base; }; } +>exports : { (): Base; Base: typeof Base; } >BaseFactory : { (): Base; Base: typeof Base; } === file.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.errors.txt index 73a374df92..fef4bd8c6b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.errors.txt @@ -1,5 +1,4 @@ -base.js(11,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -file.js(1,29): error TS2306: File 'base.js' is not a module. +base.js(11,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. ==== base.js (1 errors) ==== @@ -14,13 +13,11 @@ file.js(1,29): error TS2306: File 'base.js' is not a module. BaseFactory.Base = Base; module.exports = BaseFactory; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. -==== file.js (1 errors) ==== +==== file.js (0 errors) ==== /** @typedef {typeof import('./base')} BaseFactory */ - ~~~~~~~~ -!!! error TS2306: File 'base.js' is not a module. /** * diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.symbols index fadc6f4add..982c22c1e1 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.symbols @@ -22,6 +22,9 @@ BaseFactory.Base = Base; >Base : Symbol(Base, Decl(base.js, 0, 0)) module.exports = BaseFactory; +>module.exports : Symbol(BaseFactory, Decl(base.js, 4, 5)) +>module : Symbol(module.exports) +>exports : Symbol(BaseFactory, Decl(base.js, 4, 5)) >BaseFactory : Symbol(BaseFactory, Decl(base.js, 4, 5)) === file.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.symbols.diff index 444935dc38..281186ce6c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.symbols.diff @@ -26,6 +26,9 @@ ->module : Symbol(export=, Decl(base.js, 8, 24)) ->exports : Symbol(export=, Decl(base.js, 8, 24)) ->BaseFactory : Symbol(BaseFactory, Decl(base.js, 4, 5), Decl(base.js, 6, 2)) ++>module.exports : Symbol(BaseFactory, Decl(base.js, 4, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(BaseFactory, Decl(base.js, 4, 5)) +>BaseFactory : Symbol(BaseFactory, Decl(base.js, 4, 5)) === file.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.types index cec99d135f..dd819ce298 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.types @@ -26,9 +26,9 @@ BaseFactory.Base = Base; module.exports = BaseFactory; >module.exports = BaseFactory : { (): Base; Base: typeof Base; } ->module.exports : any ->module : any ->exports : any +>module.exports : { (): Base; Base: typeof Base; } +>module : { readonly BaseFactory: { (): Base; Base: typeof Base; }; } +>exports : { (): Base; Base: typeof Base; } >BaseFactory : { (): Base; Base: typeof Base; } === file.js === @@ -40,12 +40,12 @@ module.exports = BaseFactory; * @returns {InstanceType} */ const test = (base) => { ->test : (base: any) => any ->(base) => { return base;} : (base: any) => any ->base : any +>test : (base: Base) => Base +>(base) => { return base;} : (base: Base) => Base +>base : Base return base; ->base : any +>base : Base }; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.errors.txt deleted file mode 100644 index 7fd7c5e9bd..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.errors.txt +++ /dev/null @@ -1,22 +0,0 @@ -cls.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -usage.js(1,31): error TS2306: File 'cls.js' is not a module. -usage.js(5,31): error TS2306: File 'cls.js' is not a module. - - -==== cls.js (1 errors) ==== - class Foo {} - module.exports = Foo; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - -==== usage.js (2 errors) ==== - import {default as Fooa} from "./cls"; - ~~~~~~~ -!!! error TS2306: File 'cls.js' is not a module. - - export const x = new Fooa(); - - export {default as Foob} from "./cls"; - ~~~~~~~ -!!! error TS2306: File 'cls.js' is not a module. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.symbols index 1483d6be6b..87ad80b3c1 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.symbols @@ -5,10 +5,14 @@ class Foo {} >Foo : Symbol(Foo, Decl(cls.js, 0, 0)) module.exports = Foo; +>module.exports : Symbol(Foo, Decl(cls.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(Foo, Decl(cls.js, 0, 0)) >Foo : Symbol(Foo, Decl(cls.js, 0, 0)) === usage.js === import {default as Fooa} from "./cls"; +>default : Symbol(Foo, Decl(cls.js, 0, 12)) >Fooa : Symbol(Fooa, Decl(usage.js, 0, 8)) export const x = new Fooa(); @@ -16,5 +20,6 @@ export const x = new Fooa(); >Fooa : Symbol(Fooa, Decl(usage.js, 0, 8)) export {default as Foob} from "./cls"; +>default : Symbol(Foo, Decl(cls.js, 0, 12)) >Foob : Symbol(Foob, Decl(usage.js, 4, 8)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.symbols.diff index a9f553392a..1fdfd983b5 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.symbols.diff @@ -7,18 +7,23 @@ ->module.exports : Symbol(module.exports, Decl(cls.js, 0, 0)) ->module : Symbol(export=, Decl(cls.js, 0, 12)) ->exports : Symbol(export=, Decl(cls.js, 0, 12)) ++>module.exports : Symbol(Foo, Decl(cls.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(Foo, Decl(cls.js, 0, 0)) >Foo : Symbol(Foo, Decl(cls.js, 0, 0)) === usage.js === import {default as Fooa} from "./cls"; ->default : Symbol(export=, Decl(cls.js, 0, 12)) ++>default : Symbol(Foo, Decl(cls.js, 0, 12)) >Fooa : Symbol(Fooa, Decl(usage.js, 0, 8)) export const x = new Fooa(); -@@= skipped -15, +11 lines =@@ +@@= skipped -15, +15 lines =@@ >Fooa : Symbol(Fooa, Decl(usage.js, 0, 8)) export {default as Foob} from "./cls"; ->default : Symbol(export=, Decl(cls.js, 0, 12)) ++>default : Symbol(Foo, Decl(cls.js, 0, 12)) >Foob : Symbol(Foob, Decl(usage.js, 4, 8)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.types index 7359d65fba..e3b5cdd547 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportAliasesEsModuleInterop.types @@ -6,22 +6,22 @@ class Foo {} module.exports = Foo; >module.exports = Foo : typeof Foo ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Foo +>module : { Foo: typeof Foo; } +>exports : typeof Foo >Foo : typeof Foo === usage.js === import {default as Fooa} from "./cls"; ->default : any ->Fooa : any +>default : typeof Foo +>Fooa : typeof Foo export const x = new Fooa(); ->x : any ->new Fooa() : any ->Fooa : any +>x : Foo +>new Fooa() : Foo +>Fooa : typeof Foo export {default as Foob} from "./cls"; ->default : any ->Foob : any +>default : typeof Foo +>Foob : typeof Foo diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.errors.txt deleted file mode 100644 index c2936a2427..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.errors.txt +++ /dev/null @@ -1,33 +0,0 @@ -main.js(1,43): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -main.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== main.js (2 errors) ==== - const { SomeClass, SomeClass: Another } = require('./lib'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - SomeClass, - Another - } -==== lib.js (0 errors) ==== - /** - * @param {string} a - */ - function bar(a) { - return a + a; - } - - class SomeClass { - a() { - return 1; - } - } - - module.exports = { - bar, - SomeClass - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.symbols index 0f74ba0825..b353281ce8 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.symbols @@ -3,12 +3,53 @@ === main.js === const { SomeClass, SomeClass: Another } = require('./lib'); >SomeClass : Symbol(SomeClass, Decl(main.js, 0, 7)) +>SomeClass : Symbol(SomeClass, Decl(lib.js, 14, 8)) >Another : Symbol(Another, Decl(main.js, 0, 18)) +>require : Symbol(require) +>'./lib' : Symbol("lib", Decl(lib.js, 0, 0)) module.exports = { +>module.exports : Symbol(export=, Decl(main.js, 0, 59)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(main.js, 0, 59)) + SomeClass, >SomeClass : Symbol(SomeClass, Decl(main.js, 2, 18)) Another >Another : Symbol(Another, Decl(main.js, 3, 14)) } +=== lib.js === +/** + * @param {string} a + */ +function bar(a) { +>bar : Symbol(bar, Decl(lib.js, 0, 0)) +>a : Symbol(a, Decl(lib.js, 3, 13)) + + return a + a; +>a : Symbol(a, Decl(lib.js, 3, 13)) +>a : Symbol(a, Decl(lib.js, 3, 13)) +} + +class SomeClass { +>SomeClass : Symbol(SomeClass, Decl(lib.js, 5, 1)) + + a() { +>a : Symbol(a, Decl(lib.js, 7, 17)) + + return 1; + } +} + +module.exports = { +>module.exports : Symbol(export=, Decl(lib.js, 11, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(lib.js, 11, 1)) + + bar, +>bar : Symbol(bar, Decl(lib.js, 13, 18)) + + SomeClass +>SomeClass : Symbol(SomeClass, Decl(lib.js, 14, 8)) +} diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.symbols.diff index fda57deefb..7cecb61cf0 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.symbols.diff @@ -1,56 +1,36 @@ --- old.jsDeclarationsReexportedCjsAlias.symbols +++ new.jsDeclarationsReexportedCjsAlias.symbols -@@= skipped -2, +2 lines =@@ - === main.js === - const { SomeClass, SomeClass: Another } = require('./lib'); - >SomeClass : Symbol(SomeClass, Decl(main.js, 0, 7)) -->SomeClass : Symbol(SomeClass, Decl(lib.js, 14, 8)) - >Another : Symbol(Another, Decl(main.js, 0, 18)) -->require : Symbol(require) -->'./lib' : Symbol("lib", Decl(lib.js, 0, 0)) +@@= skipped -8, +8 lines =@@ + >'./lib' : Symbol("lib", Decl(lib.js, 0, 0)) module.exports = { ->module.exports : Symbol(module.exports, Decl(main.js, 0, 0)) ->module : Symbol(module, Decl(main.js, 0, 59)) ->exports : Symbol(module.exports, Decl(main.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(main.js, 0, 59)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(main.js, 0, 59)) + SomeClass, >SomeClass : Symbol(SomeClass, Decl(main.js, 2, 18)) +@@= skipped -27, +27 lines =@@ + >SomeClass : Symbol(SomeClass, Decl(lib.js, 5, 1)) - Another - >Another : Symbol(Another, Decl(main.js, 3, 14)) - } --=== lib.js === --/** -- * @param {string} a -- */ --function bar(a) { -->bar : Symbol(bar, Decl(lib.js, 0, 0)) -->a : Symbol(a, Decl(lib.js, 3, 13)) -- -- return a + a; -->a : Symbol(a, Decl(lib.js, 3, 13)) -->a : Symbol(a, Decl(lib.js, 3, 13)) --} -- --class SomeClass { -->SomeClass : Symbol(SomeClass, Decl(lib.js, 5, 1)) -- -- a() { + a() { ->a : Symbol(SomeClass.a, Decl(lib.js, 7, 17)) -- -- return 1; -- } --} -- --module.exports = { ++>a : Symbol(a, Decl(lib.js, 7, 17)) + + return 1; + } + } + + module.exports = { ->module.exports : Symbol(module.exports, Decl(lib.js, 0, 0)) ->module : Symbol(module, Decl(lib.js, 11, 1)) ->exports : Symbol(module.exports, Decl(lib.js, 0, 0)) -- -- bar, -->bar : Symbol(bar, Decl(lib.js, 13, 18)) -- -- SomeClass -->SomeClass : Symbol(SomeClass, Decl(lib.js, 14, 8)) --} ++>module.exports : Symbol(export=, Decl(lib.js, 11, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(lib.js, 11, 1)) + + bar, + >bar : Symbol(bar, Decl(lib.js, 13, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.types index 652e219be9..23a4080a80 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReexportedCjsAlias.types @@ -2,23 +2,61 @@ === main.js === const { SomeClass, SomeClass: Another } = require('./lib'); +>SomeClass : typeof SomeClass >SomeClass : any ->SomeClass : any ->Another : any ->require('./lib') : any +>Another : typeof SomeClass +>require('./lib') : { bar: (a: string) => string; SomeClass: typeof SomeClass; } >require : any >'./lib' : "./lib" module.exports = { ->module.exports = { SomeClass, Another} : { SomeClass: any; Another: any; } ->module.exports : any ->module : any ->exports : any ->{ SomeClass, Another} : { SomeClass: any; Another: any; } +>module.exports = { SomeClass, Another} : { SomeClass: typeof SomeClass; Another: typeof SomeClass; } +>module.exports : { SomeClass: typeof SomeClass; Another: typeof SomeClass; } +>module : { export=: { SomeClass: typeof SomeClass; Another: typeof SomeClass; }; } +>exports : { SomeClass: typeof SomeClass; Another: typeof SomeClass; } +>{ SomeClass, Another} : { SomeClass: typeof SomeClass; Another: typeof SomeClass; } SomeClass, ->SomeClass : any +>SomeClass : typeof SomeClass Another ->Another : any +>Another : typeof SomeClass +} +=== lib.js === +/** + * @param {string} a + */ +function bar(a) { +>bar : (a: string) => string +>a : string + + return a + a; +>a + a : string +>a : string +>a : string +} + +class SomeClass { +>SomeClass : SomeClass + + a() { +>a : () => number + + return 1; +>1 : 1 + } +} + +module.exports = { +>module.exports = { bar, SomeClass} : { bar: (a: string) => string; SomeClass: typeof SomeClass; } +>module.exports : { bar: (a: string) => string; SomeClass: typeof SomeClass; } +>module : { export=: { bar: (a: string) => string; SomeClass: typeof SomeClass; }; } +>exports : { bar: (a: string) => string; SomeClass: typeof SomeClass; } +>{ bar, SomeClass} : { bar: (a: string) => string; SomeClass: typeof SomeClass; } + + bar, +>bar : (a: string) => string + + SomeClass +>SomeClass : typeof SomeClass } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.errors.txt index 6154588037..378f232af2 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.errors.txt @@ -1,14 +1,17 @@ -test.js(1,18): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(9,14): error TS2339: Property 'objects' does not exist on type 'Render'. +index.js(14,18): error TS2749: 'Rectangle' refers to a value, but is being used as a type here. Did you mean 'typeof Rectangle'? +index.js(18,14): error TS2339: Property 'objects' does not exist on type 'Render'. +test.js(5,31): error TS2339: Property 'objects' does not exist on type 'Render'. ==== test.js (1 errors) ==== const {Render} = require("./index"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. let render = new Render(); render.addRectangle(); console.log("Objects", render.objects); + ~~~~~~~ +!!! error TS2339: Property 'objects' does not exist on type 'Render'. ==== rectangle.js (0 errors) ==== class Rectangle { constructor() { @@ -17,7 +20,7 @@ test.js(1,18): error TS2580: Cannot find name 'require'. Do you need to install } module.exports = { Rectangle }; -==== index.js (0 errors) ==== +==== index.js (3 errors) ==== const {Rectangle} = require('./rectangle'); class Render { @@ -27,15 +30,21 @@ test.js(1,18): error TS2580: Cannot find name 'require'. Do you need to install * @type {Rectangle[]} */ this.objects = []; + ~~~~~~~ +!!! error TS2339: Property 'objects' does not exist on type 'Render'. } /** * Adds a rectangle * * @returns {Rectangle} the rect + ~~~~~~~~~ +!!! error TS2749: 'Rectangle' refers to a value, but is being used as a type here. Did you mean 'typeof Rectangle'? */ addRectangle() { const obj = new Rectangle(); this.objects.push(obj); + ~~~~~~~ +!!! error TS2339: Property 'objects' does not exist on type 'Render'. return obj; } } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.symbols index db5ed444c6..bc6e98c0ba 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.symbols @@ -3,13 +3,17 @@ === test.js === const {Render} = require("./index"); >Render : Symbol(Render, Decl(test.js, 0, 7)) +>require : Symbol(require) +>"./index" : Symbol("index", Decl(index.js, 0, 0)) let render = new Render(); >render : Symbol(render, Decl(test.js, 1, 3)) >Render : Symbol(Render, Decl(test.js, 0, 7)) render.addRectangle(); +>render.addRectangle : Symbol(addRectangle, Decl(index.js, 9, 5)) >render : Symbol(render, Decl(test.js, 1, 3)) +>addRectangle : Symbol(addRectangle, Decl(index.js, 9, 5)) console.log("Objects", render.objects); >console.log : Symbol(log, Decl(lib.dom.d.ts, --, --)) @@ -17,3 +21,65 @@ console.log("Objects", render.objects); >log : Symbol(log, Decl(lib.dom.d.ts, --, --)) >render : Symbol(render, Decl(test.js, 1, 3)) +=== rectangle.js === +class Rectangle { +>Rectangle : Symbol(Rectangle, Decl(rectangle.js, 0, 0)) + + constructor() { + console.log("I'm a rectangle!"); +>console.log : Symbol(log, Decl(lib.dom.d.ts, --, --)) +>console : Symbol(console, Decl(lib.dom.d.ts, --, --)) +>log : Symbol(log, Decl(lib.dom.d.ts, --, --)) + } +} + +module.exports = { Rectangle }; +>module.exports : Symbol(export=, Decl(rectangle.js, 4, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(rectangle.js, 4, 1)) +>Rectangle : Symbol(Rectangle, Decl(rectangle.js, 6, 18)) + +=== index.js === +const {Rectangle} = require('./rectangle'); +>Rectangle : Symbol(Rectangle, Decl(index.js, 0, 7)) +>require : Symbol(require) +>'./rectangle' : Symbol("rectangle", Decl(rectangle.js, 0, 0)) + +class Render { +>Render : Symbol(Render, Decl(index.js, 0, 43)) + + constructor() { + /** + * Object list + * @type {Rectangle[]} + */ + this.objects = []; +>this : Symbol(Render, Decl(index.js, 0, 43)) + } + /** + * Adds a rectangle + * + * @returns {Rectangle} the rect + */ + addRectangle() { +>addRectangle : Symbol(addRectangle, Decl(index.js, 9, 5)) + + const obj = new Rectangle(); +>obj : Symbol(obj, Decl(index.js, 16, 13)) +>Rectangle : Symbol(Rectangle, Decl(index.js, 0, 7)) + + this.objects.push(obj); +>this : Symbol(Render, Decl(index.js, 0, 43)) +>obj : Symbol(obj, Decl(index.js, 16, 13)) + + return obj; +>obj : Symbol(obj, Decl(index.js, 16, 13)) + } +} + +module.exports = { Render }; +>module.exports : Symbol(export=, Decl(index.js, 20, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 20, 1)) +>Render : Symbol(Render, Decl(index.js, 22, 18)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.symbols.diff index 20f23d7dff..8c870ff340 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.symbols.diff @@ -1,20 +1,14 @@ --- old.jsDeclarationsReferenceToClassInstanceCrossFile.symbols +++ new.jsDeclarationsReferenceToClassInstanceCrossFile.symbols -@@= skipped -2, +2 lines =@@ - === test.js === - const {Render} = require("./index"); - >Render : Symbol(Render, Decl(test.js, 0, 7)) -->require : Symbol(require) -->"./index" : Symbol("index", Decl(index.js, 0, 0)) - - let render = new Render(); - >render : Symbol(render, Decl(test.js, 1, 3)) +@@= skipped -10, +10 lines =@@ >Render : Symbol(Render, Decl(test.js, 0, 7)) render.addRectangle(); ->render.addRectangle : Symbol(Render.addRectangle, Decl(index.js, 9, 5)) ++>render.addRectangle : Symbol(addRectangle, Decl(index.js, 9, 5)) >render : Symbol(render, Decl(test.js, 1, 3)) ->addRectangle : Symbol(Render.addRectangle, Decl(index.js, 9, 5)) ++>addRectangle : Symbol(addRectangle, Decl(index.js, 9, 5)) console.log("Objects", render.objects); ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) @@ -26,71 +20,69 @@ >render : Symbol(render, Decl(test.js, 1, 3)) ->objects : Symbol(Render.objects, Decl(index.js, 3, 19)) --=== rectangle.js === --class Rectangle { -->Rectangle : Symbol(Rectangle, Decl(rectangle.js, 0, 0)) -- -- constructor() { -- console.log("I'm a rectangle!"); + === rectangle.js === + class Rectangle { +@@= skipped -18, +16 lines =@@ + + constructor() { + console.log("I'm a rectangle!"); ->console.log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) -->console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ++>console.log : Symbol(log, Decl(lib.dom.d.ts, --, --)) + >console : Symbol(console, Decl(lib.dom.d.ts, --, --)) ->log : Symbol(Console.log, Decl(lib.dom.d.ts, --, --)) -- } --} -- --module.exports = { Rectangle }; ++>log : Symbol(log, Decl(lib.dom.d.ts, --, --)) + } + } + + module.exports = { Rectangle }; ->module.exports : Symbol(module.exports, Decl(rectangle.js, 0, 0)) ->module : Symbol(module, Decl(rectangle.js, 4, 1)) ->exports : Symbol(module.exports, Decl(rectangle.js, 0, 0)) -->Rectangle : Symbol(Rectangle, Decl(rectangle.js, 6, 18)) -- --=== index.js === --const {Rectangle} = require('./rectangle'); -->Rectangle : Symbol(Rectangle, Decl(index.js, 0, 7)) -->require : Symbol(require) -->'./rectangle' : Symbol("rectangle", Decl(rectangle.js, 0, 0)) -- --class Render { -->Render : Symbol(Render, Decl(index.js, 0, 43)) -- -- constructor() { -- /** -- * Object list -- * @type {Rectangle[]} -- */ -- this.objects = []; ++>module.exports : Symbol(export=, Decl(rectangle.js, 4, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(rectangle.js, 4, 1)) + >Rectangle : Symbol(Rectangle, Decl(rectangle.js, 6, 18)) + + === index.js === +@@= skipped -27, +27 lines =@@ + * @type {Rectangle[]} + */ + this.objects = []; ->this.objects : Symbol(Render.objects, Decl(index.js, 3, 19)) -->this : Symbol(Render, Decl(index.js, 0, 43)) + >this : Symbol(Render, Decl(index.js, 0, 43)) ->objects : Symbol(Render.objects, Decl(index.js, 3, 19)) -- } -- /** -- * Adds a rectangle -- * -- * @returns {Rectangle} the rect -- */ -- addRectangle() { + } + /** + * Adds a rectangle +@@= skipped -10, +8 lines =@@ + * @returns {Rectangle} the rect + */ + addRectangle() { ->addRectangle : Symbol(Render.addRectangle, Decl(index.js, 9, 5)) -- -- const obj = new Rectangle(); -->obj : Symbol(obj, Decl(index.js, 16, 13)) -->Rectangle : Symbol(Rectangle, Decl(index.js, 0, 7)) -- -- this.objects.push(obj); ++>addRectangle : Symbol(addRectangle, Decl(index.js, 9, 5)) + + const obj = new Rectangle(); + >obj : Symbol(obj, Decl(index.js, 16, 13)) + >Rectangle : Symbol(Rectangle, Decl(index.js, 0, 7)) + + this.objects.push(obj); ->this.objects.push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) ->this.objects : Symbol(Render.objects, Decl(index.js, 3, 19)) -->this : Symbol(Render, Decl(index.js, 0, 43)) + >this : Symbol(Render, Decl(index.js, 0, 43)) ->objects : Symbol(Render.objects, Decl(index.js, 3, 19)) ->push : Symbol(Array.push, Decl(lib.es5.d.ts, --, --)) -->obj : Symbol(obj, Decl(index.js, 16, 13)) -- -- return obj; -->obj : Symbol(obj, Decl(index.js, 16, 13)) -- } --} -- --module.exports = { Render }; + >obj : Symbol(obj, Decl(index.js, 16, 13)) + + return obj; +@@= skipped -20, +16 lines =@@ + } + + module.exports = { Render }; ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(module, Decl(index.js, 20, 1)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -->Render : Symbol(Render, Decl(index.js, 22, 18)) -- ++>module.exports : Symbol(export=, Decl(index.js, 20, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(index.js, 20, 1)) + >Render : Symbol(Render, Decl(index.js, 22, 18)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.types index 862d5664de..c11d9b3b3a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.types @@ -2,21 +2,21 @@ === test.js === const {Render} = require("./index"); ->Render : any ->require("./index") : any +>Render : typeof Render +>require("./index") : { Render: typeof Render; } >require : any >"./index" : "./index" let render = new Render(); ->render : any ->new Render() : any ->Render : any +>render : Render +>new Render() : Render +>Render : typeof Render render.addRectangle(); ->render.addRectangle() : any ->render.addRectangle : any ->render : any ->addRectangle : any +>render.addRectangle() : Rectangle +>render.addRectangle : () => Rectangle +>render : Render +>addRectangle : () => Rectangle console.log("Objects", render.objects); >console.log("Objects", render.objects) : void @@ -25,6 +25,85 @@ console.log("Objects", render.objects); >log : (...data: any[]) => void >"Objects" : "Objects" >render.objects : any ->render : any +>render : Render >objects : any +=== rectangle.js === +class Rectangle { +>Rectangle : Rectangle + + constructor() { + console.log("I'm a rectangle!"); +>console.log("I'm a rectangle!") : void +>console.log : (...data: any[]) => void +>console : Console +>log : (...data: any[]) => void +>"I'm a rectangle!" : "I'm a rectangle!" + } +} + +module.exports = { Rectangle }; +>module.exports = { Rectangle } : { Rectangle: typeof Rectangle; } +>module.exports : { Rectangle: typeof Rectangle; } +>module : { export=: { Rectangle: typeof Rectangle; }; } +>exports : { Rectangle: typeof Rectangle; } +>{ Rectangle } : { Rectangle: typeof Rectangle; } +>Rectangle : typeof Rectangle + +=== index.js === +const {Rectangle} = require('./rectangle'); +>Rectangle : typeof Rectangle +>require('./rectangle') : { Rectangle: typeof Rectangle; } +>require : any +>'./rectangle' : "./rectangle" + +class Render { +>Render : Render + + constructor() { + /** + * Object list + * @type {Rectangle[]} + */ + this.objects = []; +>this.objects = [] : undefined[] +>this.objects : any +>this : this +>objects : any +>[] : undefined[] + } + /** + * Adds a rectangle + * + * @returns {Rectangle} the rect + */ + addRectangle() { +>addRectangle : () => Rectangle + + const obj = new Rectangle(); +>obj : Rectangle +>new Rectangle() : Rectangle +>Rectangle : typeof Rectangle + + this.objects.push(obj); +>this.objects.push(obj) : any +>this.objects.push : any +>this.objects : any +>this : this +>objects : any +>push : any +>obj : Rectangle + + return obj; +>obj : Rectangle + } +} + +module.exports = { Render }; +>module.exports = { Render } : { Render: typeof Render; } +>module.exports : { Render: typeof Render; } +>module : { export=: { Render: typeof Render; }; } +>exports : { Render: typeof Render; } +>{ Render } : { Render: typeof Render; } +>Render : typeof Render + diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.errors.txt index 45186dc6b4..324fb0ae0d 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.errors.txt @@ -1,4 +1,4 @@ -mixed.js(14,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mixed.js(14,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ==== index.js (0 errors) ==== @@ -44,11 +44,14 @@ mixed.js(14,1): error TS2580: Cannot find name 'module'. Do you need to install z = "ok" } module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~ doTheThing, + ~~~~~~~~~~~~~~~ ExportedThing, + ~~~~~~~~~~~~~~~~~~ }; + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. class LocalThing { y = "ok" } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.symbols index db15a82914..6fe7582381 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.symbols @@ -52,6 +52,10 @@ class ExportedThing { >z : Symbol(z, Decl(mixed.js, 10, 21)) } module.exports = { +>module.exports : Symbol(export=, Decl(mixed.js, 12, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mixed.js, 12, 1)) + doTheThing, >doTheThing : Symbol(doTheThing, Decl(mixed.js, 13, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.symbols.diff index deb9304353..1b949eec6a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.symbols.diff @@ -11,11 +11,13 @@ ->module.exports : Symbol(module.exports, Decl(mixed.js, 0, 0)) ->module : Symbol(module, Decl(mixed.js, 12, 1)) ->exports : Symbol(module.exports, Decl(mixed.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(mixed.js, 12, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(mixed.js, 12, 1)) + doTheThing, >doTheThing : Symbol(doTheThing, Decl(mixed.js, 13, 18)) - -@@= skipped -18, +14 lines =@@ +@@= skipped -18, +18 lines =@@ >LocalThing : Symbol(LocalThing, Decl(mixed.js, 16, 2)) y = "ok" diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.types index b81b70e809..fc578db558 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeAliases.types @@ -57,9 +57,9 @@ class ExportedThing { } module.exports = { >module.exports = { doTheThing, ExportedThing,} : { doTheThing: (x: number) => SomeType; ExportedThing: typeof ExportedThing; } ->module.exports : any ->module : any ->exports : any +>module.exports : { doTheThing: (x: number) => SomeType; ExportedThing: typeof ExportedThing; } +>module : { export=: { doTheThing: (x: number) => SomeType; ExportedThing: typeof ExportedThing; }; } +>exports : { doTheThing: (x: number) => SomeType; ExportedThing: typeof ExportedThing; } >{ doTheThing, ExportedThing,} : { doTheThing: (x: number) => SomeType; ExportedThing: typeof ExportedThing; } doTheThing, diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.errors.txt deleted file mode 100644 index a78bbfd4ca..0000000000 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.errors.txt +++ /dev/null @@ -1,15 +0,0 @@ -index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== /some-mod.d.ts (0 errors) ==== - interface Item { - x: string; - } - declare const items: Item[]; - export = items; -==== index.js (1 errors) ==== - /** @type {typeof import("/some-mod")} */ - const items = []; - module.exports = items; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.symbols index 3e99e94dbb..6a34e25da5 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.symbols @@ -20,5 +20,8 @@ const items = []; >items : Symbol(items, Decl(index.js, 1, 5)) module.exports = items; +>module.exports : Symbol(items, Decl(index.js, 1, 5)) +>module : Symbol(module.exports) +>exports : Symbol(items, Decl(index.js, 1, 5)) >items : Symbol(items, Decl(index.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.symbols.diff index 5de9d3e3a2..fb55ebe2f5 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.symbols.diff @@ -16,5 +16,8 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 1, 17)) ->exports : Symbol(export=, Decl(index.js, 1, 17)) ++>module.exports : Symbol(items, Decl(index.js, 1, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(items, Decl(index.js, 1, 5)) >items : Symbol(items, Decl(index.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.types index 99b586db29..41589f0d1e 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration.types @@ -19,8 +19,8 @@ const items = []; module.exports = items; >module.exports = items : Item[] ->module.exports : any ->module : any ->exports : any +>module.exports : Item[] +>module : { readonly items: Item[]; } +>exports : Item[] >items : Item[] diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.errors.txt index 1eb3a0d3ab..c3053269d0 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.errors.txt @@ -1,14 +1,11 @@ index.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== index.js (2 errors) ==== +==== index.js (1 errors) ==== const items = require("./some-mod")(); ~~~~~~~ !!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports = items; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== some-mod.d.ts (0 errors) ==== interface Item { x: string; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.symbols index dddcc22c2d..6f1f52ce7b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.symbols @@ -5,6 +5,9 @@ const items = require("./some-mod")(); >items : Symbol(items, Decl(index.js, 0, 5)) module.exports = items; +>module.exports : Symbol(items, Decl(index.js, 0, 5)) +>module : Symbol(module.exports) +>exports : Symbol(items, Decl(index.js, 0, 5)) >items : Symbol(items, Decl(index.js, 0, 5)) === some-mod.d.ts === diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.symbols.diff index 33e79fd505..b446b0f974 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.symbols.diff @@ -11,10 +11,13 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 0, 38)) ->exports : Symbol(export=, Decl(index.js, 0, 38)) ++>module.exports : Symbol(items, Decl(index.js, 0, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(items, Decl(index.js, 0, 5)) >items : Symbol(items, Decl(index.js, 0, 5)) === some-mod.d.ts === -@@= skipped -14, +9 lines =@@ +@@= skipped -14, +12 lines =@@ >Item : Symbol(Item, Decl(some-mod.d.ts, 0, 0)) x: string; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.types index 74f06670de..40ff68dc81 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.types @@ -11,7 +11,7 @@ const items = require("./some-mod")(); module.exports = items; >module.exports = items : any >module.exports : any ->module : any +>module : { readonly items: any; } >exports : any >items : any diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.errors.txt index e0f90da831..ee3f1e9d1a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.errors.txt @@ -1,8 +1,7 @@ index.js(3,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== index.js (2 errors) ==== +==== index.js (1 errors) ==== /// const Something = require("fs").Something; @@ -12,8 +11,6 @@ index.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install t const thing = new Something(); module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. thing }; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.symbols index e435d2aaa2..cb748f1453 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.symbols @@ -11,6 +11,10 @@ const thing = new Something(); >Something : Symbol(Something, Decl(index.js, 2, 5)) module.exports = { +>module.exports : Symbol(export=, Decl(index.js, 4, 30)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 4, 30)) + thing >thing : Symbol(thing, Decl(index.js, 6, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.symbols.diff index d67bcc6472..25b08e1eb1 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.symbols.diff @@ -17,7 +17,9 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(module, Decl(index.js, 4, 30)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(index.js, 4, 30)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(index.js, 4, 30)) + thing >thing : Symbol(thing, Decl(index.js, 6, 18)) - diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.types index 1337aa64af..46d835b5a9 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences.types @@ -18,9 +18,9 @@ const thing = new Something(); module.exports = { >module.exports = { thing} : { thing: any; } ->module.exports : any ->module : any ->exports : any +>module.exports : { thing: any; } +>module : { export=: { thing: any; }; } +>exports : { thing: any; } >{ thing} : { thing: any; } thing diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.errors.txt index 773bec3191..aebb0c41aa 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.errors.txt @@ -1,8 +1,7 @@ index.js(1,17): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== index.js (2 errors) ==== +==== index.js (1 errors) ==== const{ a, m } = require("./something").o; ~~~~~~~ !!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. @@ -10,8 +9,6 @@ index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install t const thing = a + m module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. thing }; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.symbols index 433827273d..ebeb897f29 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.symbols @@ -11,6 +11,10 @@ const thing = a + m >m : Symbol(m, Decl(index.js, 0, 9)) module.exports = { +>module.exports : Symbol(export=, Decl(index.js, 2, 19)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 2, 19)) + thing >thing : Symbol(thing, Decl(index.js, 4, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.symbols.diff index f180b7d2ae..c18772a136 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.symbols.diff @@ -18,7 +18,9 @@ ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(module, Decl(index.js, 2, 19)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(index.js, 2, 19)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(index.js, 2, 19)) + thing >thing : Symbol(thing, Decl(index.js, 4, 18)) - diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.types index eeb977a221..b4986b3159 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences2.types @@ -18,9 +18,9 @@ const thing = a + m module.exports = { >module.exports = { thing} : { thing: any; } ->module.exports : any ->module : any ->exports : any +>module.exports : { thing: any; } +>module : { export=: { thing: any; }; } +>exports : { thing: any; } >{ thing} : { thing: any; } thing diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.errors.txt index b930aaa11d..b54ec9236b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.errors.txt @@ -1,20 +1,14 @@ index.js(3,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== index.js (3 errors) ==== +==== index.js (1 errors) ==== /// const Something = require("fs").Something; ~~~~~~~ !!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports.A = {} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports.A.B = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. thing: new Something() } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.symbols index e8cbe7b317..2514877b4c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.symbols @@ -7,7 +7,19 @@ const Something = require("fs").Something; >Something : Symbol(Something, Decl(index.js, 2, 5)) module.exports.A = {} +>module.exports.A : Symbol(A, Decl(index.js, 2, 42)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>A : Symbol(A, Decl(index.js, 2, 42)) + module.exports.A.B = { +>module.exports.A : Symbol(A, Decl(index.js, 2, 42)) +>module.exports : Symbol("index", Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("index", Decl(index.js, 0, 0)) +>A : Symbol(A, Decl(index.js, 2, 42)) + thing: new Something() >thing : Symbol(thing, Decl(index.js, 4, 22)) >Something : Symbol(Something, Decl(index.js, 2, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.symbols.diff index 0a6cc5af09..2d3be5dd17 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.symbols.diff @@ -15,7 +15,12 @@ ->module : Symbol(module, Decl(index.js, 2, 42)) ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->A : Symbol(A, Decl(index.js, 2, 42), Decl(index.js, 4, 15)) -- ++>module.exports.A : Symbol(A, Decl(index.js, 2, 42)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) ++>A : Symbol(A, Decl(index.js, 2, 42)) + module.exports.A.B = { ->module.exports.A.B : Symbol(A.B, Decl(index.js, 3, 21)) ->module.exports.A : Symbol(A.B, Decl(index.js, 3, 21)) @@ -24,7 +29,11 @@ ->exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->A : Symbol(A, Decl(index.js, 2, 42), Decl(index.js, 4, 15)) ->B : Symbol(A.B, Decl(index.js, 3, 21)) -- ++>module.exports.A : Symbol(A, Decl(index.js, 2, 42)) ++>module.exports : Symbol("index", Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("index", Decl(index.js, 0, 0)) ++>A : Symbol(A, Decl(index.js, 2, 42)) + thing: new Something() >thing : Symbol(thing, Decl(index.js, 4, 22)) - >Something : Symbol(Something, Decl(index.js, 2, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.types index 199965fcd6..77aefd3056 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypeReferences3.types @@ -14,9 +14,9 @@ const Something = require("fs").Something; module.exports.A = {} >module.exports.A = {} : {} >module.exports.A : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >A : any >{} : {} @@ -24,9 +24,9 @@ module.exports.A.B = { >module.exports.A.B = { thing: new Something()} : { thing: any; } >module.exports.A.B : any >module.exports.A : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("index") +>module : { "index": typeof import("index"); } +>exports : typeof import("index") >A : any >B : any >{ thing: new Something()} : { thing: any; } diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.errors.txt index 0add975d32..c319376abf 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.errors.txt @@ -1,8 +1,7 @@ -conn.js(11,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -usage.js(2,14): error TS1340: Module './conn' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./conn')'? +conn.js(11,1): error TS2309: An export assignment cannot be used in a module with other exported elements. usage.js(10,14): error TS2339: Property 'connItem' does not exist on type 'Wrap'. usage.js(12,14): error TS2339: Property 'another' does not exist on type 'Wrap'. -usage.js(16,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +usage.js(16,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ==== conn.js (1 errors) ==== @@ -17,14 +16,12 @@ usage.js(16,1): error TS2580: Cannot find name 'module'. Do you need to install } module.exports = Conn; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. -==== usage.js (4 errors) ==== +==== usage.js (3 errors) ==== /** * @typedef {import("./conn")} Conn - ~~~~~~~~~~~~~~~~ -!!! error TS1340: Module './conn' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./conn')'? */ class Wrap { @@ -43,8 +40,10 @@ usage.js(16,1): error TS2580: Cannot find name 'module'. Do you need to install } module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~ Wrap + ~~~~~~~~ }; + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.symbols index 4f556a9e04..9c06625b4c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.symbols @@ -17,6 +17,9 @@ class Conn { } module.exports = Conn; +>module.exports : Symbol(Conn, Decl(conn.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(Conn, Decl(conn.js, 0, 0)) >Conn : Symbol(Conn, Decl(conn.js, 0, 0)) === usage.js === @@ -35,7 +38,9 @@ class Wrap { this.connItem = c.item; >this : Symbol(Wrap, Decl(usage.js, 0, 0)) +>c.item : Symbol(item, Decl(conn.js, 5, 20)) >c : Symbol(c, Decl(usage.js, 8, 16)) +>item : Symbol(item, Decl(conn.js, 5, 20)) /** @type {import("./conn").Whatever} */ this.another = ""; @@ -44,6 +49,10 @@ class Wrap { } module.exports = { +>module.exports : Symbol(export=, Decl(usage.js, 13, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(usage.js, 13, 1)) + Wrap >Wrap : Symbol(Wrap, Decl(usage.js, 15, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.symbols.diff index a1525e8dbc..612c925f9d 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.symbols.diff @@ -16,10 +16,13 @@ ->module.exports : Symbol(module.exports, Decl(conn.js, 0, 0)) ->module : Symbol(export=, Decl(conn.js, 8, 1)) ->exports : Symbol(export=, Decl(conn.js, 8, 1)) ++>module.exports : Symbol(Conn, Decl(conn.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(Conn, Decl(conn.js, 0, 0)) >Conn : Symbol(Conn, Decl(conn.js, 0, 0)) === usage.js === -@@= skipped -27, +24 lines =@@ +@@= skipped -27, +27 lines =@@ >c : Symbol(c, Decl(usage.js, 8, 16)) this.connItem = c.item; @@ -27,8 +30,10 @@ >this : Symbol(Wrap, Decl(usage.js, 0, 0)) ->connItem : Symbol(Wrap.connItem, Decl(usage.js, 8, 20)) ->c.item : Symbol(Conn.item, Decl(conn.js, 5, 20)) ++>c.item : Symbol(item, Decl(conn.js, 5, 20)) >c : Symbol(c, Decl(usage.js, 8, 16)) ->item : Symbol(Conn.item, Decl(conn.js, 5, 20)) ++>item : Symbol(item, Decl(conn.js, 5, 20)) /** @type {import("./conn").Whatever} */ this.another = ""; @@ -42,7 +47,9 @@ ->module.exports : Symbol(module.exports, Decl(usage.js, 0, 0)) ->module : Symbol(module, Decl(usage.js, 13, 1)) ->exports : Symbol(module.exports, Decl(usage.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(usage.js, 13, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(usage.js, 13, 1)) + Wrap >Wrap : Symbol(Wrap, Decl(usage.js, 15, 18)) - diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.types index d384caf838..b2cfda6619 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndImportTypes.types @@ -19,9 +19,9 @@ class Conn { module.exports = Conn; >module.exports = Conn : typeof Conn ->module.exports : any ->module : any ->exports : any +>module.exports : typeof Conn +>module : { Conn: typeof Conn; } +>exports : typeof Conn >Conn : typeof Conn === usage.js === @@ -36,16 +36,16 @@ class Wrap { * @param {Conn} c */ constructor(c) { ->c : any +>c : Conn this.connItem = c.item; ->this.connItem = c.item : any +>this.connItem = c.item : number >this.connItem : any >this : this >connItem : any ->c.item : any ->c : any ->item : any +>c.item : number +>c : Conn +>item : number /** @type {import("./conn").Whatever} */ this.another = ""; @@ -59,9 +59,9 @@ class Wrap { module.exports = { >module.exports = { Wrap} : { Wrap: typeof Wrap; } ->module.exports : any ->module : any ->exports : any +>module.exports : { Wrap: typeof Wrap; } +>module : { export=: { Wrap: typeof Wrap; }; } +>exports : { Wrap: typeof Wrap; } >{ Wrap} : { Wrap: typeof Wrap; } Wrap diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.errors.txt index 48fc6a2824..4c105d6974 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.errors.txt @@ -1,16 +1,10 @@ -LazySet.js(13,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(1,17): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(3,12): error TS2749: 'LazySet' refers to a value, but is being used as a type here. Did you mean 'typeof LazySet'? +LazySet.js(13,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== index.js (2 errors) ==== +==== index.js (0 errors) ==== const LazySet = require("./LazySet"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** @type {LazySet} */ - ~~~~~~~ -!!! error TS2749: 'LazySet' refers to a value, but is being used as a type here. Did you mean 'typeof LazySet'? const stringSet = undefined; stringSet.addAll(stringSet); @@ -29,6 +23,6 @@ index.js(3,12): error TS2749: 'LazySet' refers to a value, but is being used as } module.exports = LazySet; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.symbols index b792c9fb28..32610b29dd 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.symbols @@ -3,6 +3,8 @@ === index.js === const LazySet = require("./LazySet"); >LazySet : Symbol(LazySet, Decl(index.js, 0, 5)) +>require : Symbol(require) +>"./LazySet" : Symbol("LazySet", Decl(LazySet.js, 0, 0)) /** @type {LazySet} */ const stringSet = undefined; @@ -10,7 +12,9 @@ const stringSet = undefined; >undefined : Symbol(undefined) stringSet.addAll(stringSet); +>stringSet.addAll : Symbol(addAll, Decl(LazySet.js, 4, 15)) >stringSet : Symbol(stringSet, Decl(index.js, 3, 5)) +>addAll : Symbol(addAll, Decl(LazySet.js, 4, 15)) >stringSet : Symbol(stringSet, Decl(index.js, 3, 5)) @@ -37,5 +41,8 @@ class LazySet { } module.exports = LazySet; +>module.exports : Symbol(LazySet, Decl(LazySet.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(LazySet, Decl(LazySet.js, 0, 0)) >LazySet : Symbol(LazySet, Decl(LazySet.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.symbols.diff index f0002b54f6..1e12a162c8 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.symbols.diff @@ -1,25 +1,18 @@ --- old.jsDeclarationsTypedefAndLatebound.symbols +++ new.jsDeclarationsTypedefAndLatebound.symbols -@@= skipped -2, +2 lines =@@ - === index.js === - const LazySet = require("./LazySet"); - >LazySet : Symbol(LazySet, Decl(index.js, 0, 5)) -->require : Symbol(require) -->"./LazySet" : Symbol("LazySet", Decl(LazySet.js, 0, 0)) - - /** @type {LazySet} */ - const stringSet = undefined; -@@= skipped -9, +7 lines =@@ +@@= skipped -11, +11 lines =@@ >undefined : Symbol(undefined) stringSet.addAll(stringSet); ->stringSet.addAll : Symbol(LazySet.addAll, Decl(LazySet.js, 4, 15)) ++>stringSet.addAll : Symbol(addAll, Decl(LazySet.js, 4, 15)) >stringSet : Symbol(stringSet, Decl(index.js, 3, 5)) ->addAll : Symbol(LazySet.addAll, Decl(LazySet.js, 4, 15)) ++>addAll : Symbol(addAll, Decl(LazySet.js, 4, 15)) >stringSet : Symbol(stringSet, Decl(index.js, 3, 5)) -@@= skipped -18, +16 lines =@@ +@@= skipped -18, +18 lines =@@ * @param {LazySet} iterable */ addAll(iterable) {} @@ -41,5 +34,8 @@ ->module.exports : Symbol(module.exports, Decl(LazySet.js, 0, 0)) ->module : Symbol(export=, Decl(LazySet.js, 10, 1)) ->exports : Symbol(export=, Decl(LazySet.js, 10, 1)) ++>module.exports : Symbol(LazySet, Decl(LazySet.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(LazySet, Decl(LazySet.js, 0, 0)) >LazySet : Symbol(LazySet, Decl(LazySet.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.types index d00f82d698..7690579039 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefAndLatebound.types @@ -2,8 +2,8 @@ === index.js === const LazySet = require("./LazySet"); ->LazySet : any ->require("./LazySet") : any +>LazySet : typeof LazySet +>require("./LazySet") : typeof LazySet >require : any >"./LazySet" : "./LazySet" @@ -13,10 +13,10 @@ const stringSet = undefined; >undefined : undefined stringSet.addAll(stringSet); ->stringSet.addAll(stringSet) : any ->stringSet.addAll : any +>stringSet.addAll(stringSet) : void +>stringSet.addAll : (iterable: LazySet) => void >stringSet : LazySet ->addAll : any +>addAll : (iterable: LazySet) => void >stringSet : LazySet @@ -44,8 +44,8 @@ class LazySet { module.exports = LazySet; >module.exports = LazySet : typeof LazySet ->module.exports : any ->module : any ->exports : any +>module.exports : typeof LazySet +>module : { LazySet: typeof LazySet; } +>exports : typeof LazySet >LazySet : typeof LazySet diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.errors.txt b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.errors.txt index 26e7eee074..9159bcdbdb 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.errors.txt @@ -1,16 +1,16 @@ -index.js(1,39): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -index.js(3,22): error TS2307: Cannot find module './module.js' or its corresponding type declarations. -index.js(21,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(3,37): error TS2694: Namespace '"module".export=' has no exported member 'TaskGroup'. +index.js(21,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +module.js(11,38): error TS2304: Cannot find name 'P'. +module.js(24,12): error TS2315: Type 'Object' is not generic. +module.js(27,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== index.js (3 errors) ==== +==== index.js (2 errors) ==== const {taskGroups, taskNameToGroup} = require('./module.js'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** @typedef {import('./module.js').TaskGroup} TaskGroup */ - ~~~~~~~~~~~~~ -!!! error TS2307: Cannot find module './module.js' or its corresponding type declarations. + ~~~~~~~~~ +!!! error TS2694: Namespace '"module".export=' has no exported member 'TaskGroup'. /** * @typedef TaskNode @@ -29,9 +29,9 @@ index.js(21,1): error TS2580: Cannot find name 'module'. Do you need to install } module.exports = MainThreadTasks; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== module.js (0 errors) ==== + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. +==== module.js (3 errors) ==== /** @typedef {'parseHTML'|'styleLayout'} TaskGroupIds */ /** @@ -43,6 +43,8 @@ index.js(21,1): error TS2580: Cannot find name 'module'. Do you need to install /** * @type {{[P in TaskGroupIds]: {id: P, label: string}}} + ~ +!!! error TS2304: Cannot find name 'P'. */ const taskGroups = { parseHTML: { @@ -56,9 +58,16 @@ index.js(21,1): error TS2580: Cannot find name 'module'. Do you need to install } /** @type {Object} */ + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2315: Type 'Object' is not generic. const taskNameToGroup = {}; module.exports = { + ~~~~~~~~~~~~~~~~~~ taskGroups, + ~~~~~~~~~~~~~~~ taskNameToGroup, - }; \ No newline at end of file + ~~~~~~~~~~~~~~~~~~~~ + }; + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.symbols b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.symbols index e18f140418..383deeead4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.symbols @@ -4,6 +4,8 @@ const {taskGroups, taskNameToGroup} = require('./module.js'); >taskGroups : Symbol(taskGroups, Decl(index.js, 0, 7)) >taskNameToGroup : Symbol(taskNameToGroup, Decl(index.js, 0, 18)) +>require : Symbol(require) +>'./module.js' : Symbol("module", Decl(module.js, 0, 0)) /** @typedef {import('./module.js').TaskGroup} TaskGroup */ @@ -28,5 +30,62 @@ class MainThreadTasks { } module.exports = MainThreadTasks; +>module.exports : Symbol(MainThreadTasks, Decl(index.js, 0, 61)) +>module : Symbol(module.exports) +>exports : Symbol(MainThreadTasks, Decl(index.js, 0, 61)) >MainThreadTasks : Symbol(MainThreadTasks, Decl(index.js, 0, 61)) +=== module.js === +/** @typedef {'parseHTML'|'styleLayout'} TaskGroupIds */ + +/** + * @typedef TaskGroup + * @property {TaskGroupIds} id + * @property {string} label + * @property {string[]} traceEventNames + */ + +/** + * @type {{[P in TaskGroupIds]: {id: P, label: string}}} + */ +const taskGroups = { +>taskGroups : Symbol(taskGroups, Decl(module.js, 12, 5)) + + parseHTML: { +>parseHTML : Symbol(parseHTML, Decl(module.js, 12, 20)) + + id: 'parseHTML', +>id : Symbol(id, Decl(module.js, 13, 16)) + + label: 'Parse HTML & CSS' +>label : Symbol(label, Decl(module.js, 14, 24)) + + }, + styleLayout: { +>styleLayout : Symbol(styleLayout, Decl(module.js, 16, 6)) + + id: 'styleLayout', +>id : Symbol(id, Decl(module.js, 17, 18)) + + label: 'Style & Layout' +>label : Symbol(label, Decl(module.js, 18, 26)) + + }, +} + +/** @type {Object} */ +const taskNameToGroup = {}; +>taskNameToGroup : Symbol(taskNameToGroup, Decl(module.js, 24, 5)) + +module.exports = { +>module.exports : Symbol(export=, Decl(module.js, 24, 27)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(module.js, 24, 27)) + + taskGroups, +>taskGroups : Symbol(taskGroups, Decl(module.js, 26, 18)) + + taskNameToGroup, +>taskNameToGroup : Symbol(taskNameToGroup, Decl(module.js, 27, 15)) + +}; diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.symbols.diff index c196b877bd..80cb2b4d97 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.symbols.diff @@ -1,74 +1,28 @@ --- old.jsDeclarationsTypedefPropertyAndExportAssignment.symbols +++ new.jsDeclarationsTypedefPropertyAndExportAssignment.symbols -@@= skipped -3, +3 lines =@@ - const {taskGroups, taskNameToGroup} = require('./module.js'); - >taskGroups : Symbol(taskGroups, Decl(index.js, 0, 7)) - >taskNameToGroup : Symbol(taskNameToGroup, Decl(index.js, 0, 18)) -->require : Symbol(require) -->'./module.js' : Symbol("module", Decl(module.js, 0, 0)) - - /** @typedef {import('./module.js').TaskGroup} TaskGroup */ - -@@= skipped -26, +24 lines =@@ +@@= skipped -29, +29 lines =@@ } module.exports = MainThreadTasks; ->module.exports : Symbol(module.exports, Decl(index.js, 0, 0)) ->module : Symbol(export=, Decl(index.js, 18, 1)) ->exports : Symbol(export=, Decl(index.js, 18, 1)) ++>module.exports : Symbol(MainThreadTasks, Decl(index.js, 0, 61)) ++>module : Symbol(module.exports) ++>exports : Symbol(MainThreadTasks, Decl(index.js, 0, 61)) >MainThreadTasks : Symbol(MainThreadTasks, Decl(index.js, 0, 61)) --=== module.js === --/** @typedef {'parseHTML'|'styleLayout'} TaskGroupIds */ -- --/** -- * @typedef TaskGroup -- * @property {TaskGroupIds} id -- * @property {string} label -- * @property {string[]} traceEventNames -- */ -- --/** -- * @type {{[P in TaskGroupIds]: {id: P, label: string}}} -- */ --const taskGroups = { -->taskGroups : Symbol(taskGroups, Decl(module.js, 12, 5)) -- -- parseHTML: { -->parseHTML : Symbol(parseHTML, Decl(module.js, 12, 20)) -- -- id: 'parseHTML', -->id : Symbol(id, Decl(module.js, 13, 16)) -- -- label: 'Parse HTML & CSS' -->label : Symbol(label, Decl(module.js, 14, 24)) -- -- }, -- styleLayout: { -->styleLayout : Symbol(styleLayout, Decl(module.js, 16, 6)) -- -- id: 'styleLayout', -->id : Symbol(id, Decl(module.js, 17, 18)) -- -- label: 'Style & Layout' -->label : Symbol(label, Decl(module.js, 18, 26)) -- -- }, --} -- --/** @type {Object} */ --const taskNameToGroup = {}; -->taskNameToGroup : Symbol(taskNameToGroup, Decl(module.js, 24, 5)) -- --module.exports = { + === module.js === +@@= skipped -48, +48 lines =@@ + >taskNameToGroup : Symbol(taskNameToGroup, Decl(module.js, 24, 5)) + + module.exports = { ->module.exports : Symbol(module.exports, Decl(module.js, 0, 0)) ->module : Symbol(module, Decl(module.js, 24, 27)) ->exports : Symbol(module.exports, Decl(module.js, 0, 0)) -- -- taskGroups, -->taskGroups : Symbol(taskGroups, Decl(module.js, 26, 18)) -- -- taskNameToGroup, -->taskNameToGroup : Symbol(taskNameToGroup, Decl(module.js, 27, 15)) -- --}; ++>module.exports : Symbol(export=, Decl(module.js, 24, 27)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(module.js, 24, 27)) + + taskGroups, + >taskGroups : Symbol(taskGroups, Decl(module.js, 26, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.types b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.types index e63e30c6b2..66e4dc7661 100644 --- a/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.types @@ -2,9 +2,9 @@ === index.js === const {taskGroups, taskNameToGroup} = require('./module.js'); ->taskGroups : any +>taskGroups : { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; } >taskNameToGroup : any ->require('./module.js') : any +>require('./module.js') : { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; } >require : any >'./module.js' : "./module.js" @@ -32,8 +32,72 @@ class MainThreadTasks { module.exports = MainThreadTasks; >module.exports = MainThreadTasks : typeof MainThreadTasks ->module.exports : any ->module : any ->exports : any +>module.exports : typeof MainThreadTasks +>module : { MainThreadTasks: typeof MainThreadTasks; } +>exports : typeof MainThreadTasks >MainThreadTasks : typeof MainThreadTasks +=== module.js === +/** @typedef {'parseHTML'|'styleLayout'} TaskGroupIds */ + +/** + * @typedef TaskGroup + * @property {TaskGroupIds} id + * @property {string} label + * @property {string[]} traceEventNames + */ + +/** + * @type {{[P in TaskGroupIds]: {id: P, label: string}}} + */ +const taskGroups = { +>taskGroups : { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; } +>{ parseHTML: { id: 'parseHTML', label: 'Parse HTML & CSS' }, styleLayout: { id: 'styleLayout', label: 'Style & Layout' },} : { parseHTML: { id: string; label: string; }; styleLayout: { id: string; label: string; }; } + + parseHTML: { +>parseHTML : { id: string; label: string; } +>{ id: 'parseHTML', label: 'Parse HTML & CSS' } : { id: string; label: string; } + + id: 'parseHTML', +>id : string +>'parseHTML' : "parseHTML" + + label: 'Parse HTML & CSS' +>label : string +>'Parse HTML & CSS' : "Parse HTML & CSS" + + }, + styleLayout: { +>styleLayout : { id: string; label: string; } +>{ id: 'styleLayout', label: 'Style & Layout' } : { id: string; label: string; } + + id: 'styleLayout', +>id : string +>'styleLayout' : "styleLayout" + + label: 'Style & Layout' +>label : string +>'Style & Layout' : "Style & Layout" + + }, +} + +/** @type {Object} */ +const taskNameToGroup = {}; +>taskNameToGroup : any +>{} : {} + +module.exports = { +>module.exports = { taskGroups, taskNameToGroup,} : { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; } +>module.exports : { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; } +>module : { export=: { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; }; } +>exports : { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; } +>{ taskGroups, taskNameToGroup,} : { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; } + + taskGroups, +>taskGroups : { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; } + + taskNameToGroup, +>taskNameToGroup : any + +}; diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportType.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocImportType.errors.txt index b203c22a1c..50d816064a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportType.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportType.errors.txt @@ -1,32 +1,35 @@ -use.js(2,22): error TS2307: Cannot find module './mod1' or its corresponding type declarations. -use.js(8,12): error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? +mod1.js(4,14): error TS2339: Property 'chunk' does not exist on type 'Chunk'. +use.js(5,3): error TS2339: Property 'chunk' does not exist on type 'Chunk'. +use.js(10,3): error TS2339: Property 'chunk' does not exist on type 'Chunk'. ==== use.js (2 errors) ==== /// /** @typedef {import("./mod1")} C - ~~~~~~~~ -!!! error TS2307: Cannot find module './mod1' or its corresponding type declarations. * @type {C} */ var c; c.chunk; + ~~~~~ +!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. const D = require("./mod1"); /** @type {D} */ - ~ -!!! error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? var d; d.chunk; + ~~~~~ +!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. ==== types.d.ts (0 errors) ==== declare function require(name: string): any; declare var exports: any; declare var module: { exports: any }; -==== mod1.js (0 errors) ==== +==== mod1.js (1 errors) ==== /// class Chunk { constructor() { this.chunk = 1; + ~~~~~ +!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. } } module.exports = Chunk; diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportType.symbols b/testdata/baselines/reference/submodule/conformance/jsdocImportType.symbols index f4fbe092fa..93fb6896b8 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportType.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportType.symbols @@ -13,6 +13,7 @@ c.chunk; const D = require("./mod1"); >D : Symbol(D, Decl(use.js, 6, 5)) >require : Symbol(require, Decl(types.d.ts, 0, 0)) +>"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) /** @type {D} */ var d; @@ -33,3 +34,19 @@ declare var module: { exports: any }; >module : Symbol(module, Decl(types.d.ts, 2, 11)) >exports : Symbol(exports, Decl(types.d.ts, 2, 21)) +=== mod1.js === +/// +class Chunk { +>Chunk : Symbol(Chunk, Decl(mod1.js, 0, 0)) + + constructor() { + this.chunk = 1; +>this : Symbol(Chunk, Decl(mod1.js, 0, 0)) + } +} +module.exports = Chunk; +>module.exports : Symbol(Chunk, Decl(mod1.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(Chunk, Decl(mod1.js, 0, 0)) +>Chunk : Symbol(Chunk, Decl(mod1.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportType.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocImportType.symbols.diff index 24ea3bbc5f..f46c241539 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportType.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportType.symbols.diff @@ -10,11 +10,7 @@ const D = require("./mod1"); >D : Symbol(D, Decl(use.js, 6, 5)) - >require : Symbol(require, Decl(types.d.ts, 0, 0)) -->"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) - - /** @type {D} */ - var d; +@@= skipped -14, +12 lines =@@ >d : Symbol(d, Decl(use.js, 8, 3)) d.chunk; @@ -24,25 +20,21 @@ === types.d.ts === declare function require(name: string): any; -@@= skipped -30, +25 lines =@@ - >module : Symbol(module, Decl(types.d.ts, 2, 11)) - >exports : Symbol(exports, Decl(types.d.ts, 2, 21)) +@@= skipped -23, +21 lines =@@ --=== mod1.js === --/// --class Chunk { -->Chunk : Symbol(Chunk, Decl(mod1.js, 0, 0)) -- -- constructor() { -- this.chunk = 1; + constructor() { + this.chunk = 1; ->this.chunk : Symbol(Chunk.chunk, Decl(mod1.js, 2, 19)) -->this : Symbol(Chunk, Decl(mod1.js, 0, 0)) + >this : Symbol(Chunk, Decl(mod1.js, 0, 0)) ->chunk : Symbol(Chunk.chunk, Decl(mod1.js, 2, 19)) -- } --} --module.exports = Chunk; + } + } + module.exports = Chunk; ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 5, 1)) ->exports : Symbol(export=, Decl(mod1.js, 5, 1)) -->Chunk : Symbol(Chunk, Decl(mod1.js, 0, 0)) -- ++>module.exports : Symbol(Chunk, Decl(mod1.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(Chunk, Decl(mod1.js, 0, 0)) + >Chunk : Symbol(Chunk, Decl(mod1.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportType.types b/testdata/baselines/reference/submodule/conformance/jsdocImportType.types index b8e71d9b26..f2014f2aca 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportType.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportType.types @@ -5,26 +5,26 @@ /** @typedef {import("./mod1")} C * @type {C} */ var c; ->c : any +>c : Chunk c.chunk; >c.chunk : any ->c : any +>c : Chunk >chunk : any const D = require("./mod1"); ->D : any ->require("./mod1") : any +>D : typeof Chunk +>require("./mod1") : typeof Chunk >require : (name: string) => any >"./mod1" : "./mod1" /** @type {D} */ var d; ->d : D +>d : Chunk d.chunk; >d.chunk : any ->d : D +>d : Chunk >chunk : any === types.d.ts === @@ -39,3 +39,24 @@ declare var module: { exports: any }; >module : { exports: any; } >exports : any +=== mod1.js === +/// +class Chunk { +>Chunk : Chunk + + constructor() { + this.chunk = 1; +>this.chunk = 1 : 1 +>this.chunk : any +>this : this +>chunk : any +>1 : 1 + } +} +module.exports = Chunk; +>module.exports = Chunk : typeof Chunk +>module.exports : typeof Chunk +>module : { Chunk: typeof Chunk; } +>exports : typeof Chunk +>Chunk : typeof Chunk + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportType2.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocImportType2.errors.txt index c05368aaf8..3273bfe228 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportType2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportType2.errors.txt @@ -1,32 +1,35 @@ -use.js(2,22): error TS2307: Cannot find module './mod1' or its corresponding type declarations. -use.js(8,12): error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? +mod1.js(4,14): error TS2339: Property 'chunk' does not exist on type 'Chunk'. +use.js(5,3): error TS2339: Property 'chunk' does not exist on type 'Chunk'. +use.js(10,3): error TS2339: Property 'chunk' does not exist on type 'Chunk'. ==== use.js (2 errors) ==== /// /** @typedef {import("./mod1")} C - ~~~~~~~~ -!!! error TS2307: Cannot find module './mod1' or its corresponding type declarations. * @type {C} */ var c; c.chunk; + ~~~~~ +!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. const D = require("./mod1"); /** @type {D} */ - ~ -!!! error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? var d; d.chunk; + ~~~~~ +!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. ==== types.d.ts (0 errors) ==== declare function require(name: string): any; declare var exports: any; declare var module: { exports: any }; -==== mod1.js (0 errors) ==== +==== mod1.js (1 errors) ==== /// module.exports = class Chunk { constructor() { this.chunk = 1; + ~~~~~ +!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. } } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportType2.symbols b/testdata/baselines/reference/submodule/conformance/jsdocImportType2.symbols index 2a73980c73..b5061bd821 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportType2.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportType2.symbols @@ -13,6 +13,7 @@ c.chunk; const D = require("./mod1"); >D : Symbol(D, Decl(use.js, 6, 5)) >require : Symbol(require, Decl(types.d.ts, 0, 0)) +>"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) /** @type {D} */ var d; @@ -33,3 +34,17 @@ declare var module: { exports: any }; >module : Symbol(module, Decl(types.d.ts, 2, 11)) >exports : Symbol(exports, Decl(types.d.ts, 2, 21)) +=== mod1.js === +/// +module.exports = class Chunk { +>module.exports : Symbol(Chunk, Decl(mod1.js, 1, 16)) +>module : Symbol(module.exports) +>exports : Symbol(Chunk, Decl(mod1.js, 1, 16)) +>Chunk : Symbol(Chunk, Decl(mod1.js, 1, 16)) + + constructor() { + this.chunk = 1; +>this : Symbol(Chunk, Decl(mod1.js, 1, 16)) + } +} + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportType2.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocImportType2.symbols.diff index 26883e8f94..add0deb055 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportType2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportType2.symbols.diff @@ -10,11 +10,7 @@ const D = require("./mod1"); >D : Symbol(D, Decl(use.js, 6, 5)) - >require : Symbol(require, Decl(types.d.ts, 0, 0)) -->"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) - - /** @type {D} */ - var d; +@@= skipped -14, +12 lines =@@ >d : Symbol(d, Decl(use.js, 8, 3)) d.chunk; @@ -24,23 +20,23 @@ === types.d.ts === declare function require(name: string): any; -@@= skipped -30, +25 lines =@@ - >module : Symbol(module, Decl(types.d.ts, 2, 11)) - >exports : Symbol(exports, Decl(types.d.ts, 2, 21)) - --=== mod1.js === --/// --module.exports = class Chunk { +@@= skipped -19, +17 lines =@@ + === mod1.js === + /// + module.exports = class Chunk { ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 0, 0)) ->exports : Symbol(export=, Decl(mod1.js, 0, 0)) -->Chunk : Symbol(Chunk, Decl(mod1.js, 1, 16)) -- -- constructor() { -- this.chunk = 1; ++>module.exports : Symbol(Chunk, Decl(mod1.js, 1, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(Chunk, Decl(mod1.js, 1, 16)) + >Chunk : Symbol(Chunk, Decl(mod1.js, 1, 16)) + + constructor() { + this.chunk = 1; ->this.chunk : Symbol(Chunk.chunk, Decl(mod1.js, 2, 19)) -->this : Symbol(Chunk, Decl(mod1.js, 1, 16)) + >this : Symbol(Chunk, Decl(mod1.js, 1, 16)) ->chunk : Symbol(Chunk.chunk, Decl(mod1.js, 2, 19)) -- } --} -- + } + } + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportType2.types b/testdata/baselines/reference/submodule/conformance/jsdocImportType2.types index 68968909e1..1fc82acd28 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportType2.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportType2.types @@ -5,26 +5,26 @@ /** @typedef {import("./mod1")} C * @type {C} */ var c; ->c : any +>c : Chunk c.chunk; >c.chunk : any ->c : any +>c : Chunk >chunk : any const D = require("./mod1"); ->D : any ->require("./mod1") : any +>D : typeof Chunk +>require("./mod1") : typeof Chunk >require : (name: string) => any >"./mod1" : "./mod1" /** @type {D} */ var d; ->d : D +>d : Chunk d.chunk; >d.chunk : any ->d : D +>d : Chunk >chunk : any === types.d.ts === @@ -39,3 +39,23 @@ declare var module: { exports: any }; >module : { exports: any; } >exports : any +=== mod1.js === +/// +module.exports = class Chunk { +>module.exports = class Chunk { constructor() { this.chunk = 1; }} : typeof Chunk +>module.exports : typeof Chunk +>module : { Chunk: typeof Chunk; } +>exports : typeof Chunk +>class Chunk { constructor() { this.chunk = 1; }} : typeof Chunk +>Chunk : typeof Chunk + + constructor() { + this.chunk = 1; +>this.chunk = 1 : 1 +>this.chunk : any +>this : this +>chunk : any +>1 : 1 + } +} + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.errors.txt index 5555cf2cf6..0a42dea7d4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.errors.txt @@ -1,19 +1,16 @@ -mod1.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -test.js(1,22): error TS2306: File 'mod1.js' is not a module. +test.js(1,32): error TS2694: Namespace '"mod1"' has no exported member 'C'. -==== mod1.js (1 errors) ==== +==== mod1.js (0 errors) ==== class C { s() { } } module.exports.C = C - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== test.js (1 errors) ==== /** @typedef {import('./mod1').C} X */ - ~~~~~~~~ -!!! error TS2306: File 'mod1.js' is not a module. + ~ +!!! error TS2694: Namespace '"mod1"' has no exported member 'C'. /** @param {X} c */ function demo(c) { c.s diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.symbols b/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.symbols index ad46e0cc6f..2efc73a491 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.symbols @@ -8,6 +8,11 @@ class C { >s : Symbol(s, Decl(mod1.js, 0, 9)) } module.exports.C = C +>module.exports.C : Symbol(C, Decl(mod1.js, 2, 1)) +>module.exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>C : Symbol(C, Decl(mod1.js, 2, 1)) >C : Symbol(C, Decl(mod1.js, 0, 0)) === test.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.symbols.diff index 729ff3ce9d..bd51876b6c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.symbols.diff @@ -8,15 +8,17 @@ +>s : Symbol(s, Decl(mod1.js, 0, 9)) } module.exports.C = C -->module.exports.C : Symbol(C, Decl(mod1.js, 2, 1)) + >module.exports.C : Symbol(C, Decl(mod1.js, 2, 1)) ->module.exports : Symbol(C, Decl(mod1.js, 2, 1)) ->module : Symbol(module, Decl(mod1.js, 2, 1)) ->exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) -->C : Symbol(C, Decl(mod1.js, 2, 1)) ++>module.exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) + >C : Symbol(C, Decl(mod1.js, 2, 1)) >C : Symbol(C, Decl(mod1.js, 0, 0)) - === test.js === -@@= skipped -18, +13 lines =@@ +@@= skipped -18, +18 lines =@@ >c : Symbol(c, Decl(test.js, 2, 14)) c.s diff --git a/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.types b/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.types index 708c0cd094..ef614c82e9 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocImportTypeReferenceToClassAlias.types @@ -9,11 +9,11 @@ class C { } module.exports.C = C >module.exports.C = C : typeof C ->module.exports.C : any ->module.exports : any ->module : any ->exports : any ->C : any +>module.exports.C : typeof C +>module.exports : typeof import("mod1") +>module : { "mod1": typeof import("mod1"); } +>exports : typeof import("mod1") +>C : typeof C >C : typeof C === test.js === diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.errors.txt index c1d8fe65fb..7763b5edfe 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.errors.txt @@ -1,22 +1,37 @@ -use.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod.js(2,21): error TS2339: Property 'g' does not exist on type 'typeof import("mod")'. +mod.js(2,37): error TS7006: Parameter 'n' implicitly has an 'any' type. +mod.js(6,35): error TS2339: Property 'i' does not exist on type 'typeof import("mod")'. +mod.js(6,51): error TS7006: Parameter 'mom' implicitly has an 'any' type. +use.js(3,5): error TS2339: Property 'g' does not exist on type 'typeof import("mod")'. +use.js(5,5): error TS2339: Property 'i' does not exist on type 'typeof import("mod")'. -==== use.js (1 errors) ==== +==== use.js (2 errors) ==== var mod = require('./mod'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. mod.f('no') mod.g('also no') + ~ +!!! error TS2339: Property 'g' does not exist on type 'typeof import("mod")'. mod.h(0) mod.i(1) + ~ +!!! error TS2339: Property 'i' does not exist on type 'typeof import("mod")'. -==== mod.js (0 errors) ==== +==== mod.js (4 errors) ==== /** @param {number} n */ exports.f = exports.g = function fg(n) { + ~ +!!! error TS2339: Property 'g' does not exist on type 'typeof import("mod")'. + ~ +!!! error TS7006: Parameter 'n' implicitly has an 'any' type. return n + 1 } /** @param {string} mom */ module.exports.h = module.exports.i = function hi(mom) { + ~ +!!! error TS2339: Property 'i' does not exist on type 'typeof import("mod")'. + ~~~ +!!! error TS7006: Parameter 'mom' implicitly has an 'any' type. return `hi, ${mom}!`; } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.symbols b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.symbols index 06d1ec0222..dfaa882c92 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.symbols @@ -3,16 +3,52 @@ === use.js === var mod = require('./mod'); >mod : Symbol(mod, Decl(use.js, 0, 3)) +>require : Symbol(require) +>'./mod' : Symbol("mod", Decl(mod.js, 0, 0)) mod.f('no') +>mod.f : Symbol(f, Decl(mod.js, 0, 0)) >mod : Symbol(mod, Decl(use.js, 0, 3)) +>f : Symbol(f, Decl(mod.js, 0, 0)) mod.g('also no') >mod : Symbol(mod, Decl(use.js, 0, 3)) mod.h(0) +>mod.h : Symbol(h, Decl(mod.js, 3, 1)) >mod : Symbol(mod, Decl(use.js, 0, 3)) +>h : Symbol(h, Decl(mod.js, 3, 1)) mod.i(1) >mod : Symbol(mod, Decl(use.js, 0, 3)) +=== mod.js === +/** @param {number} n */ +exports.f = exports.g = function fg(n) { +>exports.f : Symbol(f, Decl(mod.js, 0, 0)) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>f : Symbol(f, Decl(mod.js, 0, 0)) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>fg : Symbol(fg, Decl(mod.js, 1, 23)) +>n : Symbol(n, Decl(mod.js, 1, 36)) + + return n + 1 +>n : Symbol(n, Decl(mod.js, 1, 36)) +} +/** @param {string} mom */ +module.exports.h = module.exports.i = function hi(mom) { +>module.exports.h : Symbol(h, Decl(mod.js, 3, 1)) +>module.exports : Symbol("mod", Decl(mod.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>h : Symbol(h, Decl(mod.js, 3, 1)) +>module.exports : Symbol("mod", Decl(mod.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>hi : Symbol(hi, Decl(mod.js, 5, 37)) +>mom : Symbol(mom, Decl(mod.js, 5, 50)) + + return `hi, ${mom}!`; +>mom : Symbol(mom, Decl(mod.js, 5, 50)) +} + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.symbols.diff index a94228b90a..5e5d91c480 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.symbols.diff @@ -1,16 +1,18 @@ --- old.jsdocTypeFromChainedAssignment2.symbols +++ new.jsdocTypeFromChainedAssignment2.symbols -@@= skipped -2, +2 lines =@@ - === use.js === +@@= skipped -3, +3 lines =@@ var mod = require('./mod'); >mod : Symbol(mod, Decl(use.js, 0, 3)) -->require : Symbol(require) + >require : Symbol(require) ->'./mod' : Symbol(mod, Decl(mod.js, 0, 0)) ++>'./mod' : Symbol("mod", Decl(mod.js, 0, 0)) mod.f('no') ->mod.f : Symbol(mod.f, Decl(mod.js, 0, 0)) ++>mod.f : Symbol(f, Decl(mod.js, 0, 0)) >mod : Symbol(mod, Decl(use.js, 0, 3)) ->f : Symbol(mod.f, Decl(mod.js, 0, 0)) ++>f : Symbol(f, Decl(mod.js, 0, 0)) mod.g('also no') ->mod.g : Symbol(mod.g, Decl(mod.js, 1, 11)) @@ -19,45 +21,49 @@ mod.h(0) ->mod.h : Symbol(mod.h, Decl(mod.js, 3, 1)) ++>mod.h : Symbol(h, Decl(mod.js, 3, 1)) >mod : Symbol(mod, Decl(use.js, 0, 3)) ->h : Symbol(mod.h, Decl(mod.js, 3, 1)) ++>h : Symbol(h, Decl(mod.js, 3, 1)) mod.i(1) ->mod.i : Symbol(mod.i, Decl(mod.js, 5, 18)) >mod : Symbol(mod, Decl(use.js, 0, 3)) ->i : Symbol(mod.i, Decl(mod.js, 5, 18)) --=== mod.js === --/** @param {number} n */ --exports.f = exports.g = function fg(n) { -->exports.f : Symbol(f, Decl(mod.js, 0, 0)) + === mod.js === + /** @param {number} n */ + exports.f = exports.g = function fg(n) { + >exports.f : Symbol(f, Decl(mod.js, 0, 0)) ->exports : Symbol(f, Decl(mod.js, 0, 0)) -->f : Symbol(f, Decl(mod.js, 0, 0)) ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) + >f : Symbol(f, Decl(mod.js, 0, 0)) ->exports.g : Symbol(g, Decl(mod.js, 1, 11)) ->exports : Symbol(g, Decl(mod.js, 1, 11)) ->g : Symbol(g, Decl(mod.js, 1, 11)) -->fg : Symbol(fg, Decl(mod.js, 1, 23)) -->n : Symbol(n, Decl(mod.js, 1, 36)) -- -- return n + 1 -->n : Symbol(n, Decl(mod.js, 1, 36)) --} --/** @param {string} mom */ --module.exports.h = module.exports.i = function hi(mom) { -->module.exports.h : Symbol(h, Decl(mod.js, 3, 1)) ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) + >fg : Symbol(fg, Decl(mod.js, 1, 23)) + >n : Symbol(n, Decl(mod.js, 1, 36)) + +@@= skipped -40, +34 lines =@@ + /** @param {string} mom */ + module.exports.h = module.exports.i = function hi(mom) { + >module.exports.h : Symbol(h, Decl(mod.js, 3, 1)) ->module.exports : Symbol(h, Decl(mod.js, 3, 1)) ->module : Symbol(module, Decl(mod.js, 3, 1)) ->exports : Symbol(module.exports, Decl(mod.js, 0, 0)) -->h : Symbol(h, Decl(mod.js, 3, 1)) ++>module.exports : Symbol("mod", Decl(mod.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) + >h : Symbol(h, Decl(mod.js, 3, 1)) ->module.exports.i : Symbol(i, Decl(mod.js, 5, 18)) ->module.exports : Symbol(i, Decl(mod.js, 5, 18)) ->module : Symbol(module, Decl(mod.js, 3, 1)) ->exports : Symbol(module.exports, Decl(mod.js, 0, 0)) ->i : Symbol(i, Decl(mod.js, 5, 18)) -->hi : Symbol(hi, Decl(mod.js, 5, 37)) -->mom : Symbol(mom, Decl(mod.js, 5, 50)) -- -- return `hi, ${mom}!`; -->mom : Symbol(mom, Decl(mod.js, 5, 50)) --} -- ++>module.exports : Symbol("mod", Decl(mod.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) + >hi : Symbol(hi, Decl(mod.js, 5, 37)) + >mom : Symbol(mom, Decl(mod.js, 5, 50)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.types b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.types index 1043bd0ba7..133f69c522 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment2.types @@ -2,36 +2,79 @@ === use.js === var mod = require('./mod'); ->mod : any ->require('./mod') : any +>mod : typeof import("mod") +>require('./mod') : typeof import("mod") >require : any >'./mod' : "./mod" mod.f('no') >mod.f('no') : any ->mod.f : any ->mod : any ->f : any +>mod.f : (n: any) => any +>mod : typeof import("mod") +>f : (n: any) => any >'no' : "no" mod.g('also no') >mod.g('also no') : any >mod.g : any ->mod : any +>mod : typeof import("mod") >g : any >'also no' : "also no" mod.h(0) ->mod.h(0) : any ->mod.h : any ->mod : any ->h : any +>mod.h(0) : string +>mod.h : (mom: any) => string +>mod : typeof import("mod") +>h : (mom: any) => string >0 : 0 mod.i(1) >mod.i(1) : any >mod.i : any ->mod : any +>mod : typeof import("mod") >i : any >1 : 1 +=== mod.js === +/** @param {number} n */ +exports.f = exports.g = function fg(n) { +>exports.f = exports.g = function fg(n) { return n + 1} : (n: any) => any +>exports.f : (n: any) => any +>exports : typeof import("mod") +>f : (n: any) => any +>exports.g = function fg(n) { return n + 1} : (n: any) => any +>exports.g : any +>exports : typeof import("mod") +>g : any +>function fg(n) { return n + 1} : (n: any) => any +>fg : (n: any) => any +>n : any + + return n + 1 +>n + 1 : any +>n : any +>1 : 1 +} +/** @param {string} mom */ +module.exports.h = module.exports.i = function hi(mom) { +>module.exports.h = module.exports.i = function hi(mom) { return `hi, ${mom}!`;} : (mom: any) => string +>module.exports.h : (mom: any) => string +>module.exports : typeof import("mod") +>module : { "mod": typeof import("mod"); } +>exports : typeof import("mod") +>h : (mom: any) => string +>module.exports.i = function hi(mom) { return `hi, ${mom}!`;} : (mom: any) => string +>module.exports.i : any +>module.exports : typeof import("mod") +>module : { "mod": typeof import("mod"); } +>exports : typeof import("mod") +>i : any +>function hi(mom) { return `hi, ${mom}!`;} : (mom: any) => string +>hi : (mom: any) => string +>mom : any + + return `hi, ${mom}!`; +>`hi, ${mom}!` : string +>mom : any +} + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.errors.txt index 5c16612660..d4cc5b3817 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.errors.txt @@ -1,301 +1,298 @@ -a.js(1,1): error TS2304: Cannot find name 'exports'. -a.js(1,20): error TS2304: Cannot find name 'exports'. -a.js(1,43): error TS2304: Cannot find name 'exports'. -a.js(1,65): error TS2304: Cannot find name 'exports'. -a.js(1,82): error TS2304: Cannot find name 'exports'. -a.js(1,98): error TS2304: Cannot find name 'exports'. -a.js(1,114): error TS2304: Cannot find name 'exports'. -a.js(1,131): error TS2304: Cannot find name 'exports'. -a.js(1,156): error TS2304: Cannot find name 'exports'. -a.js(1,182): error TS2304: Cannot find name 'exports'. -a.js(1,202): error TS2304: Cannot find name 'exports'. -a.js(1,225): error TS2304: Cannot find name 'exports'. -a.js(1,249): error TS2304: Cannot find name 'exports'. -a.js(1,267): error TS2304: Cannot find name 'exports'. -a.js(1,288): error TS2304: Cannot find name 'exports'. -a.js(1,308): error TS2304: Cannot find name 'exports'. -a.js(1,323): error TS2304: Cannot find name 'exports'. -a.js(1,343): error TS2304: Cannot find name 'exports'. -a.js(1,362): error TS2304: Cannot find name 'exports'. -a.js(1,376): error TS2304: Cannot find name 'exports'. -a.js(1,396): error TS2304: Cannot find name 'exports'. -a.js(1,415): error TS2304: Cannot find name 'exports'. -a.js(1,429): error TS2304: Cannot find name 'exports'. -a.js(1,446): error TS2304: Cannot find name 'exports'. -a.js(1,466): error TS2304: Cannot find name 'exports'. -a.js(1,482): error TS2304: Cannot find name 'exports'. -a.js(1,502): error TS2304: Cannot find name 'exports'. -a.js(1,520): error TS2304: Cannot find name 'exports'. -a.js(1,540): error TS2304: Cannot find name 'exports'. -a.js(1,562): error TS2304: Cannot find name 'exports'. -a.js(1,583): error TS2304: Cannot find name 'exports'. -a.js(1,599): error TS2304: Cannot find name 'exports'. -a.js(1,617): error TS2304: Cannot find name 'exports'. -a.js(1,634): error TS2304: Cannot find name 'exports'. -a.js(1,655): error TS2304: Cannot find name 'exports'. -a.js(1,675): error TS2304: Cannot find name 'exports'. -a.js(1,690): error TS2304: Cannot find name 'exports'. -a.js(1,713): error TS2304: Cannot find name 'exports'. -a.js(1,730): error TS2304: Cannot find name 'exports'. -a.js(1,744): error TS2304: Cannot find name 'exports'. -a.js(1,764): error TS2304: Cannot find name 'exports'. -a.js(1,780): error TS2304: Cannot find name 'exports'. -a.js(1,803): error TS2304: Cannot find name 'exports'. -a.js(1,825): error TS2304: Cannot find name 'exports'. -a.js(1,842): error TS2304: Cannot find name 'exports'. -a.js(1,863): error TS2304: Cannot find name 'exports'. -a.js(1,881): error TS2304: Cannot find name 'exports'. -a.js(1,903): error TS2304: Cannot find name 'exports'. -a.js(1,920): error TS2304: Cannot find name 'exports'. -a.js(1,935): error TS2304: Cannot find name 'exports'. -a.js(1,951): error TS2304: Cannot find name 'exports'. -a.js(1,975): error TS2304: Cannot find name 'exports'. -a.js(1,999): error TS2304: Cannot find name 'exports'. -a.js(1,1018): error TS2304: Cannot find name 'exports'. -a.js(1,1037): error TS2304: Cannot find name 'exports'. -a.js(1,1055): error TS2304: Cannot find name 'exports'. -a.js(1,1081): error TS2304: Cannot find name 'exports'. -a.js(1,1106): error TS2304: Cannot find name 'exports'. -a.js(1,1126): error TS2304: Cannot find name 'exports'. -a.js(1,1146): error TS2304: Cannot find name 'exports'. -a.js(1,1165): error TS2304: Cannot find name 'exports'. -a.js(1,1179): error TS2304: Cannot find name 'exports'. -a.js(1,1193): error TS2304: Cannot find name 'exports'. -a.js(1,1217): error TS2304: Cannot find name 'exports'. -a.js(1,1240): error TS2304: Cannot find name 'exports'. -a.js(1,1258): error TS2304: Cannot find name 'exports'. -a.js(1,1276): error TS2304: Cannot find name 'exports'. -a.js(1,1299): error TS2304: Cannot find name 'exports'. -a.js(1,1321): error TS2304: Cannot find name 'exports'. -a.js(1,1338): error TS2304: Cannot find name 'exports'. -a.js(1,1360): error TS2304: Cannot find name 'exports'. -a.js(1,1381): error TS2304: Cannot find name 'exports'. -a.js(1,1397): error TS2304: Cannot find name 'exports'. -a.js(1,1419): error TS2304: Cannot find name 'exports'. -a.js(1,1440): error TS2304: Cannot find name 'exports'. -a.js(1,1463): error TS2304: Cannot find name 'exports'. -a.js(1,1485): error TS2304: Cannot find name 'exports'. -a.js(1,1502): error TS2304: Cannot find name 'exports'. -a.js(1,1522): error TS2304: Cannot find name 'exports'. -a.js(1,1537): error TS2304: Cannot find name 'exports'. -a.js(1,1554): error TS2304: Cannot find name 'exports'. -a.js(1,1573): error TS2304: Cannot find name 'exports'. -a.js(1,1591): error TS2304: Cannot find name 'exports'. -a.js(1,1610): error TS2304: Cannot find name 'exports'. -a.js(1,1624): error TS2304: Cannot find name 'exports'. -a.js(1,1647): error TS2304: Cannot find name 'exports'. -a.js(1,1669): error TS2304: Cannot find name 'exports'. -a.js(1,1686): error TS2304: Cannot find name 'exports'. -a.js(1,1705): error TS2304: Cannot find name 'exports'. -a.js(1,1728): error TS2304: Cannot find name 'exports'. -a.js(1,1750): error TS2304: Cannot find name 'exports'. -a.js(1,1767): error TS2304: Cannot find name 'exports'. -a.js(1,1785): error TS2304: Cannot find name 'exports'. -a.js(1,1801): error TS2304: Cannot find name 'exports'. -a.js(1,1822): error TS2304: Cannot find name 'exports'. -a.js(1,1837): error TS2304: Cannot find name 'exports'. -a.js(1,1856): error TS2304: Cannot find name 'exports'. -a.js(1,1882): error TS2304: Cannot find name 'exports'. -a.js(1,1902): error TS2304: Cannot find name 'exports'. +a.js(1,28): error TS2339: Property 'selectSeries' does not exist on type 'typeof import("a")'. +a.js(1,51): error TS2339: Property 'selectLimit' does not exist on type 'typeof import("a")'. +a.js(1,73): error TS2339: Property 'select' does not exist on type 'typeof import("a")'. +a.js(1,90): error TS2339: Property 'foldr' does not exist on type 'typeof import("a")'. +a.js(1,106): error TS2339: Property 'foldl' does not exist on type 'typeof import("a")'. +a.js(1,122): error TS2339: Property 'inject' does not exist on type 'typeof import("a")'. +a.js(1,139): error TS2339: Property 'forEachOfLimit' does not exist on type 'typeof import("a")'. +a.js(1,164): error TS2339: Property 'forEachOfSeries' does not exist on type 'typeof import("a")'. +a.js(1,190): error TS2339: Property 'forEachOf' does not exist on type 'typeof import("a")'. +a.js(1,210): error TS2339: Property 'forEachLimit' does not exist on type 'typeof import("a")'. +a.js(1,233): error TS2339: Property 'forEachSeries' does not exist on type 'typeof import("a")'. +a.js(1,257): error TS2339: Property 'forEach' does not exist on type 'typeof import("a")'. +a.js(1,275): error TS2339: Property 'findSeries' does not exist on type 'typeof import("a")'. +a.js(1,296): error TS2339: Property 'findLimit' does not exist on type 'typeof import("a")'. +a.js(1,316): error TS2339: Property 'find' does not exist on type 'typeof import("a")'. +a.js(1,331): error TS2339: Property 'anySeries' does not exist on type 'typeof import("a")'. +a.js(1,351): error TS2339: Property 'anyLimit' does not exist on type 'typeof import("a")'. +a.js(1,370): error TS2339: Property 'any' does not exist on type 'typeof import("a")'. +a.js(1,384): error TS2339: Property 'allSeries' does not exist on type 'typeof import("a")'. +a.js(1,404): error TS2339: Property 'allLimit' does not exist on type 'typeof import("a")'. +a.js(1,423): error TS2339: Property 'all' does not exist on type 'typeof import("a")'. +a.js(1,437): error TS2339: Property 'whilst' does not exist on type 'typeof import("a")'. +a.js(1,454): error TS2339: Property 'waterfall' does not exist on type 'typeof import("a")'. +a.js(1,474): error TS2339: Property 'until' does not exist on type 'typeof import("a")'. +a.js(1,490): error TS2339: Property 'unmemoize' does not exist on type 'typeof import("a")'. +a.js(1,510): error TS2339: Property 'tryEach' does not exist on type 'typeof import("a")'. +a.js(1,528): error TS2339: Property 'transform' does not exist on type 'typeof import("a")'. +a.js(1,548): error TS2339: Property 'timesSeries' does not exist on type 'typeof import("a")'. +a.js(1,570): error TS2339: Property 'timesLimit' does not exist on type 'typeof import("a")'. +a.js(1,591): error TS2339: Property 'times' does not exist on type 'typeof import("a")'. +a.js(1,607): error TS2339: Property 'timeout' does not exist on type 'typeof import("a")'. +a.js(1,625): error TS2339: Property 'sortBy' does not exist on type 'typeof import("a")'. +a.js(1,642): error TS2339: Property 'someSeries' does not exist on type 'typeof import("a")'. +a.js(1,663): error TS2339: Property 'someLimit' does not exist on type 'typeof import("a")'. +a.js(1,683): error TS2339: Property 'some' does not exist on type 'typeof import("a")'. +a.js(1,698): error TS2339: Property 'setImmediate' does not exist on type 'typeof import("a")'. +a.js(1,721): error TS2339: Property 'series' does not exist on type 'typeof import("a")'. +a.js(1,738): error TS2339: Property 'seq' does not exist on type 'typeof import("a")'. +a.js(1,752): error TS2339: Property 'retryable' does not exist on type 'typeof import("a")'. +a.js(1,772): error TS2339: Property 'retry' does not exist on type 'typeof import("a")'. +a.js(1,788): error TS2339: Property 'rejectSeries' does not exist on type 'typeof import("a")'. +a.js(1,811): error TS2339: Property 'rejectLimit' does not exist on type 'typeof import("a")'. +a.js(1,833): error TS2339: Property 'reject' does not exist on type 'typeof import("a")'. +a.js(1,850): error TS2339: Property 'reflectAll' does not exist on type 'typeof import("a")'. +a.js(1,871): error TS2339: Property 'reflect' does not exist on type 'typeof import("a")'. +a.js(1,889): error TS2339: Property 'reduceRight' does not exist on type 'typeof import("a")'. +a.js(1,911): error TS2339: Property 'reduce' does not exist on type 'typeof import("a")'. +a.js(1,928): error TS2339: Property 'race' does not exist on type 'typeof import("a")'. +a.js(1,943): error TS2339: Property 'queue' does not exist on type 'typeof import("a")'. +a.js(1,959): error TS2339: Property 'priorityQueue' does not exist on type 'typeof import("a")'. +a.js(1,983): error TS2339: Property 'parallelLimit' does not exist on type 'typeof import("a")'. +a.js(1,1007): error TS2339: Property 'parallel' does not exist on type 'typeof import("a")'. +a.js(1,1026): error TS2339: Property 'nextTick' does not exist on type 'typeof import("a")'. +a.js(1,1045): error TS2339: Property 'memoize' does not exist on type 'typeof import("a")'. +a.js(1,1063): error TS2339: Property 'mapValuesSeries' does not exist on type 'typeof import("a")'. +a.js(1,1089): error TS2339: Property 'mapValuesLimit' does not exist on type 'typeof import("a")'. +a.js(1,1114): error TS2339: Property 'mapValues' does not exist on type 'typeof import("a")'. +a.js(1,1134): error TS2339: Property 'mapSeries' does not exist on type 'typeof import("a")'. +a.js(1,1154): error TS2339: Property 'mapLimit' does not exist on type 'typeof import("a")'. +a.js(1,1173): error TS2339: Property 'map' does not exist on type 'typeof import("a")'. +a.js(1,1187): error TS2339: Property 'log' does not exist on type 'typeof import("a")'. +a.js(1,1201): error TS2339: Property 'groupBySeries' does not exist on type 'typeof import("a")'. +a.js(1,1225): error TS2339: Property 'groupByLimit' does not exist on type 'typeof import("a")'. +a.js(1,1248): error TS2339: Property 'groupBy' does not exist on type 'typeof import("a")'. +a.js(1,1266): error TS2339: Property 'forever' does not exist on type 'typeof import("a")'. +a.js(1,1284): error TS2339: Property 'filterSeries' does not exist on type 'typeof import("a")'. +a.js(1,1307): error TS2339: Property 'filterLimit' does not exist on type 'typeof import("a")'. +a.js(1,1329): error TS2339: Property 'filter' does not exist on type 'typeof import("a")'. +a.js(1,1346): error TS2339: Property 'everySeries' does not exist on type 'typeof import("a")'. +a.js(1,1368): error TS2339: Property 'everyLimit' does not exist on type 'typeof import("a")'. +a.js(1,1389): error TS2339: Property 'every' does not exist on type 'typeof import("a")'. +a.js(1,1405): error TS2339: Property 'ensureAsync' does not exist on type 'typeof import("a")'. +a.js(1,1427): error TS2339: Property 'eachSeries' does not exist on type 'typeof import("a")'. +a.js(1,1448): error TS2339: Property 'eachOfSeries' does not exist on type 'typeof import("a")'. +a.js(1,1471): error TS2339: Property 'eachOfLimit' does not exist on type 'typeof import("a")'. +a.js(1,1493): error TS2339: Property 'eachOf' does not exist on type 'typeof import("a")'. +a.js(1,1510): error TS2339: Property 'eachLimit' does not exist on type 'typeof import("a")'. +a.js(1,1530): error TS2339: Property 'each' does not exist on type 'typeof import("a")'. +a.js(1,1545): error TS2339: Property 'during' does not exist on type 'typeof import("a")'. +a.js(1,1562): error TS2339: Property 'doWhilst' does not exist on type 'typeof import("a")'. +a.js(1,1581): error TS2339: Property 'doUntil' does not exist on type 'typeof import("a")'. +a.js(1,1599): error TS2339: Property 'doDuring' does not exist on type 'typeof import("a")'. +a.js(1,1618): error TS2339: Property 'dir' does not exist on type 'typeof import("a")'. +a.js(1,1632): error TS2339: Property 'detectSeries' does not exist on type 'typeof import("a")'. +a.js(1,1655): error TS2339: Property 'detectLimit' does not exist on type 'typeof import("a")'. +a.js(1,1677): error TS2339: Property 'detect' does not exist on type 'typeof import("a")'. +a.js(1,1694): error TS2339: Property 'constant' does not exist on type 'typeof import("a")'. +a.js(1,1713): error TS2339: Property 'concatSeries' does not exist on type 'typeof import("a")'. +a.js(1,1736): error TS2339: Property 'concatLimit' does not exist on type 'typeof import("a")'. +a.js(1,1758): error TS2339: Property 'concat' does not exist on type 'typeof import("a")'. +a.js(1,1775): error TS2339: Property 'compose' does not exist on type 'typeof import("a")'. +a.js(1,1793): error TS2339: Property 'cargo' does not exist on type 'typeof import("a")'. +a.js(1,1809): error TS2339: Property 'autoInject' does not exist on type 'typeof import("a")'. +a.js(1,1830): error TS2339: Property 'auto' does not exist on type 'typeof import("a")'. +a.js(1,1845): error TS2339: Property 'asyncify' does not exist on type 'typeof import("a")'. +a.js(1,1864): error TS2339: Property 'applyEachSeries' does not exist on type 'typeof import("a")'. +a.js(1,1890): error TS2339: Property 'applyEach' does not exist on type 'typeof import("a")'. +a.js(1,1910): error TS2339: Property 'apply' does not exist on type 'typeof import("a")'. -==== a.js (99 errors) ==== +==== a.js (98 errors) ==== exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. \ No newline at end of file + ~~~~~~~~~~~~ +!!! error TS2339: Property 'selectSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~ +!!! error TS2339: Property 'selectLimit' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'select' does not exist on type 'typeof import("a")'. + ~~~~~ +!!! error TS2339: Property 'foldr' does not exist on type 'typeof import("a")'. + ~~~~~ +!!! error TS2339: Property 'foldl' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'inject' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~~~ +!!! error TS2339: Property 'forEachOfLimit' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'forEachOfSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'forEachOf' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~ +!!! error TS2339: Property 'forEachLimit' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~~ +!!! error TS2339: Property 'forEachSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~ +!!! error TS2339: Property 'forEach' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~ +!!! error TS2339: Property 'findSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'findLimit' does not exist on type 'typeof import("a")'. + ~~~~ +!!! error TS2339: Property 'find' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'anySeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~ +!!! error TS2339: Property 'anyLimit' does not exist on type 'typeof import("a")'. + ~~~ +!!! error TS2339: Property 'any' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'allSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~ +!!! error TS2339: Property 'allLimit' does not exist on type 'typeof import("a")'. + ~~~ +!!! error TS2339: Property 'all' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'whilst' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'waterfall' does not exist on type 'typeof import("a")'. + ~~~~~ +!!! error TS2339: Property 'until' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'unmemoize' does not exist on type 'typeof import("a")'. + ~~~~~~~ +!!! error TS2339: Property 'tryEach' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'transform' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~ +!!! error TS2339: Property 'timesSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~ +!!! error TS2339: Property 'timesLimit' does not exist on type 'typeof import("a")'. + ~~~~~ +!!! error TS2339: Property 'times' does not exist on type 'typeof import("a")'. + ~~~~~~~ +!!! error TS2339: Property 'timeout' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'sortBy' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~ +!!! error TS2339: Property 'someSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'someLimit' does not exist on type 'typeof import("a")'. + ~~~~ +!!! error TS2339: Property 'some' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~ +!!! error TS2339: Property 'setImmediate' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'series' does not exist on type 'typeof import("a")'. + ~~~ +!!! error TS2339: Property 'seq' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'retryable' does not exist on type 'typeof import("a")'. + ~~~~~ +!!! error TS2339: Property 'retry' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~ +!!! error TS2339: Property 'rejectSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~ +!!! error TS2339: Property 'rejectLimit' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'reject' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~ +!!! error TS2339: Property 'reflectAll' does not exist on type 'typeof import("a")'. + ~~~~~~~ +!!! error TS2339: Property 'reflect' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~ +!!! error TS2339: Property 'reduceRight' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'reduce' does not exist on type 'typeof import("a")'. + ~~~~ +!!! error TS2339: Property 'race' does not exist on type 'typeof import("a")'. + ~~~~~ +!!! error TS2339: Property 'queue' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~~ +!!! error TS2339: Property 'priorityQueue' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~~ +!!! error TS2339: Property 'parallelLimit' does not exist on type 'typeof import("a")'. + ~~~~~~~~ +!!! error TS2339: Property 'parallel' does not exist on type 'typeof import("a")'. + ~~~~~~~~ +!!! error TS2339: Property 'nextTick' does not exist on type 'typeof import("a")'. + ~~~~~~~ +!!! error TS2339: Property 'memoize' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mapValuesSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~~~ +!!! error TS2339: Property 'mapValuesLimit' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'mapValues' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'mapSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~ +!!! error TS2339: Property 'mapLimit' does not exist on type 'typeof import("a")'. + ~~~ +!!! error TS2339: Property 'map' does not exist on type 'typeof import("a")'. + ~~~ +!!! error TS2339: Property 'log' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~~ +!!! error TS2339: Property 'groupBySeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~ +!!! error TS2339: Property 'groupByLimit' does not exist on type 'typeof import("a")'. + ~~~~~~~ +!!! error TS2339: Property 'groupBy' does not exist on type 'typeof import("a")'. + ~~~~~~~ +!!! error TS2339: Property 'forever' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~ +!!! error TS2339: Property 'filterSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~ +!!! error TS2339: Property 'filterLimit' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'filter' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~ +!!! error TS2339: Property 'everySeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~ +!!! error TS2339: Property 'everyLimit' does not exist on type 'typeof import("a")'. + ~~~~~ +!!! error TS2339: Property 'every' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~ +!!! error TS2339: Property 'ensureAsync' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~ +!!! error TS2339: Property 'eachSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~ +!!! error TS2339: Property 'eachOfSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~ +!!! error TS2339: Property 'eachOfLimit' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'eachOf' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'eachLimit' does not exist on type 'typeof import("a")'. + ~~~~ +!!! error TS2339: Property 'each' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'during' does not exist on type 'typeof import("a")'. + ~~~~~~~~ +!!! error TS2339: Property 'doWhilst' does not exist on type 'typeof import("a")'. + ~~~~~~~ +!!! error TS2339: Property 'doUntil' does not exist on type 'typeof import("a")'. + ~~~~~~~~ +!!! error TS2339: Property 'doDuring' does not exist on type 'typeof import("a")'. + ~~~ +!!! error TS2339: Property 'dir' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~ +!!! error TS2339: Property 'detectSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~ +!!! error TS2339: Property 'detectLimit' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'detect' does not exist on type 'typeof import("a")'. + ~~~~~~~~ +!!! error TS2339: Property 'constant' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~ +!!! error TS2339: Property 'concatSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~ +!!! error TS2339: Property 'concatLimit' does not exist on type 'typeof import("a")'. + ~~~~~~ +!!! error TS2339: Property 'concat' does not exist on type 'typeof import("a")'. + ~~~~~~~ +!!! error TS2339: Property 'compose' does not exist on type 'typeof import("a")'. + ~~~~~ +!!! error TS2339: Property 'cargo' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~ +!!! error TS2339: Property 'autoInject' does not exist on type 'typeof import("a")'. + ~~~~ +!!! error TS2339: Property 'auto' does not exist on type 'typeof import("a")'. + ~~~~~~~~ +!!! error TS2339: Property 'asyncify' does not exist on type 'typeof import("a")'. + ~~~~~~~~~~~~~~~ +!!! error TS2339: Property 'applyEachSeries' does not exist on type 'typeof import("a")'. + ~~~~~~~~~ +!!! error TS2339: Property 'applyEach' does not exist on type 'typeof import("a")'. + ~~~~~ +!!! error TS2339: Property 'apply' does not exist on type 'typeof import("a")'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.symbols b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.symbols index 2942ce4181..1d92be59d4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.symbols @@ -2,5 +2,106 @@ === a.js === exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined; +>exports.wrapSync : Symbol(wrapSync, Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>wrapSync : Symbol(wrapSync, Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) >undefined : Symbol(undefined) diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.symbols.diff index 4192009079..fbfa9bcd81 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.symbols.diff @@ -1,12 +1,12 @@ --- old.jsdocTypeFromChainedAssignment3.symbols +++ new.jsdocTypeFromChainedAssignment3.symbols -@@= skipped -1, +1 lines =@@ - +@@= skipped -2, +2 lines =@@ === a.js === exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined; -->exports.wrapSync : Symbol(wrapSync, Decl(a.js, 0, 0)) + >exports.wrapSync : Symbol(wrapSync, Decl(a.js, 0, 0)) ->exports : Symbol(wrapSync, Decl(a.js, 0, 0)) -->wrapSync : Symbol(wrapSync, Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) + >wrapSync : Symbol(wrapSync, Decl(a.js, 0, 0)) ->exports.selectSeries : Symbol(selectSeries, Decl(a.js, 0, 18)) ->exports : Symbol(selectSeries, Decl(a.js, 0, 18)) ->selectSeries : Symbol(selectSeries, Decl(a.js, 0, 18)) @@ -302,5 +302,103 @@ ->exports : Symbol(apply, Decl(a.js, 0, 1900)) ->apply : Symbol(apply, Decl(a.js, 0, 1900)) ->undefined : Symbol(apply) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) +>undefined : Symbol(undefined) diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.types b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.types index c72a5ff379..b60f3cee0b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeFromChainedAssignment3.types @@ -3,400 +3,400 @@ === a.js === exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined; >exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined ->exports.wrapSync : any ->exports : any ->wrapSync : any +>exports.wrapSync : undefined +>exports : typeof import("a") +>wrapSync : undefined >exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.selectSeries : any ->exports : any +>exports : typeof import("a") >selectSeries : any >exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.selectLimit : any ->exports : any +>exports : typeof import("a") >selectLimit : any >exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.select : any ->exports : any +>exports : typeof import("a") >select : any >exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.foldr : any ->exports : any +>exports : typeof import("a") >foldr : any >exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.foldl : any ->exports : any +>exports : typeof import("a") >foldl : any >exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.inject : any ->exports : any +>exports : typeof import("a") >inject : any >exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.forEachOfLimit : any ->exports : any +>exports : typeof import("a") >forEachOfLimit : any >exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.forEachOfSeries : any ->exports : any +>exports : typeof import("a") >forEachOfSeries : any >exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.forEachOf : any ->exports : any +>exports : typeof import("a") >forEachOf : any >exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.forEachLimit : any ->exports : any +>exports : typeof import("a") >forEachLimit : any >exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.forEachSeries : any ->exports : any +>exports : typeof import("a") >forEachSeries : any >exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.forEach : any ->exports : any +>exports : typeof import("a") >forEach : any >exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.findSeries : any ->exports : any +>exports : typeof import("a") >findSeries : any >exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.findLimit : any ->exports : any +>exports : typeof import("a") >findLimit : any >exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.find : any ->exports : any +>exports : typeof import("a") >find : any >exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.anySeries : any ->exports : any +>exports : typeof import("a") >anySeries : any >exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.anyLimit : any ->exports : any +>exports : typeof import("a") >anyLimit : any >exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.any : any ->exports : any +>exports : typeof import("a") >any : any >exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.allSeries : any ->exports : any +>exports : typeof import("a") >allSeries : any >exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.allLimit : any ->exports : any +>exports : typeof import("a") >allLimit : any >exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.all : any ->exports : any +>exports : typeof import("a") >all : any >exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.whilst : any ->exports : any +>exports : typeof import("a") >whilst : any >exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.waterfall : any ->exports : any +>exports : typeof import("a") >waterfall : any >exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.until : any ->exports : any +>exports : typeof import("a") >until : any >exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.unmemoize : any ->exports : any +>exports : typeof import("a") >unmemoize : any >exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.tryEach : any ->exports : any +>exports : typeof import("a") >tryEach : any >exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.transform : any ->exports : any +>exports : typeof import("a") >transform : any >exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.timesSeries : any ->exports : any +>exports : typeof import("a") >timesSeries : any >exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.timesLimit : any ->exports : any +>exports : typeof import("a") >timesLimit : any >exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.times : any ->exports : any +>exports : typeof import("a") >times : any >exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.timeout : any ->exports : any +>exports : typeof import("a") >timeout : any >exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.sortBy : any ->exports : any +>exports : typeof import("a") >sortBy : any >exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.someSeries : any ->exports : any +>exports : typeof import("a") >someSeries : any >exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.someLimit : any ->exports : any +>exports : typeof import("a") >someLimit : any >exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.some : any ->exports : any +>exports : typeof import("a") >some : any >exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.setImmediate : any ->exports : any +>exports : typeof import("a") >setImmediate : any >exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.series : any ->exports : any +>exports : typeof import("a") >series : any >exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.seq : any ->exports : any +>exports : typeof import("a") >seq : any >exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.retryable : any ->exports : any +>exports : typeof import("a") >retryable : any >exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.retry : any ->exports : any +>exports : typeof import("a") >retry : any >exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.rejectSeries : any ->exports : any +>exports : typeof import("a") >rejectSeries : any >exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.rejectLimit : any ->exports : any +>exports : typeof import("a") >rejectLimit : any >exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.reject : any ->exports : any +>exports : typeof import("a") >reject : any >exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.reflectAll : any ->exports : any +>exports : typeof import("a") >reflectAll : any >exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.reflect : any ->exports : any +>exports : typeof import("a") >reflect : any >exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.reduceRight : any ->exports : any +>exports : typeof import("a") >reduceRight : any >exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.reduce : any ->exports : any +>exports : typeof import("a") >reduce : any >exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.race : any ->exports : any +>exports : typeof import("a") >race : any >exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.queue : any ->exports : any +>exports : typeof import("a") >queue : any >exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.priorityQueue : any ->exports : any +>exports : typeof import("a") >priorityQueue : any >exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.parallelLimit : any ->exports : any +>exports : typeof import("a") >parallelLimit : any >exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.parallel : any ->exports : any +>exports : typeof import("a") >parallel : any >exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.nextTick : any ->exports : any +>exports : typeof import("a") >nextTick : any >exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.memoize : any ->exports : any +>exports : typeof import("a") >memoize : any >exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.mapValuesSeries : any ->exports : any +>exports : typeof import("a") >mapValuesSeries : any >exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.mapValuesLimit : any ->exports : any +>exports : typeof import("a") >mapValuesLimit : any >exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.mapValues : any ->exports : any +>exports : typeof import("a") >mapValues : any >exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.mapSeries : any ->exports : any +>exports : typeof import("a") >mapSeries : any >exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.mapLimit : any ->exports : any +>exports : typeof import("a") >mapLimit : any >exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.map : any ->exports : any +>exports : typeof import("a") >map : any >exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.log : any ->exports : any +>exports : typeof import("a") >log : any >exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.groupBySeries : any ->exports : any +>exports : typeof import("a") >groupBySeries : any >exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.groupByLimit : any ->exports : any +>exports : typeof import("a") >groupByLimit : any >exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.groupBy : any ->exports : any +>exports : typeof import("a") >groupBy : any >exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.forever : any ->exports : any +>exports : typeof import("a") >forever : any >exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.filterSeries : any ->exports : any +>exports : typeof import("a") >filterSeries : any >exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.filterLimit : any ->exports : any +>exports : typeof import("a") >filterLimit : any >exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.filter : any ->exports : any +>exports : typeof import("a") >filter : any >exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.everySeries : any ->exports : any +>exports : typeof import("a") >everySeries : any >exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.everyLimit : any ->exports : any +>exports : typeof import("a") >everyLimit : any >exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.every : any ->exports : any +>exports : typeof import("a") >every : any >exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.ensureAsync : any ->exports : any +>exports : typeof import("a") >ensureAsync : any >exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.eachSeries : any ->exports : any +>exports : typeof import("a") >eachSeries : any >exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.eachOfSeries : any ->exports : any +>exports : typeof import("a") >eachOfSeries : any >exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.eachOfLimit : any ->exports : any +>exports : typeof import("a") >eachOfLimit : any >exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.eachOf : any ->exports : any +>exports : typeof import("a") >eachOf : any >exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.eachLimit : any ->exports : any +>exports : typeof import("a") >eachLimit : any >exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.each : any ->exports : any +>exports : typeof import("a") >each : any >exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.during : any ->exports : any +>exports : typeof import("a") >during : any >exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.doWhilst : any ->exports : any +>exports : typeof import("a") >doWhilst : any >exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.doUntil : any ->exports : any +>exports : typeof import("a") >doUntil : any >exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.doDuring : any ->exports : any +>exports : typeof import("a") >doDuring : any >exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.dir : any ->exports : any +>exports : typeof import("a") >dir : any >exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.detectSeries : any ->exports : any +>exports : typeof import("a") >detectSeries : any >exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.detectLimit : any ->exports : any +>exports : typeof import("a") >detectLimit : any >exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.detect : any ->exports : any +>exports : typeof import("a") >detect : any >exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.constant : any ->exports : any +>exports : typeof import("a") >constant : any >exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.concatSeries : any ->exports : any +>exports : typeof import("a") >concatSeries : any >exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.concatLimit : any ->exports : any +>exports : typeof import("a") >concatLimit : any >exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.concat : any ->exports : any +>exports : typeof import("a") >concat : any >exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.compose : any ->exports : any +>exports : typeof import("a") >compose : any >exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.cargo : any ->exports : any +>exports : typeof import("a") >cargo : any >exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.autoInject : any ->exports : any +>exports : typeof import("a") >autoInject : any >exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.auto : any ->exports : any +>exports : typeof import("a") >auto : any >exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.asyncify : any ->exports : any +>exports : typeof import("a") >asyncify : any >exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.applyEachSeries : any ->exports : any +>exports : typeof import("a") >applyEachSeries : any >exports.applyEach = exports.apply = undefined : undefined >exports.applyEach : any ->exports : any +>exports : typeof import("a") >applyEach : any >exports.apply = undefined : undefined >exports.apply : any ->exports : any +>exports : typeof import("a") >apply : any >undefined : undefined diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.errors.txt index 4b1d9f2cb3..edfbb88499 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.errors.txt @@ -1,15 +1,12 @@ -bug27342.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -bug27342.js(3,11): error TS2304: Cannot find name 'exports'. +bug27342.js(3,11): error TS2709: Cannot use namespace 'exports' as a type. -==== bug27342.js (2 errors) ==== +==== bug27342.js (1 errors) ==== module.exports = {} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** * @type {exports} ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. +!!! error TS2709: Cannot use namespace 'exports' as a type. */ var x diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.symbols b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.symbols index 43cc34d2b3..19deb87c3b 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.symbols @@ -2,6 +2,10 @@ === bug27342.js === module.exports = {} +>module.exports : Symbol(export=, Decl(bug27342.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(bug27342.js, 0, 0)) + /** * @type {exports} */ diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.symbols.diff index 444c5520de..7876596553 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.symbols.diff @@ -7,7 +7,9 @@ ->module.exports : Symbol(module.exports, Decl(bug27342.js, 0, 0)) ->module : Symbol(module, Decl(bug27342.js, 0, 0)) ->exports : Symbol(module.exports, Decl(bug27342.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(bug27342.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(bug27342.js, 0, 0)) + /** * @type {exports} - */ diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.types b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.types index 541485d3a9..d85b76398c 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceExports.types @@ -3,9 +3,9 @@ === bug27342.js === module.exports = {} >module.exports = {} : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >{} : {} /** diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.errors.txt index 2cc53a1fa5..40ea387acb 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.errors.txt @@ -1,23 +1,26 @@ -MC.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -MC.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +MC.js(5,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +MW.js(8,10): error TS2339: Property 'compiler' does not exist on type 'MW'. +MW.js(12,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== MC.js (2 errors) ==== +==== MC.js (1 errors) ==== const MW = require("./MW"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** @typedef {number} Cictema */ module.exports = class MC { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ watch() { + ~~~~~~~~~~~ return new MW(this); + ~~~~~~~~~~~~~~~~~~~~~~~~ } + ~~~ }; + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. -==== MW.js (0 errors) ==== +==== MW.js (2 errors) ==== /** @typedef {import("./MC")} MC */ class MW { @@ -26,8 +29,12 @@ MC.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type */ constructor(compiler) { this.compiler = compiler; + ~~~~~~~~ +!!! error TS2339: Property 'compiler' does not exist on type 'MW'. } } module.exports = MW; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.symbols b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.symbols index f6bd0450cc..3ee8f67b2d 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.symbols @@ -3,10 +3,15 @@ === MC.js === const MW = require("./MW"); >MW : Symbol(MW, Decl(MC.js, 0, 5)) +>require : Symbol(require) +>"./MW" : Symbol("MW", Decl(MW.js, 0, 0)) /** @typedef {number} Cictema */ module.exports = class MC { +>module.exports : Symbol(MC, Decl(MC.js, 4, 16)) +>module : Symbol(module.exports) +>exports : Symbol(MC, Decl(MC.js, 4, 16)) >MC : Symbol(MC, Decl(MC.js, 4, 16)) watch() { @@ -18,3 +23,27 @@ module.exports = class MC { } }; +=== MW.js === +/** @typedef {import("./MC")} MC */ + +class MW { +>MW : Symbol(MW, Decl(MW.js, 0, 0)) + + /** + * @param {MC} compiler the compiler + */ + constructor(compiler) { +>compiler : Symbol(compiler, Decl(MW.js, 6, 14)) + + this.compiler = compiler; +>this : Symbol(MW, Decl(MW.js, 0, 0)) +>compiler : Symbol(compiler, Decl(MW.js, 6, 14)) + } +} + +module.exports = MW; +>module.exports : Symbol(MW, Decl(MW.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(MW, Decl(MW.js, 0, 0)) +>MW : Symbol(MW, Decl(MW.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.symbols.diff index f469f27285..61a7b3444e 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.symbols.diff @@ -1,18 +1,15 @@ --- old.jsdocTypeReferenceToImportOfClassExpression.symbols +++ new.jsdocTypeReferenceToImportOfClassExpression.symbols -@@= skipped -2, +2 lines =@@ - === MC.js === - const MW = require("./MW"); - >MW : Symbol(MW, Decl(MC.js, 0, 5)) -->require : Symbol(require) -->"./MW" : Symbol("MW", Decl(MW.js, 0, 0)) - +@@= skipped -8, +8 lines =@@ /** @typedef {number} Cictema */ module.exports = class MC { ->module.exports : Symbol(module.exports, Decl(MC.js, 0, 0)) ->module : Symbol(export=, Decl(MC.js, 0, 27)) ->exports : Symbol(export=, Decl(MC.js, 0, 27)) ++>module.exports : Symbol(MC, Decl(MC.js, 4, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(MC, Decl(MC.js, 4, 16)) >MC : Symbol(MC, Decl(MC.js, 4, 16)) watch() { @@ -21,33 +18,23 @@ return new MW(this); >MW : Symbol(MW, Decl(MC.js, 0, 5)) -@@= skipped -20, +15 lines =@@ - } - }; +@@= skipped -27, +27 lines =@@ + >compiler : Symbol(compiler, Decl(MW.js, 6, 14)) --=== MW.js === --/** @typedef {import("./MC")} MC */ -- --class MW { -->MW : Symbol(MW, Decl(MW.js, 0, 0)) -- -- /** -- * @param {MC} compiler the compiler -- */ -- constructor(compiler) { -->compiler : Symbol(compiler, Decl(MW.js, 6, 14)) -- -- this.compiler = compiler; + this.compiler = compiler; ->this.compiler : Symbol(MW.compiler, Decl(MW.js, 6, 25)) -->this : Symbol(MW, Decl(MW.js, 0, 0)) + >this : Symbol(MW, Decl(MW.js, 0, 0)) ->compiler : Symbol(MW.compiler, Decl(MW.js, 6, 25)) -->compiler : Symbol(compiler, Decl(MW.js, 6, 14)) -- } --} -- --module.exports = MW; + >compiler : Symbol(compiler, Decl(MW.js, 6, 14)) + } + } + + module.exports = MW; ->module.exports : Symbol(module.exports, Decl(MW.js, 0, 0)) ->module : Symbol(export=, Decl(MW.js, 9, 1)) ->exports : Symbol(export=, Decl(MW.js, 9, 1)) -->MW : Symbol(MW, Decl(MW.js, 0, 0)) -- ++>module.exports : Symbol(MW, Decl(MW.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(MW, Decl(MW.js, 0, 0)) + >MW : Symbol(MW, Decl(MW.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.types b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.types index e0b15c5774..f02de57cd4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfClassExpression.types @@ -2,8 +2,8 @@ === MC.js === const MW = require("./MW"); ->MW : any ->require("./MW") : any +>MW : typeof MW +>require("./MW") : typeof MW >require : any >"./MW" : "./MW" @@ -11,19 +11,47 @@ const MW = require("./MW"); module.exports = class MC { >module.exports = class MC { watch() { return new MW(this); }} : typeof MC ->module.exports : any ->module : any ->exports : any +>module.exports : typeof MC +>module : { MC: typeof MC; } +>exports : typeof MC >class MC { watch() { return new MW(this); }} : typeof MC >MC : typeof MC watch() { ->watch : () => any +>watch : () => MW return new MW(this); ->new MW(this) : any ->MW : any +>new MW(this) : MW +>MW : typeof MW >this : this } }; +=== MW.js === +/** @typedef {import("./MC")} MC */ + +class MW { +>MW : MW + + /** + * @param {MC} compiler the compiler + */ + constructor(compiler) { +>compiler : MC + + this.compiler = compiler; +>this.compiler = compiler : MC +>this.compiler : any +>this : this +>compiler : any +>compiler : MC + } +} + +module.exports = MW; +>module.exports = MW : typeof MW +>module.exports : typeof MW +>module : { MW: typeof MW; } +>exports : typeof MW +>MW : typeof MW + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.errors.txt b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.errors.txt index a342270a4b..a81017037a 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.errors.txt @@ -1,25 +1,31 @@ -MC.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -MC.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +MC.js(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +MW.js(1,15): error TS1340: Module './MC' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./MC')'? +MW.js(8,10): error TS2339: Property 'compiler' does not exist on type 'MW'. +MW.js(12,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== MC.js (2 errors) ==== +==== MC.js (1 errors) ==== const MW = require("./MW"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** @typedef {number} Meyerhauser */ /** @class */ module.exports = function MC() { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /** @type {any} */ + ~~~~~~~~~~~~~~~~~~~~~~ var x = {} + ~~~~~~~~~~~~~~ return new MW(x); + ~~~~~~~~~~~~~~~~~~~~~ }; + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. -==== MW.js (0 errors) ==== +==== MW.js (3 errors) ==== /** @typedef {import("./MC")} MC */ + ~~~~~~~~~~~~~~ +!!! error TS1340: Module './MC' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./MC')'? class MW { /** @@ -27,8 +33,12 @@ MC.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type */ constructor(compiler) { this.compiler = compiler; + ~~~~~~~~ +!!! error TS2339: Property 'compiler' does not exist on type 'MW'. } } module.exports = MW; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.symbols b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.symbols index 6227f9d33e..1c27613be4 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.symbols +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.symbols @@ -3,11 +3,16 @@ === MC.js === const MW = require("./MW"); >MW : Symbol(MW, Decl(MC.js, 0, 5)) +>require : Symbol(require) +>"./MW" : Symbol("MW", Decl(MW.js, 0, 0)) /** @typedef {number} Meyerhauser */ /** @class */ module.exports = function MC() { +>module.exports : Symbol(export=, Decl(MC.js, 0, 27)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(MC.js, 0, 27)) >MC : Symbol(MC, Decl(MC.js, 5, 16)) /** @type {any} */ @@ -20,3 +25,27 @@ module.exports = function MC() { }; +=== MW.js === +/** @typedef {import("./MC")} MC */ + +class MW { +>MW : Symbol(MW, Decl(MW.js, 0, 0)) + + /** + * @param {MC} compiler the compiler + */ + constructor(compiler) { +>compiler : Symbol(compiler, Decl(MW.js, 6, 14)) + + this.compiler = compiler; +>this : Symbol(MW, Decl(MW.js, 0, 0)) +>compiler : Symbol(compiler, Decl(MW.js, 6, 14)) + } +} + +module.exports = MW; +>module.exports : Symbol(MW, Decl(MW.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(MW, Decl(MW.js, 0, 0)) +>MW : Symbol(MW, Decl(MW.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.symbols.diff b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.symbols.diff index f6127e7141..71368dfa96 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.symbols.diff @@ -1,49 +1,33 @@ --- old.jsdocTypeReferenceToImportOfFunctionExpression.symbols +++ new.jsdocTypeReferenceToImportOfFunctionExpression.symbols -@@= skipped -2, +2 lines =@@ - === MC.js === - const MW = require("./MW"); - >MW : Symbol(MW, Decl(MC.js, 0, 5)) -->require : Symbol(require) -->"./MW" : Symbol("MW", Decl(MW.js, 0, 0)) - - /** @typedef {number} Meyerhauser */ +@@= skipped -9, +9 lines =@@ /** @class */ module.exports = function MC() { ->module.exports : Symbol(module.exports, Decl(MC.js, 0, 0)) ->module : Symbol(export=, Decl(MC.js, 0, 27)) -->exports : Symbol(export=, Decl(MC.js, 0, 27)) ++>module.exports : Symbol(export=, Decl(MC.js, 0, 27)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(MC.js, 0, 27)) >MC : Symbol(MC, Decl(MC.js, 5, 16)) - /** @type {any} */ -@@= skipped -22, +17 lines =@@ - - }; +@@= skipped -28, +28 lines =@@ + >compiler : Symbol(compiler, Decl(MW.js, 6, 14)) --=== MW.js === --/** @typedef {import("./MC")} MC */ -- --class MW { -->MW : Symbol(MW, Decl(MW.js, 0, 0)) -- -- /** -- * @param {MC} compiler the compiler -- */ -- constructor(compiler) { -->compiler : Symbol(compiler, Decl(MW.js, 6, 14)) -- -- this.compiler = compiler; + this.compiler = compiler; ->this.compiler : Symbol(MW.compiler, Decl(MW.js, 6, 25)) -->this : Symbol(MW, Decl(MW.js, 0, 0)) + >this : Symbol(MW, Decl(MW.js, 0, 0)) ->compiler : Symbol(MW.compiler, Decl(MW.js, 6, 25)) -->compiler : Symbol(compiler, Decl(MW.js, 6, 14)) -- } --} -- --module.exports = MW; + >compiler : Symbol(compiler, Decl(MW.js, 6, 14)) + } + } + + module.exports = MW; ->module.exports : Symbol(module.exports, Decl(MW.js, 0, 0)) ->module : Symbol(export=, Decl(MW.js, 9, 1)) ->exports : Symbol(export=, Decl(MW.js, 9, 1)) -->MW : Symbol(MW, Decl(MW.js, 0, 0)) -- ++>module.exports : Symbol(MW, Decl(MW.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(MW, Decl(MW.js, 0, 0)) + >MW : Symbol(MW, Decl(MW.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.types b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.types index 1536a69a39..8e53ae07de 100644 --- a/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.types +++ b/testdata/baselines/reference/submodule/conformance/jsdocTypeReferenceToImportOfFunctionExpression.types @@ -2,8 +2,8 @@ === MC.js === const MW = require("./MW"); ->MW : any ->require("./MW") : any +>MW : typeof MW +>require("./MW") : typeof MW >require : any >"./MW" : "./MW" @@ -11,12 +11,12 @@ const MW = require("./MW"); /** @class */ module.exports = function MC() { ->module.exports = function MC() { /** @type {any} */ var x = {} return new MW(x);} : () => any ->module.exports : any ->module : any ->exports : any ->function MC() { /** @type {any} */ var x = {} return new MW(x);} : () => any ->MC : () => any +>module.exports = function MC() { /** @type {any} */ var x = {} return new MW(x);} : () => MW +>module.exports : () => MW +>module : { export=: () => MW; } +>exports : () => MW +>function MC() { /** @type {any} */ var x = {} return new MW(x);} : () => MW +>MC : () => MW /** @type {any} */ var x = {} @@ -24,9 +24,37 @@ module.exports = function MC() { >{} : {} return new MW(x); ->new MW(x) : any ->MW : any +>new MW(x) : MW +>MW : typeof MW >x : any }; +=== MW.js === +/** @typedef {import("./MC")} MC */ + +class MW { +>MW : MW + + /** + * @param {MC} compiler the compiler + */ + constructor(compiler) { +>compiler : any + + this.compiler = compiler; +>this.compiler = compiler : any +>this.compiler : any +>this : this +>compiler : any +>compiler : any + } +} + +module.exports = MW; +>module.exports = MW : typeof MW +>module.exports : typeof MW +>module : { MW: typeof MW; } +>exports : typeof MW +>MW : typeof MW + diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.errors.txt b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.errors.txt index 5a2d27d6ae..a63a73e1e2 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.errors.txt @@ -1,18 +1,35 @@ -usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +lateBoundAssignmentDeclarationSupport1.js(5,1): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. + Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. +lateBoundAssignmentDeclarationSupport1.js(6,1): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. + Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. +usage.js(2,11): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. + Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. +usage.js(3,11): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. + Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. -==== usage.js (1 errors) ==== +==== usage.js (2 errors) ==== const x = require("./lateBoundAssignmentDeclarationSupport1.js"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. const y = x["my-fake-sym"]; + ~~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. +!!! error TS7053: Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. const z = x[x.S]; + ~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. +!!! error TS7053: Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. -==== lateBoundAssignmentDeclarationSupport1.js (0 errors) ==== +==== lateBoundAssignmentDeclarationSupport1.js (2 errors) ==== // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; exports[_sym] = "ok"; + ~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. +!!! error TS7053: Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. exports[_str] = "ok"; + ~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. +!!! error TS7053: Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. exports.S = _sym; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.symbols b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.symbols index 41cd5a222f..b663516983 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.symbols +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.symbols @@ -3,6 +3,8 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport1.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) +>require : Symbol(require) +>"./lateBoundAssignmentDeclarationSupport1.js" : Symbol("lateBoundAssignmentDeclarationSupport1", Decl(lateBoundAssignmentDeclarationSupport1.js, 0, 0)) const y = x["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 1, 5)) @@ -11,5 +13,30 @@ const y = x["my-fake-sym"]; const z = x[x.S]; >z : Symbol(z, Decl(usage.js, 2, 5)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) + +=== lateBoundAssignmentDeclarationSupport1.js === +// currently unsupported +const _sym = Symbol(); +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport1.js, 1, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const _str = "my-fake-sym"; +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport1.js, 2, 5)) + +exports[_sym] = "ok"; +>exports : Symbol("lateBoundAssignmentDeclarationSupport1", Decl(lateBoundAssignmentDeclarationSupport1.js, 0, 0)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport1.js, 1, 5)) + +exports[_str] = "ok"; +>exports : Symbol("lateBoundAssignmentDeclarationSupport1", Decl(lateBoundAssignmentDeclarationSupport1.js, 0, 0)) +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport1.js, 2, 5)) + +exports.S = _sym; +>exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) +>exports : Symbol("lateBoundAssignmentDeclarationSupport1", Decl(lateBoundAssignmentDeclarationSupport1.js, 0, 0)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport1.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.symbols.diff b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.symbols.diff index e7e6aaea7c..581c8df8a1 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.symbols.diff @@ -1,42 +1,32 @@ --- old.lateBoundAssignmentDeclarationSupport1.symbols +++ new.lateBoundAssignmentDeclarationSupport1.symbols -@@= skipped -2, +2 lines =@@ - === usage.js === +@@= skipped -3, +3 lines =@@ const x = require("./lateBoundAssignmentDeclarationSupport1.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./lateBoundAssignmentDeclarationSupport1.js" : Symbol(x, Decl(lateBoundAssignmentDeclarationSupport1.js, 0, 0)) ++>"./lateBoundAssignmentDeclarationSupport1.js" : Symbol("lateBoundAssignmentDeclarationSupport1", Decl(lateBoundAssignmentDeclarationSupport1.js, 0, 0)) const y = x["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 1, 5)) -@@= skipped -10, +8 lines =@@ +@@= skipped -9, +9 lines =@@ const z = x[x.S]; >z : Symbol(z, Decl(usage.js, 2, 5)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->x.S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) ++>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) ++>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) --=== lateBoundAssignmentDeclarationSupport1.js === --// currently unsupported --const _sym = Symbol(); -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport1.js, 1, 5)) -->Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) -- --const _str = "my-fake-sym"; -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport1.js, 2, 5)) -- --exports[_sym] = "ok"; -->exports : Symbol("lateBoundAssignmentDeclarationSupport1", Decl(lateBoundAssignmentDeclarationSupport1.js, 0, 0)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport1.js, 1, 5)) -- --exports[_str] = "ok"; -->exports : Symbol("lateBoundAssignmentDeclarationSupport1", Decl(lateBoundAssignmentDeclarationSupport1.js, 0, 0)) -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport1.js, 2, 5)) -- --exports.S = _sym; -->exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) + === lateBoundAssignmentDeclarationSupport1.js === + // currently unsupported +@@= skipped -23, +23 lines =@@ + + exports.S = _sym; + >exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) ->exports : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) -->S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport1.js, 1, 5)) -- ++>exports : Symbol("lateBoundAssignmentDeclarationSupport1", Decl(lateBoundAssignmentDeclarationSupport1.js, 0, 0)) + >S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport1.js, 5, 21)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport1.js, 1, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.types b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.types index dccd599da6..6e1f4e35e5 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.types +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport1.types @@ -2,22 +2,54 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport1.js"); ->x : any ->require("./lateBoundAssignmentDeclarationSupport1.js") : any +>x : typeof import("lateBoundAssignmentDeclarationSupport1") +>require("./lateBoundAssignmentDeclarationSupport1.js") : typeof import("lateBoundAssignmentDeclarationSupport1") >require : any >"./lateBoundAssignmentDeclarationSupport1.js" : "./lateBoundAssignmentDeclarationSupport1.js" const y = x["my-fake-sym"]; >y : any >x["my-fake-sym"] : any ->x : any +>x : typeof import("lateBoundAssignmentDeclarationSupport1") >"my-fake-sym" : "my-fake-sym" const z = x[x.S]; >z : any >x[x.S] : any ->x : any ->x.S : any ->x : any ->S : any +>x : typeof import("lateBoundAssignmentDeclarationSupport1") +>x.S : unique symbol +>x : typeof import("lateBoundAssignmentDeclarationSupport1") +>S : unique symbol + +=== lateBoundAssignmentDeclarationSupport1.js === +// currently unsupported +const _sym = Symbol(); +>_sym : unique symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + +const _str = "my-fake-sym"; +>_str : "my-fake-sym" +>"my-fake-sym" : "my-fake-sym" + +exports[_sym] = "ok"; +>exports[_sym] = "ok" : "ok" +>exports[_sym] : any +>exports : typeof import("lateBoundAssignmentDeclarationSupport1") +>_sym : unique symbol +>"ok" : "ok" + +exports[_str] = "ok"; +>exports[_str] = "ok" : "ok" +>exports[_str] : any +>exports : typeof import("lateBoundAssignmentDeclarationSupport1") +>_str : "my-fake-sym" +>"ok" : "ok" + +exports.S = _sym; +>exports.S = _sym : unique symbol +>exports.S : unique symbol +>exports : typeof import("lateBoundAssignmentDeclarationSupport1") +>S : unique symbol +>_sym : unique symbol diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.errors.txt b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.errors.txt index da22111891..8533aa1d2e 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.errors.txt @@ -1,18 +1,35 @@ -usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +lateBoundAssignmentDeclarationSupport2.js(5,1): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. + Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. +lateBoundAssignmentDeclarationSupport2.js(6,1): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. + Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. +usage.js(2,11): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. + Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. +usage.js(3,11): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. + Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. -==== usage.js (1 errors) ==== +==== usage.js (2 errors) ==== const x = require("./lateBoundAssignmentDeclarationSupport2.js"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. const y = x["my-fake-sym"]; + ~~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. +!!! error TS7053: Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. const z = x[x.S]; + ~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. +!!! error TS7053: Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. -==== lateBoundAssignmentDeclarationSupport2.js (0 errors) ==== +==== lateBoundAssignmentDeclarationSupport2.js (2 errors) ==== // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; module.exports[_sym] = "ok"; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. +!!! error TS7053: Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. module.exports[_str] = "ok"; + ~~~~~~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. +!!! error TS7053: Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. module.exports.S = _sym; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.symbols b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.symbols index bf6c441ec3..c9654d78f5 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.symbols +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.symbols @@ -3,6 +3,8 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport2.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) +>require : Symbol(require) +>"./lateBoundAssignmentDeclarationSupport2.js" : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) const y = x["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 1, 5)) @@ -11,5 +13,36 @@ const y = x["my-fake-sym"]; const z = x[x.S]; >z : Symbol(z, Decl(usage.js, 2, 5)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) + +=== lateBoundAssignmentDeclarationSupport2.js === +// currently unsupported +const _sym = Symbol(); +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport2.js, 1, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const _str = "my-fake-sym"; +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport2.js, 2, 5)) + +module.exports[_sym] = "ok"; +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport2.js, 1, 5)) + +module.exports[_str] = "ok"; +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport2.js, 2, 5)) + +module.exports.S = _sym; +>module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport2.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.symbols.diff b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.symbols.diff index 34184393b1..dc81e50c75 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.symbols.diff @@ -1,48 +1,55 @@ --- old.lateBoundAssignmentDeclarationSupport2.symbols +++ new.lateBoundAssignmentDeclarationSupport2.symbols -@@= skipped -2, +2 lines =@@ - === usage.js === +@@= skipped -3, +3 lines =@@ const x = require("./lateBoundAssignmentDeclarationSupport2.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./lateBoundAssignmentDeclarationSupport2.js" : Symbol(x, Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) ++>"./lateBoundAssignmentDeclarationSupport2.js" : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) const y = x["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 1, 5)) -@@= skipped -10, +8 lines =@@ +@@= skipped -9, +9 lines =@@ const z = x[x.S]; >z : Symbol(z, Decl(usage.js, 2, 5)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->x.S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) ++>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) ++>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) --=== lateBoundAssignmentDeclarationSupport2.js === --// currently unsupported --const _sym = Symbol(); -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport2.js, 1, 5)) -->Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) -- --const _str = "my-fake-sym"; -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport2.js, 2, 5)) -- --module.exports[_sym] = "ok"; + === lateBoundAssignmentDeclarationSupport2.js === + // currently unsupported +@@= skipped -14, +14 lines =@@ + >_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport2.js, 2, 5)) + + module.exports[_sym] = "ok"; ->module.exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport2.js, 1, 5)) -- --module.exports[_str] = "ok"; ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport2.js, 1, 5)) + + module.exports[_str] = "ok"; ->module.exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport2.js, 2, 5)) -- --module.exports.S = _sym; -->module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) + >_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport2.js, 2, 5)) + + module.exports.S = _sym; + >module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) ->module.exports : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) -->S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport2.js, 1, 5)) -- ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport2", Decl(lateBoundAssignmentDeclarationSupport2.js, 0, 0)) + >S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport2.js, 5, 28)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport2.js, 1, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.types b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.types index b3614e356b..e075777820 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.types +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport2.types @@ -2,22 +2,60 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport2.js"); ->x : any ->require("./lateBoundAssignmentDeclarationSupport2.js") : any +>x : typeof import("lateBoundAssignmentDeclarationSupport2") +>require("./lateBoundAssignmentDeclarationSupport2.js") : typeof import("lateBoundAssignmentDeclarationSupport2") >require : any >"./lateBoundAssignmentDeclarationSupport2.js" : "./lateBoundAssignmentDeclarationSupport2.js" const y = x["my-fake-sym"]; >y : any >x["my-fake-sym"] : any ->x : any +>x : typeof import("lateBoundAssignmentDeclarationSupport2") >"my-fake-sym" : "my-fake-sym" const z = x[x.S]; >z : any >x[x.S] : any ->x : any ->x.S : any ->x : any ->S : any +>x : typeof import("lateBoundAssignmentDeclarationSupport2") +>x.S : unique symbol +>x : typeof import("lateBoundAssignmentDeclarationSupport2") +>S : unique symbol + +=== lateBoundAssignmentDeclarationSupport2.js === +// currently unsupported +const _sym = Symbol(); +>_sym : unique symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + +const _str = "my-fake-sym"; +>_str : "my-fake-sym" +>"my-fake-sym" : "my-fake-sym" + +module.exports[_sym] = "ok"; +>module.exports[_sym] = "ok" : "ok" +>module.exports[_sym] : any +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport2") +>module : { "lateBoundAssignmentDeclarationSupport2": typeof import("lateBoundAssignmentDeclarationSupport2"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport2") +>_sym : unique symbol +>"ok" : "ok" + +module.exports[_str] = "ok"; +>module.exports[_str] = "ok" : "ok" +>module.exports[_str] : any +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport2") +>module : { "lateBoundAssignmentDeclarationSupport2": typeof import("lateBoundAssignmentDeclarationSupport2"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport2") +>_str : "my-fake-sym" +>"ok" : "ok" + +module.exports.S = _sym; +>module.exports.S = _sym : unique symbol +>module.exports.S : unique symbol +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport2") +>module : { "lateBoundAssignmentDeclarationSupport2": typeof import("lateBoundAssignmentDeclarationSupport2"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport2") +>S : unique symbol +>_sym : unique symbol diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.errors.txt b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.errors.txt index 106228cb9a..d65e4df9b2 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.errors.txt @@ -1,12 +1,19 @@ -usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +usage.js(2,11): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. + Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. +usage.js(3,11): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. + Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. -==== usage.js (1 errors) ==== +==== usage.js (2 errors) ==== const x = require("./lateBoundAssignmentDeclarationSupport3.js"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. const y = x["my-fake-sym"]; + ~~~~~~~~~~~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. +!!! error TS7053: Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. const z = x[x.S]; + ~~~~~~ +!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. +!!! error TS7053: Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. ==== lateBoundAssignmentDeclarationSupport3.js (0 errors) ==== // currently unsupported diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.symbols b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.symbols index 3bd32dca8a..4fbeabef51 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.symbols +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.symbols @@ -3,6 +3,8 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport3.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) +>require : Symbol(require) +>"./lateBoundAssignmentDeclarationSupport3.js" : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) const y = x["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 1, 5)) @@ -11,5 +13,44 @@ const y = x["my-fake-sym"]; const z = x[x.S]; >z : Symbol(z, Decl(usage.js, 2, 5)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) + +=== lateBoundAssignmentDeclarationSupport3.js === +// currently unsupported +const _sym = Symbol(); +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport3.js, 1, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const _str = "my-fake-sym"; +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport3.js, 2, 5)) + +Object.defineProperty(module.exports, _sym, { value: "ok" }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport3.js, 1, 5)) +>value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport3.js, 4, 45)) + +Object.defineProperty(module.exports, _str, { value: "ok" }); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport3.js, 2, 5)) +>value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 45)) + +module.exports.S = _sym; +>module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport3.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.symbols.diff b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.symbols.diff index ba65c90610..e6829d137a 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.symbols.diff @@ -1,56 +1,67 @@ --- old.lateBoundAssignmentDeclarationSupport3.symbols +++ new.lateBoundAssignmentDeclarationSupport3.symbols -@@= skipped -2, +2 lines =@@ - === usage.js === +@@= skipped -3, +3 lines =@@ const x = require("./lateBoundAssignmentDeclarationSupport3.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./lateBoundAssignmentDeclarationSupport3.js" : Symbol(x, Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) ++>"./lateBoundAssignmentDeclarationSupport3.js" : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) const y = x["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 1, 5)) -@@= skipped -10, +8 lines =@@ +@@= skipped -9, +9 lines =@@ const z = x[x.S]; >z : Symbol(z, Decl(usage.js, 2, 5)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->x.S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) ++>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) ++>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) --=== lateBoundAssignmentDeclarationSupport3.js === --// currently unsupported --const _sym = Symbol(); -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport3.js, 1, 5)) -->Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) -- --const _str = "my-fake-sym"; -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport3.js, 2, 5)) -- --Object.defineProperty(module.exports, _sym, { value: "ok" }); + === lateBoundAssignmentDeclarationSupport3.js === + // currently unsupported +@@= skipped -14, +14 lines =@@ + >_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport3.js, 2, 5)) + + Object.defineProperty(module.exports, _sym, { value: "ok" }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->module.exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport3.js, 1, 5)) -->value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport3.js, 4, 45)) -- --Object.defineProperty(module.exports, _str, { value: "ok" }); ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport3.js, 1, 5)) + >value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport3.js, 4, 45)) + + Object.defineProperty(module.exports, _str, { value: "ok" }); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->module.exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport3.js, 2, 5)) -->value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 45)) -- --module.exports.S = _sym; -->module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) + >_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport3.js, 2, 5)) + >value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 45)) + + module.exports.S = _sym; + >module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) ->module.exports : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) -->S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport3.js, 1, 5)) -- ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport3", Decl(lateBoundAssignmentDeclarationSupport3.js, 0, 0)) + >S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport3.js, 5, 61)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport3.js, 1, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.types b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.types index 87a0d10171..21bf8e21e1 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.types +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport3.types @@ -2,22 +2,68 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport3.js"); ->x : any ->require("./lateBoundAssignmentDeclarationSupport3.js") : any +>x : typeof import("lateBoundAssignmentDeclarationSupport3") +>require("./lateBoundAssignmentDeclarationSupport3.js") : typeof import("lateBoundAssignmentDeclarationSupport3") >require : any >"./lateBoundAssignmentDeclarationSupport3.js" : "./lateBoundAssignmentDeclarationSupport3.js" const y = x["my-fake-sym"]; >y : any >x["my-fake-sym"] : any ->x : any +>x : typeof import("lateBoundAssignmentDeclarationSupport3") >"my-fake-sym" : "my-fake-sym" const z = x[x.S]; >z : any >x[x.S] : any ->x : any ->x.S : any ->x : any ->S : any +>x : typeof import("lateBoundAssignmentDeclarationSupport3") +>x.S : unique symbol +>x : typeof import("lateBoundAssignmentDeclarationSupport3") +>S : unique symbol + +=== lateBoundAssignmentDeclarationSupport3.js === +// currently unsupported +const _sym = Symbol(); +>_sym : unique symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + +const _str = "my-fake-sym"; +>_str : "my-fake-sym" +>"my-fake-sym" : "my-fake-sym" + +Object.defineProperty(module.exports, _sym, { value: "ok" }); +>Object.defineProperty(module.exports, _sym, { value: "ok" }) : typeof import("lateBoundAssignmentDeclarationSupport3") +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport3") +>module : { "lateBoundAssignmentDeclarationSupport3": typeof import("lateBoundAssignmentDeclarationSupport3"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport3") +>_sym : unique symbol +>{ value: "ok" } : { value: string; } +>value : string +>"ok" : "ok" + +Object.defineProperty(module.exports, _str, { value: "ok" }); +>Object.defineProperty(module.exports, _str, { value: "ok" }) : typeof import("lateBoundAssignmentDeclarationSupport3") +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport3") +>module : { "lateBoundAssignmentDeclarationSupport3": typeof import("lateBoundAssignmentDeclarationSupport3"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport3") +>_str : "my-fake-sym" +>{ value: "ok" } : { value: string; } +>value : string +>"ok" : "ok" + +module.exports.S = _sym; +>module.exports.S = _sym : unique symbol +>module.exports.S : unique symbol +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport3") +>module : { "lateBoundAssignmentDeclarationSupport3": typeof import("lateBoundAssignmentDeclarationSupport3"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport3") +>S : unique symbol +>_sym : unique symbol diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.errors.txt b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.errors.txt index 705d8b258e..6f68a5e892 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.errors.txt @@ -1,15 +1,16 @@ -usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +lateBoundAssignmentDeclarationSupport4.js(9,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. +usage.js(2,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. ==== usage.js (1 errors) ==== const x = require("./lateBoundAssignmentDeclarationSupport4.js"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. const inst = new x.F(); + ~~~~~~~~~ +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const y = inst["my-fake-sym"]; const z = inst[x.S]; -==== lateBoundAssignmentDeclarationSupport4.js (0 errors) ==== +==== lateBoundAssignmentDeclarationSupport4.js (1 errors) ==== // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; @@ -19,6 +20,8 @@ usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install F.prototype[_sym] = "ok"; F.prototype[_str] = "ok"; const inst = new F(); + ~~~~~~~ +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const _y = inst[_str]; const _z = inst[_sym]; module.exports.F = F; diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.symbols b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.symbols index 3334853101..746adf1266 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.symbols +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.symbols @@ -3,10 +3,14 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport4.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) +>require : Symbol(require) +>"./lateBoundAssignmentDeclarationSupport4.js" : Symbol("lateBoundAssignmentDeclarationSupport4", Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) const inst = new x.F(); >inst : Symbol(inst, Decl(usage.js, 1, 5)) +>x.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) const y = inst["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 2, 5)) @@ -15,5 +19,61 @@ const y = inst["my-fake-sym"]; const z = inst[x.S]; >z : Symbol(z, Decl(usage.js, 3, 5)) >inst : Symbol(inst, Decl(usage.js, 1, 5)) +>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) + +=== lateBoundAssignmentDeclarationSupport4.js === +// currently unsupported +const _sym = Symbol(); +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport4.js, 1, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const _str = "my-fake-sym"; +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 5)) + +function F() { +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) +} +F.prototype[_sym] = "ok"; +>F.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport4.js, 1, 5)) + +F.prototype[_str] = "ok"; +>F.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 5)) + +const inst = new F(); +>inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport4.js, 8, 5)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) + +const _y = inst[_str]; +>_y : Symbol(_y, Decl(lateBoundAssignmentDeclarationSupport4.js, 9, 5)) +>inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport4.js, 8, 5)) +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 5)) + +const _z = inst[_sym]; +>_z : Symbol(_z, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 5)) +>inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport4.js, 8, 5)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport4.js, 1, 5)) + +module.exports.F = F; +>module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport4", Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport4", Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) + +module.exports.S = _sym; +>module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport4", Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport4", Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport4.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.symbols.diff b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.symbols.diff index a1ceda1cf9..b047e51a2d 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.symbols.diff @@ -1,79 +1,75 @@ --- old.lateBoundAssignmentDeclarationSupport4.symbols +++ new.lateBoundAssignmentDeclarationSupport4.symbols -@@= skipped -2, +2 lines =@@ - === usage.js === +@@= skipped -3, +3 lines =@@ const x = require("./lateBoundAssignmentDeclarationSupport4.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./lateBoundAssignmentDeclarationSupport4.js" : Symbol(x, Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) ++>"./lateBoundAssignmentDeclarationSupport4.js" : Symbol("lateBoundAssignmentDeclarationSupport4", Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) const inst = new x.F(); >inst : Symbol(inst, Decl(usage.js, 1, 5)) ->x.F : Symbol(x.F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) ++>x.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->F : Symbol(x.F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) const y = inst["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 2, 5)) -@@= skipped -16, +12 lines =@@ +@@= skipped -15, +15 lines =@@ const z = inst[x.S]; >z : Symbol(z, Decl(usage.js, 3, 5)) >inst : Symbol(inst, Decl(usage.js, 1, 5)) ->x.S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) ++>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) ++>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) --=== lateBoundAssignmentDeclarationSupport4.js === --// currently unsupported --const _sym = Symbol(); -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport4.js, 1, 5)) -->Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) -- --const _str = "my-fake-sym"; -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 5)) -- --function F() { -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) --} --F.prototype[_sym] = "ok"; + === lateBoundAssignmentDeclarationSupport4.js === + // currently unsupported +@@= skipped -17, +17 lines =@@ + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) + } + F.prototype[_sym] = "ok"; ->F.prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) ++>F.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport4.js, 1, 5)) -- --F.prototype[_str] = "ok"; ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport4.js, 1, 5)) + + F.prototype[_str] = "ok"; ->F.prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) ++>F.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 5)) -- --const inst = new F(); -->inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport4.js, 8, 5)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) -- --const _y = inst[_str]; -->_y : Symbol(_y, Decl(lateBoundAssignmentDeclarationSupport4.js, 9, 5)) -->inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport4.js, 8, 5)) -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 5)) -- --const _z = inst[_sym]; -->_z : Symbol(_z, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 5)) -->inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport4.js, 8, 5)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport4.js, 1, 5)) -- --module.exports.F = F; -->module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 5)) + + const inst = new F(); +@@= skipped -27, +27 lines =@@ + + module.exports.F = F; + >module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) ->module.exports : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) -- --module.exports.S = _sym; -->module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport4", Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport4", Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport4.js, 2, 27)) + + module.exports.S = _sym; + >module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) ->module.exports : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport4.js, 10, 22)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) -->S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport4.js, 1, 5)) -- ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport4", Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport4", Decl(lateBoundAssignmentDeclarationSupport4.js, 0, 0)) + >S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport4.js, 11, 21)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport4.js, 1, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.types b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.types index 123e4b405c..2d1acbb04b 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.types +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport4.types @@ -2,17 +2,17 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport4.js"); ->x : any ->require("./lateBoundAssignmentDeclarationSupport4.js") : any +>x : typeof import("lateBoundAssignmentDeclarationSupport4") +>require("./lateBoundAssignmentDeclarationSupport4.js") : typeof import("lateBoundAssignmentDeclarationSupport4") >require : any >"./lateBoundAssignmentDeclarationSupport4.js" : "./lateBoundAssignmentDeclarationSupport4.js" const inst = new x.F(); >inst : any >new x.F() : any ->x.F : any ->x : any ->F : any +>x.F : () => void +>x : typeof import("lateBoundAssignmentDeclarationSupport4") +>F : () => void const y = inst["my-fake-sym"]; >y : any @@ -24,7 +24,74 @@ const z = inst[x.S]; >z : any >inst[x.S] : any >inst : any ->x.S : any ->x : any ->S : any +>x.S : unique symbol +>x : typeof import("lateBoundAssignmentDeclarationSupport4") +>S : unique symbol + +=== lateBoundAssignmentDeclarationSupport4.js === +// currently unsupported +const _sym = Symbol(); +>_sym : unique symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + +const _str = "my-fake-sym"; +>_str : "my-fake-sym" +>"my-fake-sym" : "my-fake-sym" + +function F() { +>F : () => void +} +F.prototype[_sym] = "ok"; +>F.prototype[_sym] = "ok" : "ok" +>F.prototype[_sym] : any +>F.prototype : any +>F : () => void +>prototype : any +>_sym : unique symbol +>"ok" : "ok" + +F.prototype[_str] = "ok"; +>F.prototype[_str] = "ok" : "ok" +>F.prototype[_str] : any +>F.prototype : any +>F : () => void +>prototype : any +>_str : "my-fake-sym" +>"ok" : "ok" + +const inst = new F(); +>inst : any +>new F() : any +>F : () => void + +const _y = inst[_str]; +>_y : any +>inst[_str] : any +>inst : any +>_str : "my-fake-sym" + +const _z = inst[_sym]; +>_z : any +>inst[_sym] : any +>inst : any +>_sym : unique symbol + +module.exports.F = F; +>module.exports.F = F : () => void +>module.exports.F : () => void +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport4") +>module : { "lateBoundAssignmentDeclarationSupport4": typeof import("lateBoundAssignmentDeclarationSupport4"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport4") +>F : () => void +>F : () => void + +module.exports.S = _sym; +>module.exports.S = _sym : unique symbol +>module.exports.S : unique symbol +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport4") +>module : { "lateBoundAssignmentDeclarationSupport4": typeof import("lateBoundAssignmentDeclarationSupport4"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport4") +>S : unique symbol +>_sym : unique symbol diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.errors.txt b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.errors.txt index 0ec9bee30f..356f94438c 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.errors.txt @@ -1,15 +1,16 @@ -usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +lateBoundAssignmentDeclarationSupport5.js(11,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. +usage.js(2,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. ==== usage.js (1 errors) ==== const x = require("./lateBoundAssignmentDeclarationSupport5.js"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. const inst = new x.F(); + ~~~~~~~~~ +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const y = inst["my-fake-sym"]; const z = inst[x.S]; -==== lateBoundAssignmentDeclarationSupport5.js (0 errors) ==== +==== lateBoundAssignmentDeclarationSupport5.js (1 errors) ==== // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; @@ -21,6 +22,8 @@ usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install [_str]: "ok" } const inst = new F(); + ~~~~~~~ +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const _y = inst[_str]; const _z = inst[_sym]; module.exports.F = F; diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.symbols b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.symbols index 322023ecda..dfec96506b 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.symbols +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.symbols @@ -3,10 +3,14 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport5.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) +>require : Symbol(require) +>"./lateBoundAssignmentDeclarationSupport5.js" : Symbol("lateBoundAssignmentDeclarationSupport5", Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) const inst = new x.F(); >inst : Symbol(inst, Decl(usage.js, 1, 5)) +>x.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) const y = inst["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 2, 5)) @@ -15,5 +19,62 @@ const y = inst["my-fake-sym"]; const z = inst[x.S]; >z : Symbol(z, Decl(usage.js, 3, 5)) >inst : Symbol(inst, Decl(usage.js, 1, 5)) +>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) + +=== lateBoundAssignmentDeclarationSupport5.js === +// currently unsupported +const _sym = Symbol(); +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport5.js, 1, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const _str = "my-fake-sym"; +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 5)) + +function F() { +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27)) +} +F.prototype = { +>F.prototype : Symbol(prototype, Decl(lateBoundAssignmentDeclarationSupport5.js, 5, 1)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27)) +>prototype : Symbol(prototype, Decl(lateBoundAssignmentDeclarationSupport5.js, 5, 1)) + + [_sym]: "ok", +>[_sym] : Symbol([_sym], Decl(lateBoundAssignmentDeclarationSupport5.js, 6, 15)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport5.js, 1, 5)) + + [_str]: "ok" +>[_str] : Symbol([_str], Decl(lateBoundAssignmentDeclarationSupport5.js, 7, 17)) +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 5)) +} +const inst = new F(); +>inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport5.js, 10, 5)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27)) + +const _y = inst[_str]; +>_y : Symbol(_y, Decl(lateBoundAssignmentDeclarationSupport5.js, 11, 5)) +>inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport5.js, 10, 5)) +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 5)) + +const _z = inst[_sym]; +>_z : Symbol(_z, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 5)) +>inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport5.js, 10, 5)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport5.js, 1, 5)) + +module.exports.F = F; +>module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport5", Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport5", Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27)) + +module.exports.S = _sym; +>module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport5", Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport5", Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport5.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.symbols.diff b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.symbols.diff index 8bcb7aa137..ac03d0e47a 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.symbols.diff @@ -1,80 +1,82 @@ --- old.lateBoundAssignmentDeclarationSupport5.symbols +++ new.lateBoundAssignmentDeclarationSupport5.symbols -@@= skipped -2, +2 lines =@@ - === usage.js === +@@= skipped -3, +3 lines =@@ const x = require("./lateBoundAssignmentDeclarationSupport5.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./lateBoundAssignmentDeclarationSupport5.js" : Symbol(x, Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) ++>"./lateBoundAssignmentDeclarationSupport5.js" : Symbol("lateBoundAssignmentDeclarationSupport5", Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) const inst = new x.F(); >inst : Symbol(inst, Decl(usage.js, 1, 5)) ->x.F : Symbol(x.F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) ++>x.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->F : Symbol(x.F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) const y = inst["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 2, 5)) -@@= skipped -16, +12 lines =@@ +@@= skipped -15, +15 lines =@@ const z = inst[x.S]; >z : Symbol(z, Decl(usage.js, 3, 5)) >inst : Symbol(inst, Decl(usage.js, 1, 5)) ->x.S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) ++>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) ++>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) --=== lateBoundAssignmentDeclarationSupport5.js === --// currently unsupported --const _sym = Symbol(); -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport5.js, 1, 5)) -->Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) -- --const _str = "my-fake-sym"; -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 5)) -- --function F() { + === lateBoundAssignmentDeclarationSupport5.js === + // currently unsupported +@@= skipped -14, +14 lines =@@ + >_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 5)) + + function F() { ->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27), Decl(lateBoundAssignmentDeclarationSupport5.js, 5, 1)) --} --F.prototype = { ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27)) + } + F.prototype = { ->F.prototype : Symbol(F.prototype, Decl(lateBoundAssignmentDeclarationSupport5.js, 5, 1)) ->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27), Decl(lateBoundAssignmentDeclarationSupport5.js, 5, 1)) ->prototype : Symbol(F.prototype, Decl(lateBoundAssignmentDeclarationSupport5.js, 5, 1)) -- -- [_sym]: "ok", -->[_sym] : Symbol([_sym], Decl(lateBoundAssignmentDeclarationSupport5.js, 6, 15)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport5.js, 1, 5)) -- -- [_str]: "ok" -->[_str] : Symbol([_str], Decl(lateBoundAssignmentDeclarationSupport5.js, 7, 17)) -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 5)) --} --const inst = new F(); -->inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport5.js, 10, 5)) ++>F.prototype : Symbol(prototype, Decl(lateBoundAssignmentDeclarationSupport5.js, 5, 1)) ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27)) ++>prototype : Symbol(prototype, Decl(lateBoundAssignmentDeclarationSupport5.js, 5, 1)) + + [_sym]: "ok", + >[_sym] : Symbol([_sym], Decl(lateBoundAssignmentDeclarationSupport5.js, 6, 15)) +@@= skipped -17, +17 lines =@@ + } + const inst = new F(); + >inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport5.js, 10, 5)) ->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27), Decl(lateBoundAssignmentDeclarationSupport5.js, 5, 1)) -- --const _y = inst[_str]; -->_y : Symbol(_y, Decl(lateBoundAssignmentDeclarationSupport5.js, 11, 5)) -->inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport5.js, 10, 5)) -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 5)) -- --const _z = inst[_sym]; -->_z : Symbol(_z, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 5)) -->inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport5.js, 10, 5)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport5.js, 1, 5)) -- --module.exports.F = F; -->module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27)) + + const _y = inst[_str]; + >_y : Symbol(_y, Decl(lateBoundAssignmentDeclarationSupport5.js, 11, 5)) +@@= skipped -14, +14 lines =@@ + + module.exports.F = F; + >module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) ->module.exports : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport5", Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport5", Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) ->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27), Decl(lateBoundAssignmentDeclarationSupport5.js, 5, 1)) -- --module.exports.S = _sym; -->module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport5.js, 2, 27)) + + module.exports.S = _sym; + >module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) ->module.exports : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport5.js, 12, 22)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) -->S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport5.js, 1, 5)) -- ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport5", Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport5", Decl(lateBoundAssignmentDeclarationSupport5.js, 0, 0)) + >S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport5.js, 13, 21)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport5.js, 1, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.types b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.types index f01b6acab6..7bcf1bfaa3 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.types +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport5.types @@ -2,17 +2,17 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport5.js"); ->x : any ->require("./lateBoundAssignmentDeclarationSupport5.js") : any +>x : typeof import("lateBoundAssignmentDeclarationSupport5") +>require("./lateBoundAssignmentDeclarationSupport5.js") : typeof import("lateBoundAssignmentDeclarationSupport5") >require : any >"./lateBoundAssignmentDeclarationSupport5.js" : "./lateBoundAssignmentDeclarationSupport5.js" const inst = new x.F(); >inst : any >new x.F() : any ->x.F : any ->x : any ->F : any +>x.F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } +>x : typeof import("lateBoundAssignmentDeclarationSupport5") +>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } const y = inst["my-fake-sym"]; >y : any @@ -24,7 +24,73 @@ const z = inst[x.S]; >z : any >inst[x.S] : any >inst : any ->x.S : any ->x : any ->S : any +>x.S : unique symbol +>x : typeof import("lateBoundAssignmentDeclarationSupport5") +>S : unique symbol + +=== lateBoundAssignmentDeclarationSupport5.js === +// currently unsupported +const _sym = Symbol(); +>_sym : unique symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + +const _str = "my-fake-sym"; +>_str : "my-fake-sym" +>"my-fake-sym" : "my-fake-sym" + +function F() { +>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } +} +F.prototype = { +>F.prototype = { [_sym]: "ok", [_str]: "ok"} : { [_sym]: string; [_str]: string; } +>F.prototype : { [_sym]: string; [_str]: string; } +>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } +>prototype : { [_sym]: string; [_str]: string; } +>{ [_sym]: "ok", [_str]: "ok"} : { [_sym]: string; [_str]: string; } + + [_sym]: "ok", +>[_sym] : string +>_sym : unique symbol +>"ok" : "ok" + + [_str]: "ok" +>[_str] : string +>_str : "my-fake-sym" +>"ok" : "ok" +} +const inst = new F(); +>inst : any +>new F() : any +>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } + +const _y = inst[_str]; +>_y : any +>inst[_str] : any +>inst : any +>_str : "my-fake-sym" + +const _z = inst[_sym]; +>_z : any +>inst[_sym] : any +>inst : any +>_sym : unique symbol + +module.exports.F = F; +>module.exports.F = F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } +>module.exports.F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport5") +>module : { "lateBoundAssignmentDeclarationSupport5": typeof import("lateBoundAssignmentDeclarationSupport5"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport5") +>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } +>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } + +module.exports.S = _sym; +>module.exports.S = _sym : unique symbol +>module.exports.S : unique symbol +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport5") +>module : { "lateBoundAssignmentDeclarationSupport5": typeof import("lateBoundAssignmentDeclarationSupport5"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport5") +>S : unique symbol +>_sym : unique symbol diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.errors.txt b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.errors.txt index b100fb9493..f178d33b5d 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.errors.txt @@ -1,15 +1,16 @@ -usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +lateBoundAssignmentDeclarationSupport6.js(10,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. +usage.js(2,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. ==== usage.js (1 errors) ==== const x = require("./lateBoundAssignmentDeclarationSupport6.js"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. const inst = new x.F(); + ~~~~~~~~~ +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const y = inst["my-fake-sym"]; const z = inst[x.S]; -==== lateBoundAssignmentDeclarationSupport6.js (0 errors) ==== +==== lateBoundAssignmentDeclarationSupport6.js (1 errors) ==== // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; @@ -20,6 +21,8 @@ usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install Object.defineProperty(F.prototype, _str, {value: "ok"}); Object.defineProperty(F.prototype, _sym, {value: "ok"}); const inst = new F(); + ~~~~~~~ +!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const _y = inst[_str]; const _z = inst[_sym]; module.exports.F = F; diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.symbols b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.symbols index a275641ded..0262cf32be 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.symbols +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.symbols @@ -3,10 +3,14 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport6.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) +>require : Symbol(require) +>"./lateBoundAssignmentDeclarationSupport6.js" : Symbol("lateBoundAssignmentDeclarationSupport6", Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) const inst = new x.F(); >inst : Symbol(inst, Decl(usage.js, 1, 5)) +>x.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) const y = inst["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 2, 5)) @@ -15,5 +19,74 @@ const y = inst["my-fake-sym"]; const z = inst[x.S]; >z : Symbol(z, Decl(usage.js, 3, 5)) >inst : Symbol(inst, Decl(usage.js, 1, 5)) +>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) + +=== lateBoundAssignmentDeclarationSupport6.js === +// currently unsupported +const _sym = Symbol(); +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport6.js, 1, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const _str = "my-fake-sym"; +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 5)) + +function F() { +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) +} +F.prototype.defsAClass = true; +>F.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + +Object.defineProperty(F.prototype, _str, {value: "ok"}); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>F.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 5)) +>value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport6.js, 7, 42)) + +Object.defineProperty(F.prototype, _sym, {value: "ok"}); +>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) +>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) +>F.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport6.js, 1, 5)) +>value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport6.js, 8, 42)) + +const inst = new F(); +>inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport6.js, 9, 5)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) + +const _y = inst[_str]; +>_y : Symbol(_y, Decl(lateBoundAssignmentDeclarationSupport6.js, 10, 5)) +>inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport6.js, 9, 5)) +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 5)) + +const _z = inst[_sym]; +>_z : Symbol(_z, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 5)) +>inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport6.js, 9, 5)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport6.js, 1, 5)) + +module.exports.F = F; +>module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport6", Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport6", Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) + +module.exports.S = _sym; +>module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport6", Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport6", Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport6.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.symbols.diff b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.symbols.diff index 8251bda976..0740303e51 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.symbols.diff @@ -1,93 +1,94 @@ --- old.lateBoundAssignmentDeclarationSupport6.symbols +++ new.lateBoundAssignmentDeclarationSupport6.symbols -@@= skipped -2, +2 lines =@@ - === usage.js === +@@= skipped -3, +3 lines =@@ const x = require("./lateBoundAssignmentDeclarationSupport6.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./lateBoundAssignmentDeclarationSupport6.js" : Symbol(x, Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) ++>"./lateBoundAssignmentDeclarationSupport6.js" : Symbol("lateBoundAssignmentDeclarationSupport6", Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) const inst = new x.F(); >inst : Symbol(inst, Decl(usage.js, 1, 5)) ->x.F : Symbol(x.F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) ++>x.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->F : Symbol(x.F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) const y = inst["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 2, 5)) -@@= skipped -16, +12 lines =@@ +@@= skipped -15, +15 lines =@@ const z = inst[x.S]; >z : Symbol(z, Decl(usage.js, 3, 5)) >inst : Symbol(inst, Decl(usage.js, 1, 5)) ->x.S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) ++>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) ++>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) --=== lateBoundAssignmentDeclarationSupport6.js === --// currently unsupported --const _sym = Symbol(); -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport6.js, 1, 5)) -->Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) -- --const _str = "my-fake-sym"; -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 5)) -- --function F() { -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) --} --F.prototype.defsAClass = true; + === lateBoundAssignmentDeclarationSupport6.js === + // currently unsupported +@@= skipped -17, +17 lines =@@ + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) + } + F.prototype.defsAClass = true; ->F.prototype : Symbol(F.defsAClass, Decl(lateBoundAssignmentDeclarationSupport6.js, 5, 1)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) ++>F.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) ->defsAClass : Symbol(F.defsAClass, Decl(lateBoundAssignmentDeclarationSupport6.js, 5, 1)) -- --Object.defineProperty(F.prototype, _str, {value: "ok"}); ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + + Object.defineProperty(F.prototype, _str, {value: "ok"}); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->F.prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>F.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 5)) -->value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport6.js, 7, 42)) -- --Object.defineProperty(F.prototype, _sym, {value: "ok"}); ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 5)) + >value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport6.js, 7, 42)) + + Object.defineProperty(F.prototype, _sym, {value: "ok"}); ->Object.defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) -->Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ++>Object.defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) + >Object : Symbol(Object, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) ->defineProperty : Symbol(ObjectConstructor.defineProperty, Decl(lib.es5.d.ts, --, --)) ->F.prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) ++>defineProperty : Symbol(defineProperty, Decl(lib.es5.d.ts, --, --)) ++>F.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport6.js, 1, 5)) -->value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport6.js, 8, 42)) -- --const inst = new F(); -->inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport6.js, 9, 5)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) -- --const _y = inst[_str]; -->_y : Symbol(_y, Decl(lateBoundAssignmentDeclarationSupport6.js, 10, 5)) -->inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport6.js, 9, 5)) -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 5)) -- --const _z = inst[_sym]; -->_z : Symbol(_z, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 5)) -->inst : Symbol(inst, Decl(lateBoundAssignmentDeclarationSupport6.js, 9, 5)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport6.js, 1, 5)) -- --module.exports.F = F; -->module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport6.js, 1, 5)) + >value : Symbol(value, Decl(lateBoundAssignmentDeclarationSupport6.js, 8, 42)) + +@@= skipped -41, +40 lines =@@ + + module.exports.F = F; + >module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) ->module.exports : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) -- --module.exports.S = _sym; -->module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport6", Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport6", Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport6.js, 2, 27)) + + module.exports.S = _sym; + >module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) ->module.exports : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport6.js, 11, 22)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) -->S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport6.js, 1, 5)) -- ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport6", Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport6", Decl(lateBoundAssignmentDeclarationSupport6.js, 0, 0)) + >S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport6.js, 12, 21)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport6.js, 1, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.types b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.types index d59bee28f5..d041405ef3 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.types +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport6.types @@ -2,17 +2,17 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport6.js"); ->x : any ->require("./lateBoundAssignmentDeclarationSupport6.js") : any +>x : typeof import("lateBoundAssignmentDeclarationSupport6") +>require("./lateBoundAssignmentDeclarationSupport6.js") : typeof import("lateBoundAssignmentDeclarationSupport6") >require : any >"./lateBoundAssignmentDeclarationSupport6.js" : "./lateBoundAssignmentDeclarationSupport6.js" const inst = new x.F(); >inst : any >new x.F() : any ->x.F : any ->x : any ->F : any +>x.F : () => void +>x : typeof import("lateBoundAssignmentDeclarationSupport6") +>F : () => void const y = inst["my-fake-sym"]; >y : any @@ -24,7 +24,91 @@ const z = inst[x.S]; >z : any >inst[x.S] : any >inst : any ->x.S : any ->x : any ->S : any +>x.S : unique symbol +>x : typeof import("lateBoundAssignmentDeclarationSupport6") +>S : unique symbol + +=== lateBoundAssignmentDeclarationSupport6.js === +// currently unsupported +const _sym = Symbol(); +>_sym : unique symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + +const _str = "my-fake-sym"; +>_str : "my-fake-sym" +>"my-fake-sym" : "my-fake-sym" + +function F() { +>F : () => void +} +F.prototype.defsAClass = true; +>F.prototype.defsAClass = true : true +>F.prototype.defsAClass : any +>F.prototype : any +>F : () => void +>prototype : any +>defsAClass : any +>true : true + +Object.defineProperty(F.prototype, _str, {value: "ok"}); +>Object.defineProperty(F.prototype, _str, {value: "ok"}) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>F.prototype : any +>F : () => void +>prototype : any +>_str : "my-fake-sym" +>{value: "ok"} : { value: string; } +>value : string +>"ok" : "ok" + +Object.defineProperty(F.prototype, _sym, {value: "ok"}); +>Object.defineProperty(F.prototype, _sym, {value: "ok"}) : any +>Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>Object : ObjectConstructor +>defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +>F.prototype : any +>F : () => void +>prototype : any +>_sym : unique symbol +>{value: "ok"} : { value: string; } +>value : string +>"ok" : "ok" + +const inst = new F(); +>inst : any +>new F() : any +>F : () => void + +const _y = inst[_str]; +>_y : any +>inst[_str] : any +>inst : any +>_str : "my-fake-sym" + +const _z = inst[_sym]; +>_z : any +>inst[_sym] : any +>inst : any +>_sym : unique symbol + +module.exports.F = F; +>module.exports.F = F : () => void +>module.exports.F : () => void +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport6") +>module : { "lateBoundAssignmentDeclarationSupport6": typeof import("lateBoundAssignmentDeclarationSupport6"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport6") +>F : () => void +>F : () => void + +module.exports.S = _sym; +>module.exports.S = _sym : unique symbol +>module.exports.S : unique symbol +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport6") +>module : { "lateBoundAssignmentDeclarationSupport6": typeof import("lateBoundAssignmentDeclarationSupport6"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport6") +>S : unique symbol +>_sym : unique symbol diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.errors.txt b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.errors.txt deleted file mode 100644 index 5fa8437c8f..0000000000 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.errors.txt +++ /dev/null @@ -1,20 +0,0 @@ -usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== usage.js (1 errors) ==== - const x = require("./lateBoundAssignmentDeclarationSupport7.js"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - const y = x.F["my-fake-sym"]; - const z = x.F[x.S]; - -==== lateBoundAssignmentDeclarationSupport7.js (0 errors) ==== - const _sym = Symbol(); - const _str = "my-fake-sym"; - - function F() { - } - F[_sym] = "ok"; - F[_str] = "ok"; - module.exports.F = F; - module.exports.S = _sym; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.symbols b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.symbols index 38f8391fb3..c240506a8e 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.symbols +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.symbols @@ -3,13 +3,57 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport7.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) +>require : Symbol(require) +>"./lateBoundAssignmentDeclarationSupport7.js" : Symbol("lateBoundAssignmentDeclarationSupport7", Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) const y = x.F["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 1, 5)) +>x.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) +>"my-fake-sym" : Symbol(F[_str], Decl(lateBoundAssignmentDeclarationSupport7.js, 5, 15)) const z = x.F[x.S]; >z : Symbol(z, Decl(usage.js, 2, 5)) +>x.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) +>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) >x : Symbol(x, Decl(usage.js, 0, 5)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) + +=== lateBoundAssignmentDeclarationSupport7.js === +const _sym = Symbol(); +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) + +const _str = "my-fake-sym"; +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 5)) + +function F() { +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27)) +} +F[_sym] = "ok"; +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 5)) + +F[_str] = "ok"; +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27)) +>_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 5)) + +module.exports.F = F; +>module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport7", Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport7", Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) +>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27)) + +module.exports.S = _sym; +>module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) +>module.exports : Symbol("lateBoundAssignmentDeclarationSupport7", Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("lateBoundAssignmentDeclarationSupport7", Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) +>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) +>_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.symbols.diff b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.symbols.diff index da45986366..6839887f10 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.symbols.diff @@ -1,60 +1,74 @@ --- old.lateBoundAssignmentDeclarationSupport7.symbols +++ new.lateBoundAssignmentDeclarationSupport7.symbols -@@= skipped -2, +2 lines =@@ - === usage.js === +@@= skipped -3, +3 lines =@@ const x = require("./lateBoundAssignmentDeclarationSupport7.js"); >x : Symbol(x, Decl(usage.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./lateBoundAssignmentDeclarationSupport7.js" : Symbol(x, Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) ++>"./lateBoundAssignmentDeclarationSupport7.js" : Symbol("lateBoundAssignmentDeclarationSupport7", Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) const y = x.F["my-fake-sym"]; >y : Symbol(y, Decl(usage.js, 1, 5)) ->x.F : Symbol(x.F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ++>x.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->F : Symbol(x.F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ->"my-fake-sym" : Symbol(x.F.F[_str], Decl(lateBoundAssignmentDeclarationSupport7.js, 5, 15)) ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ++>"my-fake-sym" : Symbol(F[_str], Decl(lateBoundAssignmentDeclarationSupport7.js, 5, 15)) const z = x.F[x.S]; >z : Symbol(z, Decl(usage.js, 2, 5)) ->x.F : Symbol(x.F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ++>x.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->F : Symbol(x.F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ->x.S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ++>x.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) >x : Symbol(x, Decl(usage.js, 0, 5)) ->S : Symbol(x.S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) ++>S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) --=== lateBoundAssignmentDeclarationSupport7.js === --const _sym = Symbol(); -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 5)) -->Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) -- --const _str = "my-fake-sym"; -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 5)) -- --function F() { + === lateBoundAssignmentDeclarationSupport7.js === + const _sym = Symbol(); +@@= skipped -27, +27 lines =@@ + >_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 5)) + + function F() { ->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27), Decl(lateBoundAssignmentDeclarationSupport7.js, 4, 1), Decl(lateBoundAssignmentDeclarationSupport7.js, 5, 15)) --} --F[_sym] = "ok"; ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27)) + } + F[_sym] = "ok"; ->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27), Decl(lateBoundAssignmentDeclarationSupport7.js, 4, 1), Decl(lateBoundAssignmentDeclarationSupport7.js, 5, 15)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 5)) -- --F[_str] = "ok"; ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 5)) + + F[_str] = "ok"; ->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27), Decl(lateBoundAssignmentDeclarationSupport7.js, 4, 1), Decl(lateBoundAssignmentDeclarationSupport7.js, 5, 15)) -->_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 5)) -- --module.exports.F = F; -->module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27)) + >_str : Symbol(_str, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 5)) + + module.exports.F = F; + >module.exports.F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ->module.exports : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) -->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport7", Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport7", Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) + >F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ->F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27), Decl(lateBoundAssignmentDeclarationSupport7.js, 4, 1), Decl(lateBoundAssignmentDeclarationSupport7.js, 5, 15)) -- --module.exports.S = _sym; -->module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) ++>F : Symbol(F, Decl(lateBoundAssignmentDeclarationSupport7.js, 1, 27)) + + module.exports.S = _sym; + >module.exports.S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) ->module.exports : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) ->module : Symbol(module, Decl(lateBoundAssignmentDeclarationSupport7.js, 6, 15)) ->exports : Symbol(module.exports, Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) -->S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) -->_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 5)) -- ++>module.exports : Symbol("lateBoundAssignmentDeclarationSupport7", Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("lateBoundAssignmentDeclarationSupport7", Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 0)) + >S : Symbol(S, Decl(lateBoundAssignmentDeclarationSupport7.js, 7, 21)) + >_sym : Symbol(_sym, Decl(lateBoundAssignmentDeclarationSupport7.js, 0, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.types b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.types index 450a5a61c7..58846e896f 100644 --- a/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.types +++ b/testdata/baselines/reference/submodule/conformance/lateBoundAssignmentDeclarationSupport7.types @@ -2,26 +2,71 @@ === usage.js === const x = require("./lateBoundAssignmentDeclarationSupport7.js"); ->x : any ->require("./lateBoundAssignmentDeclarationSupport7.js") : any +>x : typeof import("lateBoundAssignmentDeclarationSupport7") +>require("./lateBoundAssignmentDeclarationSupport7.js") : typeof import("lateBoundAssignmentDeclarationSupport7") >require : any >"./lateBoundAssignmentDeclarationSupport7.js" : "./lateBoundAssignmentDeclarationSupport7.js" const y = x.F["my-fake-sym"]; ->y : any ->x.F["my-fake-sym"] : any ->x.F : any ->x : any ->F : any +>y : string +>x.F["my-fake-sym"] : string +>x.F : { (): void; F[_sym]: string; F[_str]: string; } +>x : typeof import("lateBoundAssignmentDeclarationSupport7") +>F : { (): void; F[_sym]: string; F[_str]: string; } >"my-fake-sym" : "my-fake-sym" const z = x.F[x.S]; ->z : any ->x.F[x.S] : any ->x.F : any ->x : any ->F : any ->x.S : any ->x : any ->S : any +>z : string +>x.F[x.S] : string +>x.F : { (): void; F[_sym]: string; F[_str]: string; } +>x : typeof import("lateBoundAssignmentDeclarationSupport7") +>F : { (): void; F[_sym]: string; F[_str]: string; } +>x.S : unique symbol +>x : typeof import("lateBoundAssignmentDeclarationSupport7") +>S : unique symbol + +=== lateBoundAssignmentDeclarationSupport7.js === +const _sym = Symbol(); +>_sym : unique symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + +const _str = "my-fake-sym"; +>_str : "my-fake-sym" +>"my-fake-sym" : "my-fake-sym" + +function F() { +>F : { (): void; F[_sym]: string; F[_str]: string; } +} +F[_sym] = "ok"; +>F[_sym] = "ok" : "ok" +>F[_sym] : string +>F : { (): void; F[_sym]: string; F[_str]: string; } +>_sym : unique symbol +>"ok" : "ok" + +F[_str] = "ok"; +>F[_str] = "ok" : "ok" +>F[_str] : string +>F : { (): void; F[_sym]: string; F[_str]: string; } +>_str : "my-fake-sym" +>"ok" : "ok" + +module.exports.F = F; +>module.exports.F = F : { (): void; F[_sym]: string; F[_str]: string; } +>module.exports.F : { (): void; F[_sym]: string; F[_str]: string; } +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport7") +>module : { "lateBoundAssignmentDeclarationSupport7": typeof import("lateBoundAssignmentDeclarationSupport7"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport7") +>F : { (): void; F[_sym]: string; F[_str]: string; } +>F : { (): void; F[_sym]: string; F[_str]: string; } + +module.exports.S = _sym; +>module.exports.S = _sym : unique symbol +>module.exports.S : unique symbol +>module.exports : typeof import("lateBoundAssignmentDeclarationSupport7") +>module : { "lateBoundAssignmentDeclarationSupport7": typeof import("lateBoundAssignmentDeclarationSupport7"); } +>exports : typeof import("lateBoundAssignmentDeclarationSupport7") +>S : unique symbol +>_sym : unique symbol diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAlias.errors.txt index 13603d06e5..5144b74b30 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias.errors.txt @@ -1,199 +1,238 @@ -a.ts(1,20): error TS2306: File 'b.js' is not a module. -b.js(1,20): error TS2304: Cannot find name 'exports'. -b.js(3,1): error TS2304: Cannot find name 'exports'. -b.js(5,26): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(9,33): error TS2304: Cannot find name 'exports'. -b.js(9,43): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(12,33): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(12,50): error TS2304: Cannot find name 'exports'. -b.js(16,53): error TS2304: Cannot find name 'exports'. -b.js(19,53): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(22,33): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(22,50): error TS2304: Cannot find name 'exports'. +a.ts(2,3): error TS2339: Property 'func1' does not exist on type '{}'. +a.ts(3,3): error TS2339: Property 'func2' does not exist on type '{}'. +a.ts(4,3): error TS2339: Property 'func3' does not exist on type '{}'. +a.ts(5,3): error TS2339: Property 'func4' does not exist on type '{}'. +a.ts(6,3): error TS2339: Property 'func5' does not exist on type '{}'. +a.ts(7,3): error TS2339: Property 'func6' does not exist on type '{}'. +a.ts(8,3): error TS2339: Property 'func7' does not exist on type '{}'. +a.ts(9,3): error TS2339: Property 'func8' does not exist on type '{}'. +a.ts(10,3): error TS2339: Property 'func9' does not exist on type '{}'. +a.ts(11,3): error TS2339: Property 'func10' does not exist on type '{}'. +a.ts(12,3): error TS2339: Property 'func11' does not exist on type '{}'. +a.ts(13,3): error TS2339: Property 'func12' does not exist on type '{}'. +a.ts(14,3): error TS2339: Property 'func13' does not exist on type '{}'. +a.ts(15,3): error TS2339: Property 'func14' does not exist on type '{}'. +a.ts(16,3): error TS2339: Property 'func15' does not exist on type '{}'. +a.ts(17,3): error TS2339: Property 'func16' does not exist on type '{}'. +a.ts(18,3): error TS2339: Property 'func17' does not exist on type '{}'. +a.ts(19,3): error TS2339: Property 'func18' does not exist on type '{}'. +a.ts(20,3): error TS2339: Property 'func19' does not exist on type '{}'. +a.ts(21,3): error TS2339: Property 'func20' does not exist on type '{}'. +b.js(2,14): error TS2339: Property 'func1' does not exist on type 'typeof import("b")'. +b.js(3,9): error TS2339: Property 'func2' does not exist on type 'typeof import("b")'. +b.js(6,20): error TS2339: Property 'func3' does not exist on type '{}'. +b.js(7,16): error TS2339: Property 'func4' does not exist on type '{}'. +b.js(9,33): error TS2631: Cannot assign to '"b"' because it is a namespace. +b.js(10,27): error TS2339: Property 'func5' does not exist on type '{}'. +b.js(13,27): error TS2339: Property 'func6' does not exist on type 'typeof import("b")'. +b.js(17,27): error TS2339: Property 'func7' does not exist on type 'typeof import("b")'. +b.js(20,27): error TS2339: Property 'func8' does not exist on type '{}'. +b.js(22,50): error TS2631: Cannot assign to '"b"' because it is a namespace. b.js(23,27): error TS2339: Property 'func9' does not exist on type '{}'. -b.js(25,33): error TS2304: Cannot find name 'exports'. -b.js(25,43): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +b.js(25,33): error TS2631: Cannot assign to '"b"' because it is a namespace. b.js(26,27): error TS2339: Property 'func10' does not exist on type '{}'. -b.js(28,1): error TS2304: Cannot find name 'exports'. -b.js(28,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(29,1): error TS2304: Cannot find name 'exports'. -b.js(30,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(32,1): error TS2304: Cannot find name 'exports'. -b.js(32,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(33,1): error TS2304: Cannot find name 'exports'. -b.js(34,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(36,1): error TS2304: Cannot find name 'exports'. -b.js(36,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(37,1): error TS2304: Cannot find name 'exports'. -b.js(38,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(40,1): error TS2304: Cannot find name 'exports'. -b.js(40,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(41,1): error TS2304: Cannot find name 'exports'. -b.js(42,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(44,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(44,18): error TS2304: Cannot find name 'exports'. -b.js(45,1): error TS2304: Cannot find name 'exports'. -b.js(46,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(48,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -b.js(49,1): error TS2304: Cannot find name 'exports'. -b.js(50,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +b.js(28,1): error TS2631: Cannot assign to '"b"' because it is a namespace. +b.js(29,9): error TS2339: Property 'func11' does not exist on type 'typeof import("b")'. +b.js(30,16): error TS2339: Property 'func12' does not exist on type '{}'. +b.js(32,1): error TS2631: Cannot assign to '"b"' because it is a namespace. +b.js(33,9): error TS2339: Property 'func11' does not exist on type 'typeof import("b")'. +b.js(34,16): error TS2339: Property 'func12' does not exist on type '{}'. +b.js(36,1): error TS2631: Cannot assign to '"b"' because it is a namespace. +b.js(37,9): error TS2339: Property 'func13' does not exist on type 'typeof import("b")'. +b.js(38,16): error TS2339: Property 'func14' does not exist on type '{}'. +b.js(40,1): error TS2631: Cannot assign to '"b"' because it is a namespace. +b.js(41,9): error TS2339: Property 'func15' does not exist on type 'typeof import("b")'. +b.js(42,16): error TS2339: Property 'func16' does not exist on type '{}'. +b.js(44,1): error TS2300: Duplicate identifier 'export='. +b.js(44,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +b.js(44,18): error TS2631: Cannot assign to '"b"' because it is a namespace. +b.js(45,9): error TS2339: Property 'func17' does not exist on type 'typeof import("b")'. +b.js(46,16): error TS2339: Property 'func18' does not exist on type '{}'. +b.js(48,1): error TS2300: Duplicate identifier 'export='. +b.js(49,9): error TS2339: Property 'func19' does not exist on type 'typeof import("b")'. +b.js(50,16): error TS2339: Property 'func20' does not exist on type '{}'. -==== a.ts (1 errors) ==== +==== a.ts (20 errors) ==== import b = require("./b.js"); - ~~~~~~~~ -!!! error TS2306: File 'b.js' is not a module. b.func1; + ~~~~~ +!!! error TS2339: Property 'func1' does not exist on type '{}'. b.func2; + ~~~~~ +!!! error TS2339: Property 'func2' does not exist on type '{}'. b.func3; + ~~~~~ +!!! error TS2339: Property 'func3' does not exist on type '{}'. b.func4; + ~~~~~ +!!! error TS2339: Property 'func4' does not exist on type '{}'. b.func5; + ~~~~~ +!!! error TS2339: Property 'func5' does not exist on type '{}'. b.func6; + ~~~~~ +!!! error TS2339: Property 'func6' does not exist on type '{}'. b.func7; + ~~~~~ +!!! error TS2339: Property 'func7' does not exist on type '{}'. b.func8; + ~~~~~ +!!! error TS2339: Property 'func8' does not exist on type '{}'. b.func9; + ~~~~~ +!!! error TS2339: Property 'func9' does not exist on type '{}'. b.func10; + ~~~~~~ +!!! error TS2339: Property 'func10' does not exist on type '{}'. b.func11; + ~~~~~~ +!!! error TS2339: Property 'func11' does not exist on type '{}'. b.func12; + ~~~~~~ +!!! error TS2339: Property 'func12' does not exist on type '{}'. b.func13; + ~~~~~~ +!!! error TS2339: Property 'func13' does not exist on type '{}'. b.func14; + ~~~~~~ +!!! error TS2339: Property 'func14' does not exist on type '{}'. b.func15; + ~~~~~~ +!!! error TS2339: Property 'func15' does not exist on type '{}'. b.func16; + ~~~~~~ +!!! error TS2339: Property 'func16' does not exist on type '{}'. b.func17; + ~~~~~~ +!!! error TS2339: Property 'func17' does not exist on type '{}'. b.func18; + ~~~~~~ +!!! error TS2339: Property 'func18' does not exist on type '{}'. b.func19; + ~~~~~~ +!!! error TS2339: Property 'func19' does not exist on type '{}'. b.func20; + ~~~~~~ +!!! error TS2339: Property 'func20' does not exist on type '{}'. -==== b.js (39 errors) ==== +==== b.js (33 errors) ==== var exportsAlias = exports; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. exportsAlias.func1 = function () { }; + ~~~~~ +!!! error TS2339: Property 'func1' does not exist on type 'typeof import("b")'. exports.func2 = function () { }; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~ +!!! error TS2339: Property 'func2' does not exist on type 'typeof import("b")'. var moduleExportsAlias = module.exports; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. moduleExportsAlias.func3 = function () { }; + ~~~~~ +!!! error TS2339: Property 'func3' does not exist on type '{}'. module.exports.func4 = function () { }; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~ +!!! error TS2339: Property 'func4' does not exist on type '{}'. var multipleDeclarationAlias1 = exports = module.exports; ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2631: Cannot assign to '"b"' because it is a namespace. multipleDeclarationAlias1.func5 = function () { }; + ~~~~~ +!!! error TS2339: Property 'func5' does not exist on type '{}'. var multipleDeclarationAlias2 = module.exports = exports; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. multipleDeclarationAlias2.func6 = function () { }; + ~~~~~ +!!! error TS2339: Property 'func6' does not exist on type 'typeof import("b")'. var someOtherVariable; var multipleDeclarationAlias3 = someOtherVariable = exports; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. multipleDeclarationAlias3.func7 = function () { }; + ~~~~~ +!!! error TS2339: Property 'func7' does not exist on type 'typeof import("b")'. var multipleDeclarationAlias4 = someOtherVariable = module.exports; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. multipleDeclarationAlias4.func8 = function () { }; + ~~~~~ +!!! error TS2339: Property 'func8' does not exist on type '{}'. var multipleDeclarationAlias5 = module.exports = exports = {}; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. +!!! error TS2631: Cannot assign to '"b"' because it is a namespace. multipleDeclarationAlias5.func9 = function () { }; ~~~~~ !!! error TS2339: Property 'func9' does not exist on type '{}'. var multipleDeclarationAlias6 = exports = module.exports = {}; ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2631: Cannot assign to '"b"' because it is a namespace. multipleDeclarationAlias6.func10 = function () { }; ~~~~~~ !!! error TS2339: Property 'func10' does not exist on type '{}'. exports = module.exports = someOtherVariable = {}; ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2631: Cannot assign to '"b"' because it is a namespace. exports.func11 = function () { }; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~ +!!! error TS2339: Property 'func11' does not exist on type 'typeof import("b")'. module.exports.func12 = function () { }; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~ +!!! error TS2339: Property 'func12' does not exist on type '{}'. exports = module.exports = someOtherVariable = {}; ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2631: Cannot assign to '"b"' because it is a namespace. exports.func11 = function () { }; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~ +!!! error TS2339: Property 'func11' does not exist on type 'typeof import("b")'. module.exports.func12 = function () { }; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~ +!!! error TS2339: Property 'func12' does not exist on type '{}'. exports = module.exports = {}; ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2631: Cannot assign to '"b"' because it is a namespace. exports.func13 = function () { }; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~ +!!! error TS2339: Property 'func13' does not exist on type 'typeof import("b")'. module.exports.func14 = function () { }; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~ +!!! error TS2339: Property 'func14' does not exist on type '{}'. exports = module.exports = {}; ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2631: Cannot assign to '"b"' because it is a namespace. exports.func15 = function () { }; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~ +!!! error TS2339: Property 'func15' does not exist on type 'typeof import("b")'. module.exports.func16 = function () { }; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~ +!!! error TS2339: Property 'func16' does not exist on type '{}'. module.exports = exports = {}; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'export='. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. +!!! error TS2631: Cannot assign to '"b"' because it is a namespace. exports.func17 = function () { }; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~ +!!! error TS2339: Property 'func17' does not exist on type 'typeof import("b")'. module.exports.func18 = function () { }; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~ +!!! error TS2339: Property 'func18' does not exist on type '{}'. module.exports = {}; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2300: Duplicate identifier 'export='. exports.func19 = function () { }; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~ +!!! error TS2339: Property 'func19' does not exist on type 'typeof import("b")'. module.exports.func20 = function () { }; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~ +!!! error TS2339: Property 'func20' does not exist on type '{}'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAlias.symbols index d1be0a079f..db9cea396e 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias.symbols @@ -68,28 +68,44 @@ b.func20; === b.js === var exportsAlias = exports; >exportsAlias : Symbol(exportsAlias, Decl(b.js, 0, 3)) +>exports : Symbol("b", Decl(b.js, 0, 0)) exportsAlias.func1 = function () { }; >exportsAlias : Symbol(exportsAlias, Decl(b.js, 0, 3)) exports.func2 = function () { }; +>exports : Symbol("b", Decl(b.js, 0, 0)) var moduleExportsAlias = module.exports; >moduleExportsAlias : Symbol(moduleExportsAlias, Decl(b.js, 4, 3)) +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) moduleExportsAlias.func3 = function () { }; >moduleExportsAlias : Symbol(moduleExportsAlias, Decl(b.js, 4, 3)) module.exports.func4 = function () { }; +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) var multipleDeclarationAlias1 = exports = module.exports; >multipleDeclarationAlias1 : Symbol(multipleDeclarationAlias1, Decl(b.js, 8, 3)) +>exports : Symbol("b", Decl(b.js, 0, 0)) +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) multipleDeclarationAlias1.func5 = function () { }; >multipleDeclarationAlias1 : Symbol(multipleDeclarationAlias1, Decl(b.js, 8, 3)) var multipleDeclarationAlias2 = module.exports = exports; >multipleDeclarationAlias2 : Symbol(multipleDeclarationAlias2, Decl(b.js, 11, 3)) +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) +>exports : Symbol("b", Decl(b.js, 0, 0)) multipleDeclarationAlias2.func6 = function () { }; >multipleDeclarationAlias2 : Symbol(multipleDeclarationAlias2, Decl(b.js, 11, 3)) @@ -100,6 +116,7 @@ var someOtherVariable; var multipleDeclarationAlias3 = someOtherVariable = exports; >multipleDeclarationAlias3 : Symbol(multipleDeclarationAlias3, Decl(b.js, 15, 3)) >someOtherVariable : Symbol(someOtherVariable, Decl(b.js, 14, 3)) +>exports : Symbol("b", Decl(b.js, 0, 0)) multipleDeclarationAlias3.func7 = function () { }; >multipleDeclarationAlias3 : Symbol(multipleDeclarationAlias3, Decl(b.js, 15, 3)) @@ -107,48 +124,116 @@ multipleDeclarationAlias3.func7 = function () { }; var multipleDeclarationAlias4 = someOtherVariable = module.exports; >multipleDeclarationAlias4 : Symbol(multipleDeclarationAlias4, Decl(b.js, 18, 3)) >someOtherVariable : Symbol(someOtherVariable, Decl(b.js, 14, 3)) +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) multipleDeclarationAlias4.func8 = function () { }; >multipleDeclarationAlias4 : Symbol(multipleDeclarationAlias4, Decl(b.js, 18, 3)) var multipleDeclarationAlias5 = module.exports = exports = {}; >multipleDeclarationAlias5 : Symbol(multipleDeclarationAlias5, Decl(b.js, 21, 3)) +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) +>exports : Symbol("b", Decl(b.js, 0, 0)) multipleDeclarationAlias5.func9 = function () { }; >multipleDeclarationAlias5 : Symbol(multipleDeclarationAlias5, Decl(b.js, 21, 3)) var multipleDeclarationAlias6 = exports = module.exports = {}; >multipleDeclarationAlias6 : Symbol(multipleDeclarationAlias6, Decl(b.js, 24, 3)) +>exports : Symbol("b", Decl(b.js, 0, 0)) +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) multipleDeclarationAlias6.func10 = function () { }; >multipleDeclarationAlias6 : Symbol(multipleDeclarationAlias6, Decl(b.js, 24, 3)) exports = module.exports = someOtherVariable = {}; +>exports : Symbol("b", Decl(b.js, 0, 0)) +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) >someOtherVariable : Symbol(someOtherVariable, Decl(b.js, 14, 3)) exports.func11 = function () { }; +>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func12 = function () { }; +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) exports = module.exports = someOtherVariable = {}; +>exports : Symbol("b", Decl(b.js, 0, 0)) +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) >someOtherVariable : Symbol(someOtherVariable, Decl(b.js, 14, 3)) exports.func11 = function () { }; +>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func12 = function () { }; +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) exports = module.exports = {}; +>exports : Symbol("b", Decl(b.js, 0, 0)) +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) + exports.func13 = function () { }; +>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func14 = function () { }; +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) exports = module.exports = {}; +>exports : Symbol("b", Decl(b.js, 0, 0)) +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) + exports.func15 = function () { }; +>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func16 = function () { }; +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) module.exports = exports = {}; +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) +>exports : Symbol("b", Decl(b.js, 0, 0)) + exports.func17 = function () { }; +>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func18 = function () { }; +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) module.exports = {}; +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) + exports.func19 = function () { }; +>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func20 = function () { }; +>module.exports : Symbol(export=, Decl(b.js, 41, 40)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(b.js, 41, 40)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAlias.symbols.diff index 09caa15eac..2cb531c0ca 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias.symbols.diff @@ -105,9 +105,8 @@ === b.js === - var exportsAlias = exports; - >exportsAlias : Symbol(exportsAlias, Decl(b.js, 0, 3)) -->exports : Symbol("b", Decl(b.js, 0, 0)) +@@= skipped -106, +66 lines =@@ + >exports : Symbol("b", Decl(b.js, 0, 0)) exportsAlias.func1 = function () { }; ->exportsAlias.func1 : Symbol(func1, Decl(b.js, 0, 27)) @@ -118,12 +117,16 @@ ->exports.func2 : Symbol(func2, Decl(b.js, 1, 37)) ->exports : Symbol(func2, Decl(b.js, 1, 37)) ->func2 : Symbol(func2, Decl(b.js, 1, 37)) ++>exports : Symbol("b", Decl(b.js, 0, 0)) var moduleExportsAlias = module.exports; >moduleExportsAlias : Symbol(moduleExportsAlias, Decl(b.js, 4, 3)) ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) moduleExportsAlias.func3 = function () { }; ->moduleExportsAlias.func3 : Symbol(func3, Decl(b.js, 4, 40)) @@ -136,13 +139,19 @@ ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->func4 : Symbol(func4, Decl(b.js, 5, 43)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) var multipleDeclarationAlias1 = exports = module.exports; >multipleDeclarationAlias1 : Symbol(multipleDeclarationAlias1, Decl(b.js, 8, 3)) -->exports : Symbol("b", Decl(b.js, 0, 0)) + >exports : Symbol("b", Decl(b.js, 0, 0)) ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) multipleDeclarationAlias1.func5 = function () { }; ->multipleDeclarationAlias1.func5 : Symbol(func5, Decl(b.js, 8, 57)) @@ -154,7 +163,10 @@ ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) -->exports : Symbol("b", Decl(b.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) + >exports : Symbol("b", Decl(b.js, 0, 0)) multipleDeclarationAlias2.func6 = function () { }; ->multipleDeclarationAlias2.func6 : Symbol(func6, Decl(b.js, 11, 57)) @@ -163,11 +175,8 @@ var someOtherVariable; >someOtherVariable : Symbol(someOtherVariable, Decl(b.js, 14, 3)) -@@= skipped -163, +95 lines =@@ - var multipleDeclarationAlias3 = someOtherVariable = exports; - >multipleDeclarationAlias3 : Symbol(multipleDeclarationAlias3, Decl(b.js, 15, 3)) - >someOtherVariable : Symbol(someOtherVariable, Decl(b.js, 14, 3)) -->exports : Symbol("b", Decl(b.js, 0, 0)) +@@= skipped -60, +48 lines =@@ + >exports : Symbol("b", Decl(b.js, 0, 0)) multipleDeclarationAlias3.func7 = function () { }; ->multipleDeclarationAlias3.func7 : Symbol(func7, Decl(b.js, 15, 60)) @@ -180,6 +189,9 @@ ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) multipleDeclarationAlias4.func8 = function () { }; ->multipleDeclarationAlias4.func8 : Symbol(func8, Decl(b.js, 18, 67)) @@ -191,7 +203,10 @@ ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) -->exports : Symbol("b", Decl(b.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) + >exports : Symbol("b", Decl(b.js, 0, 0)) multipleDeclarationAlias5.func9 = function () { }; ->multipleDeclarationAlias5.func9 : Symbol(func9, Decl(b.js, 21, 62)) @@ -200,10 +215,13 @@ var multipleDeclarationAlias6 = exports = module.exports = {}; >multipleDeclarationAlias6 : Symbol(multipleDeclarationAlias6, Decl(b.js, 24, 3)) -->exports : Symbol("b", Decl(b.js, 0, 0)) + >exports : Symbol("b", Decl(b.js, 0, 0)) ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) multipleDeclarationAlias6.func10 = function () { }; ->multipleDeclarationAlias6.func10 : Symbol(func10, Decl(b.js, 24, 62)) @@ -211,112 +229,154 @@ ->func10 : Symbol(func10, Decl(b.js, 24, 62)) exports = module.exports = someOtherVariable = {}; -->exports : Symbol("b", Decl(b.js, 0, 0)) + >exports : Symbol("b", Decl(b.js, 0, 0)) ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) >someOtherVariable : Symbol(someOtherVariable, Decl(b.js, 14, 3)) exports.func11 = function () { }; ->exports.func11 : Symbol(func11, Decl(b.js, 27, 50), Decl(b.js, 31, 50)) ->exports : Symbol(func11, Decl(b.js, 27, 50), Decl(b.js, 31, 50)) ->func11 : Symbol(func11, Decl(b.js, 27, 50), Decl(b.js, 31, 50)) -- ++>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func12 = function () { }; ->module.exports.func12 : Symbol(func12, Decl(b.js, 28, 33), Decl(b.js, 32, 33)) ->module.exports : Symbol(func12, Decl(b.js, 28, 33), Decl(b.js, 32, 33)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->func12 : Symbol(func12, Decl(b.js, 28, 33), Decl(b.js, 32, 33)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) exports = module.exports = someOtherVariable = {}; -->exports : Symbol("b", Decl(b.js, 0, 0)) + >exports : Symbol("b", Decl(b.js, 0, 0)) ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) >someOtherVariable : Symbol(someOtherVariable, Decl(b.js, 14, 3)) exports.func11 = function () { }; ->exports.func11 : Symbol(func11, Decl(b.js, 27, 50), Decl(b.js, 31, 50)) ->exports : Symbol(func11, Decl(b.js, 27, 50), Decl(b.js, 31, 50)) ->func11 : Symbol(func11, Decl(b.js, 27, 50), Decl(b.js, 31, 50)) -- ++>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func12 = function () { }; ->module.exports.func12 : Symbol(func12, Decl(b.js, 28, 33), Decl(b.js, 32, 33)) ->module.exports : Symbol(func12, Decl(b.js, 28, 33), Decl(b.js, 32, 33)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->func12 : Symbol(func12, Decl(b.js, 28, 33), Decl(b.js, 32, 33)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) exports = module.exports = {}; -->exports : Symbol("b", Decl(b.js, 0, 0)) + >exports : Symbol("b", Decl(b.js, 0, 0)) ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) + exports.func13 = function () { }; ->exports.func13 : Symbol(func13, Decl(b.js, 35, 30)) ->exports : Symbol(func13, Decl(b.js, 35, 30)) ->func13 : Symbol(func13, Decl(b.js, 35, 30)) -- ++>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func14 = function () { }; ->module.exports.func14 : Symbol(func14, Decl(b.js, 36, 33)) ->module.exports : Symbol(func14, Decl(b.js, 36, 33)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->func14 : Symbol(func14, Decl(b.js, 36, 33)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) exports = module.exports = {}; -->exports : Symbol("b", Decl(b.js, 0, 0)) + >exports : Symbol("b", Decl(b.js, 0, 0)) ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) + exports.func15 = function () { }; ->exports.func15 : Symbol(func15, Decl(b.js, 39, 30)) ->exports : Symbol(func15, Decl(b.js, 39, 30)) ->func15 : Symbol(func15, Decl(b.js, 39, 30)) -- ++>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func16 = function () { }; ->module.exports.func16 : Symbol(func16, Decl(b.js, 40, 33)) ->module.exports : Symbol(func16, Decl(b.js, 40, 33)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->func16 : Symbol(func16, Decl(b.js, 40, 33)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) module.exports = exports = {}; ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) -->exports : Symbol("b", Decl(b.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) + >exports : Symbol("b", Decl(b.js, 0, 0)) + exports.func17 = function () { }; ->exports.func17 : Symbol(func17, Decl(b.js, 43, 30)) ->exports : Symbol(func17, Decl(b.js, 43, 30)) ->func17 : Symbol(func17, Decl(b.js, 43, 30)) -- ++>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func18 = function () { }; ->module.exports.func18 : Symbol(func18, Decl(b.js, 44, 33)) ->module.exports : Symbol(func18, Decl(b.js, 44, 33)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->func18 : Symbol(func18, Decl(b.js, 44, 33)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) module.exports = {}; ->module.exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) + exports.func19 = function () { }; ->exports.func19 : Symbol(func19, Decl(b.js, 47, 20)) ->exports : Symbol(func19, Decl(b.js, 47, 20)) ->func19 : Symbol(func19, Decl(b.js, 47, 20)) -- ++>exports : Symbol("b", Decl(b.js, 0, 0)) + module.exports.func20 = function () { }; ->module.exports.func20 : Symbol(func20, Decl(b.js, 48, 33)) ->module.exports : Symbol(func20, Decl(b.js, 48, 33)) ->module : Symbol(module, Decl(b.js, 4, 24)) ->exports : Symbol(module.exports, Decl(b.js, 0, 0)) ->func20 : Symbol(func20, Decl(b.js, 48, 33)) ++>module.exports : Symbol(export=, Decl(b.js, 41, 40)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(b.js, 41, 40)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias.types b/testdata/baselines/reference/submodule/conformance/moduleExportAlias.types index 51a1af123a..d7fda63a31 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias.types @@ -2,177 +2,177 @@ === a.ts === import b = require("./b.js"); ->b : any +>b : {} b.func1; >b.func1 : any ->b : any +>b : {} >func1 : any b.func2; >b.func2 : any ->b : any +>b : {} >func2 : any b.func3; >b.func3 : any ->b : any +>b : {} >func3 : any b.func4; >b.func4 : any ->b : any +>b : {} >func4 : any b.func5; >b.func5 : any ->b : any +>b : {} >func5 : any b.func6; >b.func6 : any ->b : any +>b : {} >func6 : any b.func7; >b.func7 : any ->b : any +>b : {} >func7 : any b.func8; >b.func8 : any ->b : any +>b : {} >func8 : any b.func9; >b.func9 : any ->b : any +>b : {} >func9 : any b.func10; >b.func10 : any ->b : any +>b : {} >func10 : any b.func11; >b.func11 : any ->b : any +>b : {} >func11 : any b.func12; >b.func12 : any ->b : any +>b : {} >func12 : any b.func13; >b.func13 : any ->b : any +>b : {} >func13 : any b.func14; >b.func14 : any ->b : any +>b : {} >func14 : any b.func15; >b.func15 : any ->b : any +>b : {} >func15 : any b.func16; >b.func16 : any ->b : any +>b : {} >func16 : any b.func17; >b.func17 : any ->b : any +>b : {} >func17 : any b.func18; >b.func18 : any ->b : any +>b : {} >func18 : any b.func19; >b.func19 : any ->b : any +>b : {} >func19 : any b.func20; >b.func20 : any ->b : any +>b : {} >func20 : any === b.js === var exportsAlias = exports; ->exportsAlias : any ->exports : any +>exportsAlias : typeof import("b") +>exports : typeof import("b") exportsAlias.func1 = function () { }; >exportsAlias.func1 = function () { } : () => void >exportsAlias.func1 : any ->exportsAlias : any +>exportsAlias : typeof import("b") >func1 : any >function () { } : () => void exports.func2 = function () { }; >exports.func2 = function () { } : () => void >exports.func2 : any ->exports : any +>exports : typeof import("b") >func2 : any >function () { } : () => void var moduleExportsAlias = module.exports; ->moduleExportsAlias : any ->module.exports : any ->module : any ->exports : any +>moduleExportsAlias : {} +>module.exports : {} +>module : { export=: {}; } +>exports : {} moduleExportsAlias.func3 = function () { }; >moduleExportsAlias.func3 = function () { } : () => void >moduleExportsAlias.func3 : any ->moduleExportsAlias : any +>moduleExportsAlias : {} >func3 : any >function () { } : () => void module.exports.func4 = function () { }; >module.exports.func4 = function () { } : () => void >module.exports.func4 : any ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >func4 : any >function () { } : () => void var multipleDeclarationAlias1 = exports = module.exports; ->multipleDeclarationAlias1 : any ->exports = module.exports : any ->exports : any ->module.exports : any ->module : any +>multipleDeclarationAlias1 : {} +>exports = module.exports : {} >exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} multipleDeclarationAlias1.func5 = function () { }; >multipleDeclarationAlias1.func5 = function () { } : () => void >multipleDeclarationAlias1.func5 : any ->multipleDeclarationAlias1 : any +>multipleDeclarationAlias1 : {} >func5 : any >function () { } : () => void var multipleDeclarationAlias2 = module.exports = exports; ->multipleDeclarationAlias2 : any ->module.exports = exports : any ->module.exports : any ->module : any ->exports : any ->exports : any +>multipleDeclarationAlias2 : typeof import("b") +>module.exports = exports : typeof import("b") +>module.exports : {} +>module : { export=: {}; } +>exports : {} +>exports : typeof import("b") multipleDeclarationAlias2.func6 = function () { }; >multipleDeclarationAlias2.func6 = function () { } : () => void >multipleDeclarationAlias2.func6 : any ->multipleDeclarationAlias2 : any +>multipleDeclarationAlias2 : typeof import("b") >func6 : any >function () { } : () => void @@ -180,39 +180,39 @@ var someOtherVariable; >someOtherVariable : any var multipleDeclarationAlias3 = someOtherVariable = exports; ->multipleDeclarationAlias3 : any ->someOtherVariable = exports : any +>multipleDeclarationAlias3 : typeof import("b") +>someOtherVariable = exports : typeof import("b") >someOtherVariable : any ->exports : any +>exports : typeof import("b") multipleDeclarationAlias3.func7 = function () { }; >multipleDeclarationAlias3.func7 = function () { } : () => void >multipleDeclarationAlias3.func7 : any ->multipleDeclarationAlias3 : any +>multipleDeclarationAlias3 : typeof import("b") >func7 : any >function () { } : () => void var multipleDeclarationAlias4 = someOtherVariable = module.exports; ->multipleDeclarationAlias4 : any ->someOtherVariable = module.exports : any +>multipleDeclarationAlias4 : {} +>someOtherVariable = module.exports : {} >someOtherVariable : any ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} multipleDeclarationAlias4.func8 = function () { }; >multipleDeclarationAlias4.func8 = function () { } : () => void >multipleDeclarationAlias4.func8 : any ->multipleDeclarationAlias4 : any +>multipleDeclarationAlias4 : {} >func8 : any >function () { } : () => void var multipleDeclarationAlias5 = module.exports = exports = {}; >multipleDeclarationAlias5 : {} >module.exports = exports = {} : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >exports = {} : {} >exports : any >{} : {} @@ -229,9 +229,9 @@ var multipleDeclarationAlias6 = exports = module.exports = {}; >exports = module.exports = {} : {} >exports : any >module.exports = {} : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >{} : {} multipleDeclarationAlias6.func10 = function () { }; @@ -245,9 +245,9 @@ exports = module.exports = someOtherVariable = {}; >exports = module.exports = someOtherVariable = {} : {} >exports : any >module.exports = someOtherVariable = {} : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >someOtherVariable = {} : {} >someOtherVariable : any >{} : {} @@ -255,16 +255,16 @@ exports = module.exports = someOtherVariable = {}; exports.func11 = function () { }; >exports.func11 = function () { } : () => void >exports.func11 : any ->exports : any +>exports : typeof import("b") >func11 : any >function () { } : () => void module.exports.func12 = function () { }; >module.exports.func12 = function () { } : () => void >module.exports.func12 : any ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >func12 : any >function () { } : () => void @@ -272,9 +272,9 @@ exports = module.exports = someOtherVariable = {}; >exports = module.exports = someOtherVariable = {} : {} >exports : any >module.exports = someOtherVariable = {} : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >someOtherVariable = {} : {} >someOtherVariable : any >{} : {} @@ -282,16 +282,16 @@ exports = module.exports = someOtherVariable = {}; exports.func11 = function () { }; >exports.func11 = function () { } : () => void >exports.func11 : any ->exports : any +>exports : typeof import("b") >func11 : any >function () { } : () => void module.exports.func12 = function () { }; >module.exports.func12 = function () { } : () => void >module.exports.func12 : any ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >func12 : any >function () { } : () => void @@ -299,24 +299,24 @@ exports = module.exports = {}; >exports = module.exports = {} : {} >exports : any >module.exports = {} : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >{} : {} exports.func13 = function () { }; >exports.func13 = function () { } : () => void >exports.func13 : any ->exports : any +>exports : typeof import("b") >func13 : any >function () { } : () => void module.exports.func14 = function () { }; >module.exports.func14 = function () { } : () => void >module.exports.func14 : any ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >func14 : any >function () { } : () => void @@ -324,32 +324,32 @@ exports = module.exports = {}; >exports = module.exports = {} : {} >exports : any >module.exports = {} : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >{} : {} exports.func15 = function () { }; >exports.func15 = function () { } : () => void >exports.func15 : any ->exports : any +>exports : typeof import("b") >func15 : any >function () { } : () => void module.exports.func16 = function () { }; >module.exports.func16 = function () { } : () => void >module.exports.func16 : any ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >func16 : any >function () { } : () => void module.exports = exports = {}; >module.exports = exports = {} : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >exports = {} : {} >exports : any >{} : {} @@ -357,39 +357,39 @@ module.exports = exports = {}; exports.func17 = function () { }; >exports.func17 = function () { } : () => void >exports.func17 : any ->exports : any +>exports : typeof import("b") >func17 : any >function () { } : () => void module.exports.func18 = function () { }; >module.exports.func18 = function () { } : () => void >module.exports.func18 : any ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >func18 : any >function () { } : () => void module.exports = {}; >module.exports = {} : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >{} : {} exports.func19 = function () { }; >exports.func19 = function () { } : () => void >exports.func19 : any ->exports : any +>exports : typeof import("b") >func19 : any >function () { } : () => void module.exports.func20 = function () { }; >module.exports.func20 = function () { } : () => void >module.exports.func20 : any ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { export=: {}; } +>exports : {} >func20 : any >function () { } : () => void diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.errors.txt new file mode 100644 index 0000000000..5722991ad9 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.errors.txt @@ -0,0 +1,30 @@ +index.js(4,13): error TS2351: This expression is not constructable. + Type 'typeof import("semver")' has no construct signatures. +semver.js(2,1): error TS2631: Cannot assign to '"semver"' because it is a namespace. +semver.js(2,11): error TS2322: Type '() => void' is not assignable to type 'typeof import("semver")'. + + +==== index.js (1 errors) ==== + /// + const C = require("./semver") + var two = C.f(1) + var c = new C + ~ +!!! error TS2351: This expression is not constructable. +!!! error TS2351: Type 'typeof import("semver")' has no construct signatures. + +==== node.d.ts (0 errors) ==== + declare function require(name: string): any; + declare var exports: any; + declare var module: { exports: any }; +==== semver.js (2 errors) ==== + /// + exports = module.exports = C + ~~~~~~~ +!!! error TS2631: Cannot assign to '"semver"' because it is a namespace. + ~~~~~~~~~~~~~~ +!!! error TS2322: Type '() => void' is not assignable to type 'typeof import("semver")'. + exports.f = n => n + 1 + function C() { + this.p = 1 + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.symbols index 3d87d7dd5c..e185fa60f0 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.symbols @@ -5,10 +5,13 @@ const C = require("./semver") >C : Symbol(C, Decl(index.js, 1, 5)) >require : Symbol(require, Decl(node.d.ts, 0, 0)) +>"./semver" : Symbol("semver", Decl(semver.js, 0, 0)) var two = C.f(1) >two : Symbol(two, Decl(index.js, 2, 3)) +>C.f : Symbol(f, Decl(semver.js, 1, 28)) >C : Symbol(C, Decl(index.js, 1, 5)) +>f : Symbol(f, Decl(semver.js, 1, 28)) var c = new C >c : Symbol(c, Decl(index.js, 3, 3)) @@ -26,3 +29,24 @@ declare var module: { exports: any }; >module : Symbol(module, Decl(node.d.ts, 2, 11)) >exports : Symbol(exports, Decl(node.d.ts, 2, 21)) +=== semver.js === +/// +exports = module.exports = C +>exports : Symbol("semver", Decl(semver.js, 0, 0)) +>module.exports : Symbol("semver", Decl(semver.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("semver", Decl(semver.js, 0, 0)) +>C : Symbol(C, Decl(semver.js, 2, 22)) + +exports.f = n => n + 1 +>exports.f : Symbol(f, Decl(semver.js, 1, 28)) +>exports : Symbol("semver", Decl(semver.js, 0, 0)) +>f : Symbol(f, Decl(semver.js, 1, 28)) +>n : Symbol(n, Decl(semver.js, 2, 11)) +>n : Symbol(n, Decl(semver.js, 2, 11)) + +function C() { +>C : Symbol(C, Decl(semver.js, 2, 22)) + + this.p = 1 +} diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.symbols.diff index 3c308cb946..d063bcb771 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.symbols.diff @@ -1,44 +1,41 @@ --- old.moduleExportAlias2.symbols +++ new.moduleExportAlias2.symbols -@@= skipped -4, +4 lines =@@ - const C = require("./semver") - >C : Symbol(C, Decl(index.js, 1, 5)) - >require : Symbol(require, Decl(node.d.ts, 0, 0)) -->"./semver" : Symbol("semver", Decl(semver.js, 0, 0)) +@@= skipped -8, +8 lines =@@ var two = C.f(1) >two : Symbol(two, Decl(index.js, 2, 3)) ->C.f : Symbol(C.f, Decl(semver.js, 1, 28)) ++>C.f : Symbol(f, Decl(semver.js, 1, 28)) >C : Symbol(C, Decl(index.js, 1, 5)) ->f : Symbol(C.f, Decl(semver.js, 1, 28)) ++>f : Symbol(f, Decl(semver.js, 1, 28)) var c = new C >c : Symbol(c, Decl(index.js, 3, 3)) -@@= skipped -24, +21 lines =@@ - >module : Symbol(module, Decl(node.d.ts, 2, 11)) - >exports : Symbol(exports, Decl(node.d.ts, 2, 21)) - --=== semver.js === --/// --exports = module.exports = C -->exports : Symbol("semver", Decl(semver.js, 0, 0)) +@@= skipped -24, +24 lines =@@ + /// + exports = module.exports = C + >exports : Symbol("semver", Decl(semver.js, 0, 0)) ->module.exports : Symbol(module.exports, Decl(semver.js, 0, 0)) ->module : Symbol(export=, Decl(semver.js, 1, 9)) ->exports : Symbol(export=, Decl(semver.js, 1, 9)) -->C : Symbol(C, Decl(semver.js, 2, 22)) -- --exports.f = n => n + 1 -->exports.f : Symbol(f, Decl(semver.js, 1, 28)) ++>module.exports : Symbol("semver", Decl(semver.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("semver", Decl(semver.js, 0, 0)) + >C : Symbol(C, Decl(semver.js, 2, 22)) + + exports.f = n => n + 1 + >exports.f : Symbol(f, Decl(semver.js, 1, 28)) ->exports : Symbol(f, Decl(semver.js, 1, 28)) -->f : Symbol(f, Decl(semver.js, 1, 28)) -->n : Symbol(n, Decl(semver.js, 2, 11)) -->n : Symbol(n, Decl(semver.js, 2, 11)) -- --function C() { -->C : Symbol(C, Decl(semver.js, 2, 22)) -- -- this.p = 1 ++>exports : Symbol("semver", Decl(semver.js, 0, 0)) + >f : Symbol(f, Decl(semver.js, 1, 28)) + >n : Symbol(n, Decl(semver.js, 2, 11)) + >n : Symbol(n, Decl(semver.js, 2, 11)) +@@= skipped -16, +16 lines =@@ + >C : Symbol(C, Decl(semver.js, 2, 22)) + + this.p = 1 ->this.p : Symbol(C.p, Decl(semver.js, 3, 14)) ->this : Symbol(C, Decl(semver.js, 2, 22)) ->p : Symbol(C.p, Decl(semver.js, 3, 14)) --} + } diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.types b/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.types index d244428cea..c0aa65b5de 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias2.types @@ -3,8 +3,8 @@ === index.js === /// const C = require("./semver") ->C : any ->require("./semver") : any +>C : typeof import("semver") +>require("./semver") : typeof import("semver") >require : (name: string) => any >"./semver" : "./semver" @@ -12,14 +12,14 @@ var two = C.f(1) >two : any >C.f(1) : any >C.f : any ->C : any +>C : typeof import("semver") >f : any >1 : 1 var c = new C >c : any >new C : any ->C : any +>C : typeof import("semver") === node.d.ts === declare function require(name: string): any; @@ -33,3 +33,35 @@ declare var module: { exports: any }; >module : { exports: any; } >exports : any +=== semver.js === +/// +exports = module.exports = C +>exports = module.exports = C : () => void +>exports : any +>module.exports = C : () => void +>module.exports : typeof import("semver") +>module : { "semver": typeof import("semver"); } +>exports : typeof import("semver") +>C : () => void + +exports.f = n => n + 1 +>exports.f = n => n + 1 : (n: any) => any +>exports.f : any +>exports : typeof import("semver") +>f : any +>n => n + 1 : (n: any) => any +>n : any +>n + 1 : any +>n : any +>1 : 1 + +function C() { +>C : () => void + + this.p = 1 +>this.p = 1 : 1 +>this.p : any +>this : any +>p : any +>1 : 1 +} diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.errors.txt deleted file mode 100644 index 7b983c233a..0000000000 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.errors.txt +++ /dev/null @@ -1,13 +0,0 @@ -bug24062.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== bug24062.js (1 errors) ==== - // #24062 - class C { - } - module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - C - }; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.symbols index 195b4bdfc8..4cd9a45599 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.symbols @@ -6,6 +6,10 @@ class C { >C : Symbol(C, Decl(bug24062.js, 0, 0)) } module.exports = { +>module.exports : Symbol(export=, Decl(bug24062.js, 2, 1)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(bug24062.js, 2, 1)) + C >C : Symbol(C, Decl(bug24062.js, 3, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.symbols.diff index d0f4281882..bb0b0eb1f0 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.symbols.diff @@ -7,7 +7,9 @@ ->module.exports : Symbol(module.exports, Decl(bug24062.js, 0, 0)) ->module : Symbol(module, Decl(bug24062.js, 2, 1)) ->exports : Symbol(module.exports, Decl(bug24062.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(bug24062.js, 2, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(bug24062.js, 2, 1)) + C >C : Symbol(C, Decl(bug24062.js, 3, 18)) - diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.types b/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.types index c1c5c6d45a..2fdfa48fcb 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias3.types @@ -7,9 +7,9 @@ class C { } module.exports = { >module.exports = { C} : { C: typeof C; } ->module.exports : any ->module : any ->exports : any +>module.exports : { C: typeof C; } +>module : { export=: { C: typeof C; }; } +>exports : { C: typeof C; } >{ C} : { C: typeof C; } C diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.errors.txt index c36098e2bc..ac0068ee74 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.errors.txt @@ -1,17 +1,14 @@ -bug24024.js(2,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -bug24024.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -bug24024.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +bug24024.js(3,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +bug24024.js(4,16): error TS2339: Property 'D' does not exist on type 'typeof C'. -==== bug24024.js (3 errors) ==== +==== bug24024.js (2 errors) ==== // #24024 var wat = require('./bug24024') - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports = class C {} - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.D = class D { } - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~ +!!! error TS2339: Property 'D' does not exist on type 'typeof C'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.symbols index 86d71293a7..b87494dc53 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.symbols @@ -4,10 +4,18 @@ // #24024 var wat = require('./bug24024') >wat : Symbol(wat, Decl(bug24024.js, 1, 3)) +>require : Symbol(require) +>'./bug24024' : Symbol("bug24024", Decl(bug24024.js, 0, 0)) module.exports = class C {} +>module.exports : Symbol(C, Decl(bug24024.js, 2, 16)) +>module : Symbol(module.exports) +>exports : Symbol(C, Decl(bug24024.js, 2, 16)) >C : Symbol(C, Decl(bug24024.js, 2, 16)) module.exports.D = class D { } +>module.exports : Symbol(C, Decl(bug24024.js, 2, 16)) +>module : Symbol(module.exports) +>exports : Symbol(C, Decl(bug24024.js, 2, 16)) >D : Symbol(D, Decl(bug24024.js, 3, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.symbols.diff index 7a4f84a270..a203fe8957 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.symbols.diff @@ -1,17 +1,16 @@ --- old.moduleExportAlias4.symbols +++ new.moduleExportAlias4.symbols -@@= skipped -3, +3 lines =@@ - // #24024 - var wat = require('./bug24024') - >wat : Symbol(wat, Decl(bug24024.js, 1, 3)) -->require : Symbol(require) -->'./bug24024' : Symbol("bug24024", Decl(bug24024.js, 0, 0)) +@@= skipped -7, +7 lines =@@ + >'./bug24024' : Symbol("bug24024", Decl(bug24024.js, 0, 0)) module.exports = class C {} ->module.exports : Symbol(module.exports, Decl(bug24024.js, 0, 0)) ->module : Symbol(export=, Decl(bug24024.js, 1, 31)) ->exports : Symbol(export=, Decl(bug24024.js, 1, 31)) ->C : Symbol(wat, Decl(bug24024.js, 2, 16)) ++>module.exports : Symbol(C, Decl(bug24024.js, 2, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(C, Decl(bug24024.js, 2, 16)) +>C : Symbol(C, Decl(bug24024.js, 2, 16)) module.exports.D = class D { } @@ -21,5 +20,8 @@ ->exports : Symbol(module.exports, Decl(bug24024.js, 0, 0)) ->D : Symbol(wat.D, Decl(bug24024.js, 2, 27)) ->D : Symbol(wat.D, Decl(bug24024.js, 3, 18)) ++>module.exports : Symbol(C, Decl(bug24024.js, 2, 16)) ++>module : Symbol(module.exports) ++>exports : Symbol(C, Decl(bug24024.js, 2, 16)) +>D : Symbol(D, Decl(bug24024.js, 3, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.types b/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.types index ff48d096cb..6603e62b5d 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias4.types @@ -3,25 +3,25 @@ === bug24024.js === // #24024 var wat = require('./bug24024') ->wat : any ->require('./bug24024') : any +>wat : typeof C +>require('./bug24024') : typeof C >require : any >'./bug24024' : "./bug24024" module.exports = class C {} >module.exports = class C {} : typeof C ->module.exports : any ->module : any ->exports : any +>module.exports : typeof C +>module : { C: typeof C; } +>exports : typeof C >class C {} : typeof C >C : typeof C module.exports.D = class D { } >module.exports.D = class D { } : typeof D >module.exports.D : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof C +>module : { C: typeof C; } +>exports : typeof C >D : any >class D { } : typeof D >D : typeof D diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.errors.txt index 87dc9ddde4..be48e4f829 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.errors.txt @@ -1,20 +1,18 @@ -bug24754.js(4,1): error TS2304: Cannot find name 'exports'. -bug24754.js(4,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -bug24754.js(5,1): error TS2304: Cannot find name 'exports'. +bug24754.js(4,1): error TS2631: Cannot assign to '"bug24754"' because it is a namespace. +bug24754.js(4,11): error TS2741: Property 'version' is missing in type '{ (): void; WebpackOptionsDefaulter: number; }' but required in type 'typeof import("bug24754")'. -==== bug24754.js (3 errors) ==== +==== bug24754.js (2 errors) ==== // #24754 const webpack = function (){ } exports = module.exports = webpack; ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +!!! error TS2631: Cannot assign to '"bug24754"' because it is a namespace. + ~~~~~~~~~~~~~~ +!!! error TS2741: Property 'version' is missing in type '{ (): void; WebpackOptionsDefaulter: number; }' but required in type 'typeof import("bug24754")'. +!!! related TS2728 bug24754.js:5:1: 'version' is declared here. exports.version = 1001; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. webpack.WebpackOptionsDefaulter = 1111; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.symbols index 84568e9019..b394ac8528 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.symbols @@ -6,9 +6,16 @@ const webpack = function (){ >webpack : Symbol(webpack, Decl(bug24754.js, 1, 5)) } exports = module.exports = webpack; +>exports : Symbol("bug24754", Decl(bug24754.js, 0, 0)) +>module.exports : Symbol("bug24754", Decl(bug24754.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("bug24754", Decl(bug24754.js, 0, 0)) >webpack : Symbol(webpack, Decl(bug24754.js, 1, 5)) exports.version = 1001; +>exports.version : Symbol(version, Decl(bug24754.js, 3, 35)) +>exports : Symbol("bug24754", Decl(bug24754.js, 0, 0)) +>version : Symbol(version, Decl(bug24754.js, 3, 35)) webpack.WebpackOptionsDefaulter = 1111; >webpack.WebpackOptionsDefaulter : Symbol(WebpackOptionsDefaulter, Decl(bug24754.js, 4, 23)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.symbols.diff index 06037ad234..a61228d341 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.symbols.diff @@ -8,17 +8,21 @@ +>webpack : Symbol(webpack, Decl(bug24754.js, 1, 5)) } exports = module.exports = webpack; -->exports : Symbol("bug24754", Decl(bug24754.js, 0, 0)) + >exports : Symbol("bug24754", Decl(bug24754.js, 0, 0)) ->module.exports : Symbol(module.exports, Decl(bug24754.js, 0, 0)) ->module : Symbol(export=, Decl(bug24754.js, 3, 9)) ->exports : Symbol(export=, Decl(bug24754.js, 3, 9)) ->webpack : Symbol(webpack, Decl(bug24754.js, 1, 5), Decl(bug24754.js, 4, 23)) ++>module.exports : Symbol("bug24754", Decl(bug24754.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("bug24754", Decl(bug24754.js, 0, 0)) +>webpack : Symbol(webpack, Decl(bug24754.js, 1, 5)) exports.version = 1001; -->exports.version : Symbol(version, Decl(bug24754.js, 3, 35)) + >exports.version : Symbol(version, Decl(bug24754.js, 3, 35)) ->exports : Symbol(version, Decl(bug24754.js, 3, 35)) -->version : Symbol(version, Decl(bug24754.js, 3, 35)) ++>exports : Symbol("bug24754", Decl(bug24754.js, 0, 0)) + >version : Symbol(version, Decl(bug24754.js, 3, 35)) webpack.WebpackOptionsDefaulter = 1111; ->webpack.WebpackOptionsDefaulter : Symbol(webpack.WebpackOptionsDefaulter, Decl(bug24754.js, 4, 23)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.types b/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.types index 7320e43045..2d1ddb97e7 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAlias5.types @@ -10,16 +10,16 @@ exports = module.exports = webpack; >exports = module.exports = webpack : { (): void; WebpackOptionsDefaulter: number; } >exports : any >module.exports = webpack : { (): void; WebpackOptionsDefaulter: number; } ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("bug24754") +>module : { "bug24754": typeof import("bug24754"); } +>exports : typeof import("bug24754") >webpack : { (): void; WebpackOptionsDefaulter: number; } exports.version = 1001; >exports.version = 1001 : 1001 ->exports.version : any ->exports : any ->version : any +>exports.version : 1001 +>exports : typeof import("bug24754") +>version : 1001 >1001 : 1001 webpack.WebpackOptionsDefaulter = 1111; diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.errors.txt deleted file mode 100644 index b29691345a..0000000000 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -moduleExportAliasElementAccessExpression.js(2,1): error TS2304: Cannot find name 'exports'. -moduleExportAliasElementAccessExpression.js(4,1): error TS2304: Cannot find name 'exports'. - - -==== moduleExportAliasElementAccessExpression.js (2 errors) ==== - function D () { } - exports["D"] = D; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - // (the only package I could find that uses spaces in identifiers is webidl-conversions) - exports["Does not work yet"] = D; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.symbols index 9cea4d5c32..d089d7e918 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.symbols @@ -5,9 +5,13 @@ function D () { } >D : Symbol(D, Decl(moduleExportAliasElementAccessExpression.js, 0, 0)) exports["D"] = D; +>exports : Symbol("moduleExportAliasElementAccessExpression", Decl(moduleExportAliasElementAccessExpression.js, 0, 0)) +>"D" : Symbol(D, Decl(moduleExportAliasElementAccessExpression.js, 0, 17)) >D : Symbol(D, Decl(moduleExportAliasElementAccessExpression.js, 0, 0)) // (the only package I could find that uses spaces in identifiers is webidl-conversions) exports["Does not work yet"] = D; +>exports : Symbol("moduleExportAliasElementAccessExpression", Decl(moduleExportAliasElementAccessExpression.js, 0, 0)) +>"Does not work yet" : Symbol("Does not work yet", Decl(moduleExportAliasElementAccessExpression.js, 1, 17)) >D : Symbol(D, Decl(moduleExportAliasElementAccessExpression.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.symbols.diff index c8e133707a..60d3639202 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.symbols.diff @@ -1,16 +1,11 @@ --- old.moduleExportAliasElementAccessExpression.symbols +++ new.moduleExportAliasElementAccessExpression.symbols -@@= skipped -4, +4 lines =@@ - >D : Symbol(D, Decl(moduleExportAliasElementAccessExpression.js, 0, 0)) +@@= skipped -5, +5 lines =@@ exports["D"] = D; -->exports : Symbol("moduleExportAliasElementAccessExpression", Decl(moduleExportAliasElementAccessExpression.js, 0, 0)) + >exports : Symbol("moduleExportAliasElementAccessExpression", Decl(moduleExportAliasElementAccessExpression.js, 0, 0)) ->"D" : Symbol("D", Decl(moduleExportAliasElementAccessExpression.js, 0, 17)) ++>"D" : Symbol(D, Decl(moduleExportAliasElementAccessExpression.js, 0, 17)) >D : Symbol(D, Decl(moduleExportAliasElementAccessExpression.js, 0, 0)) // (the only package I could find that uses spaces in identifiers is webidl-conversions) - exports["Does not work yet"] = D; -->exports : Symbol("moduleExportAliasElementAccessExpression", Decl(moduleExportAliasElementAccessExpression.js, 0, 0)) -->"Does not work yet" : Symbol("Does not work yet", Decl(moduleExportAliasElementAccessExpression.js, 1, 17)) - >D : Symbol(D, Decl(moduleExportAliasElementAccessExpression.js, 0, 0)) - diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.types b/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.types index 018ca8873e..08d43e677a 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasElementAccessExpression.types @@ -6,16 +6,16 @@ function D () { } exports["D"] = D; >exports["D"] = D : () => void ->exports["D"] : any ->exports : any +>exports["D"] : () => void +>exports : typeof import("moduleExportAliasElementAccessExpression") >"D" : "D" >D : () => void // (the only package I could find that uses spaces in identifiers is webidl-conversions) exports["Does not work yet"] = D; >exports["Does not work yet"] = D : () => void ->exports["Does not work yet"] : any ->exports : any +>exports["Does not work yet"] : () => void +>exports : typeof import("moduleExportAliasElementAccessExpression") >"Does not work yet" : "Does not work yet" >D : () => void diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.errors.txt index 51be8aeabc..e5b61208a5 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.errors.txt @@ -1,22 +1,16 @@ -Eloquent.js(3,1): error TS2304: Cannot find name 'exports'. -Eloquent.js(4,1): error TS2304: Cannot find name 'exports'. -Eloquent.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -Eloquent.js(5,18): error TS2304: Cannot find name 'exports'. +Eloquent.js(5,1): error TS1231: An export assignment must be at the top level of a file or module declaration. +Eloquent.js(5,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== Eloquent.js (4 errors) ==== +==== Eloquent.js (2 errors) ==== // bug #27365, crashes from github.com/marijnh/Eloquent-JavaScript (function() { exports.bigOak = 1 - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. exports.everywhere = 2 - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. module.exports = exports ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. +!!! error TS1231: An export assignment must be at the top level of a file or module declaration. + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. })() \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.symbols index d9c73684a0..373a830db8 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.symbols @@ -1,11 +1,23 @@ //// [tests/cases/conformance/salsa/moduleExportAliasExports.ts] //// === Eloquent.js === - // bug #27365, crashes from github.com/marijnh/Eloquent-JavaScript (function() { exports.bigOak = 1 +>exports.bigOak : Symbol(bigOak, Decl(Eloquent.js, 1, 13)) +>exports : Symbol("Eloquent", Decl(Eloquent.js, 0, 0)) +>bigOak : Symbol(bigOak, Decl(Eloquent.js, 1, 13)) + exports.everywhere = 2 +>exports.everywhere : Symbol(everywhere, Decl(Eloquent.js, 2, 18)) +>exports : Symbol("Eloquent", Decl(Eloquent.js, 0, 0)) +>everywhere : Symbol(everywhere, Decl(Eloquent.js, 2, 18)) + module.exports = exports +>module.exports : Symbol("Eloquent", Decl(Eloquent.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("Eloquent", Decl(Eloquent.js, 0, 0)) +>exports : Symbol("Eloquent", Decl(Eloquent.js, 0, 0)) + })() diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.symbols.diff index e4adde948b..818c18fd2a 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.symbols.diff @@ -1,27 +1,27 @@ --- old.moduleExportAliasExports.symbols +++ new.moduleExportAliasExports.symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/conformance/salsa/moduleExportAliasExports.ts] //// - - === Eloquent.js === -+ - // bug #27365, crashes from github.com/marijnh/Eloquent-JavaScript +@@= skipped -4, +4 lines =@@ (function() { exports.bigOak = 1 -->exports.bigOak : Symbol(bigOak, Decl(Eloquent.js, 1, 13)) + >exports.bigOak : Symbol(bigOak, Decl(Eloquent.js, 1, 13)) ->exports : Symbol(bigOak, Decl(Eloquent.js, 1, 13)) -->bigOak : Symbol(bigOak, Decl(Eloquent.js, 1, 13)) -- ++>exports : Symbol("Eloquent", Decl(Eloquent.js, 0, 0)) + >bigOak : Symbol(bigOak, Decl(Eloquent.js, 1, 13)) + exports.everywhere = 2 -->exports.everywhere : Symbol(everywhere, Decl(Eloquent.js, 2, 18)) + >exports.everywhere : Symbol(everywhere, Decl(Eloquent.js, 2, 18)) ->exports : Symbol(everywhere, Decl(Eloquent.js, 2, 18)) -->everywhere : Symbol(everywhere, Decl(Eloquent.js, 2, 18)) -- ++>exports : Symbol("Eloquent", Decl(Eloquent.js, 0, 0)) + >everywhere : Symbol(everywhere, Decl(Eloquent.js, 2, 18)) + module.exports = exports ->module.exports : Symbol(module.exports, Decl(Eloquent.js, 0, 0)) ->module : Symbol(export=, Decl(Eloquent.js, 3, 22)) ->exports : Symbol(export=, Decl(Eloquent.js, 3, 22)) -->exports : Symbol("Eloquent", Decl(Eloquent.js, 0, 0)) -- ++>module.exports : Symbol("Eloquent", Decl(Eloquent.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol("Eloquent", Decl(Eloquent.js, 0, 0)) ++>exports : Symbol("Eloquent", Decl(Eloquent.js, 0, 0)) + })() diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.types b/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.types index b6fa8b966d..9c872cbe80 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasExports.types @@ -9,24 +9,24 @@ exports.bigOak = 1 >exports.bigOak = 1 : 1 ->exports.bigOak : any ->exports : any ->bigOak : any +>exports.bigOak : 1 +>exports : typeof import("Eloquent") +>bigOak : 1 >1 : 1 exports.everywhere = 2 >exports.everywhere = 2 : 2 ->exports.everywhere : any ->exports : any ->everywhere : any +>exports.everywhere : 2 +>exports : typeof import("Eloquent") +>everywhere : 2 >2 : 2 module.exports = exports ->module.exports = exports : any ->module.exports : any ->module : any ->exports : any ->exports : any +>module.exports = exports : typeof import("Eloquent") +>module.exports : typeof import("Eloquent") +>module : { "Eloquent": typeof import("Eloquent"); } +>exports : typeof import("Eloquent") +>exports : typeof import("Eloquent") })() diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.errors.txt index 378447f2cb..6eb423476b 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.errors.txt @@ -1,19 +1,19 @@ -bug28014.js(1,1): error TS2304: Cannot find name 'exports'. -bug28014.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -importer.js(1,8): error TS2306: File 'bug28014.js' is not a module. +bug28014.js(1,9): error TS2339: Property 'version' does not exist on type 'typeof import("bug28014")'. +bug28014.js(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. +bug28014.js(3,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== bug28014.js (2 errors) ==== +==== bug28014.js (3 errors) ==== exports.version = 1 - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~~ +!!! error TS2339: Property 'version' does not exist on type 'typeof import("bug28014")'. function alias() { } module.exports = alias - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. -==== importer.js (1 errors) ==== +==== importer.js (0 errors) ==== import('./bug28014') - ~~~~~~~~~~~~ -!!! error TS2306: File 'bug28014.js' is not a module. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.symbols index cfa8786e8f..7f1206e1a5 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.symbols @@ -2,10 +2,15 @@ === bug28014.js === exports.version = 1 +>exports : Symbol("bug28014", Decl(bug28014.js, 0, 0)) + function alias() { } >alias : Symbol(alias, Decl(bug28014.js, 0, 19)) module.exports = alias +>module.exports : Symbol(alias, Decl(bug28014.js, 0, 19)) +>module : Symbol(module.exports) +>exports : Symbol(alias, Decl(bug28014.js, 0, 19)) >alias : Symbol(alias, Decl(bug28014.js, 0, 19)) === importer.js === diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.symbols.diff index eeddc0ace5..e7cff875e6 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.symbols.diff @@ -7,7 +7,8 @@ ->exports.version : Symbol(version, Decl(bug28014.js, 0, 0)) ->exports : Symbol(version, Decl(bug28014.js, 0, 0)) ->version : Symbol(version, Decl(bug28014.js, 0, 0)) -- ++>exports : Symbol("bug28014", Decl(bug28014.js, 0, 0)) + function alias() { } >alias : Symbol(alias, Decl(bug28014.js, 0, 19)) @@ -15,6 +16,9 @@ ->module.exports : Symbol(module.exports, Decl(bug28014.js, 0, 0)) ->module : Symbol(export=, Decl(bug28014.js, 1, 20)) ->exports : Symbol(export=, Decl(bug28014.js, 1, 20)) ++>module.exports : Symbol(alias, Decl(bug28014.js, 0, 19)) ++>module : Symbol(module.exports) ++>exports : Symbol(alias, Decl(bug28014.js, 0, 19)) >alias : Symbol(alias, Decl(bug28014.js, 0, 19)) === importer.js === diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.types b/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.types index 402f1b3d66..efd5fe7f64 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasImported.types @@ -4,7 +4,7 @@ exports.version = 1 >exports.version = 1 : 1 >exports.version : any ->exports : any +>exports : typeof import("bug28014") >version : any >1 : 1 @@ -13,13 +13,13 @@ function alias() { } module.exports = alias >module.exports = alias : () => void ->module.exports : any ->module : any ->exports : any +>module.exports : () => void +>module : { alias: () => void; } +>exports : () => void >alias : () => void === importer.js === import('./bug28014') ->import('./bug28014') : Promise +>import('./bug28014') : Promise<() => void> >'./bug28014' : "./bug28014" diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.errors.txt index 95b7dfd8bd..279d2ef30a 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.errors.txt @@ -1,18 +1,18 @@ -bug27025.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +bug27025.js(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements. bug27025.js(1,25): error TS2339: Property 'nonprop' does not exist on type 'Window & typeof globalThis'. -bug27025.js(2,1): error TS2304: Cannot find name 'exports'. +bug27025.js(2,9): error TS2339: Property 'foo' does not exist on type 'typeof import("bug27025")'. bug27025.js(2,15): error TS2304: Cannot find name 'bar'. ==== bug27025.js (4 errors) ==== module.exports = window.nonprop; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. ~~~~~~~ !!! error TS2339: Property 'nonprop' does not exist on type 'Window & typeof globalThis'. exports.foo = bar; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~ +!!! error TS2339: Property 'foo' does not exist on type 'typeof import("bug27025")'. ~~~ !!! error TS2304: Cannot find name 'bar'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.symbols index ac4a744ccc..33e6b8ac42 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.symbols @@ -2,7 +2,11 @@ === bug27025.js === module.exports = window.nonprop; +>module.exports : Symbol(unknown) +>module : Symbol(module.exports) +>exports : Symbol(unknown) >window : Symbol(window, Decl(lib.dom.d.ts, --, --)) exports.foo = bar; +>exports : Symbol("bug27025", Decl(bug27025.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.symbols.diff index 9d4f86160a..52e393e1b0 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.symbols.diff @@ -7,9 +7,13 @@ ->module.exports : Symbol(module.exports, Decl(bug27025.js, 0, 0)) ->module : Symbol(export=, Decl(bug27025.js, 0, 0)) ->exports : Symbol(export=, Decl(bug27025.js, 0, 0)) ++>module.exports : Symbol(unknown) ++>module : Symbol(module.exports) ++>exports : Symbol(unknown) >window : Symbol(window, Decl(lib.dom.d.ts, --, --)) exports.foo = bar; ->exports : Symbol(foo, Decl(bug27025.js, 0, 32)) ->foo : Symbol(foo, Decl(bug27025.js, 0, 32)) ++>exports : Symbol("bug27025", Decl(bug27025.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.types b/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.types index 312fcf46e2..0c5b3b1c77 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAliasUnknown.types @@ -4,7 +4,7 @@ module.exports = window.nonprop; >module.exports = window.nonprop : any >module.exports : any ->module : any +>module : { unknown: any; } >exports : any >window.nonprop : any >window : Window & typeof globalThis @@ -13,7 +13,7 @@ module.exports = window.nonprop; exports.foo = bar; >exports.foo = bar : any >exports.foo : any ->exports : any +>exports : typeof import("bug27025") >foo : any >bar : any diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.errors.txt index e83c4a75d6..8472709b9b 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.errors.txt @@ -1,25 +1,44 @@ -use.js(1,14): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +npmlog.js(5,14): error TS2741: Property 'y' is missing in type 'EE' but required in type 'typeof import("npmlog")'. +npmlog.js(8,16): error TS2339: Property 'on' does not exist on type 'typeof import("npmlog")'. +npmlog.js(10,8): error TS2339: Property 'x' does not exist on type 'EE'. +npmlog.js(12,8): error TS2339: Property 'y' does not exist on type 'EE'. +npmlog.js(13,16): error TS2339: Property 'x' does not exist on type 'typeof import("npmlog")'. +use.js(2,8): error TS2339: Property 'x' does not exist on type 'typeof import("npmlog")'. +use.js(3,8): error TS2339: Property 'on' does not exist on type 'typeof import("npmlog")'. -==== use.js (1 errors) ==== +==== use.js (2 errors) ==== var npmlog = require('./npmlog') - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. npmlog.x + ~ +!!! error TS2339: Property 'x' does not exist on type 'typeof import("npmlog")'. npmlog.on + ~~ +!!! error TS2339: Property 'on' does not exist on type 'typeof import("npmlog")'. -==== npmlog.js (0 errors) ==== +==== npmlog.js (5 errors) ==== class EE { /** @param {string} s */ on(s) { } } var npmlog = module.exports = new EE() + ~~~~~~~~~~~~~~ +!!! error TS2741: Property 'y' is missing in type 'EE' but required in type 'typeof import("npmlog")'. +!!! related TS2728 npmlog.js:11:1: 'y' is declared here. npmlog.on('hi') // both references should see EE.on module.exports.on('hi') // here too + ~~ +!!! error TS2339: Property 'on' does not exist on type 'typeof import("npmlog")'. npmlog.x = 1 + ~ +!!! error TS2339: Property 'x' does not exist on type 'EE'. module.exports.y = 2 npmlog.y + ~ +!!! error TS2339: Property 'y' does not exist on type 'EE'. module.exports.x + ~ +!!! error TS2339: Property 'x' does not exist on type 'typeof import("npmlog")'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.symbols index 14e719e628..30d662f4bb 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.symbols @@ -3,6 +3,8 @@ === use.js === var npmlog = require('./npmlog') >npmlog : Symbol(npmlog, Decl(use.js, 0, 3)) +>require : Symbol(require) +>'./npmlog' : Symbol("npmlog", Decl(npmlog.js, 0, 0)) npmlog.x >npmlog : Symbol(npmlog, Decl(use.js, 0, 3)) @@ -10,3 +12,47 @@ npmlog.x npmlog.on >npmlog : Symbol(npmlog, Decl(use.js, 0, 3)) +=== npmlog.js === +class EE { +>EE : Symbol(EE, Decl(npmlog.js, 0, 0)) + + /** @param {string} s */ + on(s) { } +>on : Symbol(on, Decl(npmlog.js, 0, 10)) +>s : Symbol(s, Decl(npmlog.js, 2, 7)) +} +var npmlog = module.exports = new EE() +>npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) +>module.exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) +>EE : Symbol(EE, Decl(npmlog.js, 0, 0)) + +npmlog.on('hi') // both references should see EE.on +>npmlog.on : Symbol(on, Decl(npmlog.js, 0, 10)) +>npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) +>on : Symbol(on, Decl(npmlog.js, 0, 10)) + +module.exports.on('hi') // here too +>module.exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) + +npmlog.x = 1 +>npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) + +module.exports.y = 2 +>module.exports.y : Symbol(y, Decl(npmlog.js, 9, 12)) +>module.exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) +>y : Symbol(y, Decl(npmlog.js, 9, 12)) + +npmlog.y +>npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) + +module.exports.x +>module.exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.symbols.diff index 0bb512aa8c..71c1a860e1 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.symbols.diff @@ -1,11 +1,7 @@ --- old.moduleExportAssignment.symbols +++ new.moduleExportAssignment.symbols -@@= skipped -2, +2 lines =@@ - === use.js === - var npmlog = require('./npmlog') - >npmlog : Symbol(npmlog, Decl(use.js, 0, 3)) -->require : Symbol(require) -->'./npmlog' : Symbol("npmlog", Decl(npmlog.js, 0, 0)) +@@= skipped -6, +6 lines =@@ + >'./npmlog' : Symbol("npmlog", Decl(npmlog.js, 0, 0)) npmlog.x ->npmlog.x : Symbol(npmlog.x, Decl(npmlog.js, 7, 23)) @@ -17,55 +13,70 @@ >npmlog : Symbol(npmlog, Decl(use.js, 0, 3)) ->on : Symbol(EE.on, Decl(npmlog.js, 0, 10)) --=== npmlog.js === --class EE { -->EE : Symbol(EE, Decl(npmlog.js, 0, 0)) -- -- /** @param {string} s */ -- on(s) { } + === npmlog.js === + class EE { +@@= skipped -15, +11 lines =@@ + + /** @param {string} s */ + on(s) { } ->on : Symbol(EE.on, Decl(npmlog.js, 0, 10)) -->s : Symbol(s, Decl(npmlog.js, 2, 7)) --} --var npmlog = module.exports = new EE() -->npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) ++>on : Symbol(on, Decl(npmlog.js, 0, 10)) + >s : Symbol(s, Decl(npmlog.js, 2, 7)) + } + var npmlog = module.exports = new EE() + >npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) ->module.exports : Symbol(module.exports, Decl(npmlog.js, 0, 0)) ->module : Symbol(npmlog, Decl(npmlog.js, 4, 12)) ->exports : Symbol(npmlog, Decl(npmlog.js, 4, 12)) -->EE : Symbol(EE, Decl(npmlog.js, 0, 0)) -- --npmlog.on('hi') // both references should see EE.on ++>module.exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) + >EE : Symbol(EE, Decl(npmlog.js, 0, 0)) + + npmlog.on('hi') // both references should see EE.on ->npmlog.on : Symbol(EE.on, Decl(npmlog.js, 0, 10)) -->npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) ++>npmlog.on : Symbol(on, Decl(npmlog.js, 0, 10)) + >npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) ->on : Symbol(EE.on, Decl(npmlog.js, 0, 10)) -- --module.exports.on('hi') // here too ++>on : Symbol(on, Decl(npmlog.js, 0, 10)) + + module.exports.on('hi') // here too ->module.exports.on : Symbol(EE.on, Decl(npmlog.js, 0, 10)) ->module.exports : Symbol(module.exports, Decl(npmlog.js, 0, 0)) ->module : Symbol(module, Decl(npmlog.js, 4, 12)) ->exports : Symbol(module.exports, Decl(npmlog.js, 0, 0)) ->on : Symbol(EE.on, Decl(npmlog.js, 0, 10)) -- --npmlog.x = 1 ++>module.exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) + + npmlog.x = 1 ->npmlog.x : Symbol(x, Decl(npmlog.js, 7, 23)) -->npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) + >npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) ->x : Symbol(x, Decl(npmlog.js, 7, 23)) -- --module.exports.y = 2 -->module.exports.y : Symbol(y, Decl(npmlog.js, 9, 12)) + + module.exports.y = 2 + >module.exports.y : Symbol(y, Decl(npmlog.js, 9, 12)) ->module.exports : Symbol(y, Decl(npmlog.js, 9, 12)) ->module : Symbol(module, Decl(npmlog.js, 4, 12)) ->exports : Symbol(module.exports, Decl(npmlog.js, 0, 0)) -->y : Symbol(y, Decl(npmlog.js, 9, 12)) -- --npmlog.y ++>module.exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) + >y : Symbol(y, Decl(npmlog.js, 9, 12)) + + npmlog.y ->npmlog.y : Symbol(y, Decl(npmlog.js, 9, 12)) -->npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) + >npmlog : Symbol(npmlog, Decl(npmlog.js, 4, 3)) ->y : Symbol(y, Decl(npmlog.js, 9, 12)) -- --module.exports.x + + module.exports.x ->module.exports.x : Symbol(x, Decl(npmlog.js, 7, 23)) ->module.exports : Symbol(module.exports, Decl(npmlog.js, 0, 0)) ->module : Symbol(module, Decl(npmlog.js, 4, 12)) ->exports : Symbol(module.exports, Decl(npmlog.js, 0, 0)) ->x : Symbol(x, Decl(npmlog.js, 7, 23)) -- ++>module.exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("npmlog", Decl(npmlog.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.types b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.types index 052763ea5d..21f21a63ad 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment.types @@ -2,18 +2,80 @@ === use.js === var npmlog = require('./npmlog') ->npmlog : any ->require('./npmlog') : any +>npmlog : typeof import("npmlog") +>require('./npmlog') : typeof import("npmlog") >require : any >'./npmlog' : "./npmlog" npmlog.x >npmlog.x : any ->npmlog : any +>npmlog : typeof import("npmlog") >x : any npmlog.on >npmlog.on : any ->npmlog : any +>npmlog : typeof import("npmlog") >on : any +=== npmlog.js === +class EE { +>EE : EE + + /** @param {string} s */ + on(s) { } +>on : (s: string) => void +>s : string +} +var npmlog = module.exports = new EE() +>npmlog : EE +>module.exports = new EE() : EE +>module.exports : typeof import("npmlog") +>module : { "npmlog": typeof import("npmlog"); } +>exports : typeof import("npmlog") +>new EE() : EE +>EE : typeof EE + +npmlog.on('hi') // both references should see EE.on +>npmlog.on('hi') : void +>npmlog.on : (s: string) => void +>npmlog : EE +>on : (s: string) => void +>'hi' : "hi" + +module.exports.on('hi') // here too +>module.exports.on('hi') : any +>module.exports.on : any +>module.exports : typeof import("npmlog") +>module : { "npmlog": typeof import("npmlog"); } +>exports : typeof import("npmlog") +>on : any +>'hi' : "hi" + +npmlog.x = 1 +>npmlog.x = 1 : 1 +>npmlog.x : any +>npmlog : EE +>x : any +>1 : 1 + +module.exports.y = 2 +>module.exports.y = 2 : 2 +>module.exports.y : 2 +>module.exports : typeof import("npmlog") +>module : { "npmlog": typeof import("npmlog"); } +>exports : typeof import("npmlog") +>y : 2 +>2 : 2 + +npmlog.y +>npmlog.y : any +>npmlog : EE +>y : any + +module.exports.x +>module.exports.x : any +>module.exports : typeof import("npmlog") +>module : { "npmlog": typeof import("npmlog"); } +>exports : typeof import("npmlog") +>x : any + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.errors.txt index 625a2e0a60..63ed6315f5 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.errors.txt @@ -1,19 +1,18 @@ -npm.js(1,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -npm.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -npm.js(5,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +npm.js(1,11): error TS2322: Type '(tree: any) => void' is not assignable to type 'typeof import("npm")'. +npm.js(5,12): error TS2349: This expression is not callable. + Type 'typeof import("npm")' has no call signatures. -==== npm.js (3 errors) ==== +==== npm.js (2 errors) ==== var npm = module.exports = function (tree) { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~ +!!! error TS2322: Type '(tree: any) => void' is not assignable to type 'typeof import("npm")'. } module.exports.asReadInstalled = function (tree) { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. npm(tree) // both references should be callable module.exports(tree) - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~ +!!! error TS2349: This expression is not callable. +!!! error TS2349: Type 'typeof import("npm")' has no call signatures. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.symbols index 1dd09de3c9..78fa43931d 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.symbols @@ -3,9 +3,17 @@ === npm.js === var npm = module.exports = function (tree) { >npm : Symbol(npm, Decl(npm.js, 0, 3)) +>module.exports : Symbol("npm", Decl(npm.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("npm", Decl(npm.js, 0, 0)) >tree : Symbol(tree, Decl(npm.js, 0, 37)) } module.exports.asReadInstalled = function (tree) { +>module.exports.asReadInstalled : Symbol(asReadInstalled, Decl(npm.js, 1, 1)) +>module.exports : Symbol("npm", Decl(npm.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("npm", Decl(npm.js, 0, 0)) +>asReadInstalled : Symbol(asReadInstalled, Decl(npm.js, 1, 1)) >tree : Symbol(tree, Decl(npm.js, 2, 43)) npm(tree) // both references should be callable @@ -13,6 +21,9 @@ module.exports.asReadInstalled = function (tree) { >tree : Symbol(tree, Decl(npm.js, 2, 43)) module.exports(tree) +>module.exports : Symbol("npm", Decl(npm.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("npm", Decl(npm.js, 0, 0)) >tree : Symbol(tree, Decl(npm.js, 2, 43)) } diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.symbols.diff index 48c20be623..7674d49b0f 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.symbols.diff @@ -7,24 +7,32 @@ ->module.exports : Symbol(module.exports, Decl(npm.js, 0, 0)) ->module : Symbol(npm, Decl(npm.js, 0, 9)) ->exports : Symbol(npm, Decl(npm.js, 0, 9)) ++>module.exports : Symbol("npm", Decl(npm.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("npm", Decl(npm.js, 0, 0)) >tree : Symbol(tree, Decl(npm.js, 0, 37)) } module.exports.asReadInstalled = function (tree) { -->module.exports.asReadInstalled : Symbol(asReadInstalled, Decl(npm.js, 1, 1)) + >module.exports.asReadInstalled : Symbol(asReadInstalled, Decl(npm.js, 1, 1)) ->module.exports : Symbol(asReadInstalled, Decl(npm.js, 1, 1)) ->module : Symbol(module, Decl(npm.js, 0, 9), Decl(npm.js, 3, 13)) ->exports : Symbol(module.exports, Decl(npm.js, 0, 0)) -->asReadInstalled : Symbol(asReadInstalled, Decl(npm.js, 1, 1)) ++>module.exports : Symbol("npm", Decl(npm.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("npm", Decl(npm.js, 0, 0)) + >asReadInstalled : Symbol(asReadInstalled, Decl(npm.js, 1, 1)) >tree : Symbol(tree, Decl(npm.js, 2, 43)) - npm(tree) // both references should be callable -@@= skipped -18, +10 lines =@@ +@@= skipped -18, +18 lines =@@ >tree : Symbol(tree, Decl(npm.js, 2, 43)) module.exports(tree) ->module.exports : Symbol(module.exports, Decl(npm.js, 0, 0)) ->module : Symbol(module, Decl(npm.js, 0, 9), Decl(npm.js, 3, 13)) ->exports : Symbol(module.exports, Decl(npm.js, 0, 0)) ++>module.exports : Symbol("npm", Decl(npm.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("npm", Decl(npm.js, 0, 0)) >tree : Symbol(tree, Decl(npm.js, 2, 43)) } diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.types b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.types index a0562b5142..9d1eca7397 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment2.types @@ -4,18 +4,18 @@ var npm = module.exports = function (tree) { >npm : (tree: any) => void >module.exports = function (tree) {} : (tree: any) => void ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("npm") +>module : { "npm": typeof import("npm"); } +>exports : typeof import("npm") >function (tree) {} : (tree: any) => void >tree : any } module.exports.asReadInstalled = function (tree) { >module.exports.asReadInstalled = function (tree) { npm(tree) // both references should be callable module.exports(tree)} : (tree: any) => void >module.exports.asReadInstalled : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("npm") +>module : { "npm": typeof import("npm"); } +>exports : typeof import("npm") >asReadInstalled : any >function (tree) { npm(tree) // both references should be callable module.exports(tree)} : (tree: any) => void >tree : any @@ -27,9 +27,9 @@ module.exports.asReadInstalled = function (tree) { module.exports(tree) >module.exports(tree) : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("npm") +>module : { "npm": typeof import("npm"); } +>exports : typeof import("npm") >tree : any } diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.errors.txt deleted file mode 100644 index d1fc548d3f..0000000000 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.errors.txt +++ /dev/null @@ -1,13 +0,0 @@ -npm.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== npm.js (1 errors) ==== - var mod = require('./mod') - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - mod() // should be callable from here too - -==== mod.js (0 errors) ==== - module.exports = function x() { } - module.exports() // should be callable - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.symbols index 4629fab075..6c48dba82f 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.symbols @@ -3,7 +3,21 @@ === npm.js === var mod = require('./mod') >mod : Symbol(mod, Decl(npm.js, 0, 3)) +>require : Symbol(require) +>'./mod' : Symbol("mod", Decl(mod.js, 0, 0)) mod() // should be callable from here too >mod : Symbol(mod, Decl(npm.js, 0, 3)) +=== mod.js === +module.exports = function x() { } +>module.exports : Symbol(export=, Decl(mod.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod.js, 0, 0)) +>x : Symbol(x, Decl(mod.js, 0, 16)) + +module.exports() // should be callable +>module.exports : Symbol(export=, Decl(mod.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.symbols.diff index 2fe8e28935..971a1263f8 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.symbols.diff @@ -1,24 +1,21 @@ --- old.moduleExportAssignment3.symbols +++ new.moduleExportAssignment3.symbols -@@= skipped -2, +2 lines =@@ - === npm.js === - var mod = require('./mod') - >mod : Symbol(mod, Decl(npm.js, 0, 3)) -->require : Symbol(require) -->'./mod' : Symbol("mod", Decl(mod.js, 0, 0)) +@@= skipped -10, +10 lines =@@ - mod() // should be callable from here too - >mod : Symbol(mod, Decl(npm.js, 0, 3)) - --=== mod.js === --module.exports = function x() { } + === mod.js === + module.exports = function x() { } ->module.exports : Symbol(module.exports, Decl(mod.js, 0, 0)) ->module : Symbol(export=, Decl(mod.js, 0, 0)) -->exports : Symbol(export=, Decl(mod.js, 0, 0)) -->x : Symbol(x, Decl(mod.js, 0, 16)) -- --module.exports() // should be callable ++>module.exports : Symbol(export=, Decl(mod.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(mod.js, 0, 0)) + >x : Symbol(x, Decl(mod.js, 0, 16)) + + module.exports() // should be callable ->module.exports : Symbol(module.exports, Decl(mod.js, 0, 0)) ->module : Symbol(module, Decl(mod.js, 0, 0)) ->exports : Symbol(module.exports, Decl(mod.js, 0, 0)) -- ++>module.exports : Symbol(export=, Decl(mod.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(mod.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.types b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.types index 1bcd664346..e6022047a3 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment3.types @@ -2,12 +2,27 @@ === npm.js === var mod = require('./mod') ->mod : any ->require('./mod') : any +>mod : () => void +>require('./mod') : () => void >require : any >'./mod' : "./mod" mod() // should be callable from here too ->mod() : any ->mod : any +>mod() : void +>mod : () => void + +=== mod.js === +module.exports = function x() { } +>module.exports = function x() { } : () => void +>module.exports : () => void +>module : { export=: () => void; } +>exports : () => void +>function x() { } : () => void +>x : () => void + +module.exports() // should be callable +>module.exports() : void +>module.exports : () => void +>module : { export=: () => void; } +>exports : () => void diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.errors.txt index 8ddc35e276..a505beb7ed 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.errors.txt @@ -1,15 +1,12 @@ -async.js(1,1): error TS2304: Cannot find name 'exports'. -async.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -async.js(2,18): error TS2304: Cannot find name 'exports'. +async.js(1,9): error TS2339: Property 'default' does not exist on type 'typeof import("async")'. +async.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== async.js (3 errors) ==== +==== async.js (2 errors) ==== exports.default = { m: 1, a: 1 } - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~~ +!!! error TS2339: Property 'default' does not exist on type 'typeof import("async")'. module.exports = exports['default']; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.symbols index 7c8e42a4fb..723e4e6100 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.symbols @@ -2,8 +2,13 @@ === async.js === exports.default = { m: 1, a: 1 } +>exports : Symbol("async", Decl(async.js, 0, 0)) >m : Symbol(m, Decl(async.js, 0, 19)) >a : Symbol(a, Decl(async.js, 0, 25)) module.exports = exports['default']; +>module.exports : Symbol(export=, Decl(async.js, 0, 32)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(async.js, 0, 32)) +>exports : Symbol("async", Decl(async.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.symbols.diff index e5d7eca79a..c5a2c14617 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.symbols.diff @@ -6,12 +6,15 @@ exports.default = { m: 1, a: 1 } ->exports : Symbol(default, Decl(async.js, 0, 0)) ->default : Symbol(default, Decl(async.js, 0, 0)) ++>exports : Symbol("async", Decl(async.js, 0, 0)) >m : Symbol(m, Decl(async.js, 0, 19)) >a : Symbol(a, Decl(async.js, 0, 25)) module.exports = exports['default']; ->module.exports : Symbol(module.exports, Decl(async.js, 0, 0)) ->module : Symbol(export=, Decl(async.js, 0, 32)) -->exports : Symbol(export=, Decl(async.js, 0, 32)) -->exports : Symbol("async", Decl(async.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(async.js, 0, 32)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(async.js, 0, 32)) + >exports : Symbol("async", Decl(async.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.types b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.types index 16a4070e56..dcbd8cf715 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment4.types @@ -4,7 +4,7 @@ exports.default = { m: 1, a: 1 } >exports.default = { m: 1, a: 1 } : { m: number; a: number; } >exports.default : any ->exports : any +>exports : typeof import("async") >default : any >{ m: 1, a: 1 } : { m: number; a: number; } >m : number @@ -15,9 +15,9 @@ exports.default = { m: 1, a: 1 } module.exports = exports['default']; >module.exports = exports['default'] : any >module.exports : any ->module : any +>module : { export=: any; } >exports : any >exports['default'] : any ->exports : any +>exports : typeof import("async") >'default' : "default" diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.errors.txt index 0ed7f76553..817b5b7b5b 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.errors.txt @@ -1,5 +1,5 @@ -axios.js(9,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -axios.js(10,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +axios.js(9,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +axios.js(10,16): error TS2339: Property 'default' does not exist on type 'Axios'. ==== axios.js (2 errors) ==== @@ -12,9 +12,9 @@ axios.js(10,1): error TS2580: Cannot find name 'module'. Do you need to install // none of the 3 references should have a use-before-def error axios.m() module.exports = axios; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.default = axios; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~ +!!! error TS2339: Property 'default' does not exist on type 'Axios'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.symbols index 06784505bb..e1144e754b 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.symbols @@ -20,8 +20,14 @@ axios.m() >m : Symbol(m, Decl(axios.js, 2, 5)) module.exports = axios; +>module.exports : Symbol(axios, Decl(axios.js, 5, 3)) +>module : Symbol(module.exports) +>exports : Symbol(axios, Decl(axios.js, 5, 3)) >axios : Symbol(axios, Decl(axios.js, 5, 3)) module.exports.default = axios; +>module.exports : Symbol(axios, Decl(axios.js, 5, 3)) +>module : Symbol(module.exports) +>exports : Symbol(axios, Decl(axios.js, 5, 3)) >axios : Symbol(axios, Decl(axios.js, 5, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.symbols.diff index 3efd38180b..c773d65dd9 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.symbols.diff @@ -23,6 +23,9 @@ ->module.exports : Symbol(module.exports, Decl(axios.js, 0, 0)) ->module : Symbol(export=, Decl(axios.js, 7, 9)) ->exports : Symbol(export=, Decl(axios.js, 7, 9)) ++>module.exports : Symbol(axios, Decl(axios.js, 5, 3)) ++>module : Symbol(module.exports) ++>exports : Symbol(axios, Decl(axios.js, 5, 3)) >axios : Symbol(axios, Decl(axios.js, 5, 3)) module.exports.default = axios; @@ -31,5 +34,8 @@ ->module : Symbol(module, Decl(axios.js, 7, 9)) ->exports : Symbol(module.exports, Decl(axios.js, 0, 0)) ->default : Symbol(default, Decl(axios.js, 8, 23)) ++>module.exports : Symbol(axios, Decl(axios.js, 5, 3)) ++>module : Symbol(module.exports) ++>exports : Symbol(axios, Decl(axios.js, 5, 3)) >axios : Symbol(axios, Decl(axios.js, 5, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.types b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.types index 3c790e2f15..68d421dd4e 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment5.types @@ -23,17 +23,17 @@ axios.m() module.exports = axios; >module.exports = axios : Axios ->module.exports : any ->module : any ->exports : any +>module.exports : Axios +>module : { axios: Axios; } +>exports : Axios >axios : Axios module.exports.default = axios; >module.exports.default = axios : Axios >module.exports.default : any ->module.exports : any ->module : any ->exports : any +>module.exports : Axios +>module : { axios: Axios; } +>exports : Axios >default : any >axios : Axios diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.errors.txt index bc5363672c..88bbc580cf 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.errors.txt @@ -1,30 +1,20 @@ -index.ts(2,24): error TS2694: Namespace '"mod"' has no exported member 'Thing'. -index.ts(3,24): error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. -index.ts(4,24): error TS2694: Namespace '"mod"' has no exported member 'foo'. -index.ts(5,24): error TS2694: Namespace '"mod"' has no exported member 'qux'. -index.ts(6,24): error TS2694: Namespace '"mod"' has no exported member 'baz'. -index.ts(8,24): error TS2694: Namespace '"mod"' has no exported member 'literal'. -index.ts(14,31): error TS2694: Namespace '"mod"' has no exported member 'Thing'. -index.ts(15,31): error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. -index.ts(16,31): error TS2694: Namespace '"mod"' has no exported member 'foo'. -index.ts(17,31): error TS2694: Namespace '"mod"' has no exported member 'qux'. -index.ts(18,31): error TS2694: Namespace '"mod"' has no exported member 'baz'. -index.ts(19,31): error TS2694: Namespace '"mod"' has no exported member 'buz'. -index.ts(20,31): error TS2694: Namespace '"mod"' has no exported member 'literal'. -main.js(2,28): error TS2694: Namespace '"mod"' has no exported member 'Thing'. -main.js(3,28): error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. -main.js(4,28): error TS2694: Namespace '"mod"' has no exported member 'foo'. -main.js(5,28): error TS2694: Namespace '"mod"' has no exported member 'qux'. -main.js(6,28): error TS2694: Namespace '"mod"' has no exported member 'baz'. -main.js(8,28): error TS2694: Namespace '"mod"' has no exported member 'literal'. -main.js(15,35): error TS2694: Namespace '"mod"' has no exported member 'Thing'. -main.js(16,35): error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. -main.js(17,35): error TS2694: Namespace '"mod"' has no exported member 'foo'. -main.js(18,35): error TS2694: Namespace '"mod"' has no exported member 'qux'. -main.js(19,35): error TS2694: Namespace '"mod"' has no exported member 'baz'. -main.js(20,35): error TS2694: Namespace '"mod"' has no exported member 'buz'. -main.js(21,35): error TS2694: Namespace '"mod"' has no exported member 'literal'. -mod.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.ts(2,24): error TS2694: Namespace '"mod".export=' has no exported member 'Thing'. +index.ts(3,24): error TS2694: Namespace '"mod".export=' has no exported member 'AnotherThing'. +index.ts(4,24): error TS2694: Namespace '"mod".export=' has no exported member 'foo'. +index.ts(5,24): error TS2694: Namespace '"mod".export=' has no exported member 'qux'. +index.ts(6,24): error TS2694: Namespace '"mod".export=' has no exported member 'baz'. +index.ts(7,24): error TS2694: Namespace '"mod".export=' has no exported member 'buz'. +index.ts(8,24): error TS2694: Namespace '"mod".export=' has no exported member 'literal'. +index.ts(19,31): error TS2694: Namespace '"mod".export=' has no exported member 'buz'. +main.js(2,28): error TS2694: Namespace '"mod".export=' has no exported member 'Thing'. +main.js(3,28): error TS2694: Namespace '"mod".export=' has no exported member 'AnotherThing'. +main.js(4,28): error TS2694: Namespace '"mod".export=' has no exported member 'foo'. +main.js(5,28): error TS2694: Namespace '"mod".export=' has no exported member 'qux'. +main.js(6,28): error TS2694: Namespace '"mod".export=' has no exported member 'baz'. +main.js(7,28): error TS2694: Namespace '"mod".export=' has no exported member 'buz'. +main.js(8,28): error TS2694: Namespace '"mod".export=' has no exported member 'literal'. +main.js(20,35): error TS2694: Namespace '"mod".export=' has no exported member 'buz'. +mod.js(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ==== mod.js (1 errors) ==== @@ -34,36 +24,45 @@ mod.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install typ function bar() { return 4 } /** @typedef {() => number} buz */ module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~ Thing, + ~~~~~~~~~~ AnotherThing, + ~~~~~~~~~~~~~~~~~ foo, + ~~~~~~~~ qux: bar, + ~~~~~~~~~~~~~ baz() { return 5 }, + ~~~~~~~~~~~~~~~~~~~~~~~ literal: "", + ~~~~~~~~~~~~~~~~ } -==== main.js (13 errors) ==== + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. +==== main.js (8 errors) ==== /** * @param {import("./mod").Thing} a ~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'Thing'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'Thing'. * @param {import("./mod").AnotherThing} b ~~~~~~~~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'AnotherThing'. * @param {import("./mod").foo} c ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'foo'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'foo'. * @param {import("./mod").qux} d ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'qux'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'qux'. * @param {import("./mod").baz} e ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'baz'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'baz'. * @param {import("./mod").buz} f + ~~~ +!!! error TS2694: Namespace '"mod".export=' has no exported member 'buz'. * @param {import("./mod").literal} g ~~~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'literal'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'literal'. */ function jstypes(a, b, c, d, e, f, g) { return a.x + b.y + c() + d() + e() + f() + g.length @@ -71,78 +70,56 @@ mod.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install typ /** * @param {typeof import("./mod").Thing} a - ~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'Thing'. * @param {typeof import("./mod").AnotherThing} b - ~~~~~~~~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. * @param {typeof import("./mod").foo} c - ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'foo'. * @param {typeof import("./mod").qux} d - ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'qux'. * @param {typeof import("./mod").baz} e - ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'baz'. * @param {typeof import("./mod").buz} f ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'buz'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'buz'. * @param {typeof import("./mod").literal} g - ~~~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'literal'. */ function jsvalues(a, b, c, d, e, f, g) { return a.length + b.length + c() + d() + e() + f() + g.length } -==== index.ts (13 errors) ==== +==== index.ts (8 errors) ==== function types( a: import('./mod').Thing, ~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'Thing'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'Thing'. b: import('./mod').AnotherThing, ~~~~~~~~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'AnotherThing'. c: import('./mod').foo, ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'foo'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'foo'. d: import('./mod').qux, ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'qux'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'qux'. e: import('./mod').baz, ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'baz'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'baz'. f: import('./mod').buz, + ~~~ +!!! error TS2694: Namespace '"mod".export=' has no exported member 'buz'. g: import('./mod').literal, ~~~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'literal'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'literal'. ) { return a.x + b.y + c() + d() + e() + f() + g.length } function values( a: typeof import('./mod').Thing, - ~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'Thing'. b: typeof import('./mod').AnotherThing, - ~~~~~~~~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. c: typeof import('./mod').foo, - ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'foo'. d: typeof import('./mod').qux, - ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'qux'. e: typeof import('./mod').baz, - ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'baz'. f: typeof import('./mod').buz, ~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'buz'. +!!! error TS2694: Namespace '"mod".export=' has no exported member 'buz'. g: typeof import('./mod').literal, - ~~~~~~~ -!!! error TS2694: Namespace '"mod"' has no exported member 'literal'. ) { return a.length + b.length + c() + d() + e() + f() + g.length } diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.symbols index 318be9ed2b..f7dfd5ea5e 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.symbols @@ -17,6 +17,10 @@ function bar() { return 4 } /** @typedef {() => number} buz */ module.exports = { +>module.exports : Symbol(export=, Decl(mod.js, 3, 27)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod.js, 3, 27)) + Thing, >Thing : Symbol(Thing, Decl(mod.js, 5, 18)) @@ -86,13 +90,19 @@ function jsvalues(a, b, c, d, e, f, g) { >g : Symbol(g, Decl(main.js, 22, 35)) return a.length + b.length + c() + d() + e() + f() + g.length +>a.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(main.js, 22, 18)) +>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) +>b.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >b : Symbol(b, Decl(main.js, 22, 20)) +>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(main.js, 22, 23)) >d : Symbol(d, Decl(main.js, 22, 26)) >e : Symbol(e, Decl(main.js, 22, 29)) >f : Symbol(f, Decl(main.js, 22, 32)) +>g.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >g : Symbol(g, Decl(main.js, 22, 35)) +>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) } === index.ts === @@ -116,7 +126,6 @@ function types( f: import('./mod').buz, >f : Symbol(f, Decl(index.ts, 5, 27)) ->buz : Symbol(buz, Decl(mod.js, 4, 4)) g: import('./mod').literal, >g : Symbol(g, Decl(index.ts, 6, 27)) @@ -137,33 +146,45 @@ function values( a: typeof import('./mod').Thing, >a : Symbol(a, Decl(index.ts, 12, 16)) +>Thing : Symbol(Thing, Decl(mod.js, 5, 18)) b: typeof import('./mod').AnotherThing, >b : Symbol(b, Decl(index.ts, 13, 36)) +>AnotherThing : Symbol(AnotherThing, Decl(mod.js, 6, 10)) c: typeof import('./mod').foo, >c : Symbol(c, Decl(index.ts, 14, 43)) +>foo : Symbol(foo, Decl(mod.js, 7, 17)) d: typeof import('./mod').qux, >d : Symbol(d, Decl(index.ts, 15, 34)) +>qux : Symbol(qux, Decl(mod.js, 8, 8)) e: typeof import('./mod').baz, >e : Symbol(e, Decl(index.ts, 16, 34)) +>baz : Symbol(baz, Decl(mod.js, 9, 13)) f: typeof import('./mod').buz, >f : Symbol(f, Decl(index.ts, 17, 34)) g: typeof import('./mod').literal, >g : Symbol(g, Decl(index.ts, 18, 34)) +>literal : Symbol(literal, Decl(mod.js, 10, 23)) ) { return a.length + b.length + c() + d() + e() + f() + g.length +>a.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(index.ts, 12, 16)) +>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) +>b.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >b : Symbol(b, Decl(index.ts, 13, 36)) +>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(index.ts, 14, 43)) >d : Symbol(d, Decl(index.ts, 15, 34)) >e : Symbol(e, Decl(index.ts, 16, 34)) >f : Symbol(f, Decl(index.ts, 17, 34)) +>g.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >g : Symbol(g, Decl(index.ts, 18, 34)) +>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) } diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.symbols.diff index cf0b78e146..8c07ecccc4 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.symbols.diff @@ -20,12 +20,12 @@ module.exports = { ->module.exports : Symbol(module.exports, Decl(mod.js, 0, 0)) ->module : Symbol(export=, Decl(mod.js, 3, 27)) -->exports : Symbol(export=, Decl(mod.js, 3, 27)) -- - Thing, - >Thing : Symbol(Thing, Decl(mod.js, 5, 18)) ++>module.exports : Symbol(export=, Decl(mod.js, 3, 27)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(mod.js, 3, 27)) -@@= skipped -44, +40 lines =@@ + Thing, +@@= skipped -44, +44 lines =@@ >g : Symbol(g, Decl(main.js, 9, 34)) return a.x + b.y + c() + d() + e() + f() + g.length @@ -50,64 +50,57 @@ return a.length + b.length + c() + d() + e() + f() + g.length ->a.length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) ++>a.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(main.js, 22, 18)) ->length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) ->b.length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) ++>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) ++>b.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >b : Symbol(b, Decl(main.js, 22, 20)) ->length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) ++>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(main.js, 22, 23)) >d : Symbol(d, Decl(main.js, 22, 26)) >e : Symbol(e, Decl(main.js, 22, 29)) >f : Symbol(f, Decl(main.js, 22, 32)) ->g.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) ++>g.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >g : Symbol(g, Decl(main.js, 22, 35)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) ++>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) } === index.ts === -@@= skipped -57, +51 lines =@@ - - a: typeof import('./mod').Thing, - >a : Symbol(a, Decl(index.ts, 12, 16)) -->Thing : Symbol(Thing, Decl(mod.js, 5, 18)) - - b: typeof import('./mod').AnotherThing, - >b : Symbol(b, Decl(index.ts, 13, 36)) -->AnotherThing : Symbol(AnotherThing, Decl(mod.js, 6, 10)) - - c: typeof import('./mod').foo, - >c : Symbol(c, Decl(index.ts, 14, 43)) -->foo : Symbol(foo, Decl(mod.js, 7, 17)) - - d: typeof import('./mod').qux, - >d : Symbol(d, Decl(index.ts, 15, 34)) -->qux : Symbol(qux, Decl(mod.js, 8, 8)) +@@= skipped -36, +36 lines =@@ - e: typeof import('./mod').baz, - >e : Symbol(e, Decl(index.ts, 16, 34)) -->baz : Symbol(baz, Decl(mod.js, 9, 13)) + f: import('./mod').buz, + >f : Symbol(f, Decl(index.ts, 5, 27)) +->buz : Symbol(buz, Decl(mod.js, 4, 4)) - f: typeof import('./mod').buz, - >f : Symbol(f, Decl(index.ts, 17, 34)) - - g: typeof import('./mod').literal, - >g : Symbol(g, Decl(index.ts, 18, 34)) -->literal : Symbol(literal, Decl(mod.js, 10, 23)) + g: import('./mod').literal, + >g : Symbol(g, Decl(index.ts, 6, 27)) +@@= skipped -48, +47 lines =@@ ) { return a.length + b.length + c() + d() + e() + f() + g.length ->a.length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) ++>a.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >a : Symbol(a, Decl(index.ts, 12, 16)) ->length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) ->b.length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) ++>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) ++>b.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >b : Symbol(b, Decl(index.ts, 13, 36)) ->length : Symbol(Function.length, Decl(lib.es5.d.ts, --, --)) ++>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >c : Symbol(c, Decl(index.ts, 14, 43)) >d : Symbol(d, Decl(index.ts, 15, 34)) >e : Symbol(e, Decl(index.ts, 16, 34)) >f : Symbol(f, Decl(index.ts, 17, 34)) ->g.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) ++>g.length : Symbol(length, Decl(lib.es5.d.ts, --, --)) >g : Symbol(g, Decl(index.ts, 18, 34)) ->length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) ++>length : Symbol(length, Decl(lib.es5.d.ts, --, --)) } diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.types b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.types index fcde31ff62..099a6e5460 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportAssignment7.types @@ -22,9 +22,9 @@ function bar() { return 4 } /** @typedef {() => number} buz */ module.exports = { >module.exports = { Thing, AnotherThing, foo, qux: bar, baz() { return 5 }, literal: "",} : { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz: () => number; literal: string; } ->module.exports : any ->module : any ->exports : any +>module.exports : { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz: () => number; literal: string; } +>module : { export=: { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz: () => number; literal: string; }; } +>exports : { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz: () => number; literal: string; } >{ Thing, AnotherThing, foo, qux: bar, baz() { return 5 }, literal: "",} : { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz: () => number; literal: string; } Thing, @@ -59,13 +59,13 @@ module.exports = { * @param {import("./mod").literal} g */ function jstypes(a, b, c, d, e, f, g) { ->jstypes : (a: any, b: any, c: any, d: any, e: any, f: () => number, g: any) => any +>jstypes : (a: any, b: any, c: any, d: any, e: any, f: any, g: any) => any >a : any >b : any >c : any >d : any >e : any ->f : () => number +>f : any >g : any return a.x + b.y + c() + d() + e() + f() + g.length @@ -87,8 +87,8 @@ function jstypes(a, b, c, d, e, f, g) { >d : any >e() : any >e : any ->f() : number ->f : () => number +>f() : any +>f : any >g.length : any >g : any >length : any @@ -104,44 +104,44 @@ function jstypes(a, b, c, d, e, f, g) { * @param {typeof import("./mod").literal} g */ function jsvalues(a, b, c, d, e, f, g) { ->jsvalues : (a: any, b: any, c: any, d: any, e: any, f: any, g: any) => any ->a : any ->b : any ->c : any ->d : any ->e : any +>jsvalues : (a: typeof Thing, b: typeof AnotherThing, c: () => number, d: () => number, e: () => number, f: any, g: string) => any +>a : typeof Thing +>b : typeof AnotherThing +>c : () => number +>d : () => number +>e : () => number >f : any ->g : any +>g : string return a.length + b.length + c() + d() + e() + f() + g.length >a.length + b.length + c() + d() + e() + f() + g.length : any >a.length + b.length + c() + d() + e() + f() : any ->a.length + b.length + c() + d() + e() : any ->a.length + b.length + c() + d() : any ->a.length + b.length + c() : any ->a.length + b.length : any ->a.length : any ->a : any ->length : any ->b.length : any ->b : any ->length : any ->c() : any ->c : any ->d() : any ->d : any ->e() : any ->e : any +>a.length + b.length + c() + d() + e() : number +>a.length + b.length + c() + d() : number +>a.length + b.length + c() : number +>a.length + b.length : number +>a.length : number +>a : typeof Thing +>length : number +>b.length : number +>b : typeof AnotherThing +>length : number +>c() : number +>c : () => number +>d() : number +>d : () => number +>e() : number +>e : () => number >f() : any >f : any ->g.length : any ->g : any ->length : any +>g.length : number +>g : string +>length : number } === index.ts === function types( ->types : (a: any, b: any, c: any, d: any, e: any, f: () => number, g: any) => any +>types : (a: any, b: any, c: any, d: any, e: any, f: any, g: any) => any a: import('./mod').Thing, >a : any @@ -159,7 +159,7 @@ function types( >e : any f: import('./mod').buz, ->f : () => number +>f : any g: import('./mod').literal, >g : any @@ -184,34 +184,34 @@ function types( >d : any >e() : any >e : any ->f() : number ->f : () => number +>f() : any +>f : any >g.length : any >g : any >length : any } function values( ->values : (a: any, b: any, c: any, d: any, e: any, f: any, g: any) => any +>values : (a: typeof Thing, b: typeof AnotherThing, c: () => number, d: () => number, e: () => number, f: any, g: string) => any a: typeof import('./mod').Thing, ->a : any +>a : typeof Thing >Thing : any b: typeof import('./mod').AnotherThing, ->b : any +>b : typeof AnotherThing >AnotherThing : any c: typeof import('./mod').foo, ->c : any +>c : () => number >foo : any d: typeof import('./mod').qux, ->d : any +>d : () => number >qux : any e: typeof import('./mod').baz, ->e : any +>e : () => number >baz : any f: typeof import('./mod').buz, @@ -219,33 +219,33 @@ function values( >buz : any g: typeof import('./mod').literal, ->g : any +>g : string >literal : any ) { return a.length + b.length + c() + d() + e() + f() + g.length >a.length + b.length + c() + d() + e() + f() + g.length : any >a.length + b.length + c() + d() + e() + f() : any ->a.length + b.length + c() + d() + e() : any ->a.length + b.length + c() + d() : any ->a.length + b.length + c() : any ->a.length + b.length : any ->a.length : any ->a : any ->length : any ->b.length : any ->b : any ->length : any ->c() : any ->c : any ->d() : any ->d : any ->e() : any ->e : any +>a.length + b.length + c() + d() + e() : number +>a.length + b.length + c() + d() : number +>a.length + b.length + c() : number +>a.length + b.length : number +>a.length : number +>a : typeof Thing +>length : number +>b.length : number +>b : typeof AnotherThing +>length : number +>c() : number +>c : () => number +>d() : number +>d : () => number +>e() : number +>e : () => number >f() : any >f : any ->g.length : any ->g : any ->length : any +>g.length : number +>g : string +>length : number } diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.errors.txt index 84d10ae4d2..52d04dc3c5 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.errors.txt @@ -1,10 +1,10 @@ -test.js(1,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +test.js(1,27): error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. ==== test.js (1 errors) ==== const { apply } = require('./moduleExportAliasDuplicateAlias') - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. apply() ==== moduleExportAliasDuplicateAlias.js (0 errors) ==== diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.symbols index bd915513cb..437998041f 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.symbols @@ -3,6 +3,7 @@ === test.js === const { apply } = require('./moduleExportAliasDuplicateAlias') >apply : Symbol(apply, Decl(test.js, 0, 7)) +>require : Symbol(require) apply() >apply : Symbol(apply, Decl(test.js, 0, 7)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.symbols.diff index 6030b10576..24efaac00e 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias.symbols.diff @@ -1,10 +1,9 @@ --- old.moduleExportDuplicateAlias.symbols +++ new.moduleExportDuplicateAlias.symbols -@@= skipped -2, +2 lines =@@ - === test.js === +@@= skipped -3, +3 lines =@@ const { apply } = require('./moduleExportAliasDuplicateAlias') >apply : Symbol(apply, Decl(test.js, 0, 7)) -->require : Symbol(require) + >require : Symbol(require) ->'./moduleExportAliasDuplicateAlias' : Symbol("moduleExportAliasDuplicateAlias", Decl(moduleExportAliasDuplicateAlias.js, 0, 0)) apply() diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.errors.txt index 08ecd87df4..6b5b273a1e 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.errors.txt @@ -1,10 +1,10 @@ -test.js(1,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +test.js(1,27): error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. ==== test.js (1 errors) ==== const { apply } = require('./moduleExportAliasDuplicateAlias') - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. apply() ==== moduleExportAliasDuplicateAlias.js (0 errors) ==== diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.symbols index 0969e0fbdd..1e416b02d9 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.symbols @@ -3,6 +3,7 @@ === test.js === const { apply } = require('./moduleExportAliasDuplicateAlias') >apply : Symbol(apply, Decl(test.js, 0, 7)) +>require : Symbol(require) apply() >apply : Symbol(apply, Decl(test.js, 0, 7)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.symbols.diff index 579fa277d3..b6461a8f50 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias2.symbols.diff @@ -1,10 +1,9 @@ --- old.moduleExportDuplicateAlias2.symbols +++ new.moduleExportDuplicateAlias2.symbols -@@= skipped -2, +2 lines =@@ - === test.js === +@@= skipped -3, +3 lines =@@ const { apply } = require('./moduleExportAliasDuplicateAlias') >apply : Symbol(apply, Decl(test.js, 0, 7)) -->require : Symbol(require) + >require : Symbol(require) ->'./moduleExportAliasDuplicateAlias' : Symbol("moduleExportAliasDuplicateAlias", Decl(moduleExportAliasDuplicateAlias.js, 0, 0)) apply() diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.errors.txt index 2abc5de579..57050a304a 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.errors.txt @@ -1,10 +1,10 @@ -test.js(1,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +test.js(1,27): error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. ==== test.js (1 errors) ==== const { apply } = require('./moduleExportAliasDuplicateAlias') - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. const result = apply.toFixed() ==== moduleExportAliasDuplicateAlias.js (0 errors) ==== diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.symbols index de48cd69f8..f56e947274 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.symbols @@ -3,6 +3,7 @@ === test.js === const { apply } = require('./moduleExportAliasDuplicateAlias') >apply : Symbol(apply, Decl(test.js, 0, 7)) +>require : Symbol(require) const result = apply.toFixed() >result : Symbol(result, Decl(test.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.symbols.diff index c6f80869a0..b01945440b 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportDuplicateAlias3.symbols.diff @@ -1,10 +1,9 @@ --- old.moduleExportDuplicateAlias3.symbols +++ new.moduleExportDuplicateAlias3.symbols -@@= skipped -2, +2 lines =@@ - === test.js === +@@= skipped -3, +3 lines =@@ const { apply } = require('./moduleExportAliasDuplicateAlias') >apply : Symbol(apply, Decl(test.js, 0, 7)) -->require : Symbol(require) + >require : Symbol(require) ->'./moduleExportAliasDuplicateAlias' : Symbol("moduleExportAliasDuplicateAlias", Decl(moduleExportAliasDuplicateAlias.js, 0, 0)) const result = apply.toFixed() diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.errors.txt index b8a3e7f5ac..487aeb584e 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.errors.txt @@ -1,22 +1,14 @@ -mod.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -mod.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -mod.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. mod.js(7,14): error TS2339: Property 'p' does not exist on type 'Classic'. -use.js(1,20): error TS2306: File 'mod.js' is not a module. +use.js(8,15): error TS2694: Namespace '"mod"' has no exported member 'n'. +use.js(9,13): error TS2749: 's.Classic' refers to a value, but is being used as a type here. Did you mean 'typeof s.Classic'? -==== mod.js (4 errors) ==== +==== mod.js (1 errors) ==== module.exports.n = {}; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports.n.K = function C() { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. this.x = 10; } module.exports.Classic = class { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. constructor() { this.p = 1 ~ @@ -24,10 +16,8 @@ use.js(1,20): error TS2306: File 'mod.js' is not a module. } } -==== use.js (1 errors) ==== +==== use.js (2 errors) ==== import * as s from './mod' - ~~~~~~~ -!!! error TS2306: File 'mod.js' is not a module. var k = new s.n.K() k.x @@ -35,7 +25,11 @@ use.js(1,20): error TS2306: File 'mod.js' is not a module. /** @param {s.n.K} c + ~ +!!! error TS2694: Namespace '"mod"' has no exported member 'n'. @param {s.Classic} classic */ + ~~~~~~~~~ +!!! error TS2749: 's.Classic' refers to a value, but is being used as a type here. Did you mean 'typeof s.Classic'? function f(c, classic) { c.x classic.p diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.symbols index 01422bb7ed..500368aaea 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.symbols @@ -2,12 +2,29 @@ === mod.js === module.exports.n = {}; +>module.exports.n : Symbol(n, Decl(mod.js, 0, 0)) +>module.exports : Symbol("mod", Decl(mod.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>n : Symbol(n, Decl(mod.js, 0, 0)) + module.exports.n.K = function C() { +>module.exports.n : Symbol(n, Decl(mod.js, 0, 0)) +>module.exports : Symbol("mod", Decl(mod.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>n : Symbol(n, Decl(mod.js, 0, 0)) >C : Symbol(C, Decl(mod.js, 1, 20)) this.x = 10; } module.exports.Classic = class { +>module.exports.Classic : Symbol(Classic, Decl(mod.js, 3, 1)) +>module.exports : Symbol("mod", Decl(mod.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("mod", Decl(mod.js, 0, 0)) +>Classic : Symbol(Classic, Decl(mod.js, 3, 1)) + constructor() { this.p = 1 >this : Symbol(Classic, Decl(mod.js, 4, 24)) @@ -20,14 +37,18 @@ import * as s from './mod' var k = new s.n.K() >k : Symbol(k, Decl(use.js, 2, 3)) +>s.n : Symbol(n, Decl(mod.js, 0, 0)) >s : Symbol(s, Decl(use.js, 0, 6)) +>n : Symbol(n, Decl(mod.js, 0, 0)) k.x >k : Symbol(k, Decl(use.js, 2, 3)) var classic = new s.Classic() >classic : Symbol(classic, Decl(use.js, 4, 3)) +>s.Classic : Symbol(Classic, Decl(mod.js, 3, 1)) >s : Symbol(s, Decl(use.js, 0, 6)) +>Classic : Symbol(Classic, Decl(mod.js, 3, 1)) /** @param {s.n.K} c diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.symbols.diff index 808e4ee3da..f80d7c93c5 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.symbols.diff @@ -9,7 +9,12 @@ ->module : Symbol(module, Decl(mod.js, 0, 0)) ->exports : Symbol(module.exports, Decl(mod.js, 0, 0)) ->n : Symbol(n, Decl(mod.js, 0, 0), Decl(mod.js, 1, 15)) -- ++>module.exports.n : Symbol(n, Decl(mod.js, 0, 0)) ++>module.exports : Symbol("mod", Decl(mod.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) ++>n : Symbol(n, Decl(mod.js, 0, 0)) + module.exports.n.K = function C() { ->module.exports.n.K : Symbol(n.K, Decl(mod.js, 0, 22)) ->module.exports.n : Symbol(n.K, Decl(mod.js, 0, 22)) @@ -18,6 +23,11 @@ ->exports : Symbol(module.exports, Decl(mod.js, 0, 0)) ->n : Symbol(n, Decl(mod.js, 0, 0), Decl(mod.js, 1, 15)) ->K : Symbol(n.K, Decl(mod.js, 0, 22)) ++>module.exports.n : Symbol(n, Decl(mod.js, 0, 0)) ++>module.exports : Symbol("mod", Decl(mod.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) ++>n : Symbol(n, Decl(mod.js, 0, 0)) >C : Symbol(C, Decl(mod.js, 1, 20)) this.x = 10; @@ -26,12 +36,15 @@ ->x : Symbol(C.x, Decl(mod.js, 1, 35)) } module.exports.Classic = class { -->module.exports.Classic : Symbol(Classic, Decl(mod.js, 3, 1)) + >module.exports.Classic : Symbol(Classic, Decl(mod.js, 3, 1)) ->module.exports : Symbol(Classic, Decl(mod.js, 3, 1)) ->module : Symbol(module, Decl(mod.js, 0, 0)) ->exports : Symbol(module.exports, Decl(mod.js, 0, 0)) -->Classic : Symbol(Classic, Decl(mod.js, 3, 1)) -- ++>module.exports : Symbol("mod", Decl(mod.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("mod", Decl(mod.js, 0, 0)) + >Classic : Symbol(Classic, Decl(mod.js, 3, 1)) + constructor() { this.p = 1 ->this.p : Symbol(Classic.p, Decl(mod.js, 5, 19)) @@ -40,15 +53,17 @@ } } -@@= skipped -42, +18 lines =@@ +@@= skipped -42, +35 lines =@@ var k = new s.n.K() >k : Symbol(k, Decl(use.js, 2, 3)) ->s.n.K : Symbol(s.n.K, Decl(mod.js, 0, 22)) ->s.n : Symbol(s.n, Decl(mod.js, 0, 0), Decl(mod.js, 1, 15)) ++>s.n : Symbol(n, Decl(mod.js, 0, 0)) >s : Symbol(s, Decl(use.js, 0, 6)) ->n : Symbol(s.n, Decl(mod.js, 0, 0), Decl(mod.js, 1, 15)) ->K : Symbol(s.n.K, Decl(mod.js, 0, 22)) ++>n : Symbol(n, Decl(mod.js, 0, 0)) k.x ->k.x : Symbol(C.x, Decl(mod.js, 1, 35)) @@ -58,12 +73,14 @@ var classic = new s.Classic() >classic : Symbol(classic, Decl(use.js, 4, 3)) ->s.Classic : Symbol(s.Classic, Decl(mod.js, 3, 1)) ++>s.Classic : Symbol(Classic, Decl(mod.js, 3, 1)) >s : Symbol(s, Decl(use.js, 0, 6)) ->Classic : Symbol(s.Classic, Decl(mod.js, 3, 1)) ++>Classic : Symbol(Classic, Decl(mod.js, 3, 1)) /** @param {s.n.K} c -@@= skipped -26, +18 lines =@@ +@@= skipped -26, +22 lines =@@ >classic : Symbol(classic, Decl(use.js, 9, 13)) c.x diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.types b/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.types index ea97d76e1d..ba531322fa 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportNestedNamespaces.types @@ -4,9 +4,9 @@ module.exports.n = {}; >module.exports.n = {} : {} >module.exports.n : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("mod") +>module : { "mod": typeof import("mod"); } +>exports : typeof import("mod") >n : any >{} : {} @@ -14,9 +14,9 @@ module.exports.n.K = function C() { >module.exports.n.K = function C() { this.x = 10;} : () => void >module.exports.n.K : any >module.exports.n : any ->module.exports : any ->module : any ->exports : any +>module.exports : typeof import("mod") +>module : { "mod": typeof import("mod"); } +>exports : typeof import("mod") >n : any >K : any >function C() { this.x = 10;} : () => void @@ -31,11 +31,11 @@ module.exports.n.K = function C() { } module.exports.Classic = class { >module.exports.Classic = class { constructor() { this.p = 1 }} : typeof Classic ->module.exports.Classic : any ->module.exports : any ->module : any ->exports : any ->Classic : any +>module.exports.Classic : typeof Classic +>module.exports : typeof import("mod") +>module : { "mod": typeof import("mod"); } +>exports : typeof import("mod") +>Classic : typeof Classic >class { constructor() { this.p = 1 }} : typeof Classic constructor() { @@ -50,14 +50,14 @@ module.exports.Classic = class { === use.js === import * as s from './mod' ->s : any +>s : typeof import("mod") var k = new s.n.K() >k : any >new s.n.K() : any >s.n.K : any >s.n : any ->s : any +>s : typeof import("mod") >n : any >K : any @@ -67,11 +67,11 @@ k.x >x : any var classic = new s.Classic() ->classic : any ->new s.Classic() : any ->s.Classic : any ->s : any ->Classic : any +>classic : Classic +>new s.Classic() : Classic +>s.Classic : typeof Classic +>s : typeof import("mod") +>Classic : typeof Classic /** @param {s.n.K} c diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.errors.txt index c451463a59..3867a2f253 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.errors.txt @@ -1,13 +1,13 @@ -axios.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -axios.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +axios.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +axios.js(3,16): error TS2339: Property 'default' does not exist on type '{}'. ==== axios.js (2 errors) ==== var axios = {} module.exports = axios // both assignments should be ok - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.default = axios - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~ +!!! error TS2339: Property 'default' does not exist on type '{}'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.symbols index b3e07920cc..49ff0d0d69 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.symbols @@ -5,8 +5,14 @@ var axios = {} >axios : Symbol(axios, Decl(axios.js, 0, 3)) module.exports = axios // both assignments should be ok +>module.exports : Symbol(axios, Decl(axios.js, 0, 3)) +>module : Symbol(module.exports) +>exports : Symbol(axios, Decl(axios.js, 0, 3)) >axios : Symbol(axios, Decl(axios.js, 0, 3)) module.exports.default = axios +>module.exports : Symbol(axios, Decl(axios.js, 0, 3)) +>module : Symbol(module.exports) +>exports : Symbol(axios, Decl(axios.js, 0, 3)) >axios : Symbol(axios, Decl(axios.js, 0, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.symbols.diff index e562ce5f53..83a0272583 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.symbols.diff @@ -7,6 +7,9 @@ ->module.exports : Symbol(module.exports, Decl(axios.js, 0, 0)) ->module : Symbol(export=, Decl(axios.js, 0, 14)) ->exports : Symbol(export=, Decl(axios.js, 0, 14)) ++>module.exports : Symbol(axios, Decl(axios.js, 0, 3)) ++>module : Symbol(module.exports) ++>exports : Symbol(axios, Decl(axios.js, 0, 3)) >axios : Symbol(axios, Decl(axios.js, 0, 3)) module.exports.default = axios @@ -15,5 +18,8 @@ ->module : Symbol(module, Decl(axios.js, 0, 14)) ->exports : Symbol(module.exports, Decl(axios.js, 0, 0)) ->default : Symbol(default, Decl(axios.js, 1, 22)) ++>module.exports : Symbol(axios, Decl(axios.js, 0, 3)) ++>module : Symbol(module.exports) ++>exports : Symbol(axios, Decl(axios.js, 0, 3)) >axios : Symbol(axios, Decl(axios.js, 0, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.types b/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.types index c512456469..722a2dd211 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportPropertyAssignmentDefault.types @@ -7,17 +7,17 @@ var axios = {} module.exports = axios // both assignments should be ok >module.exports = axios : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { axios: {}; } +>exports : {} >axios : {} module.exports.default = axios >module.exports.default = axios : {} >module.exports.default : any ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { axios: {}; } +>exports : {} >default : any >axios : {} diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.errors.txt new file mode 100644 index 0000000000..c062fa89da --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.errors.txt @@ -0,0 +1,26 @@ +a.js(4,6): error TS2339: Property 'f' does not exist on type '() => void'. +mod1.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +mod1.js(4,16): error TS2339: Property 'f' does not exist on type '() => void'. + + +==== a.js (1 errors) ==== + /// + var mod1 = require('./mod1') + mod1() + mod1.f() // error, not enough arguments + ~ +!!! error TS2339: Property 'f' does not exist on type '() => void'. + +==== requires.d.ts (0 errors) ==== + declare var module: { exports: any }; + declare function require(name: string): any; +==== mod1.js (2 errors) ==== + /// + module.exports = function () { } + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + /** @param {number} a */ + module.exports.f = function (a) { } + ~ +!!! error TS2339: Property 'f' does not exist on type '() => void'. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.symbols index e4165dbfd3..72949ef09f 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.symbols @@ -5,6 +5,7 @@ var mod1 = require('./mod1') >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) >require : Symbol(require, Decl(requires.d.ts, 0, 37)) +>'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) mod1() >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) @@ -21,3 +22,17 @@ declare function require(name: string): any; >require : Symbol(require, Decl(requires.d.ts, 0, 37)) >name : Symbol(name, Decl(requires.d.ts, 1, 25)) +=== mod1.js === +/// +module.exports = function () { } +>module.exports : Symbol(export=, Decl(mod1.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod1.js, 0, 0)) + +/** @param {number} a */ +module.exports.f = function (a) { } +>module.exports : Symbol(export=, Decl(mod1.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod1.js, 0, 0)) +>a : Symbol(a, Decl(mod1.js, 3, 29)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.symbols.diff index 2641b27d22..64f80186f9 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.symbols.diff @@ -1,12 +1,6 @@ --- old.moduleExportWithExportPropertyAssignment.symbols +++ new.moduleExportWithExportPropertyAssignment.symbols -@@= skipped -4, +4 lines =@@ - var mod1 = require('./mod1') - >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) - >require : Symbol(require, Decl(requires.d.ts, 0, 37)) -->'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) - - mod1() +@@= skipped -10, +10 lines =@@ >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) mod1.f() // error, not enough arguments @@ -16,23 +10,25 @@ === requires.d.ts === declare var module: { exports: any }; -@@= skipped -19, +16 lines =@@ - >require : Symbol(require, Decl(requires.d.ts, 0, 37)) - >name : Symbol(name, Decl(requires.d.ts, 1, 25)) - --=== mod1.js === --/// --module.exports = function () { } +@@= skipped -16, +14 lines =@@ + === mod1.js === + /// + module.exports = function () { } ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 0, 0)) -->exports : Symbol(export=, Decl(mod1.js, 0, 0)) -- --/** @param {number} a */ --module.exports.f = function (a) { } ++>module.exports : Symbol(export=, Decl(mod1.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(mod1.js, 0, 0)) + + /** @param {number} a */ + module.exports.f = function (a) { } ->module.exports.f : Symbol(f, Decl(mod1.js, 1, 32)) ->module.exports : Symbol(f, Decl(mod1.js, 1, 32)) ->module : Symbol(module, Decl(mod1.js, 0, 0)) ->exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->f : Symbol(f, Decl(mod1.js, 1, 32)) -->a : Symbol(a, Decl(mod1.js, 3, 29)) -- ++>module.exports : Symbol(export=, Decl(mod1.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(mod1.js, 0, 0)) + >a : Symbol(a, Decl(mod1.js, 3, 29)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.types b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.types index 7b6a08b939..045d5d5ffc 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment.types @@ -3,19 +3,19 @@ === a.js === /// var mod1 = require('./mod1') ->mod1 : any ->require('./mod1') : any +>mod1 : () => void +>require('./mod1') : () => void >require : (name: string) => any >'./mod1' : "./mod1" mod1() ->mod1() : any ->mod1 : any +>mod1() : void +>mod1 : () => void mod1.f() // error, not enough arguments >mod1.f() : any >mod1.f : any ->mod1 : any +>mod1 : () => void >f : any === requires.d.ts === @@ -27,3 +27,23 @@ declare function require(name: string): any; >require : (name: string) => any >name : string +=== mod1.js === +/// +module.exports = function () { } +>module.exports = function () { } : () => void +>module.exports : () => void +>module : { export=: () => void; } +>exports : () => void +>function () { } : () => void + +/** @param {number} a */ +module.exports.f = function (a) { } +>module.exports.f = function (a) { } : (a: any) => void +>module.exports.f : any +>module.exports : () => void +>module : { export=: () => void; } +>exports : () => void +>f : any +>function (a) { } : (a: any) => void +>a : any + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.errors.txt new file mode 100644 index 0000000000..7d5e2c2c91 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.errors.txt @@ -0,0 +1,25 @@ +a.js(4,6): error TS2339: Property 'f' does not exist on type '1'. +mod1.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +mod1.js(3,16): error TS2339: Property 'f' does not exist on type '1'. + + +==== a.js (1 errors) ==== + /// + var mod1 = require('./mod1') + mod1.toFixed(12) + mod1.f() // error, 'f' is not a property on 'number' + ~ +!!! error TS2339: Property 'f' does not exist on type '1'. + +==== requires.d.ts (0 errors) ==== + declare var module: { exports: any }; + declare function require(name: string): any; +==== mod1.js (2 errors) ==== + /// + module.exports = 1 + ~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.f = function () { } + ~ +!!! error TS2339: Property 'f' does not exist on type '1'. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.symbols index ba7038b6c4..ab4d96a505 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.symbols @@ -5,9 +5,12 @@ var mod1 = require('./mod1') >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) >require : Symbol(require, Decl(requires.d.ts, 0, 37)) +>'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) mod1.toFixed(12) +>mod1.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) +>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.f() // error, 'f' is not a property on 'number' >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) @@ -21,3 +24,15 @@ declare function require(name: string): any; >require : Symbol(require, Decl(requires.d.ts, 0, 37)) >name : Symbol(name, Decl(requires.d.ts, 1, 25)) +=== mod1.js === +/// +module.exports = 1 +>module.exports : Symbol(export=, Decl(mod1.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod1.js, 0, 0)) + +module.exports.f = function () { } +>module.exports : Symbol(export=, Decl(mod1.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod1.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.symbols.diff index d295bbb36a..bf1ddcf94b 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.symbols.diff @@ -1,32 +1,33 @@ --- old.moduleExportWithExportPropertyAssignment2.symbols +++ new.moduleExportWithExportPropertyAssignment2.symbols -@@= skipped -4, +4 lines =@@ - var mod1 = require('./mod1') - >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) - >require : Symbol(require, Decl(requires.d.ts, 0, 37)) -->'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) +@@= skipped -7, +7 lines =@@ + >'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) mod1.toFixed(12) ->mod1.toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --)) ++>mod1.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) ->toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --)) ++>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.f() // error, 'f' is not a property on 'number' >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) -@@= skipped -19, +16 lines =@@ - >require : Symbol(require, Decl(requires.d.ts, 0, 37)) - >name : Symbol(name, Decl(requires.d.ts, 1, 25)) - --=== mod1.js === --/// --module.exports = 1 +@@= skipped -19, +19 lines =@@ + === mod1.js === + /// + module.exports = 1 ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 0, 0)) -->exports : Symbol(export=, Decl(mod1.js, 0, 0)) -- --module.exports.f = function () { } ++>module.exports : Symbol(export=, Decl(mod1.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(mod1.js, 0, 0)) + + module.exports.f = function () { } ->module.exports : Symbol(f, Decl(mod1.js, 1, 18)) ->module : Symbol(module, Decl(mod1.js, 0, 0)) ->exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->f : Symbol(f, Decl(mod1.js, 1, 18)) -- ++>module.exports : Symbol(export=, Decl(mod1.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(mod1.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.types b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.types index 9ad71ecd6b..4c1240bb91 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment2.types @@ -3,22 +3,22 @@ === a.js === /// var mod1 = require('./mod1') ->mod1 : any ->require('./mod1') : any +>mod1 : 1 +>require('./mod1') : 1 >require : (name: string) => any >'./mod1' : "./mod1" mod1.toFixed(12) ->mod1.toFixed(12) : any ->mod1.toFixed : any ->mod1 : any ->toFixed : any +>mod1.toFixed(12) : string +>mod1.toFixed : (fractionDigits?: number) => string +>mod1 : 1 +>toFixed : (fractionDigits?: number) => string >12 : 12 mod1.f() // error, 'f' is not a property on 'number' >mod1.f() : any >mod1.f : any ->mod1 : any +>mod1 : 1 >f : any === requires.d.ts === @@ -30,3 +30,21 @@ declare function require(name: string): any; >require : (name: string) => any >name : string +=== mod1.js === +/// +module.exports = 1 +>module.exports = 1 : 1 +>module.exports : 1 +>module : { export=: 1; } +>exports : 1 +>1 : 1 + +module.exports.f = function () { } +>module.exports.f = function () { } : () => void +>module.exports.f : any +>module.exports : 1 +>module : { export=: 1; } +>exports : 1 +>f : any +>function () { } : () => void + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.errors.txt new file mode 100644 index 0000000000..0048e20c35 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.errors.txt @@ -0,0 +1,43 @@ +a.js(6,6): error TS2339: Property 'justProperty' does not exist on type '{ justExport: number; bothBefore: number; bothAfter: number; }'. +mod1.js(2,1): error TS2322: Type 'string' is not assignable to type 'number'. +mod1.js(3,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +mod1.js(8,1): error TS2322: Type 'string' is not assignable to type 'number'. +mod1.js(9,16): error TS2339: Property 'justProperty' does not exist on type '{ justExport: number; bothBefore: number; bothAfter: number; }'. + + +==== a.js (1 errors) ==== + /// + var mod1 = require('./mod1') + mod1.justExport.toFixed() + mod1.bothBefore.toFixed() // error, 'toFixed' not on 'string | number' + mod1.bothAfter.toFixed() // error, 'toFixed' not on 'string | number' + mod1.justProperty.length + ~~~~~~~~~~~~ +!!! error TS2339: Property 'justProperty' does not exist on type '{ justExport: number; bothBefore: number; bothAfter: number; }'. + +==== requires.d.ts (0 errors) ==== + declare var module: { exports: any }; + declare function require(name: string): any; +==== mod1.js (4 errors) ==== + /// + module.exports.bothBefore = 'string' + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + module.exports = { + ~~~~~~~~~~~~~~~~~~ + justExport: 1, + ~~~~~~~~~~~~~~~~~~ + bothBefore: 2, + ~~~~~~~~~~~~~~~~~~ + bothAfter: 3, + ~~~~~~~~~~~~~~~~~ + } + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.bothAfter = 'string' + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + module.exports.justProperty = 'string' + ~~~~~~~~~~~~ +!!! error TS2339: Property 'justProperty' does not exist on type '{ justExport: number; bothBefore: number; bothAfter: number; }'. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.symbols index 3ec55b9f3d..98651fb010 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.symbols @@ -5,15 +5,28 @@ var mod1 = require('./mod1') >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) >require : Symbol(require, Decl(requires.d.ts, 0, 37)) +>'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) mod1.justExport.toFixed() +>mod1.justExport.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) +>mod1.justExport : Symbol(justExport, Decl(mod1.js, 2, 18)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) +>justExport : Symbol(justExport, Decl(mod1.js, 2, 18)) +>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.bothBefore.toFixed() // error, 'toFixed' not on 'string | number' +>mod1.bothBefore.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) +>mod1.bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) +>bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18)) +>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.bothAfter.toFixed() // error, 'toFixed' not on 'string | number' +>mod1.bothAfter.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) +>mod1.bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) +>bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18)) +>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.justProperty.length >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) @@ -27,3 +40,38 @@ declare function require(name: string): any; >require : Symbol(require, Decl(requires.d.ts, 0, 37)) >name : Symbol(name, Decl(requires.d.ts, 1, 25)) +=== mod1.js === +/// +module.exports.bothBefore = 'string' +>module.exports.bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18)) +>module.exports : Symbol(export=, Decl(mod1.js, 1, 36)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod1.js, 1, 36)) +>bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18)) + +module.exports = { +>module.exports : Symbol(export=, Decl(mod1.js, 1, 36)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod1.js, 1, 36)) + + justExport: 1, +>justExport : Symbol(justExport, Decl(mod1.js, 2, 18)) + + bothBefore: 2, +>bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18)) + + bothAfter: 3, +>bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18)) +} +module.exports.bothAfter = 'string' +>module.exports.bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18)) +>module.exports : Symbol(export=, Decl(mod1.js, 1, 36)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod1.js, 1, 36)) +>bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18)) + +module.exports.justProperty = 'string' +>module.exports : Symbol(export=, Decl(mod1.js, 1, 36)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod1.js, 1, 36)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.symbols.diff index def365692f..f23086b23b 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.symbols.diff @@ -1,27 +1,34 @@ --- old.moduleExportWithExportPropertyAssignment3.symbols +++ new.moduleExportWithExportPropertyAssignment3.symbols -@@= skipped -4, +4 lines =@@ - var mod1 = require('./mod1') - >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) - >require : Symbol(require, Decl(requires.d.ts, 0, 37)) -->'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) +@@= skipped -7, +7 lines =@@ + >'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) mod1.justExport.toFixed() ->mod1.justExport.toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --)) -->mod1.justExport : Symbol(justExport, Decl(mod1.js, 2, 18)) ++>mod1.justExport.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) + >mod1.justExport : Symbol(justExport, Decl(mod1.js, 2, 18)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) -->justExport : Symbol(justExport, Decl(mod1.js, 2, 18)) + >justExport : Symbol(justExport, Decl(mod1.js, 2, 18)) ->toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --)) ++>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.bothBefore.toFixed() // error, 'toFixed' not on 'string | number' ->mod1.bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18), Decl(mod1.js, 0, 0)) ++>mod1.bothBefore.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) ++>mod1.bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) ->bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18), Decl(mod1.js, 0, 0)) ++>bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18)) ++>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.bothAfter.toFixed() // error, 'toFixed' not on 'string | number' ->mod1.bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18), Decl(mod1.js, 6, 1)) ++>mod1.bothAfter.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) ++>mod1.bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) ->bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18), Decl(mod1.js, 6, 1)) ++>bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18)) ++>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.justProperty.length ->mod1.justProperty.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) @@ -32,44 +39,51 @@ === requires.d.ts === declare var module: { exports: any }; -@@= skipped -35, +22 lines =@@ - >require : Symbol(require, Decl(requires.d.ts, 0, 37)) - >name : Symbol(name, Decl(requires.d.ts, 1, 25)) - --=== mod1.js === --/// --module.exports.bothBefore = 'string' +@@= skipped -35, +35 lines =@@ + === mod1.js === + /// + module.exports.bothBefore = 'string' ->module.exports.bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18), Decl(mod1.js, 0, 0)) ->module.exports : Symbol(bothBefore, Decl(mod1.js, 0, 0)) ->module : Symbol(module, Decl(mod1.js, 0, 0)) ->exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->bothBefore : Symbol(bothBefore, Decl(mod1.js, 0, 0)) -- --module.exports = { ++>module.exports.bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18)) ++>module.exports : Symbol(export=, Decl(mod1.js, 1, 36)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(mod1.js, 1, 36)) ++>bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18)) + + module.exports = { ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 1, 36)) -->exports : Symbol(export=, Decl(mod1.js, 1, 36)) -- -- justExport: 1, -->justExport : Symbol(justExport, Decl(mod1.js, 2, 18)) -- -- bothBefore: 2, -->bothBefore : Symbol(bothBefore, Decl(mod1.js, 3, 18)) -- -- bothAfter: 3, -->bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18)) --} --module.exports.bothAfter = 'string' ++>module.exports : Symbol(export=, Decl(mod1.js, 1, 36)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(mod1.js, 1, 36)) + + justExport: 1, +@@= skipped -21, +21 lines =@@ + >bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18)) + } + module.exports.bothAfter = 'string' ->module.exports.bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18), Decl(mod1.js, 6, 1)) ->module.exports : Symbol(bothAfter, Decl(mod1.js, 6, 1)) ->module : Symbol(module, Decl(mod1.js, 0, 0)) ->exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->bothAfter : Symbol(bothAfter, Decl(mod1.js, 6, 1)) -- --module.exports.justProperty = 'string' ++>module.exports.bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18)) ++>module.exports : Symbol(export=, Decl(mod1.js, 1, 36)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(mod1.js, 1, 36)) ++>bothAfter : Symbol(bothAfter, Decl(mod1.js, 4, 18)) + + module.exports.justProperty = 'string' ->module.exports.justProperty : Symbol(justProperty, Decl(mod1.js, 7, 35)) ->module.exports : Symbol(justProperty, Decl(mod1.js, 7, 35)) ->module : Symbol(module, Decl(mod1.js, 0, 0)) ->exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->justProperty : Symbol(justProperty, Decl(mod1.js, 7, 35)) -- ++>module.exports : Symbol(export=, Decl(mod1.js, 1, 36)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(mod1.js, 1, 36)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.types b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.types index 0e664abaaa..e11ea3eede 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment3.types @@ -3,39 +3,39 @@ === a.js === /// var mod1 = require('./mod1') ->mod1 : any ->require('./mod1') : any +>mod1 : { justExport: number; bothBefore: number; bothAfter: number; } +>require('./mod1') : { justExport: number; bothBefore: number; bothAfter: number; } >require : (name: string) => any >'./mod1' : "./mod1" mod1.justExport.toFixed() ->mod1.justExport.toFixed() : any ->mod1.justExport.toFixed : any ->mod1.justExport : any ->mod1 : any ->justExport : any ->toFixed : any +>mod1.justExport.toFixed() : string +>mod1.justExport.toFixed : (fractionDigits?: number) => string +>mod1.justExport : number +>mod1 : { justExport: number; bothBefore: number; bothAfter: number; } +>justExport : number +>toFixed : (fractionDigits?: number) => string mod1.bothBefore.toFixed() // error, 'toFixed' not on 'string | number' ->mod1.bothBefore.toFixed() : any ->mod1.bothBefore.toFixed : any ->mod1.bothBefore : any ->mod1 : any ->bothBefore : any ->toFixed : any +>mod1.bothBefore.toFixed() : string +>mod1.bothBefore.toFixed : (fractionDigits?: number) => string +>mod1.bothBefore : number +>mod1 : { justExport: number; bothBefore: number; bothAfter: number; } +>bothBefore : number +>toFixed : (fractionDigits?: number) => string mod1.bothAfter.toFixed() // error, 'toFixed' not on 'string | number' ->mod1.bothAfter.toFixed() : any ->mod1.bothAfter.toFixed : any ->mod1.bothAfter : any ->mod1 : any ->bothAfter : any ->toFixed : any +>mod1.bothAfter.toFixed() : string +>mod1.bothAfter.toFixed : (fractionDigits?: number) => string +>mod1.bothAfter : number +>mod1 : { justExport: number; bothBefore: number; bothAfter: number; } +>bothAfter : number +>toFixed : (fractionDigits?: number) => string mod1.justProperty.length >mod1.justProperty.length : any >mod1.justProperty : any ->mod1 : any +>mod1 : { justExport: number; bothBefore: number; bothAfter: number; } >justProperty : any >length : any @@ -48,3 +48,51 @@ declare function require(name: string): any; >require : (name: string) => any >name : string +=== mod1.js === +/// +module.exports.bothBefore = 'string' +>module.exports.bothBefore = 'string' : "string" +>module.exports.bothBefore : number +>module.exports : { justExport: number; bothBefore: number; bothAfter: number; } +>module : { export=: { justExport: number; bothBefore: number; bothAfter: number; }; } +>exports : { justExport: number; bothBefore: number; bothAfter: number; } +>bothBefore : number +>'string' : "string" + +module.exports = { +>module.exports = { justExport: 1, bothBefore: 2, bothAfter: 3,} : { justExport: number; bothBefore: number; bothAfter: number; } +>module.exports : { justExport: number; bothBefore: number; bothAfter: number; } +>module : { export=: { justExport: number; bothBefore: number; bothAfter: number; }; } +>exports : { justExport: number; bothBefore: number; bothAfter: number; } +>{ justExport: 1, bothBefore: 2, bothAfter: 3,} : { justExport: number; bothBefore: number; bothAfter: number; } + + justExport: 1, +>justExport : number +>1 : 1 + + bothBefore: 2, +>bothBefore : number +>2 : 2 + + bothAfter: 3, +>bothAfter : number +>3 : 3 +} +module.exports.bothAfter = 'string' +>module.exports.bothAfter = 'string' : "string" +>module.exports.bothAfter : number +>module.exports : { justExport: number; bothBefore: number; bothAfter: number; } +>module : { export=: { justExport: number; bothBefore: number; bothAfter: number; }; } +>exports : { justExport: number; bothBefore: number; bothAfter: number; } +>bothAfter : number +>'string' : "string" + +module.exports.justProperty = 'string' +>module.exports.justProperty = 'string' : "string" +>module.exports.justProperty : any +>module.exports : { justExport: number; bothBefore: number; bothAfter: number; } +>module : { export=: { justExport: number; bothBefore: number; bothAfter: number; }; } +>exports : { justExport: number; bothBefore: number; bothAfter: number; } +>justProperty : any +>'string' : "string" + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.errors.txt new file mode 100644 index 0000000000..040e68925d --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.errors.txt @@ -0,0 +1,41 @@ +a.js(6,6): error TS2339: Property 'justProperty' does not exist on type '{ (): void; justExport: number; bothBefore: number; bothAfter: number; }'. +mod1.js(2,1): error TS2322: Type 'string' is not assignable to type 'number'. +mod1.js(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +mod1.js(10,1): error TS2322: Type 'string' is not assignable to type 'number'. +mod1.js(11,16): error TS2339: Property 'justProperty' does not exist on type '{ (): void; justExport: number; bothBefore: number; bothAfter: number; }'. + + +==== a.js (1 errors) ==== + /// + var mod1 = require('./mod1') + mod1.justExport.toFixed() + mod1.bothBefore.toFixed() // error + mod1.bothAfter.toFixed() + mod1.justProperty.length + ~~~~~~~~~~~~ +!!! error TS2339: Property 'justProperty' does not exist on type '{ (): void; justExport: number; bothBefore: number; bothAfter: number; }'. + +==== requires.d.ts (0 errors) ==== + declare var module: { exports: any }; + declare function require(name: string): any; +==== mod1.js (4 errors) ==== + /// + module.exports.bothBefore = 'string' + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + A.justExport = 4 + A.bothBefore = 2 + A.bothAfter = 3 + module.exports = A + ~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + function A() { + this.p = 1 + } + module.exports.bothAfter = 'string' + ~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2322: Type 'string' is not assignable to type 'number'. + module.exports.justProperty = 'string' + ~~~~~~~~~~~~ +!!! error TS2339: Property 'justProperty' does not exist on type '{ (): void; justExport: number; bothBefore: number; bothAfter: number; }'. + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.symbols index 0c8025b781..b236c055da 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.symbols @@ -5,15 +5,28 @@ var mod1 = require('./mod1') >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) >require : Symbol(require, Decl(requires.d.ts, 0, 37)) +>'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) mod1.justExport.toFixed() +>mod1.justExport.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) +>mod1.justExport : Symbol(justExport, Decl(mod1.js, 1, 36)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) +>justExport : Symbol(justExport, Decl(mod1.js, 1, 36)) +>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.bothBefore.toFixed() // error +>mod1.bothBefore.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) +>mod1.bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) +>bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) +>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.bothAfter.toFixed() +>mod1.bothAfter.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) +>mod1.bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) +>bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) +>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.justProperty.length >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) @@ -27,3 +40,50 @@ declare function require(name: string): any; >require : Symbol(require, Decl(requires.d.ts, 0, 37)) >name : Symbol(name, Decl(requires.d.ts, 1, 25)) +=== mod1.js === +/// +module.exports.bothBefore = 'string' +>module.exports.bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) +>module.exports : Symbol(A, Decl(mod1.js, 5, 18)) +>module : Symbol(module.exports) +>exports : Symbol(A, Decl(mod1.js, 5, 18)) +>bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) + +A.justExport = 4 +>A.justExport : Symbol(justExport, Decl(mod1.js, 1, 36)) +>A : Symbol(A, Decl(mod1.js, 5, 18)) +>justExport : Symbol(justExport, Decl(mod1.js, 1, 36)) + +A.bothBefore = 2 +>A.bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) +>A : Symbol(A, Decl(mod1.js, 5, 18)) +>bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) + +A.bothAfter = 3 +>A.bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) +>A : Symbol(A, Decl(mod1.js, 5, 18)) +>bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) + +module.exports = A +>module.exports : Symbol(A, Decl(mod1.js, 5, 18)) +>module : Symbol(module.exports) +>exports : Symbol(A, Decl(mod1.js, 5, 18)) +>A : Symbol(A, Decl(mod1.js, 5, 18)) + +function A() { +>A : Symbol(A, Decl(mod1.js, 5, 18)) + + this.p = 1 +} +module.exports.bothAfter = 'string' +>module.exports.bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) +>module.exports : Symbol(A, Decl(mod1.js, 5, 18)) +>module : Symbol(module.exports) +>exports : Symbol(A, Decl(mod1.js, 5, 18)) +>bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) + +module.exports.justProperty = 'string' +>module.exports : Symbol(A, Decl(mod1.js, 5, 18)) +>module : Symbol(module.exports) +>exports : Symbol(A, Decl(mod1.js, 5, 18)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.symbols.diff index c05536648a..db17845530 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.symbols.diff @@ -1,27 +1,36 @@ --- old.moduleExportWithExportPropertyAssignment4.symbols +++ new.moduleExportWithExportPropertyAssignment4.symbols -@@= skipped -4, +4 lines =@@ - var mod1 = require('./mod1') - >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) - >require : Symbol(require, Decl(requires.d.ts, 0, 37)) -->'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) +@@= skipped -7, +7 lines =@@ + >'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) mod1.justExport.toFixed() ->mod1.justExport.toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --)) ->mod1.justExport : Symbol(mod1.justExport, Decl(mod1.js, 1, 36)) ++>mod1.justExport.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) ++>mod1.justExport : Symbol(justExport, Decl(mod1.js, 1, 36)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) ->justExport : Symbol(mod1.justExport, Decl(mod1.js, 1, 36)) ->toFixed : Symbol(Number.toFixed, Decl(lib.es5.d.ts, --, --)) ++>justExport : Symbol(justExport, Decl(mod1.js, 1, 36)) ++>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.bothBefore.toFixed() // error ->mod1.bothBefore : Symbol(mod1.bothBefore, Decl(mod1.js, 2, 16), Decl(mod1.js, 0, 0)) ++>mod1.bothBefore.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) ++>mod1.bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) ->bothBefore : Symbol(mod1.bothBefore, Decl(mod1.js, 2, 16), Decl(mod1.js, 0, 0)) ++>bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) ++>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.bothAfter.toFixed() ->mod1.bothAfter : Symbol(mod1.bothAfter, Decl(mod1.js, 3, 16), Decl(mod1.js, 8, 1)) ++>mod1.bothAfter.toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) ++>mod1.bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) >mod1 : Symbol(mod1, Decl(a.js, 1, 3)) ->bothAfter : Symbol(mod1.bothAfter, Decl(mod1.js, 3, 16), Decl(mod1.js, 8, 1)) ++>bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) ++>toFixed : Symbol(toFixed, Decl(lib.es5.d.ts, --, --)) mod1.justProperty.length ->mod1.justProperty.length : Symbol(String.length, Decl(lib.es5.d.ts, --, --)) @@ -32,59 +41,83 @@ === requires.d.ts === declare var module: { exports: any }; -@@= skipped -35, +22 lines =@@ - >require : Symbol(require, Decl(requires.d.ts, 0, 37)) - >name : Symbol(name, Decl(requires.d.ts, 1, 25)) - --=== mod1.js === --/// --module.exports.bothBefore = 'string' +@@= skipped -35, +35 lines =@@ + === mod1.js === + /// + module.exports.bothBefore = 'string' ->module.exports.bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16), Decl(mod1.js, 0, 0)) ->module.exports : Symbol(bothBefore, Decl(mod1.js, 2, 16), Decl(mod1.js, 0, 0)) ->module : Symbol(module, Decl(mod1.js, 0, 0)) ->exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16), Decl(mod1.js, 0, 0)) -- --A.justExport = 4 ++>module.exports.bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) ++>module.exports : Symbol(A, Decl(mod1.js, 5, 18)) ++>module : Symbol(module.exports) ++>exports : Symbol(A, Decl(mod1.js, 5, 18)) ++>bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) + + A.justExport = 4 ->A.justExport : Symbol(A.justExport, Decl(mod1.js, 1, 36)) ->A : Symbol(A, Decl(mod1.js, 5, 18), Decl(mod1.js, 1, 36), Decl(mod1.js, 2, 16), Decl(mod1.js, 3, 16)) ->justExport : Symbol(A.justExport, Decl(mod1.js, 1, 36)) -- --A.bothBefore = 2 ++>A.justExport : Symbol(justExport, Decl(mod1.js, 1, 36)) ++>A : Symbol(A, Decl(mod1.js, 5, 18)) ++>justExport : Symbol(justExport, Decl(mod1.js, 1, 36)) + + A.bothBefore = 2 ->A.bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16), Decl(mod1.js, 0, 0)) ->A : Symbol(A, Decl(mod1.js, 5, 18), Decl(mod1.js, 1, 36), Decl(mod1.js, 2, 16), Decl(mod1.js, 3, 16)) ->bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16), Decl(mod1.js, 0, 0)) -- --A.bothAfter = 3 ++>A.bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) ++>A : Symbol(A, Decl(mod1.js, 5, 18)) ++>bothBefore : Symbol(bothBefore, Decl(mod1.js, 2, 16)) + + A.bothAfter = 3 ->A.bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16), Decl(mod1.js, 8, 1)) ->A : Symbol(A, Decl(mod1.js, 5, 18), Decl(mod1.js, 1, 36), Decl(mod1.js, 2, 16), Decl(mod1.js, 3, 16)) ->bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16), Decl(mod1.js, 8, 1)) -- --module.exports = A ++>A.bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) ++>A : Symbol(A, Decl(mod1.js, 5, 18)) ++>bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) + + module.exports = A ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 4, 15)) ->exports : Symbol(export=, Decl(mod1.js, 4, 15)) ->A : Symbol(A, Decl(mod1.js, 5, 18), Decl(mod1.js, 1, 36), Decl(mod1.js, 2, 16), Decl(mod1.js, 3, 16)) -- --function A() { ++>module.exports : Symbol(A, Decl(mod1.js, 5, 18)) ++>module : Symbol(module.exports) ++>exports : Symbol(A, Decl(mod1.js, 5, 18)) ++>A : Symbol(A, Decl(mod1.js, 5, 18)) + + function A() { ->A : Symbol(A, Decl(mod1.js, 5, 18), Decl(mod1.js, 1, 36), Decl(mod1.js, 2, 16), Decl(mod1.js, 3, 16)) -- -- this.p = 1 ++>A : Symbol(A, Decl(mod1.js, 5, 18)) + + this.p = 1 ->this.p : Symbol(A.p, Decl(mod1.js, 6, 14)) ->this : Symbol(A, Decl(mod1.js, 5, 18), Decl(mod1.js, 1, 36), Decl(mod1.js, 2, 16), Decl(mod1.js, 3, 16)) ->p : Symbol(A.p, Decl(mod1.js, 6, 14)) --} --module.exports.bothAfter = 'string' + } + module.exports.bothAfter = 'string' ->module.exports.bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16), Decl(mod1.js, 8, 1)) ->module.exports : Symbol(bothAfter, Decl(mod1.js, 3, 16), Decl(mod1.js, 8, 1)) ->module : Symbol(module, Decl(mod1.js, 0, 0)) ->exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16), Decl(mod1.js, 8, 1)) -- --module.exports.justProperty = 'string' ++>module.exports.bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) ++>module.exports : Symbol(A, Decl(mod1.js, 5, 18)) ++>module : Symbol(module.exports) ++>exports : Symbol(A, Decl(mod1.js, 5, 18)) ++>bothAfter : Symbol(bothAfter, Decl(mod1.js, 3, 16)) + + module.exports.justProperty = 'string' ->module.exports.justProperty : Symbol(justProperty, Decl(mod1.js, 9, 35)) ->module.exports : Symbol(justProperty, Decl(mod1.js, 9, 35)) ->module : Symbol(module, Decl(mod1.js, 0, 0)) ->exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->justProperty : Symbol(justProperty, Decl(mod1.js, 9, 35)) -- ++>module.exports : Symbol(A, Decl(mod1.js, 5, 18)) ++>module : Symbol(module.exports) ++>exports : Symbol(A, Decl(mod1.js, 5, 18)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.types b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.types index 7dc08c6e6c..48e342babc 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportWithExportPropertyAssignment4.types @@ -3,39 +3,39 @@ === a.js === /// var mod1 = require('./mod1') ->mod1 : any ->require('./mod1') : any +>mod1 : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>require('./mod1') : { (): void; justExport: number; bothBefore: number; bothAfter: number; } >require : (name: string) => any >'./mod1' : "./mod1" mod1.justExport.toFixed() ->mod1.justExport.toFixed() : any ->mod1.justExport.toFixed : any ->mod1.justExport : any ->mod1 : any ->justExport : any ->toFixed : any +>mod1.justExport.toFixed() : string +>mod1.justExport.toFixed : (fractionDigits?: number) => string +>mod1.justExport : number +>mod1 : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>justExport : number +>toFixed : (fractionDigits?: number) => string mod1.bothBefore.toFixed() // error ->mod1.bothBefore.toFixed() : any ->mod1.bothBefore.toFixed : any ->mod1.bothBefore : any ->mod1 : any ->bothBefore : any ->toFixed : any +>mod1.bothBefore.toFixed() : string +>mod1.bothBefore.toFixed : (fractionDigits?: number) => string +>mod1.bothBefore : number +>mod1 : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>bothBefore : number +>toFixed : (fractionDigits?: number) => string mod1.bothAfter.toFixed() ->mod1.bothAfter.toFixed() : any ->mod1.bothAfter.toFixed : any ->mod1.bothAfter : any ->mod1 : any ->bothAfter : any ->toFixed : any +>mod1.bothAfter.toFixed() : string +>mod1.bothAfter.toFixed : (fractionDigits?: number) => string +>mod1.bothAfter : number +>mod1 : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>bothAfter : number +>toFixed : (fractionDigits?: number) => string mod1.justProperty.length >mod1.justProperty.length : any >mod1.justProperty : any ->mod1 : any +>mod1 : { (): void; justExport: number; bothBefore: number; bothAfter: number; } >justProperty : any >length : any @@ -48,3 +48,70 @@ declare function require(name: string): any; >require : (name: string) => any >name : string +=== mod1.js === +/// +module.exports.bothBefore = 'string' +>module.exports.bothBefore = 'string' : "string" +>module.exports.bothBefore : number +>module.exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>module : { A: { (): void; justExport: number; bothBefore: number; bothAfter: number; }; } +>exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>bothBefore : number +>'string' : "string" + +A.justExport = 4 +>A.justExport = 4 : 4 +>A.justExport : number +>A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>justExport : number +>4 : 4 + +A.bothBefore = 2 +>A.bothBefore = 2 : 2 +>A.bothBefore : number +>A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>bothBefore : number +>2 : 2 + +A.bothAfter = 3 +>A.bothAfter = 3 : 3 +>A.bothAfter : number +>A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>bothAfter : number +>3 : 3 + +module.exports = A +>module.exports = A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>module.exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>module : { A: { (): void; justExport: number; bothBefore: number; bothAfter: number; }; } +>exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } + +function A() { +>A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } + + this.p = 1 +>this.p = 1 : 1 +>this.p : any +>this : any +>p : any +>1 : 1 +} +module.exports.bothAfter = 'string' +>module.exports.bothAfter = 'string' : "string" +>module.exports.bothAfter : number +>module.exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>module : { A: { (): void; justExport: number; bothBefore: number; bothAfter: number; }; } +>exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>bothAfter : number +>'string' : "string" + +module.exports.justProperty = 'string' +>module.exports.justProperty = 'string' : "string" +>module.exports.justProperty : any +>module.exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>module : { A: { (): void; justExport: number; bothBefore: number; bothAfter: number; }; } +>exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>justProperty : any +>'string' : "string" + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.errors.txt index 70acbdf85d..d6acb840da 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.errors.txt @@ -1,12 +1,9 @@ -x.js(1,1): error TS2304: Cannot find name 'exports'. -x.js(2,1): error TS2304: Cannot find name 'exports'. +x.js(1,9): error TS2339: Property 'fn1' does not exist on type 'typeof import("x")'. -==== x.js (2 errors) ==== +==== x.js (1 errors) ==== exports.fn1(); - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~ +!!! error TS2339: Property 'fn1' does not exist on type 'typeof import("x")'. exports.fn2 = Math.min; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.symbols index 96e0273f97..e84a9092b8 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.symbols @@ -2,7 +2,12 @@ === x.js === exports.fn1(); +>exports : Symbol("x", Decl(x.js, 0, 0)) + exports.fn2 = Math.min; +>exports.fn2 : Symbol(fn2, Decl(x.js, 0, 14)) +>exports : Symbol("x", Decl(x.js, 0, 0)) +>fn2 : Symbol(fn2, Decl(x.js, 0, 14)) >Math.min : Symbol(min, Decl(lib.es5.d.ts, --, --)) >Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) >min : Symbol(min, Decl(lib.es5.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.symbols.diff index ea72cd41f4..80300e13aa 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.symbols.diff @@ -1,15 +1,12 @@ --- old.moduleExportsAliasLoop1.symbols +++ new.moduleExportsAliasLoop1.symbols -@@= skipped -1, +1 lines =@@ +@@= skipped -5, +5 lines =@@ - === x.js === - exports.fn1(); -->exports : Symbol("x", Decl(x.js, 0, 0)) -- exports.fn2 = Math.min; -->exports.fn2 : Symbol(fn2, Decl(x.js, 0, 14)) + >exports.fn2 : Symbol(fn2, Decl(x.js, 0, 14)) ->exports : Symbol(fn2, Decl(x.js, 0, 14)) -->fn2 : Symbol(fn2, Decl(x.js, 0, 14)) ++>exports : Symbol("x", Decl(x.js, 0, 0)) + >fn2 : Symbol(fn2, Decl(x.js, 0, 14)) ->Math.min : Symbol(fn2, Decl(lib.es5.d.ts, --, --)) +>Math.min : Symbol(min, Decl(lib.es5.d.ts, --, --)) >Math : Symbol(Math, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.types b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.types index 26164e9ac6..7a1be8e9a5 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop1.types @@ -4,14 +4,14 @@ exports.fn1(); >exports.fn1() : any >exports.fn1 : any ->exports : any +>exports : typeof import("x") >fn1 : any exports.fn2 = Math.min; >exports.fn2 = Math.min : (...values: number[]) => number ->exports.fn2 : any ->exports : any ->fn2 : any +>exports.fn2 : (...values: number[]) => number +>exports : typeof import("x") +>fn2 : (...values: number[]) => number >Math.min : (...values: number[]) => number >Math : Math >min : (...values: number[]) => number diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.errors.txt index 5e7d0f2073..51a78fbd94 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.errors.txt @@ -1,13 +1,10 @@ -x.js(2,1): error TS2304: Cannot find name 'exports'. -x.js(3,1): error TS2304: Cannot find name 'exports'. +x.js(2,9): error TS2339: Property 'fn1' does not exist on type 'typeof import("x")'. -==== x.js (2 errors) ==== +==== x.js (1 errors) ==== const Foo = { min: 3 }; exports.fn1(); - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. + ~~~ +!!! error TS2339: Property 'fn1' does not exist on type 'typeof import("x")'. exports.fn2 = Foo.min; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.symbols index 7b7c2c8bc7..ff10ba4871 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.symbols @@ -6,7 +6,12 @@ const Foo = { min: 3 }; >min : Symbol(min, Decl(x.js, 0, 13)) exports.fn1(); +>exports : Symbol("x", Decl(x.js, 0, 0)) + exports.fn2 = Foo.min; +>exports.fn2 : Symbol(fn2, Decl(x.js, 1, 14)) +>exports : Symbol("x", Decl(x.js, 0, 0)) +>fn2 : Symbol(fn2, Decl(x.js, 1, 14)) >Foo.min : Symbol(min, Decl(x.js, 0, 13)) >Foo : Symbol(Foo, Decl(x.js, 0, 5)) >min : Symbol(min, Decl(x.js, 0, 13)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.symbols.diff index 3473070e7a..993a8adfce 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.symbols.diff @@ -1,15 +1,12 @@ --- old.moduleExportsAliasLoop2.symbols +++ new.moduleExportsAliasLoop2.symbols -@@= skipped -5, +5 lines =@@ - >min : Symbol(min, Decl(x.js, 0, 13)) +@@= skipped -9, +9 lines =@@ - exports.fn1(); -->exports : Symbol("x", Decl(x.js, 0, 0)) -- exports.fn2 = Foo.min; -->exports.fn2 : Symbol(fn2, Decl(x.js, 1, 14)) + >exports.fn2 : Symbol(fn2, Decl(x.js, 1, 14)) ->exports : Symbol(fn2, Decl(x.js, 1, 14)) -->fn2 : Symbol(fn2, Decl(x.js, 1, 14)) ++>exports : Symbol("x", Decl(x.js, 0, 0)) + >fn2 : Symbol(fn2, Decl(x.js, 1, 14)) ->Foo.min : Symbol(fn2, Decl(x.js, 0, 13)) +>Foo.min : Symbol(min, Decl(x.js, 0, 13)) >Foo : Symbol(Foo, Decl(x.js, 0, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.types b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.types index 24a15bcdeb..cc2605b18b 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsAliasLoop2.types @@ -10,14 +10,14 @@ const Foo = { min: 3 }; exports.fn1(); >exports.fn1() : any >exports.fn1 : any ->exports : any +>exports : typeof import("x") >fn1 : any exports.fn2 = Foo.min; >exports.fn2 = Foo.min : number ->exports.fn2 : any ->exports : any ->fn2 : any +>exports.fn2 : number +>exports : typeof import("x") +>fn2 : number >Foo.min : number >Foo : { min: number; } >min : number diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.errors.txt b/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.errors.txt index d38030001c..ef452d142a 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.errors.txt @@ -1,21 +1,33 @@ -mod2.js(1,14): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod1.js(1,1): error TS7022: 'a' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +mod1.js(2,1): error TS7022: 'b' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +mod1.js(3,1): error TS7022: 'default' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +mod1.js(4,1): error TS7022: 'c' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +mod1.js(5,1): error TS7022: 'd' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. -==== mod2.js (1 errors) ==== +==== mod2.js (0 errors) ==== const mod1 = require("./mod1"); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. mod1.a; mod1.b; mod1.c; mod1.d; mod1.d.e; mod1.default; -==== mod1.js (0 errors) ==== +==== mod1.js (5 errors) ==== exports.a = { x: "x" }; + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS7022: 'a' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. exports["b"] = { x: "x" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS7022: 'b' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. exports["default"] = { x: "x" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS7022: 'default' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. module.exports["c"] = { x: "x" }; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS7022: 'c' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. module["exports"]["d"] = {}; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS7022: 'd' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. module["exports"]["d"].e = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.symbols b/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.symbols index 98860f7fb0..9d811c45e0 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.symbols +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.symbols @@ -3,22 +3,70 @@ === mod2.js === const mod1 = require("./mod1"); >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) +>require : Symbol(require) +>"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) mod1.a; +>mod1.a : Symbol(a, Decl(mod1.js, 0, 0)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) +>a : Symbol(a, Decl(mod1.js, 0, 0)) mod1.b; +>mod1.b : Symbol(b, Decl(mod1.js, 0, 23)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) +>b : Symbol(b, Decl(mod1.js, 0, 23)) mod1.c; +>mod1.c : Symbol(c, Decl(mod1.js, 2, 32)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) +>c : Symbol(c, Decl(mod1.js, 2, 32)) mod1.d; +>mod1.d : Symbol(d, Decl(mod1.js, 3, 33)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) +>d : Symbol(d, Decl(mod1.js, 3, 33)) mod1.d.e; +>mod1.d : Symbol(d, Decl(mod1.js, 3, 33)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) +>d : Symbol(d, Decl(mod1.js, 3, 33)) mod1.default; +>mod1.default : Symbol(default, Decl(mod1.js, 1, 26)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) +>default : Symbol(default, Decl(mod1.js, 1, 26)) + +=== mod1.js === +exports.a = { x: "x" }; +>exports.a : Symbol(a, Decl(mod1.js, 0, 0)) +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>a : Symbol(a, Decl(mod1.js, 0, 0)) +>x : Symbol(x, Decl(mod1.js, 0, 13)) + +exports["b"] = { x: "x" }; +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>"b" : Symbol(b, Decl(mod1.js, 0, 23)) +>x : Symbol(x, Decl(mod1.js, 1, 16)) + +exports["default"] = { x: "x" }; +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>"default" : Symbol(default, Decl(mod1.js, 1, 26)) +>x : Symbol(x, Decl(mod1.js, 2, 22)) + +module.exports["c"] = { x: "x" }; +>module.exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>"c" : Symbol(c, Decl(mod1.js, 2, 32)) +>x : Symbol(x, Decl(mod1.js, 3, 23)) + +module["exports"]["d"] = {}; +>module : Symbol(module.exports) +>"exports" : Symbol("mod1", Decl(mod1.js, 0, 0)) +>"d" : Symbol(d, Decl(mod1.js, 3, 33)) + +module["exports"]["d"].e = 0; +>module : Symbol(module.exports) +>"exports" : Symbol("mod1", Decl(mod1.js, 0, 0)) +>"d" : Symbol(d, Decl(mod1.js, 3, 33)) diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.symbols.diff b/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.symbols.diff index c4fd0bc067..a5c9f44c23 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.symbols.diff @@ -1,77 +1,102 @@ --- old.moduleExportsElementAccessAssignment.symbols +++ new.moduleExportsElementAccessAssignment.symbols -@@= skipped -2, +2 lines =@@ - === mod2.js === +@@= skipped -3, +3 lines =@@ const mod1 = require("./mod1"); >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->"./mod1" : Symbol(mod1, Decl(mod1.js, 0, 0)) ++>"./mod1" : Symbol("mod1", Decl(mod1.js, 0, 0)) mod1.a; ->mod1.a : Symbol(mod1.a, Decl(mod1.js, 0, 0)) ++>mod1.a : Symbol(a, Decl(mod1.js, 0, 0)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) ->a : Symbol(mod1.a, Decl(mod1.js, 0, 0)) ++>a : Symbol(a, Decl(mod1.js, 0, 0)) mod1.b; ->mod1.b : Symbol(mod1["b"], Decl(mod1.js, 0, 23)) ++>mod1.b : Symbol(b, Decl(mod1.js, 0, 23)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) ->b : Symbol(mod1["b"], Decl(mod1.js, 0, 23)) ++>b : Symbol(b, Decl(mod1.js, 0, 23)) mod1.c; ->mod1.c : Symbol(mod1["c"], Decl(mod1.js, 2, 32)) ++>mod1.c : Symbol(c, Decl(mod1.js, 2, 32)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) ->c : Symbol(mod1["c"], Decl(mod1.js, 2, 32)) ++>c : Symbol(c, Decl(mod1.js, 2, 32)) mod1.d; ->mod1.d : Symbol(mod1["d"], Decl(mod1.js, 3, 33), Decl(mod1.js, 5, 18)) ++>mod1.d : Symbol(d, Decl(mod1.js, 3, 33)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) ->d : Symbol(mod1["d"], Decl(mod1.js, 3, 33), Decl(mod1.js, 5, 18)) ++>d : Symbol(d, Decl(mod1.js, 3, 33)) mod1.d.e; ->mod1.d.e : Symbol(mod1["d"].e, Decl(mod1.js, 4, 28)) ->mod1.d : Symbol(mod1["d"], Decl(mod1.js, 3, 33), Decl(mod1.js, 5, 18)) ++>mod1.d : Symbol(d, Decl(mod1.js, 3, 33)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) ->d : Symbol(mod1["d"], Decl(mod1.js, 3, 33), Decl(mod1.js, 5, 18)) ->e : Symbol(mod1["d"].e, Decl(mod1.js, 4, 28)) ++>d : Symbol(d, Decl(mod1.js, 3, 33)) mod1.default; ->mod1.default : Symbol(mod1.default, Decl(mod1.js, 1, 26)) ++>mod1.default : Symbol(default, Decl(mod1.js, 1, 26)) >mod1 : Symbol(mod1, Decl(mod2.js, 0, 5)) ->default : Symbol(mod1.default, Decl(mod1.js, 1, 26)) ++>default : Symbol(default, Decl(mod1.js, 1, 26)) --=== mod1.js === --exports.a = { x: "x" }; -->exports.a : Symbol(a, Decl(mod1.js, 0, 0)) + === mod1.js === + exports.a = { x: "x" }; + >exports.a : Symbol(a, Decl(mod1.js, 0, 0)) ->exports : Symbol(a, Decl(mod1.js, 0, 0)) -->a : Symbol(a, Decl(mod1.js, 0, 0)) -->x : Symbol(x, Decl(mod1.js, 0, 13)) -- --exports["b"] = { x: "x" }; -->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ++>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) + >a : Symbol(a, Decl(mod1.js, 0, 0)) + >x : Symbol(x, Decl(mod1.js, 0, 13)) + + exports["b"] = { x: "x" }; + >exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ->"b" : Symbol("b", Decl(mod1.js, 0, 23)) -->x : Symbol(x, Decl(mod1.js, 1, 16)) -- --exports["default"] = { x: "x" }; -->exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ++>"b" : Symbol(b, Decl(mod1.js, 0, 23)) + >x : Symbol(x, Decl(mod1.js, 1, 16)) + + exports["default"] = { x: "x" }; + >exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ->"default" : Symbol("default", Decl(mod1.js, 1, 26)) -->x : Symbol(x, Decl(mod1.js, 2, 22)) -- --module.exports["c"] = { x: "x" }; ++>"default" : Symbol(default, Decl(mod1.js, 1, 26)) + >x : Symbol(x, Decl(mod1.js, 2, 22)) + + module.exports["c"] = { x: "x" }; ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(module, Decl(mod1.js, 2, 32)) ->exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->"c" : Symbol("c", Decl(mod1.js, 2, 32)) -->x : Symbol(x, Decl(mod1.js, 3, 23)) -- --module["exports"]["d"] = {}; ++>module.exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ++>"c" : Symbol(c, Decl(mod1.js, 2, 32)) + >x : Symbol(x, Decl(mod1.js, 3, 23)) + + module["exports"]["d"] = {}; ->module : Symbol(module, Decl(mod1.js, 2, 32)) ->"exports" : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->"d" : Symbol("d", Decl(mod1.js, 3, 33), Decl(mod1.js, 5, 18)) -- --module["exports"]["d"].e = 0; ++>module : Symbol(module.exports) ++>"exports" : Symbol("mod1", Decl(mod1.js, 0, 0)) ++>"d" : Symbol(d, Decl(mod1.js, 3, 33)) + + module["exports"]["d"].e = 0; ->module["exports"]["d"].e : Symbol("d".e, Decl(mod1.js, 4, 28)) ->module : Symbol(module, Decl(mod1.js, 2, 32)) ->"exports" : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->"d" : Symbol("d", Decl(mod1.js, 3, 33), Decl(mod1.js, 5, 18)) ->e : Symbol("d".e, Decl(mod1.js, 4, 28)) -- ++>module : Symbol(module.exports) ++>"exports" : Symbol("mod1", Decl(mod1.js, 0, 0)) ++>"d" : Symbol(d, Decl(mod1.js, 3, 33)) + diff --git a/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.types b/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.types index 0ab897d93a..0262c54af8 100644 --- a/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.types +++ b/testdata/baselines/reference/submodule/conformance/moduleExportsElementAccessAssignment.types @@ -2,40 +2,99 @@ === mod2.js === const mod1 = require("./mod1"); ->mod1 : any ->require("./mod1") : any +>mod1 : typeof import("mod1") +>require("./mod1") : typeof import("mod1") >require : any >"./mod1" : "./mod1" mod1.a; >mod1.a : any ->mod1 : any +>mod1 : typeof import("mod1") >a : any mod1.b; >mod1.b : any ->mod1 : any +>mod1 : typeof import("mod1") >b : any mod1.c; >mod1.c : any ->mod1 : any +>mod1 : typeof import("mod1") >c : any mod1.d; >mod1.d : any ->mod1 : any +>mod1 : typeof import("mod1") >d : any mod1.d.e; >mod1.d.e : any >mod1.d : any ->mod1 : any +>mod1 : typeof import("mod1") >d : any >e : any mod1.default; >mod1.default : any ->mod1 : any +>mod1 : typeof import("mod1") >default : any +=== mod1.js === +exports.a = { x: "x" }; +>exports.a = { x: "x" } : { x: string; } +>exports.a : any +>exports : typeof import("mod1") +>a : any +>{ x: "x" } : { x: string; } +>x : string +>"x" : "x" + +exports["b"] = { x: "x" }; +>exports["b"] = { x: "x" } : { x: string; } +>exports["b"] : any +>exports : typeof import("mod1") +>"b" : "b" +>{ x: "x" } : { x: string; } +>x : string +>"x" : "x" + +exports["default"] = { x: "x" }; +>exports["default"] = { x: "x" } : { x: string; } +>exports["default"] : any +>exports : typeof import("mod1") +>"default" : "default" +>{ x: "x" } : { x: string; } +>x : string +>"x" : "x" + +module.exports["c"] = { x: "x" }; +>module.exports["c"] = { x: "x" } : { x: string; } +>module.exports["c"] : any +>module.exports : typeof import("mod1") +>module : { "mod1": typeof import("mod1"); } +>exports : typeof import("mod1") +>"c" : "c" +>{ x: "x" } : { x: string; } +>x : string +>"x" : "x" + +module["exports"]["d"] = {}; +>module["exports"]["d"] = {} : {} +>module["exports"]["d"] : any +>module["exports"] : typeof import("mod1") +>module : { "mod1": typeof import("mod1"); } +>"exports" : "exports" +>"d" : "d" +>{} : {} + +module["exports"]["d"].e = 0; +>module["exports"]["d"].e = 0 : 0 +>module["exports"]["d"].e : any +>module["exports"]["d"] : any +>module["exports"] : typeof import("mod1") +>module : { "mod1": typeof import("mod1"); } +>"exports" : "exports" +>"d" : "d" +>e : any +>0 : 0 + diff --git a/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.errors.txt b/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.errors.txt index 58b953d034..655085e89c 100644 --- a/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.errors.txt @@ -1,12 +1,15 @@ -bug40140.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +bug40140.js(2,3): error TS2339: Property 'assignment' does not exist on type '{}'. +bug40140.js(3,3): error TS2339: Property 'noError' does not exist on type '{}'. -==== bug40140.js (1 errors) ==== +==== bug40140.js (2 errors) ==== const u = require('untyped'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. u.assignment.nested = true + ~~~~~~~~~~ +!!! error TS2339: Property 'assignment' does not exist on type '{}'. u.noError() + ~~~~~~~ +!!! error TS2339: Property 'noError' does not exist on type '{}'. ==== node_modules/untyped/index.js (0 errors) ==== diff --git a/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.symbols b/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.symbols index 187160fcad..a3e07e4f90 100644 --- a/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.symbols +++ b/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.symbols @@ -3,6 +3,8 @@ === bug40140.js === const u = require('untyped'); >u : Symbol(u, Decl(bug40140.js, 0, 5)) +>require : Symbol(require) +>'untyped' : Symbol("node_modules/untyped/index", Decl(index.js, 0, 0)) u.assignment.nested = true >u : Symbol(u, Decl(bug40140.js, 0, 5)) @@ -11,3 +13,9 @@ u.noError() >u : Symbol(u, Decl(bug40140.js, 0, 5)) +=== node_modules/untyped/index.js === +module.exports = {} +>module.exports : Symbol(export=, Decl(index.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(index.js, 0, 0)) + diff --git a/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.symbols.diff b/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.symbols.diff index c24f7c4507..f9a0f28ac0 100644 --- a/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.symbols.diff @@ -1,10 +1,20 @@ --- old.namespaceAssignmentToRequireAlias.symbols +++ new.namespaceAssignmentToRequireAlias.symbols -@@= skipped -2, +2 lines =@@ - === bug40140.js === +@@= skipped -3, +3 lines =@@ const u = require('untyped'); >u : Symbol(u, Decl(bug40140.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ++>'untyped' : Symbol("node_modules/untyped/index", Decl(index.js, 0, 0)) u.assignment.nested = true >u : Symbol(u, Decl(bug40140.js, 0, 5)) +@@= skipped -8, +9 lines =@@ + >u : Symbol(u, Decl(bug40140.js, 0, 5)) + + ++=== node_modules/untyped/index.js === ++module.exports = {} ++>module.exports : Symbol(export=, Decl(index.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(index.js, 0, 0)) ++ diff --git a/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.types b/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.types index 1e3cf57f0e..0ab8965485 100644 --- a/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.types +++ b/testdata/baselines/reference/submodule/conformance/namespaceAssignmentToRequireAlias.types @@ -2,8 +2,8 @@ === bug40140.js === const u = require('untyped'); ->u : any ->require('untyped') : any +>u : {} +>require('untyped') : {} >require : any >'untyped' : "untyped" @@ -11,7 +11,7 @@ u.assignment.nested = true >u.assignment.nested = true : true >u.assignment.nested : any >u.assignment : any ->u : any +>u : {} >assignment : any >nested : any >true : true @@ -19,7 +19,15 @@ u.assignment.nested = true u.noError() >u.noError() : any >u.noError : any ->u : any +>u : {} >noError : any +=== node_modules/untyped/index.js === +module.exports = {} +>module.exports = {} : {} +>module.exports : {} +>module : { export=: {}; } +>exports : {} +>{} : {} + diff --git a/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.errors.txt b/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.errors.txt index 73b5a2a1ea..ba74f68fcf 100644 --- a/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.errors.txt @@ -1,13 +1,10 @@ -main.js(3,5): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. main.js(5,1): error TS2304: Cannot find name 'chalk'. -==== main.js (2 errors) ==== +==== main.js (1 errors) ==== const { chalk: { grey } } = require('./mod1'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. grey chalk ~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.symbols b/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.symbols index f27668b656..3a19abbb9b 100644 --- a/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.symbols +++ b/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.symbols @@ -3,11 +3,31 @@ === main.js === const { chalk: { grey } +>chalk : Symbol(chalk, Decl(mod1.js, 2, 2)) >grey : Symbol(grey, Decl(main.js, 1, 12)) } = require('./mod1'); +>require : Symbol(require) +>'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) + grey >grey : Symbol(grey, Decl(main.js, 1, 12)) chalk +=== mod1.js === +const chalk = { +>chalk : Symbol(chalk, Decl(mod1.js, 0, 5)) + + grey: {} +>grey : Symbol(grey, Decl(mod1.js, 0, 15)) + +}; +module.exports.chalk = chalk +>module.exports.chalk : Symbol(chalk, Decl(mod1.js, 2, 2)) +>module.exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) +>chalk : Symbol(chalk, Decl(mod1.js, 2, 2)) +>chalk : Symbol(chalk, Decl(mod1.js, 0, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.symbols.diff b/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.symbols.diff index b49a66c302..96f369a075 100644 --- a/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.symbols.diff @@ -1,34 +1,15 @@ --- old.nestedDestructuringOfRequire.symbols +++ new.nestedDestructuringOfRequire.symbols -@@= skipped -2, +2 lines =@@ - === main.js === - const { - chalk: { grey } -->chalk : Symbol(chalk, Decl(mod1.js, 2, 2)) - >grey : Symbol(grey, Decl(main.js, 1, 12)) - - } = require('./mod1'); -->require : Symbol(require) -->'./mod1' : Symbol("mod1", Decl(mod1.js, 0, 0)) -- - grey - >grey : Symbol(grey, Decl(main.js, 1, 12)) - - chalk - --=== mod1.js === --const chalk = { -->chalk : Symbol(chalk, Decl(mod1.js, 0, 5)) -- -- grey: {} -->grey : Symbol(grey, Decl(mod1.js, 0, 15)) -- --}; --module.exports.chalk = chalk -->module.exports.chalk : Symbol(chalk, Decl(mod1.js, 2, 2)) +@@= skipped -24, +24 lines =@@ + }; + module.exports.chalk = chalk + >module.exports.chalk : Symbol(chalk, Decl(mod1.js, 2, 2)) ->module.exports : Symbol(chalk, Decl(mod1.js, 2, 2)) ->module : Symbol(module, Decl(mod1.js, 2, 2)) ->exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) -->chalk : Symbol(chalk, Decl(mod1.js, 2, 2)) -->chalk : Symbol(chalk, Decl(mod1.js, 0, 5)) -- ++>module.exports : Symbol("mod1", Decl(mod1.js, 0, 0)) ++>module : Symbol(module.exports) ++>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) + >chalk : Symbol(chalk, Decl(mod1.js, 2, 2)) + >chalk : Symbol(chalk, Decl(mod1.js, 0, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.types b/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.types index 400756f8b4..eb39b0eaed 100644 --- a/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.types +++ b/testdata/baselines/reference/submodule/conformance/nestedDestructuringOfRequire.types @@ -4,16 +4,35 @@ const { chalk: { grey } >chalk : any ->grey : any +>grey : {} } = require('./mod1'); ->require('./mod1') : any +>require('./mod1') : typeof import("mod1") >require : any >'./mod1' : "./mod1" grey ->grey : any +>grey : {} chalk >chalk : any +=== mod1.js === +const chalk = { +>chalk : { grey: {}; } +>{ grey: {}} : { grey: {}; } + + grey: {} +>grey : {} +>{} : {} + +}; +module.exports.chalk = chalk +>module.exports.chalk = chalk : { grey: {}; } +>module.exports.chalk : { grey: {}; } +>module.exports : typeof import("mod1") +>module : { "mod1": typeof import("mod1"); } +>exports : typeof import("mod1") +>chalk : { grey: {}; } +>chalk : { grey: {}; } + diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).errors.txt index 7c51e7524f..2341cc6d8a 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).errors.txt @@ -1,13 +1,10 @@ -bar.ts(1,17): error TS2306: File 'foo.cjs' is not a module. -foo.cjs(1,1): error TS2304: Cannot find name 'exports'. +bar.ts(1,8): error TS2613: Module '"foo"' has no default export. Did you mean to use 'import { foo } from "foo"' instead? -==== foo.cjs (1 errors) ==== +==== foo.cjs (0 errors) ==== exports.foo = "foo" - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. ==== bar.ts (1 errors) ==== import foo from "./foo.cjs" - ~~~~~~~~~~~ -!!! error TS2306: File 'foo.cjs' is not a module. + ~~~ +!!! error TS2613: Module '"foo"' has no default export. Did you mean to use 'import { foo } from "foo"' instead? foo.foo; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).symbols b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).symbols index cbd03d4b0f..e0dacb4026 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).symbols +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).symbols @@ -1,8 +1,11 @@ //// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts] //// === foo.cjs === - exports.foo = "foo" +>exports.foo : Symbol(foo, Decl(foo.cjs, 0, 0)) +>exports : Symbol("foo", Decl(foo.cjs, 0, 0)) +>foo : Symbol(foo, Decl(foo.cjs, 0, 0)) + === bar.ts === import foo from "./foo.cjs" >foo : Symbol(foo, Decl(bar.ts, 0, 6)) diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).symbols.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).symbols.diff index db333b1ec6..2326172372 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).symbols.diff @@ -1,17 +1,15 @@ --- old.nodeModulesAllowJsCjsFromJs(module=node16).symbols +++ new.nodeModulesAllowJsCjsFromJs(module=node16).symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts] //// - +@@= skipped -2, +2 lines =@@ === foo.cjs === --exports.foo = "foo" -->exports.foo : Symbol(foo, Decl(foo.cjs, 0, 0)) + exports.foo = "foo" + >exports.foo : Symbol(foo, Decl(foo.cjs, 0, 0)) ->exports : Symbol(foo, Decl(foo.cjs, 0, 0)) -->foo : Symbol(foo, Decl(foo.cjs, 0, 0)) ++>exports : Symbol("foo", Decl(foo.cjs, 0, 0)) + >foo : Symbol(foo, Decl(foo.cjs, 0, 0)) -+exports.foo = "foo" === bar.ts === - import foo from "./foo.cjs" +@@= skipped -8, +8 lines =@@ >foo : Symbol(foo, Decl(bar.ts, 0, 6)) foo.foo; diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).types b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).types index afb0ed743a..44070dc13f 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).types +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=node16).types @@ -3,9 +3,9 @@ === foo.cjs === exports.foo = "foo" >exports.foo = "foo" : "foo" ->exports.foo : any ->exports : any ->foo : any +>exports.foo : "foo" +>exports : typeof import("foo") +>foo : "foo" >"foo" : "foo" === bar.ts === diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).errors.txt index 7c51e7524f..2341cc6d8a 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).errors.txt @@ -1,13 +1,10 @@ -bar.ts(1,17): error TS2306: File 'foo.cjs' is not a module. -foo.cjs(1,1): error TS2304: Cannot find name 'exports'. +bar.ts(1,8): error TS2613: Module '"foo"' has no default export. Did you mean to use 'import { foo } from "foo"' instead? -==== foo.cjs (1 errors) ==== +==== foo.cjs (0 errors) ==== exports.foo = "foo" - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. ==== bar.ts (1 errors) ==== import foo from "./foo.cjs" - ~~~~~~~~~~~ -!!! error TS2306: File 'foo.cjs' is not a module. + ~~~ +!!! error TS2613: Module '"foo"' has no default export. Did you mean to use 'import { foo } from "foo"' instead? foo.foo; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).symbols b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).symbols index cbd03d4b0f..e0dacb4026 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).symbols +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).symbols @@ -1,8 +1,11 @@ //// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts] //// === foo.cjs === - exports.foo = "foo" +>exports.foo : Symbol(foo, Decl(foo.cjs, 0, 0)) +>exports : Symbol("foo", Decl(foo.cjs, 0, 0)) +>foo : Symbol(foo, Decl(foo.cjs, 0, 0)) + === bar.ts === import foo from "./foo.cjs" >foo : Symbol(foo, Decl(bar.ts, 0, 6)) diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).symbols.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).symbols.diff index 354a295f84..be8fe6a059 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).symbols.diff @@ -1,17 +1,15 @@ --- old.nodeModulesAllowJsCjsFromJs(module=nodenext).symbols +++ new.nodeModulesAllowJsCjsFromJs(module=nodenext).symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/conformance/node/allowJs/nodeModulesAllowJsCjsFromJs.ts] //// - +@@= skipped -2, +2 lines =@@ === foo.cjs === --exports.foo = "foo" -->exports.foo : Symbol(foo, Decl(foo.cjs, 0, 0)) + exports.foo = "foo" + >exports.foo : Symbol(foo, Decl(foo.cjs, 0, 0)) ->exports : Symbol(foo, Decl(foo.cjs, 0, 0)) -->foo : Symbol(foo, Decl(foo.cjs, 0, 0)) ++>exports : Symbol("foo", Decl(foo.cjs, 0, 0)) + >foo : Symbol(foo, Decl(foo.cjs, 0, 0)) -+exports.foo = "foo" === bar.ts === - import foo from "./foo.cjs" +@@= skipped -8, +8 lines =@@ >foo : Symbol(foo, Decl(bar.ts, 0, 6)) foo.foo; diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).types b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).types index afb0ed743a..44070dc13f 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).types +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).types @@ -3,9 +3,9 @@ === foo.cjs === exports.foo = "foo" >exports.foo = "foo" : "foo" ->exports.foo : any ->exports : any ->foo : any +>exports.foo : "foo" +>exports : typeof import("foo") +>foo : "foo" >"foo" : "foo" === bar.ts === diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).errors.txt index 5c37afd462..b80fa4321a 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).errors.txt @@ -1,18 +1,15 @@ -file.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +file.js(4,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. index.js(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. -subfolder/file.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== subfolder/index.js (0 errors) ==== // cjs format file const a = {}; export = a; -==== subfolder/file.js (1 errors) ==== +==== subfolder/file.js (0 errors) ==== // cjs format file const a = {}; module.exports = a; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== index.js (1 errors) ==== // esm format file const a = {}; @@ -24,8 +21,8 @@ subfolder/file.js(3,1): error TS2580: Cannot find name 'module'. Do you need to import "fs"; const a = {}; module.exports = a; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. ==== package.json (0 errors) ==== { "name": "package", diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).symbols b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).symbols index 6ce8916660..406c1eb55f 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).symbols +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).symbols @@ -14,6 +14,9 @@ const a = {}; >a : Symbol(a, Decl(file.js, 1, 5)) module.exports = a; +>module.exports : Symbol(a, Decl(file.js, 1, 5)) +>module : Symbol(module.exports) +>exports : Symbol(a, Decl(file.js, 1, 5)) >a : Symbol(a, Decl(file.js, 1, 5)) === index.js === @@ -31,5 +34,8 @@ const a = {}; >a : Symbol(a, Decl(file.js, 2, 5)) module.exports = a; +>module.exports : Symbol(a, Decl(file.js, 2, 5)) +>module : Symbol(module.exports) +>exports : Symbol(a, Decl(file.js, 2, 5)) >a : Symbol(a, Decl(file.js, 2, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).symbols.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).symbols.diff index b5cdff62cd..17c8876eb0 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).symbols.diff @@ -7,6 +7,18 @@ ->module.exports : Symbol(module.exports, Decl(file.js, 0, 0)) ->module : Symbol(export=, Decl(file.js, 1, 13)) ->exports : Symbol(export=, Decl(file.js, 1, 13)) ++>module.exports : Symbol(a, Decl(file.js, 1, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(a, Decl(file.js, 1, 5)) >a : Symbol(a, Decl(file.js, 1, 5)) === index.js === +@@= skipped -20, +20 lines =@@ + >a : Symbol(a, Decl(file.js, 2, 5)) + + module.exports = a; ++>module.exports : Symbol(a, Decl(file.js, 2, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(a, Decl(file.js, 2, 5)) + >a : Symbol(a, Decl(file.js, 2, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).types b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).types index 1b10c50ed2..a2a34b8c70 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).types +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=node16).types @@ -17,9 +17,9 @@ const a = {}; module.exports = a; >module.exports = a : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { readonly a: {}; } +>exports : {} >a : {} === index.js === @@ -40,8 +40,8 @@ const a = {}; module.exports = a; >module.exports = a : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { readonly a: {}; } +>exports : {} >a : {} diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt index 5c37afd462..b80fa4321a 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt @@ -1,18 +1,15 @@ -file.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +file.js(4,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. index.js(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. -subfolder/file.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== subfolder/index.js (0 errors) ==== // cjs format file const a = {}; export = a; -==== subfolder/file.js (1 errors) ==== +==== subfolder/file.js (0 errors) ==== // cjs format file const a = {}; module.exports = a; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== index.js (1 errors) ==== // esm format file const a = {}; @@ -24,8 +21,8 @@ subfolder/file.js(3,1): error TS2580: Cannot find name 'module'. Do you need to import "fs"; const a = {}; module.exports = a; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~ +!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. ==== package.json (0 errors) ==== { "name": "package", diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).symbols b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).symbols index 6ce8916660..406c1eb55f 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).symbols +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).symbols @@ -14,6 +14,9 @@ const a = {}; >a : Symbol(a, Decl(file.js, 1, 5)) module.exports = a; +>module.exports : Symbol(a, Decl(file.js, 1, 5)) +>module : Symbol(module.exports) +>exports : Symbol(a, Decl(file.js, 1, 5)) >a : Symbol(a, Decl(file.js, 1, 5)) === index.js === @@ -31,5 +34,8 @@ const a = {}; >a : Symbol(a, Decl(file.js, 2, 5)) module.exports = a; +>module.exports : Symbol(a, Decl(file.js, 2, 5)) +>module : Symbol(module.exports) +>exports : Symbol(a, Decl(file.js, 2, 5)) >a : Symbol(a, Decl(file.js, 2, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).symbols.diff b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).symbols.diff index 508d6e453f..25b089e7e8 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).symbols.diff @@ -7,6 +7,18 @@ ->module.exports : Symbol(module.exports, Decl(file.js, 0, 0)) ->module : Symbol(export=, Decl(file.js, 1, 13)) ->exports : Symbol(export=, Decl(file.js, 1, 13)) ++>module.exports : Symbol(a, Decl(file.js, 1, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(a, Decl(file.js, 1, 5)) >a : Symbol(a, Decl(file.js, 1, 5)) === index.js === +@@= skipped -20, +20 lines =@@ + >a : Symbol(a, Decl(file.js, 2, 5)) + + module.exports = a; ++>module.exports : Symbol(a, Decl(file.js, 2, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(a, Decl(file.js, 2, 5)) + >a : Symbol(a, Decl(file.js, 2, 5)) + diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).types b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).types index 1b10c50ed2..a2a34b8c70 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).types +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).types @@ -17,9 +17,9 @@ const a = {}; module.exports = a; >module.exports = a : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { readonly a: {}; } +>exports : {} >a : {} === index.js === @@ -40,8 +40,8 @@ const a = {}; module.exports = a; >module.exports = a : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { readonly a: {}; } +>exports : {} >a : {} diff --git a/testdata/baselines/reference/submodule/conformance/nodeModulesCJSEmit1.errors.txt b/testdata/baselines/reference/submodule/conformance/nodeModulesCJSEmit1.errors.txt index e66f3db853..68c11a8bbb 100644 --- a/testdata/baselines/reference/submodule/conformance/nodeModulesCJSEmit1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/nodeModulesCJSEmit1.errors.txt @@ -1,33 +1,24 @@ -/1.cjs(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -/2.cjs(1,1): error TS2304: Cannot find name 'exports'. -/3.cjs(2,1): error TS2304: Cannot find name 'exports'. -/5.cjs(1,17): error TS2306: File '/2.cjs' is not a module. +/5.cjs(1,8): error TS1192: Module '"/2"' has no default export. /5.cjs(2,8): error TS1192: Module '"/3"' has no default export. -==== /1.cjs (1 errors) ==== +==== /1.cjs (0 errors) ==== module.exports = {}; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== /2.cjs (1 errors) ==== +==== /2.cjs (0 errors) ==== exports.foo = 0; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. -==== /3.cjs (1 errors) ==== +==== /3.cjs (0 errors) ==== import "foo"; exports.foo = {}; - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. ==== /4.cjs (0 errors) ==== ; ==== /5.cjs (2 errors) ==== import two from "./2.cjs"; // ok - ~~~~~~~~~ -!!! error TS2306: File '/2.cjs' is not a module. + ~~~ +!!! error TS1192: Module '"/2"' has no default export. import three from "./3.cjs"; // error ~~~~~ !!! error TS1192: Module '"/3"' has no default export. diff --git a/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.errors.txt b/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.errors.txt deleted file mode 100644 index 944587753f..0000000000 --- a/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -a.js(3,1): error TS2304: Cannot find name 'exports'. - - -==== decls.d.ts (0 errors) ==== - declare function factory(type: string): {}; -==== a.js (1 errors) ==== - // from util - /** @param {function} ctor - A big long explanation follows */ - exports.inherits = factory('inherits') - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.symbols b/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.symbols index 36ef7faed7..c52a21de1c 100644 --- a/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.symbols +++ b/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.symbols @@ -9,5 +9,8 @@ declare function factory(type: string): {}; // from util /** @param {function} ctor - A big long explanation follows */ exports.inherits = factory('inherits') +>exports.inherits : Symbol(inherits, Decl(a.js, 0, 0)) +>exports : Symbol("a", Decl(a.js, 0, 0)) +>inherits : Symbol(inherits, Decl(a.js, 0, 0)) >factory : Symbol(factory, Decl(decls.d.ts, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.symbols.diff b/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.symbols.diff index f9ccf51bc6..9aa922cf3d 100644 --- a/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.symbols.diff @@ -1,11 +1,11 @@ --- old.paramTagOnCallExpression.symbols +++ new.paramTagOnCallExpression.symbols -@@= skipped -8, +8 lines =@@ - // from util +@@= skipped -9, +9 lines =@@ /** @param {function} ctor - A big long explanation follows */ exports.inherits = factory('inherits') -->exports.inherits : Symbol(inherits, Decl(a.js, 0, 0)) + >exports.inherits : Symbol(inherits, Decl(a.js, 0, 0)) ->exports : Symbol(inherits, Decl(a.js, 0, 0)) -->inherits : Symbol(inherits, Decl(a.js, 0, 0)) ++>exports : Symbol("a", Decl(a.js, 0, 0)) + >inherits : Symbol(inherits, Decl(a.js, 0, 0)) >factory : Symbol(factory, Decl(decls.d.ts, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.types b/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.types index 2574d1f81f..c783194b17 100644 --- a/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.types +++ b/testdata/baselines/reference/submodule/conformance/paramTagOnCallExpression.types @@ -10,9 +10,9 @@ declare function factory(type: string): {}; /** @param {function} ctor - A big long explanation follows */ exports.inherits = factory('inherits') >exports.inherits = factory('inherits') : {} ->exports.inherits : any ->exports : any ->inherits : any +>exports.inherits : {} +>exports : typeof import("a") +>inherits : {} >factory('inherits') : {} >factory : (type: string) => {} >'inherits' : "inherits" diff --git a/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.errors.txt b/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.errors.txt deleted file mode 100644 index 5d2b9f1c78..0000000000 --- a/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.errors.txt +++ /dev/null @@ -1,16 +0,0 @@ -main.js(1,9): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== main.js (1 errors) ==== - var f = require('./first'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - f(1, n => { }) - -==== first.js (0 errors) ==== - /** @template T - * @param {T} x - * @param {(t: T) => void} k - */ - module.exports = function (x, k) { return k(x) } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.symbols b/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.symbols index 2b4271173c..27794910c7 100644 --- a/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.symbols +++ b/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.symbols @@ -3,8 +3,24 @@ === main.js === var f = require('./first'); >f : Symbol(f, Decl(main.js, 0, 3)) +>require : Symbol(require) +>'./first' : Symbol("first", Decl(first.js, 0, 0)) f(1, n => { }) >f : Symbol(f, Decl(main.js, 0, 3)) >n : Symbol(n, Decl(main.js, 1, 4)) +=== first.js === +/** @template T + * @param {T} x + * @param {(t: T) => void} k + */ +module.exports = function (x, k) { return k(x) } +>module.exports : Symbol(export=, Decl(first.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(first.js, 0, 0)) +>x : Symbol(x, Decl(first.js, 4, 27)) +>k : Symbol(k, Decl(first.js, 4, 29)) +>k : Symbol(k, Decl(first.js, 4, 29)) +>x : Symbol(x, Decl(first.js, 4, 27)) + diff --git a/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.symbols.diff b/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.symbols.diff index b99b6d8f45..ff195e44ba 100644 --- a/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.symbols.diff @@ -1,27 +1,13 @@ --- old.paramTagTypeResolution.symbols +++ new.paramTagTypeResolution.symbols -@@= skipped -2, +2 lines =@@ - === main.js === - var f = require('./first'); - >f : Symbol(f, Decl(main.js, 0, 3)) -->require : Symbol(require) -->'./first' : Symbol("first", Decl(first.js, 0, 0)) - - f(1, n => { }) - >f : Symbol(f, Decl(main.js, 0, 3)) - >n : Symbol(n, Decl(main.js, 1, 4)) - --=== first.js === --/** @template T -- * @param {T} x -- * @param {(t: T) => void} k -- */ --module.exports = function (x, k) { return k(x) } +@@= skipped -15, +15 lines =@@ + * @param {(t: T) => void} k + */ + module.exports = function (x, k) { return k(x) } ->module.exports : Symbol(module.exports, Decl(first.js, 0, 0)) ->module : Symbol(export=, Decl(first.js, 0, 0)) -->exports : Symbol(export=, Decl(first.js, 0, 0)) -->x : Symbol(x, Decl(first.js, 4, 27)) -->k : Symbol(k, Decl(first.js, 4, 29)) -->k : Symbol(k, Decl(first.js, 4, 29)) -->x : Symbol(x, Decl(first.js, 4, 27)) -- ++>module.exports : Symbol(export=, Decl(first.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(first.js, 0, 0)) + >x : Symbol(x, Decl(first.js, 4, 27)) + >k : Symbol(k, Decl(first.js, 4, 29)) diff --git a/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.types b/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.types index b70d3476dd..a7659af518 100644 --- a/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.types +++ b/testdata/baselines/reference/submodule/conformance/paramTagTypeResolution.types @@ -2,15 +2,32 @@ === main.js === var f = require('./first'); ->f : any ->require('./first') : any +>f : (x: any, k: any) => any +>require('./first') : (x: any, k: any) => any >require : any >'./first' : "./first" f(1, n => { }) >f(1, n => { }) : any ->f : any +>f : (x: any, k: any) => any >1 : 1 >n => { } : (n: any) => void >n : any +=== first.js === +/** @template T + * @param {T} x + * @param {(t: T) => void} k + */ +module.exports = function (x, k) { return k(x) } +>module.exports = function (x, k) { return k(x) } : (x: any, k: any) => any +>module.exports : (x: any, k: any) => any +>module : { export=: (x: any, k: any) => any; } +>exports : (x: any, k: any) => any +>function (x, k) { return k(x) } : (x: any, k: any) => any +>x : any +>k : any +>k(x) : any +>k : any +>x : any + diff --git a/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.errors.txt b/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.errors.txt index ecde36f2ec..40aeeccd69 100644 --- a/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.errors.txt @@ -1,16 +1,13 @@ -/lib/constants.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -/src/constants.ts(1,30): error TS2306: File '/lib/constants.js' is not a module. +/src/constants.ts(1,30): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. -==== /lib/constants.js (1 errors) ==== +==== /lib/constants.js (0 errors) ==== module.exports = { - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. str: 'x', }; ==== /src/constants.ts (1 errors) ==== import * as tsConstants from "../lib/constants"; ~~~~~~~~~~~~~~~~~~ -!!! error TS2306: File '/lib/constants.js' is not a module. +!!! error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. export { tsConstants }; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.symbols b/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.symbols index 06587f93b9..80a283d7cd 100644 --- a/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.symbols +++ b/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.symbols @@ -2,6 +2,10 @@ === /lib/constants.js === module.exports = { +>module.exports : Symbol(export=, Decl(constants.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(constants.js, 0, 0)) + str: 'x', >str : Symbol(str, Decl(constants.js, 0, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.symbols.diff b/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.symbols.diff index 0c404d7a8d..4b1e5a2d01 100644 --- a/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.symbols.diff @@ -6,8 +6,8 @@ module.exports = { ->module.exports : Symbol(module.exports, Decl(constants.js, 0, 0)) ->module : Symbol(export=, Decl(constants.js, 0, 0)) -->exports : Symbol(export=, Decl(constants.js, 0, 0)) -- - str: 'x', - >str : Symbol(str, Decl(constants.js, 0, 18)) ++>module.exports : Symbol(export=, Decl(constants.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(constants.js, 0, 0)) + str: 'x', diff --git a/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.types b/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.types index d4c9e006ce..c23b4f840c 100644 --- a/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.types +++ b/testdata/baselines/reference/submodule/conformance/reExportJsFromTs.types @@ -3,9 +3,9 @@ === /lib/constants.js === module.exports = { >module.exports = { str: 'x',} : { str: string; } ->module.exports : any ->module : any ->exports : any +>module.exports : { str: string; } +>module : { export=: { str: string; }; } +>exports : { str: string; } >{ str: 'x',} : { str: string; } str: 'x', @@ -16,8 +16,8 @@ module.exports = { === /src/constants.ts === import * as tsConstants from "../lib/constants"; ->tsConstants : any +>tsConstants : { str: string; } export { tsConstants }; ->tsConstants : any +>tsConstants : { str: string; } diff --git a/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.errors.txt b/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.errors.txt deleted file mode 100644 index 0e8b19d198..0000000000 --- a/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.errors.txt +++ /dev/null @@ -1,22 +0,0 @@ -38379.js(1,17): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -38379.js(2,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== 38379.js (2 errors) ==== - const { art } = require('./ex') - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - const artoo = require('./ex2') - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - let x = 1 - art(x) - let y = 1 - artoo(y) - -==== ex.d.ts (0 errors) ==== - // based on assert in @types/node - export function art(value: any, message?: string | Error): asserts value; -==== ex2.d.ts (0 errors) ==== - declare function art(value: any, message?: string | Error): asserts value; - export = art; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.symbols b/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.symbols index e10c532fa9..b7598909c2 100644 --- a/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.symbols +++ b/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.symbols @@ -3,9 +3,13 @@ === 38379.js === const { art } = require('./ex') >art : Symbol(art, Decl(38379.js, 0, 7)) +>require : Symbol(require) +>'./ex' : Symbol("ex", Decl(ex.d.ts, 0, 0)) const artoo = require('./ex2') >artoo : Symbol(artoo, Decl(38379.js, 1, 5)) +>require : Symbol(require) +>'./ex2' : Symbol("ex2", Decl(ex2.d.ts, 0, 0)) let x = 1 >x : Symbol(x, Decl(38379.js, 2, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.symbols.diff b/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.symbols.diff deleted file mode 100644 index c99baff24a..0000000000 --- a/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.symbols.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.requireAssertsFromTypescript.symbols -+++ new.requireAssertsFromTypescript.symbols -@@= skipped -2, +2 lines =@@ - === 38379.js === - const { art } = require('./ex') - >art : Symbol(art, Decl(38379.js, 0, 7)) -->require : Symbol(require) -->'./ex' : Symbol("ex", Decl(ex.d.ts, 0, 0)) - - const artoo = require('./ex2') - >artoo : Symbol(artoo, Decl(38379.js, 1, 5)) -->require : Symbol(require) -->'./ex2' : Symbol("ex2", Decl(ex2.d.ts, 0, 0)) - - let x = 1 - >x : Symbol(x, Decl(38379.js, 2, 3)) diff --git a/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.types b/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.types index 1a62e68057..48ccc7420b 100644 --- a/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.types +++ b/testdata/baselines/reference/submodule/conformance/requireAssertsFromTypescript.types @@ -2,14 +2,14 @@ === 38379.js === const { art } = require('./ex') ->art : any ->require('./ex') : any +>art : (value: any, message?: string | Error) => asserts value +>require('./ex') : typeof import("ex") >require : any >'./ex' : "./ex" const artoo = require('./ex2') ->artoo : any ->require('./ex2') : any +>artoo : (value: any, message?: string | Error) => asserts value +>require('./ex2') : (value: any, message?: string | Error) => asserts value >require : any >'./ex2' : "./ex2" @@ -18,8 +18,8 @@ let x = 1 >1 : 1 art(x) ->art(x) : any ->art : any +>art(x) : void +>art : (value: any, message?: string | Error) => asserts value >x : number let y = 1 @@ -27,8 +27,8 @@ let y = 1 >1 : 1 artoo(y) ->artoo(y) : any ->artoo : any +>artoo(y) : void +>artoo : (value: any, message?: string | Error) => asserts value >y : number === ex.d.ts === diff --git a/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.symbols b/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.symbols index 78784bab0b..29bd29a2e5 100644 --- a/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.symbols +++ b/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.symbols @@ -10,3 +10,16 @@ console.log(value) >log : Symbol(log, Decl(lib.dom.d.ts, --, --)) >value : Symbol(value, Decl(requireTwoPropertyAccesses.js, 0, 5)) +=== mod.js === +module.exports = { +>module.exports : Symbol(export=, Decl(mod.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod.js, 0, 0)) + + x: { +>x : Symbol(x, Decl(mod.js, 0, 18)) + + y: "value" +>y : Symbol(y, Decl(mod.js, 1, 8)) + } +} diff --git a/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.symbols.diff b/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.symbols.diff index fd3512ade9..effad71b03 100644 --- a/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.symbols.diff @@ -19,16 +19,12 @@ +>log : Symbol(log, Decl(lib.dom.d.ts, --, --)) >value : Symbol(value, Decl(requireTwoPropertyAccesses.js, 0, 5)) --=== mod.js === --module.exports = { + === mod.js === + module.exports = { ->module.exports : Symbol(module.exports, Decl(mod.js, 0, 0)) ->module : Symbol(export=, Decl(mod.js, 0, 0)) -->exports : Symbol(export=, Decl(mod.js, 0, 0)) -- -- x: { -->x : Symbol(x, Decl(mod.js, 0, 18)) -- -- y: "value" -->y : Symbol(y, Decl(mod.js, 1, 8)) -- } --} ++>module.exports : Symbol(export=, Decl(mod.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(mod.js, 0, 0)) + + x: { diff --git a/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.types b/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.types index ab5891fac6..b49e45461b 100644 --- a/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.types +++ b/testdata/baselines/reference/submodule/conformance/requireTwoPropertyAccesses.types @@ -18,3 +18,20 @@ console.log(value) >log : (...data: any[]) => void >value : any +=== mod.js === +module.exports = { +>module.exports = { x: { y: "value" }} : { x: { y: string; }; } +>module.exports : { x: { y: string; }; } +>module : { export=: { x: { y: string; }; }; } +>exports : { x: { y: string; }; } +>{ x: { y: "value" }} : { x: { y: string; }; } + + x: { +>x : { y: string; } +>{ y: "value" } : { y: string; } + + y: "value" +>y : string +>"value" : "value" + } +} diff --git a/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.errors.txt index 631f5be936..02ad976dc2 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.errors.txt @@ -4,7 +4,7 @@ b.js(3,13): error TS2749: 'B' refers to a value, but is being used as a type her c.js(3,13): error TS2749: 'C' refers to a value, but is being used as a type here. Did you mean 'typeof C'? d.js(3,13): error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? e-ext.js(3,14): error TS2339: Property 'x' does not exist on type 'E'. -e.js(3,13): error TS2749: 'E' refers to a value, but is being used as a type here. Did you mean 'typeof E'? +e.js(4,19): error TS2339: Property 'x' does not exist on type 'E'. f.js(5,13): error TS2749: 'F' refers to a value, but is being used as a type here. Did you mean 'typeof F'? g.js(5,13): error TS2749: 'G' refers to a value, but is being used as a type here. Did you mean 'typeof G'? h.js(3,14): error TS2339: Property 'x' does not exist on type 'H'. @@ -84,9 +84,9 @@ h.js(8,19): error TS2339: Property 'x' does not exist on type 'H'. const { E } = require("./e-ext"); /** @param {E} p */ - ~ -!!! error TS2749: 'E' refers to a value, but is being used as a type here. Did you mean 'typeof E'? function e(p) { p.x; } + ~ +!!! error TS2339: Property 'x' does not exist on type 'E'. ==== f.js (1 errors) ==== var F = function () { diff --git a/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.symbols b/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.symbols index ad2f142740..0546668f70 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.symbols @@ -11,7 +11,9 @@ declare var module: any, exports: any; === a-ext.js === exports.A = function () { ->exports : Symbol(exports, Decl(node.d.ts, 1, 24)) +>exports.A : Symbol(A, Decl(a-ext.js, 0, 0)) +>exports : Symbol("a-ext", Decl(a-ext.js, 0, 0)) +>A : Symbol(A, Decl(a-ext.js, 0, 0)) this.x = 1; }; @@ -20,6 +22,7 @@ exports.A = function () { const { A } = require("./a-ext"); >A : Symbol(A, Decl(a.js, 0, 7)) >require : Symbol(require, Decl(node.d.ts, 0, 0)) +>"./a-ext" : Symbol("a-ext", Decl(a-ext.js, 0, 0)) /** @param {A} p */ function a(p) { p.x; } @@ -29,7 +32,9 @@ function a(p) { p.x; } === b-ext.js === exports.B = class { ->exports : Symbol(exports, Decl(node.d.ts, 1, 24)) +>exports.B : Symbol(B, Decl(b-ext.js, 0, 0)) +>exports : Symbol("b-ext", Decl(b-ext.js, 0, 0)) +>B : Symbol(B, Decl(b-ext.js, 0, 0)) constructor() { this.x = 1; @@ -41,6 +46,7 @@ exports.B = class { const { B } = require("./b-ext"); >B : Symbol(B, Decl(b.js, 0, 7)) >require : Symbol(require, Decl(node.d.ts, 0, 0)) +>"./b-ext" : Symbol("b-ext", Decl(b-ext.js, 0, 0)) /** @param {B} p */ function b(p) { p.x; } @@ -59,6 +65,7 @@ export function C() { const { C } = require("./c-ext"); >C : Symbol(C, Decl(c.js, 0, 7)) >require : Symbol(require, Decl(node.d.ts, 0, 0)) +>"./c-ext" : Symbol("c-ext", Decl(c-ext.js, 0, 0)) /** @param {C} p */ function c(p) { p.x; } @@ -77,6 +84,7 @@ export var D = function() { const { D } = require("./d-ext"); >D : Symbol(D, Decl(d.js, 0, 7)) >require : Symbol(require, Decl(node.d.ts, 0, 0)) +>"./d-ext" : Symbol("d-ext", Decl(d-ext.js, 0, 0)) /** @param {D} p */ function d(p) { p.x; } @@ -98,6 +106,7 @@ export class E { const { E } = require("./e-ext"); >E : Symbol(E, Decl(e.js, 0, 7)) >require : Symbol(require, Decl(node.d.ts, 0, 0)) +>"./e-ext" : Symbol("e-ext", Decl(e-ext.js, 0, 0)) /** @param {E} p */ function e(p) { p.x; } diff --git a/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.symbols.diff index 01db8c1f00..ec5bd3ddee 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.symbols.diff @@ -1,13 +1,12 @@ --- old.typeFromParamTagForFunction.symbols +++ new.typeFromParamTagForFunction.symbols -@@= skipped -10, +10 lines =@@ - +@@= skipped -11, +11 lines =@@ === a-ext.js === exports.A = function () { -->exports.A : Symbol(A, Decl(a-ext.js, 0, 0)) + >exports.A : Symbol(A, Decl(a-ext.js, 0, 0)) ->exports : Symbol(A, Decl(a-ext.js, 0, 0)) -->A : Symbol(A, Decl(a-ext.js, 0, 0)) -+>exports : Symbol(exports, Decl(node.d.ts, 1, 24)) ++>exports : Symbol("a-ext", Decl(a-ext.js, 0, 0)) + >A : Symbol(A, Decl(a-ext.js, 0, 0)) this.x = 1; ->this.x : Symbol(A.x, Decl(a-ext.js, 0, 25)) @@ -17,12 +16,7 @@ }; === a.js === - const { A } = require("./a-ext"); - >A : Symbol(A, Decl(a.js, 0, 7)) - >require : Symbol(require, Decl(node.d.ts, 0, 0)) -->"./a-ext" : Symbol("a-ext", Decl(a-ext.js, 0, 0)) - - /** @param {A} p */ +@@= skipped -20, +16 lines =@@ function a(p) { p.x; } >a : Symbol(a, Decl(a.js, 0, 33)) >p : Symbol(p, Decl(a.js, 3, 11)) @@ -32,10 +26,10 @@ === b-ext.js === exports.B = class { -->exports.B : Symbol(B, Decl(b-ext.js, 0, 0)) + >exports.B : Symbol(B, Decl(b-ext.js, 0, 0)) ->exports : Symbol(B, Decl(b-ext.js, 0, 0)) -->B : Symbol(B, Decl(b-ext.js, 0, 0)) -+>exports : Symbol(exports, Decl(node.d.ts, 1, 24)) ++>exports : Symbol("b-ext", Decl(b-ext.js, 0, 0)) + >B : Symbol(B, Decl(b-ext.js, 0, 0)) constructor() { this.x = 1; @@ -45,13 +39,7 @@ } }; -@@= skipped -43, +30 lines =@@ - const { B } = require("./b-ext"); - >B : Symbol(B, Decl(b.js, 0, 7)) - >require : Symbol(require, Decl(node.d.ts, 0, 0)) -->"./b-ext" : Symbol("b-ext", Decl(b-ext.js, 0, 0)) - - /** @param {B} p */ +@@= skipped -28, +24 lines =@@ function b(p) { p.x; } >b : Symbol(b, Decl(b.js, 0, 33)) >p : Symbol(p, Decl(b.js, 3, 11)) @@ -70,12 +58,7 @@ } === c.js === - const { C } = require("./c-ext"); - >C : Symbol(C, Decl(c.js, 0, 7)) - >require : Symbol(require, Decl(node.d.ts, 0, 0)) -->"./c-ext" : Symbol("c-ext", Decl(c-ext.js, 0, 0)) - - /** @param {C} p */ +@@= skipped -24, +19 lines =@@ function c(p) { p.x; } >c : Symbol(c, Decl(c.js, 0, 33)) >p : Symbol(p, Decl(c.js, 3, 11)) @@ -95,12 +78,7 @@ }; === d.js === - const { D } = require("./d-ext"); - >D : Symbol(D, Decl(d.js, 0, 7)) - >require : Symbol(require, Decl(node.d.ts, 0, 0)) -->"./d-ext" : Symbol("d-ext", Decl(d-ext.js, 0, 0)) - - /** @param {D} p */ +@@= skipped -25, +19 lines =@@ function d(p) { p.x; } >d : Symbol(d, Decl(d.js, 0, 33)) >p : Symbol(p, Decl(d.js, 3, 11)) @@ -110,7 +88,7 @@ === e-ext.js === export class E { -@@= skipped -65, +49 lines =@@ +@@= skipped -10, +8 lines =@@ constructor() { this.x = 1; @@ -120,13 +98,7 @@ } } -@@= skipped -10, +8 lines =@@ - const { E } = require("./e-ext"); - >E : Symbol(E, Decl(e.js, 0, 7)) - >require : Symbol(require, Decl(node.d.ts, 0, 0)) -->"./e-ext" : Symbol("e-ext", Decl(e-ext.js, 0, 0)) - - /** @param {E} p */ +@@= skipped -16, +14 lines =@@ function e(p) { p.x; } >e : Symbol(e, Decl(e.js, 0, 33)) >p : Symbol(p, Decl(e.js, 3, 11)) @@ -173,7 +145,7 @@ === h.js === class H { -@@= skipped -53, +39 lines =@@ +@@= skipped -47, +34 lines =@@ constructor() { this.x = 1; diff --git a/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.types b/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.types index ebf78ebb4f..f3a738cd84 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromParamTagForFunction.types @@ -13,7 +13,7 @@ declare var module: any, exports: any; exports.A = function () { >exports.A = function () { this.x = 1;} : () => void >exports.A : any ->exports : any +>exports : typeof import("a-ext") >A : any >function () { this.x = 1;} : () => void @@ -29,7 +29,7 @@ exports.A = function () { === a.js === const { A } = require("./a-ext"); >A : any ->require("./a-ext") : any +>require("./a-ext") : typeof import("a-ext") >require : (id: string) => any >"./a-ext" : "./a-ext" @@ -44,9 +44,9 @@ function a(p) { p.x; } === b-ext.js === exports.B = class { >exports.B = class { constructor() { this.x = 1; }} : typeof B ->exports.B : any ->exports : any ->B : any +>exports.B : typeof B +>exports : typeof import("b-ext") +>B : typeof B >class { constructor() { this.x = 1; }} : typeof B constructor() { @@ -61,8 +61,8 @@ exports.B = class { === b.js === const { B } = require("./b-ext"); ->B : any ->require("./b-ext") : any +>B : typeof B +>require("./b-ext") : typeof import("b-ext") >require : (id: string) => any >"./b-ext" : "./b-ext" @@ -88,8 +88,8 @@ export function C() { === c.js === const { C } = require("./c-ext"); ->C : any ->require("./c-ext") : any +>C : () => void +>require("./c-ext") : typeof import("c-ext") >require : (id: string) => any >"./c-ext" : "./c-ext" @@ -117,8 +117,8 @@ export var D = function() { === d.js === const { D } = require("./d-ext"); ->D : any ->require("./d-ext") : any +>D : () => void +>require("./d-ext") : typeof import("d-ext") >require : (id: string) => any >"./d-ext" : "./d-ext" @@ -146,8 +146,8 @@ export class E { === e.js === const { E } = require("./e-ext"); ->E : any ->require("./e-ext") : any +>E : typeof E +>require("./e-ext") : typeof import("e-ext") >require : (id: string) => any >"./e-ext" : "./e-ext" diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.errors.txt new file mode 100644 index 0000000000..c367fd4d66 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.errors.txt @@ -0,0 +1,35 @@ +use.js(3,8): error TS2554: Expected 1 arguments, but got 0. + + +==== use.js (1 errors) ==== + /// + var mini = require('./minimatch') + mini.M.defaults() + ~~~~~~~~ +!!! error TS2554: Expected 1 arguments, but got 0. +!!! related TS6210 minimatch.js:10:24: An argument for 'def' was not provided. + var m = new mini.M() + m.m() + mini.filter() + +==== types.d.ts (0 errors) ==== + declare var require: any; + declare var module: any; +==== minimatch.js (0 errors) ==== + /// + module.exports = minimatch + minimatch.M = M + minimatch.filter = filter + function filter() { + return minimatch() + } + function minimatch() { + } + M.defaults = function (def) { + return def + } + M.prototype.m = function () { + } + function M() { + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.symbols index 3b2433b08b..5a1120117c 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.symbols @@ -5,19 +5,28 @@ var mini = require('./minimatch') >mini : Symbol(mini, Decl(use.js, 1, 3)) >require : Symbol(require, Decl(types.d.ts, 0, 11)) +>'./minimatch' : Symbol("minimatch", Decl(minimatch.js, 0, 0)) mini.M.defaults() +>mini.M.defaults : Symbol(defaults, Decl(minimatch.js, 8, 1)) +>mini.M : Symbol(M, Decl(minimatch.js, 1, 26)) >mini : Symbol(mini, Decl(use.js, 1, 3)) +>M : Symbol(M, Decl(minimatch.js, 1, 26)) +>defaults : Symbol(defaults, Decl(minimatch.js, 8, 1)) var m = new mini.M() >m : Symbol(m, Decl(use.js, 3, 3)) +>mini.M : Symbol(M, Decl(minimatch.js, 1, 26)) >mini : Symbol(mini, Decl(use.js, 1, 3)) +>M : Symbol(M, Decl(minimatch.js, 1, 26)) m.m() >m : Symbol(m, Decl(use.js, 3, 3)) mini.filter() +>mini.filter : Symbol(filter, Decl(minimatch.js, 2, 15)) >mini : Symbol(mini, Decl(use.js, 1, 3)) +>filter : Symbol(filter, Decl(minimatch.js, 2, 15)) === types.d.ts === declare var require: any; @@ -26,3 +35,50 @@ declare var require: any; declare var module: any; >module : Symbol(module, Decl(types.d.ts, 1, 11)) +=== minimatch.js === +/// +module.exports = minimatch +>module.exports : Symbol(minimatch, Decl(minimatch.js, 6, 1)) +>module : Symbol(module.exports) +>exports : Symbol(minimatch, Decl(minimatch.js, 6, 1)) +>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1)) + +minimatch.M = M +>minimatch.M : Symbol(M, Decl(minimatch.js, 1, 26)) +>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1)) +>M : Symbol(M, Decl(minimatch.js, 1, 26)) +>M : Symbol(M, Decl(minimatch.js, 13, 1)) + +minimatch.filter = filter +>minimatch.filter : Symbol(filter, Decl(minimatch.js, 2, 15)) +>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1)) +>filter : Symbol(filter, Decl(minimatch.js, 2, 15)) +>filter : Symbol(filter, Decl(minimatch.js, 3, 25)) + +function filter() { +>filter : Symbol(filter, Decl(minimatch.js, 3, 25)) + + return minimatch() +>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1)) +} +function minimatch() { +>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1)) +} +M.defaults = function (def) { +>M.defaults : Symbol(defaults, Decl(minimatch.js, 8, 1)) +>M : Symbol(M, Decl(minimatch.js, 13, 1)) +>defaults : Symbol(defaults, Decl(minimatch.js, 8, 1)) +>def : Symbol(def, Decl(minimatch.js, 9, 23)) + + return def +>def : Symbol(def, Decl(minimatch.js, 9, 23)) +} +M.prototype.m = function () { +>M.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +>M : Symbol(M, Decl(minimatch.js, 13, 1)) +>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) +} +function M() { +>M : Symbol(M, Decl(minimatch.js, 13, 1)) +} + diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.symbols.diff index 862bb470ed..38c9315701 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.symbols.diff @@ -1,23 +1,26 @@ --- old.typeFromPropertyAssignment17.symbols +++ new.typeFromPropertyAssignment17.symbols -@@= skipped -4, +4 lines =@@ - var mini = require('./minimatch') - >mini : Symbol(mini, Decl(use.js, 1, 3)) - >require : Symbol(require, Decl(types.d.ts, 0, 11)) -->'./minimatch' : Symbol("minimatch", Decl(minimatch.js, 0, 0)) +@@= skipped -7, +7 lines =@@ + >'./minimatch' : Symbol("minimatch", Decl(minimatch.js, 0, 0)) mini.M.defaults() ->mini.M.defaults : Symbol(M.defaults, Decl(minimatch.js, 8, 1)) ->mini.M : Symbol(mini.M, Decl(minimatch.js, 1, 26)) ++>mini.M.defaults : Symbol(defaults, Decl(minimatch.js, 8, 1)) ++>mini.M : Symbol(M, Decl(minimatch.js, 1, 26)) >mini : Symbol(mini, Decl(use.js, 1, 3)) ->M : Symbol(mini.M, Decl(minimatch.js, 1, 26)) ->defaults : Symbol(M.defaults, Decl(minimatch.js, 8, 1)) ++>M : Symbol(M, Decl(minimatch.js, 1, 26)) ++>defaults : Symbol(defaults, Decl(minimatch.js, 8, 1)) var m = new mini.M() >m : Symbol(m, Decl(use.js, 3, 3)) ->mini.M : Symbol(mini.M, Decl(minimatch.js, 1, 26)) ++>mini.M : Symbol(M, Decl(minimatch.js, 1, 26)) >mini : Symbol(mini, Decl(use.js, 1, 3)) ->M : Symbol(mini.M, Decl(minimatch.js, 1, 26)) ++>M : Symbol(M, Decl(minimatch.js, 1, 26)) m.m() ->m.m : Symbol(M.m, Decl(minimatch.js, 11, 1)) @@ -26,60 +29,79 @@ mini.filter() ->mini.filter : Symbol(mini.filter, Decl(minimatch.js, 2, 15)) ++>mini.filter : Symbol(filter, Decl(minimatch.js, 2, 15)) >mini : Symbol(mini, Decl(use.js, 1, 3)) ->filter : Symbol(mini.filter, Decl(minimatch.js, 2, 15)) ++>filter : Symbol(filter, Decl(minimatch.js, 2, 15)) === types.d.ts === declare var require: any; -@@= skipped -32, +21 lines =@@ - declare var module: any; - >module : Symbol(module, Decl(types.d.ts, 1, 11)) - --=== minimatch.js === --/// --module.exports = minimatch +@@= skipped -32, +30 lines =@@ + === minimatch.js === + /// + module.exports = minimatch ->module.exports : Symbol(module.exports, Decl(minimatch.js, 0, 0)) ->module : Symbol(export=, Decl(minimatch.js, 0, 0)) ->exports : Symbol(export=, Decl(minimatch.js, 0, 0)) ->minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1), Decl(minimatch.js, 1, 26), Decl(minimatch.js, 2, 15)) -- --minimatch.M = M ++>module.exports : Symbol(minimatch, Decl(minimatch.js, 6, 1)) ++>module : Symbol(module.exports) ++>exports : Symbol(minimatch, Decl(minimatch.js, 6, 1)) ++>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1)) + + minimatch.M = M ->minimatch.M : Symbol(minimatch.M, Decl(minimatch.js, 1, 26)) ->minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1), Decl(minimatch.js, 1, 26), Decl(minimatch.js, 2, 15)) ->M : Symbol(minimatch.M, Decl(minimatch.js, 1, 26)) ->M : Symbol(M, Decl(minimatch.js, 13, 1), Decl(minimatch.js, 8, 1)) -- --minimatch.filter = filter ++>minimatch.M : Symbol(M, Decl(minimatch.js, 1, 26)) ++>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1)) ++>M : Symbol(M, Decl(minimatch.js, 1, 26)) ++>M : Symbol(M, Decl(minimatch.js, 13, 1)) + + minimatch.filter = filter ->minimatch.filter : Symbol(minimatch.filter, Decl(minimatch.js, 2, 15)) ->minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1), Decl(minimatch.js, 1, 26), Decl(minimatch.js, 2, 15)) ->filter : Symbol(minimatch.filter, Decl(minimatch.js, 2, 15)) -->filter : Symbol(filter, Decl(minimatch.js, 3, 25)) -- --function filter() { -->filter : Symbol(filter, Decl(minimatch.js, 3, 25)) -- -- return minimatch() ++>minimatch.filter : Symbol(filter, Decl(minimatch.js, 2, 15)) ++>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1)) ++>filter : Symbol(filter, Decl(minimatch.js, 2, 15)) + >filter : Symbol(filter, Decl(minimatch.js, 3, 25)) + + function filter() { + >filter : Symbol(filter, Decl(minimatch.js, 3, 25)) + + return minimatch() ->minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1), Decl(minimatch.js, 1, 26), Decl(minimatch.js, 2, 15)) --} --function minimatch() { ++>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1)) + } + function minimatch() { ->minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1), Decl(minimatch.js, 1, 26), Decl(minimatch.js, 2, 15)) --} --M.defaults = function (def) { ++>minimatch : Symbol(minimatch, Decl(minimatch.js, 6, 1)) + } + M.defaults = function (def) { ->M.defaults : Symbol(M.defaults, Decl(minimatch.js, 8, 1)) ->M : Symbol(M, Decl(minimatch.js, 13, 1), Decl(minimatch.js, 8, 1)) ->defaults : Symbol(M.defaults, Decl(minimatch.js, 8, 1)) -->def : Symbol(def, Decl(minimatch.js, 9, 23)) -- -- return def -->def : Symbol(def, Decl(minimatch.js, 9, 23)) --} --M.prototype.m = function () { ++>M.defaults : Symbol(defaults, Decl(minimatch.js, 8, 1)) ++>M : Symbol(M, Decl(minimatch.js, 13, 1)) ++>defaults : Symbol(defaults, Decl(minimatch.js, 8, 1)) + >def : Symbol(def, Decl(minimatch.js, 9, 23)) + + return def + >def : Symbol(def, Decl(minimatch.js, 9, 23)) + } + M.prototype.m = function () { ->M.prototype : Symbol(M.m, Decl(minimatch.js, 11, 1)) ->M : Symbol(M, Decl(minimatch.js, 13, 1), Decl(minimatch.js, 8, 1)) ->prototype : Symbol(Function.prototype, Decl(lib.es5.d.ts, --, --)) ->m : Symbol(M.m, Decl(minimatch.js, 11, 1)) --} --function M() { ++>M.prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) ++>M : Symbol(M, Decl(minimatch.js, 13, 1)) ++>prototype : Symbol(prototype, Decl(lib.es5.d.ts, --, --)) + } + function M() { ->M : Symbol(M, Decl(minimatch.js, 13, 1), Decl(minimatch.js, 8, 1)) --} -- ++>M : Symbol(M, Decl(minimatch.js, 13, 1)) + } + diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.types index 50f2ba670c..20ccb10834 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment17.types @@ -3,25 +3,25 @@ === use.js === /// var mini = require('./minimatch') ->mini : any ->require('./minimatch') : any +>mini : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } +>require('./minimatch') : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } >require : any >'./minimatch' : "./minimatch" mini.M.defaults() >mini.M.defaults() : any ->mini.M.defaults : any ->mini.M : any ->mini : any ->M : any ->defaults : any +>mini.M.defaults : (def: any) => any +>mini.M : { (): void; defaults: (def: any) => any; } +>mini : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } +>M : { (): void; defaults: (def: any) => any; } +>defaults : (def: any) => any var m = new mini.M() >m : any >new mini.M() : any ->mini.M : any ->mini : any ->M : any +>mini.M : { (): void; defaults: (def: any) => any; } +>mini : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } +>M : { (): void; defaults: (def: any) => any; } m.m() >m.m() : any @@ -30,10 +30,10 @@ m.m() >m : any mini.filter() ->mini.filter() : any ->mini.filter : any ->mini : any ->filter : any +>mini.filter() : void +>mini.filter : () => void +>mini : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } +>filter : () => void === types.d.ts === declare var require: any; @@ -42,3 +42,60 @@ declare var require: any; declare var module: any; >module : any +=== minimatch.js === +/// +module.exports = minimatch +>module.exports = minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } +>module.exports : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } +>module : { minimatch: { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; }; } +>exports : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } +>minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } + +minimatch.M = M +>minimatch.M = M : { (): void; defaults: (def: any) => any; } +>minimatch.M : { (): void; defaults: (def: any) => any; } +>minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } +>M : { (): void; defaults: (def: any) => any; } +>M : { (): void; defaults: (def: any) => any; } + +minimatch.filter = filter +>minimatch.filter = filter : () => void +>minimatch.filter : () => void +>minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } +>filter : () => void +>filter : () => void + +function filter() { +>filter : () => void + + return minimatch() +>minimatch() : void +>minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } +} +function minimatch() { +>minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } +} +M.defaults = function (def) { +>M.defaults = function (def) { return def} : (def: any) => any +>M.defaults : (def: any) => any +>M : { (): void; defaults: (def: any) => any; } +>defaults : (def: any) => any +>function (def) { return def} : (def: any) => any +>def : any + + return def +>def : any +} +M.prototype.m = function () { +>M.prototype.m = function () {} : () => void +>M.prototype.m : any +>M.prototype : any +>M : { (): void; defaults: (def: any) => any; } +>prototype : any +>m : any +>function () {} : () => void +} +function M() { +>M : { (): void; defaults: (def: any) => any; } +} + diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.errors.txt new file mode 100644 index 0000000000..ae7c3d1962 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.errors.txt @@ -0,0 +1,23 @@ +index.js(2,19): error TS2306: File 'semver.js' is not a module. +semver.js(2,1): error TS2304: Cannot find name 'exports'. + + +==== index.js (1 errors) ==== + /// + const C = require("./semver") + ~~~~~~~~~~ +!!! error TS2306: File 'semver.js' is not a module. + var two = C.f(1) + +==== types.d.ts (0 errors) ==== + declare var require: any; + declare var module: any; +==== semver.js (1 errors) ==== + /// + exports = module.exports = C + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. + C.f = n => n + 1 + function C() { + this.p = 1 + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.symbols index b642887626..9523fb3bf3 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.symbols @@ -17,3 +17,21 @@ declare var require: any; declare var module: any; >module : Symbol(module, Decl(types.d.ts, 1, 11)) +=== semver.js === +/// +exports = module.exports = C +>module : Symbol(module, Decl(types.d.ts, 1, 11)) +>C : Symbol(C, Decl(semver.js, 2, 16)) + +C.f = n => n + 1 +>C.f : Symbol(f, Decl(semver.js, 1, 28)) +>C : Symbol(C, Decl(semver.js, 2, 16)) +>f : Symbol(f, Decl(semver.js, 1, 28)) +>n : Symbol(n, Decl(semver.js, 2, 5)) +>n : Symbol(n, Decl(semver.js, 2, 5)) + +function C() { +>C : Symbol(C, Decl(semver.js, 2, 16)) + + this.p = 1 +} diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.symbols.diff index 51dc795bf9..f27d8b3395 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.symbols.diff @@ -14,31 +14,34 @@ === types.d.ts === declare var require: any; -@@= skipped -15, +12 lines =@@ - declare var module: any; - >module : Symbol(module, Decl(types.d.ts, 1, 11)) - --=== semver.js === --/// --exports = module.exports = C +@@= skipped -18, +15 lines =@@ + === semver.js === + /// + exports = module.exports = C ->exports : Symbol("semver", Decl(semver.js, 0, 0)) ->module.exports : Symbol(module.exports, Decl(semver.js, 0, 0)) ->module : Symbol(export=, Decl(semver.js, 1, 9)) ->exports : Symbol(export=, Decl(semver.js, 1, 9)) ->C : Symbol(C, Decl(semver.js, 2, 16), Decl(semver.js, 1, 28)) -- --C.f = n => n + 1 ++>module : Symbol(module, Decl(types.d.ts, 1, 11)) ++>C : Symbol(C, Decl(semver.js, 2, 16)) + + C.f = n => n + 1 ->C.f : Symbol(C.f, Decl(semver.js, 1, 28)) ->C : Symbol(C, Decl(semver.js, 2, 16), Decl(semver.js, 1, 28)) ->f : Symbol(C.f, Decl(semver.js, 1, 28)) -->n : Symbol(n, Decl(semver.js, 2, 5)) -->n : Symbol(n, Decl(semver.js, 2, 5)) -- --function C() { ++>C.f : Symbol(f, Decl(semver.js, 1, 28)) ++>C : Symbol(C, Decl(semver.js, 2, 16)) ++>f : Symbol(f, Decl(semver.js, 1, 28)) + >n : Symbol(n, Decl(semver.js, 2, 5)) + >n : Symbol(n, Decl(semver.js, 2, 5)) + + function C() { ->C : Symbol(C, Decl(semver.js, 2, 16), Decl(semver.js, 1, 28)) -- -- this.p = 1 ++>C : Symbol(C, Decl(semver.js, 2, 16)) + + this.p = 1 ->this.p : Symbol(C.p, Decl(semver.js, 3, 14)) ->this : Symbol(C, Decl(semver.js, 2, 16), Decl(semver.js, 1, 28)) ->p : Symbol(C.p, Decl(semver.js, 3, 14)) --} + } diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.types index 88801b3e16..4a10207ef1 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment19.types @@ -23,3 +23,35 @@ declare var require: any; declare var module: any; >module : any +=== semver.js === +/// +exports = module.exports = C +>exports = module.exports = C : { (): void; f: (n: any) => any; } +>exports : any +>module.exports = C : { (): void; f: (n: any) => any; } +>module.exports : any +>module : any +>exports : any +>C : { (): void; f: (n: any) => any; } + +C.f = n => n + 1 +>C.f = n => n + 1 : (n: any) => any +>C.f : (n: any) => any +>C : { (): void; f: (n: any) => any; } +>f : (n: any) => any +>n => n + 1 : (n: any) => any +>n : any +>n + 1 : any +>n : any +>1 : 1 + +function C() { +>C : { (): void; f: (n: any) => any; } + + this.p = 1 +>this.p = 1 : 1 +>this.p : any +>this : any +>p : any +>1 : 1 +} diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt index 241d459cb7..a8a549a4f4 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.errors.txt @@ -1,18 +1,27 @@ -use.js(1,14): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod.js(1,14): error TS2304: Cannot find name 'exports'. +mod.js(1,24): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod.js(3,10): error TS2339: Property 'existy' does not exist on type '{}'. +use.js(1,22): error TS2306: File 'mod.js' is not a module. ==== use.js (1 errors) ==== const util = require('./mod') - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~ +!!! error TS2306: File 'mod.js' is not a module. function n() { util.existy // no error } util.existy // no error -==== mod.js (0 errors) ==== +==== mod.js (3 errors) ==== const util = exports = module.exports = {} + ~~~~~~~ +!!! error TS2304: Cannot find name 'exports'. + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. if (!!false) { util.existy = function () { } + ~~~~~~ +!!! error TS2339: Property 'existy' does not exist on type '{}'. } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.symbols b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.symbols index afd59dac35..218408dd07 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.symbols @@ -3,6 +3,7 @@ === use.js === const util = require('./mod') >util : Symbol(util, Decl(use.js, 0, 5)) +>require : Symbol(require) function n() { >n : Symbol(n, Decl(use.js, 0, 29)) @@ -13,3 +14,12 @@ function n() { util.existy // no error >util : Symbol(util, Decl(use.js, 0, 5)) +=== mod.js === +const util = exports = module.exports = {} +>util : Symbol(util, Decl(mod.js, 0, 5)) + +if (!!false) { + util.existy = function () { } +>util : Symbol(util, Decl(mod.js, 0, 5)) +} + diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.symbols.diff index 4c80700533..0037718b26 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.symbols.diff @@ -1,10 +1,9 @@ --- old.typeFromPropertyAssignment37.symbols +++ new.typeFromPropertyAssignment37.symbols -@@= skipped -2, +2 lines =@@ - === use.js === +@@= skipped -3, +3 lines =@@ const util = require('./mod') >util : Symbol(util, Decl(use.js, 0, 5)) -->require : Symbol(require) + >require : Symbol(require) ->'./mod' : Symbol(util, Decl(mod.js, 0, 0)) function n() { @@ -20,18 +19,18 @@ >util : Symbol(util, Decl(use.js, 0, 5)) ->existy : Symbol(util.existy, Decl(mod.js, 1, 14)) --=== mod.js === --const util = exports = module.exports = {} -->util : Symbol(util, Decl(mod.js, 0, 5)) + === mod.js === + const util = exports = module.exports = {} + >util : Symbol(util, Decl(mod.js, 0, 5)) ->exports : Symbol("mod", Decl(mod.js, 0, 0)) ->module.exports : Symbol(module.exports, Decl(mod.js, 0, 0)) ->module : Symbol(module, Decl(mod.js, 0, 22)) ->exports : Symbol(module.exports, Decl(mod.js, 0, 0)) -- --if (!!false) { -- util.existy = function () { } + + if (!!false) { + util.existy = function () { } ->util.existy : Symbol(existy, Decl(mod.js, 1, 14)) -->util : Symbol(util, Decl(mod.js, 0, 5)) + >util : Symbol(util, Decl(mod.js, 0, 5)) ->existy : Symbol(existy, Decl(mod.js, 1, 14)) --} -- + } + diff --git a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.types b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.types index 291336ab14..6dbb6c85d9 100644 --- a/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.types +++ b/testdata/baselines/reference/submodule/conformance/typeFromPropertyAssignment37.types @@ -20,3 +20,27 @@ util.existy // no error >util : any >existy : any +=== mod.js === +const util = exports = module.exports = {} +>util : {} +>exports = module.exports = {} : {} +>exports : any +>module.exports = {} : {} +>module.exports : any +>module : any +>exports : any +>{} : {} + +if (!!false) { +>!!false : boolean +>!false : true +>false : false + + util.existy = function () { } +>util.existy = function () { } : () => void +>util.existy : any +>util : {} +>existy : any +>function () { } : () => void +} + diff --git a/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.errors.txt b/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.errors.txt deleted file mode 100644 index c749b9209e..0000000000 --- a/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -bug27327.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - -==== bug27327.js (1 errors) ==== - /** @type {string} */ - module.exports = 0; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.symbols b/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.symbols index 6f81cfecc9..67612a6178 100644 --- a/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.symbols +++ b/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.symbols @@ -1,7 +1,9 @@ //// [tests/cases/conformance/jsdoc/typeTagModuleExports.ts] //// === bug27327.js === - /** @type {string} */ module.exports = 0; +>module.exports : Symbol(export=, Decl(bug27327.js, 0, 0)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(bug27327.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.symbols.diff b/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.symbols.diff index b795af7f31..351a74227a 100644 --- a/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.symbols.diff @@ -1,13 +1,12 @@ --- old.typeTagModuleExports.symbols +++ new.typeTagModuleExports.symbols -@@= skipped -0, +0 lines =@@ - //// [tests/cases/conformance/jsdoc/typeTagModuleExports.ts] //// - +@@= skipped -2, +2 lines =@@ === bug27327.js === -+ /** @type {string} */ module.exports = 0; ->module.exports : Symbol(module.exports, Decl(bug27327.js, 0, 0)) ->module : Symbol(export=, Decl(bug27327.js, 0, 0)) -->exports : Symbol(export=, Decl(bug27327.js, 0, 0)) ++>module.exports : Symbol(export=, Decl(bug27327.js, 0, 0)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(bug27327.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.types b/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.types index cd046edf85..28ef7704b4 100644 --- a/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.types +++ b/testdata/baselines/reference/submodule/conformance/typeTagModuleExports.types @@ -4,8 +4,8 @@ /** @type {string} */ module.exports = 0; >module.exports = 0 : 0 ->module.exports : any ->module : any ->exports : any +>module.exports : 0 +>module : { export=: 0; } +>exports : 0 >0 : 0 diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule.errors.txt b/testdata/baselines/reference/submodule/conformance/typedefCrossModule.errors.txt index 0477d0beb9..cec769759b 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule.errors.txt @@ -1,14 +1,17 @@ -mod3.js(6,1): error TS2304: Cannot find name 'exports'. +mod1.js(5,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +use.js(1,29): error TS2694: Namespace 'C' has no exported member 'Both'. ==== commonjs.d.ts (0 errors) ==== declare var module: { exports: any}; -==== mod1.js (0 errors) ==== +==== mod1.js (1 errors) ==== /// /** @typedef {{ type: "a", x: 1 }} A */ /** @typedef {{ type: "b", y: 1 }} B */ /** @typedef {A | B} Both */ module.exports = C + ~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. function C() { this.p = 1 } @@ -23,20 +26,20 @@ mod3.js(6,1): error TS2304: Cannot find name 'exports'. this.p = 1 } -==== mod3.js (1 errors) ==== +==== mod3.js (0 errors) ==== /// /** @typedef {{ type: "a", x: 1 }} A */ /** @typedef {{ type: "b", y: 1 }} B */ /** @typedef {A | B} Both */ exports.C = function() { - ~~~~~~~ -!!! error TS2304: Cannot find name 'exports'. this.p = 1 } -==== use.js (0 errors) ==== +==== use.js (1 errors) ==== /** @type {import('./mod1').Both} */ + ~~~~ +!!! error TS2694: Namespace 'C' has no exported member 'Both'. var both1 = { type: 'a', x: 1 }; /** @type {import('./mod2').Both} */ var both2 = both1; diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule.symbols b/testdata/baselines/reference/submodule/conformance/typedefCrossModule.symbols index 5099a3d4b5..32a138e1d0 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule.symbols +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule.symbols @@ -11,9 +11,9 @@ declare var module: { exports: any}; /** @typedef {{ type: "b", y: 1 }} B */ /** @typedef {A | B} Both */ module.exports = C ->module.exports : Symbol(exports, Decl(commonjs.d.ts, 0, 21)) ->module : Symbol(module, Decl(commonjs.d.ts, 0, 11)) ->exports : Symbol(exports, Decl(commonjs.d.ts, 0, 21)) +>module.exports : Symbol(C, Decl(mod1.js, 4, 18)) +>module : Symbol(module.exports) +>exports : Symbol(C, Decl(mod1.js, 4, 18)) >C : Symbol(C, Decl(mod1.js, 4, 18)) function C() { @@ -35,13 +35,16 @@ export function C() { } === mod3.js === - /// /** @typedef {{ type: "a", x: 1 }} A */ /** @typedef {{ type: "b", y: 1 }} B */ /** @typedef {A | B} Both */ exports.C = function() { +>exports.C : Symbol(C, Decl(mod3.js, 0, 0)) +>exports : Symbol("mod3", Decl(mod3.js, 0, 0)) +>C : Symbol(C, Decl(mod3.js, 0, 0)) + this.p = 1 } diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule.symbols.diff b/testdata/baselines/reference/submodule/conformance/typedefCrossModule.symbols.diff index 991bda7cb7..207aaa80f8 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule.symbols.diff @@ -7,9 +7,9 @@ ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 0, 0)) ->exports : Symbol(export=, Decl(mod1.js, 0, 0)) -+>module.exports : Symbol(exports, Decl(commonjs.d.ts, 0, 21)) -+>module : Symbol(module, Decl(commonjs.d.ts, 0, 11)) -+>exports : Symbol(exports, Decl(commonjs.d.ts, 0, 21)) ++>module.exports : Symbol(C, Decl(mod1.js, 4, 18)) ++>module : Symbol(module.exports) ++>exports : Symbol(C, Decl(mod1.js, 4, 18)) >C : Symbol(C, Decl(mod1.js, 4, 18)) function C() { @@ -32,17 +32,14 @@ } === mod3.js === -+ - /// - /** @typedef {{ type: "a", x: 1 }} A */ - /** @typedef {{ type: "b", y: 1 }} B */ - /** @typedef {A | B} Both */ +@@= skipped -13, +10 lines =@@ exports.C = function() { -->exports.C : Symbol(C, Decl(mod3.js, 0, 0)) + >exports.C : Symbol(C, Decl(mod3.js, 0, 0)) ->exports : Symbol(C, Decl(mod3.js, 0, 0)) -->C : Symbol(C, Decl(mod3.js, 0, 0)) -- ++>exports : Symbol("mod3", Decl(mod3.js, 0, 0)) + >C : Symbol(C, Decl(mod3.js, 0, 0)) + this.p = 1 ->this.p : Symbol(C.p, Decl(mod3.js, 5, 24)) ->this : Symbol(C, Decl(mod3.js, 5, 11)) diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule.types b/testdata/baselines/reference/submodule/conformance/typedefCrossModule.types index 46ee7c4072..f7fd67e21f 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule.types +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule.types @@ -12,9 +12,9 @@ declare var module: { exports: any}; /** @typedef {A | B} Both */ module.exports = C >module.exports = C : () => void ->module.exports : any ->module : { exports: any; } ->exports : any +>module.exports : () => void +>module : { C: () => void; } +>exports : () => void >C : () => void function C() { @@ -54,7 +54,7 @@ export function C() { exports.C = function() { >exports.C = function() { this.p = 1} : () => void >exports.C : any ->exports : any +>exports : typeof import("mod3") >C : any >function() { this.p = 1} : () => void @@ -69,22 +69,22 @@ exports.C = function() { === use.js === /** @type {import('./mod1').Both} */ var both1 = { type: 'a', x: 1 }; ->both1 : { type: "a"; x: 1; } | { type: "b"; y: 1; } ->{ type: 'a', x: 1 } : { type: "a"; x: 1; } ->type : "a" +>both1 : any +>{ type: 'a', x: 1 } : { type: string; x: number; } +>type : string >'a' : "a" ->x : 1 +>x : number >1 : 1 /** @type {import('./mod2').Both} */ var both2 = both1; >both2 : Both ->both1 : { type: "a"; x: 1; } +>both1 : any /** @type {import('./mod3').Both} */ var both3 = both2; >both3 : { type: "a"; x: 1; } | { type: "b"; y: 1; } ->both2 : A +>both2 : Both diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.errors.txt b/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.errors.txt index 98a50caafd..d48c75aeb1 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.errors.txt @@ -1,15 +1,20 @@ -use.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -use.js(2,19): error TS2307: Cannot find module './mod1.js' or its corresponding type declarations. +mod1.js(3,23): error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local. +mod1.js(4,7): error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local. +mod1.js(7,9): error TS2339: Property 'Bar' does not exist on type 'typeof import("mod1")'. +mod1.js(10,1): error TS2300: Duplicate identifier 'export='. +mod1.js(10,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +mod1.js(20,9): error TS2339: Property 'Quid' does not exist on type 'typeof import("mod1")'. +mod1.js(23,1): error TS2300: Duplicate identifier 'export='. +mod1.js(24,5): error TS2353: Object literal may only specify known properties, and 'Quack' does not exist in type '{ Baz: typeof Baz; }'. +use.js(2,32): error TS2694: Namespace '"mod1".export=' has no exported member 'Baz'. use.js(4,12): error TS2503: Cannot find namespace 'mod'. -==== use.js (3 errors) ==== +==== use.js (2 errors) ==== var mod = require('./mod1.js'); - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** @type {import("./mod1.js").Baz} */ - ~~~~~~~~~~~ -!!! error TS2307: Cannot find module './mod1.js' or its corresponding type declarations. + ~~~ +!!! error TS2694: Namespace '"mod1".export=' has no exported member 'Baz'. var b; /** @type {mod.Baz} */ ~~~ @@ -17,19 +22,33 @@ use.js(4,12): error TS2503: Cannot find namespace 'mod'. var bb; var bbb = new mod.Baz(); -==== mod1.js (0 errors) ==== +==== mod1.js (8 errors) ==== // error /** @typedef {number} Foo */ + ~~~ +!!! error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local. class Foo { } // should error + ~~~ +!!! error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local. /** @typedef {number} Bar */ exports.Bar = class { } + ~~~ +!!! error TS2339: Property 'Bar' does not exist on type 'typeof import("mod1")'. /** @typedef {number} Baz */ module.exports = { + ~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~ Baz: class { } + ~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~ } + ~ +!!! error TS2300: Duplicate identifier 'export='. + ~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. // ok @@ -38,9 +57,17 @@ use.js(4,12): error TS2503: Cannot find namespace 'mod'. /** @typedef {number} Quid */ exports.Quid = 2; + ~~~~ +!!! error TS2339: Property 'Quid' does not exist on type 'typeof import("mod1")'. /** @typedef {number} Quack */ module.exports = { + ~~~~~~~~~~~~~~~~~~ Quack: 2 + ~~~~~~~~~~~~ + ~~~~~ +!!! error TS2353: Object literal may only specify known properties, and 'Quack' does not exist in type '{ Baz: typeof Baz; }'. } + ~ +!!! error TS2300: Duplicate identifier 'export='. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.symbols b/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.symbols index 223b074615..2104a285c8 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.symbols +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.symbols @@ -3,6 +3,8 @@ === use.js === var mod = require('./mod1.js'); >mod : Symbol(mod, Decl(use.js, 0, 3)) +>require : Symbol(require) +>'./mod1.js' : Symbol("mod1", Decl(mod1.js, 0, 0)) /** @type {import("./mod1.js").Baz} */ var b; @@ -14,5 +16,48 @@ var bb; var bbb = new mod.Baz(); >bbb : Symbol(bbb, Decl(use.js, 5, 3)) +>mod.Baz : Symbol(Baz, Decl(mod1.js, 9, 18)) >mod : Symbol(mod, Decl(use.js, 0, 3)) +>Baz : Symbol(Baz, Decl(mod1.js, 9, 18)) + +=== mod1.js === +// error + +/** @typedef {number} Foo */ +class Foo { } // should error +>Foo : Symbol(Foo, Decl(mod1.js, 2, 4), Decl(mod1.js, 0, 0)) + +/** @typedef {number} Bar */ +exports.Bar = class { } +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) + +/** @typedef {number} Baz */ +module.exports = { +>module.exports : Symbol(export=, Decl(mod1.js, 6, 23)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod1.js, 6, 23)) + + Baz: class { } +>Baz : Symbol(Baz, Decl(mod1.js, 9, 18)) +} + +// ok + +/** @typedef {number} Qux */ +var Qux = 2; +>Qux : Symbol(Qux, Decl(mod1.js, 15, 4), Decl(mod1.js, 16, 3)) + +/** @typedef {number} Quid */ +exports.Quid = 2; +>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) + +/** @typedef {number} Quack */ +module.exports = { +>module.exports : Symbol(export=, Decl(mod1.js, 6, 23)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod1.js, 6, 23)) + + Quack: 2 +>Quack : Symbol(Quack, Decl(mod1.js, 22, 18)) +} diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.symbols.diff b/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.symbols.diff index 39b294c7b2..aee4122252 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.symbols.diff @@ -1,64 +1,63 @@ --- old.typedefCrossModule2.symbols +++ new.typedefCrossModule2.symbols -@@= skipped -2, +2 lines =@@ - === use.js === - var mod = require('./mod1.js'); - >mod : Symbol(mod, Decl(use.js, 0, 3)) -->require : Symbol(require) -->'./mod1.js' : Symbol("mod1", Decl(mod1.js, 0, 0)) - - /** @type {import("./mod1.js").Baz} */ - var b; -@@= skipped -13, +11 lines =@@ +@@= skipped -15, +15 lines =@@ var bbb = new mod.Baz(); >bbb : Symbol(bbb, Decl(use.js, 5, 3)) ->mod.Baz : Symbol(Baz, Decl(mod1.js, 8, 4), Decl(mod1.js, 9, 18), Decl(mod1.js, 8, 4), Decl(mod1.js, 9, 18)) ++>mod.Baz : Symbol(Baz, Decl(mod1.js, 9, 18)) >mod : Symbol(mod, Decl(use.js, 0, 3)) ->Baz : Symbol(Baz, Decl(mod1.js, 8, 4), Decl(mod1.js, 9, 18), Decl(mod1.js, 8, 4), Decl(mod1.js, 9, 18)) ++>Baz : Symbol(Baz, Decl(mod1.js, 9, 18)) + + === mod1.js === + // error --=== mod1.js === --// error -- --/** @typedef {number} Foo */ --class Foo { } // should error + /** @typedef {number} Foo */ + class Foo { } // should error ->Foo : Symbol(Foo, Decl(mod1.js, 0, 0)) -- --/** @typedef {number} Bar */ --exports.Bar = class { } ++>Foo : Symbol(Foo, Decl(mod1.js, 2, 4), Decl(mod1.js, 0, 0)) + + /** @typedef {number} Bar */ + exports.Bar = class { } ->exports.Bar : Symbol(Bar, Decl(mod1.js, 3, 13), Decl(mod1.js, 5, 4)) ->exports : Symbol(Bar, Decl(mod1.js, 3, 13), Decl(mod1.js, 5, 4)) ->Bar : Symbol(Bar, Decl(mod1.js, 3, 13), Decl(mod1.js, 5, 4)) -- --/** @typedef {number} Baz */ --module.exports = { ++>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) + + /** @typedef {number} Baz */ + module.exports = { ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 6, 23), Decl(mod1.js, 19, 17)) ->exports : Symbol(export=, Decl(mod1.js, 6, 23), Decl(mod1.js, 19, 17)) -- -- Baz: class { } -->Baz : Symbol(Baz, Decl(mod1.js, 9, 18)) --} -- --// ok -- --/** @typedef {number} Qux */ --var Qux = 2; ++>module.exports : Symbol(export=, Decl(mod1.js, 6, 23)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(mod1.js, 6, 23)) + + Baz: class { } + >Baz : Symbol(Baz, Decl(mod1.js, 9, 18)) +@@= skipped -31, +29 lines =@@ + + /** @typedef {number} Qux */ + var Qux = 2; ->Qux : Symbol(Qux, Decl(mod1.js, 16, 3), Decl(mod1.js, 15, 4)) -- --/** @typedef {number} Quid */ --exports.Quid = 2; ++>Qux : Symbol(Qux, Decl(mod1.js, 15, 4), Decl(mod1.js, 16, 3)) + + /** @typedef {number} Quid */ + exports.Quid = 2; ->exports.Quid : Symbol(Quid, Decl(mod1.js, 16, 12), Decl(mod1.js, 18, 4)) ->exports : Symbol(Quid, Decl(mod1.js, 16, 12), Decl(mod1.js, 18, 4)) ->Quid : Symbol(Quid, Decl(mod1.js, 16, 12), Decl(mod1.js, 18, 4)) -- --/** @typedef {number} Quack */ --module.exports = { ++>exports : Symbol("mod1", Decl(mod1.js, 0, 0)) + + /** @typedef {number} Quack */ + module.exports = { ->module.exports : Symbol(module.exports, Decl(mod1.js, 0, 0)) ->module : Symbol(export=, Decl(mod1.js, 6, 23), Decl(mod1.js, 19, 17)) ->exports : Symbol(export=, Decl(mod1.js, 6, 23), Decl(mod1.js, 19, 17)) -- -- Quack: 2 -->Quack : Symbol(Quack, Decl(mod1.js, 22, 18)) --} -- ++>module.exports : Symbol(export=, Decl(mod1.js, 6, 23)) ++>module : Symbol(module.exports) ++>exports : Symbol(export=, Decl(mod1.js, 6, 23)) + + Quack: 2 + >Quack : Symbol(Quack, Decl(mod1.js, 22, 18)) diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.types b/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.types index 053aa0751b..ec6c87f6dd 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.types +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule2.types @@ -2,8 +2,8 @@ === use.js === var mod = require('./mod1.js'); ->mod : any ->require('./mod1.js') : any +>mod : { Baz: typeof Baz; } +>require('./mod1.js') : { Baz: typeof Baz; } >require : any >'./mod1.js' : "./mod1.js" @@ -16,9 +16,65 @@ var bb; >bb : Baz var bbb = new mod.Baz(); ->bbb : any ->new mod.Baz() : any ->mod.Baz : any ->mod : any ->Baz : any +>bbb : Baz +>new mod.Baz() : Baz +>mod.Baz : typeof Baz +>mod : { Baz: typeof Baz; } +>Baz : typeof Baz + +=== mod1.js === +// error + +/** @typedef {number} Foo */ +class Foo { } // should error +>Foo : Foo + +/** @typedef {number} Bar */ +exports.Bar = class { } +>exports.Bar = class { } : typeof Bar +>exports.Bar : any +>exports : typeof import("mod1") +>Bar : any +>class { } : typeof Bar + +/** @typedef {number} Baz */ +module.exports = { +>module.exports = { Baz: class { }} : { Baz: typeof Baz; } +>module.exports : { Baz: typeof Baz; } +>module : { export=: { Baz: typeof Baz; }; } +>exports : { Baz: typeof Baz; } +>{ Baz: class { }} : { Baz: typeof Baz; } + + Baz: class { } +>Baz : typeof Baz +>class { } : typeof Baz +} + +// ok + +/** @typedef {number} Qux */ +var Qux = 2; +>Qux : number +>2 : 2 + +/** @typedef {number} Quid */ +exports.Quid = 2; +>exports.Quid = 2 : 2 +>exports.Quid : any +>exports : typeof import("mod1") +>Quid : any +>2 : 2 + +/** @typedef {number} Quack */ +module.exports = { +>module.exports = { Quack: 2} : { Quack: number; } +>module.exports : { Baz: typeof Baz; } +>module : { export=: { Baz: typeof Baz; }; } +>exports : { Baz: typeof Baz; } +>{ Quack: 2} : { Quack: number; } + + Quack: 2 +>Quack : number +>2 : 2 +} diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.errors.txt b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.errors.txt index 33d2084409..cc76ff4dfb 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.errors.txt @@ -1,5 +1,5 @@ mod2.js(3,4): error TS2339: Property 'Foo' does not exist on type '{}'. -mod2.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod2.js(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ==== mod2.js (2 errors) ==== @@ -9,7 +9,7 @@ mod2.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install ty ~~~ !!! error TS2339: Property 'Foo' does not exist on type '{}'. module.exports = ns; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols index ac02859c0a..903e7274bb 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols @@ -9,6 +9,9 @@ ns.Foo = class {} >ns : Symbol(ns, Decl(mod2.js, 1, 5)) module.exports = ns; +>module.exports : Symbol(ns, Decl(mod2.js, 1, 5)) +>module : Symbol(module.exports) +>exports : Symbol(ns, Decl(mod2.js, 1, 5)) >ns : Symbol(ns, Decl(mod2.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols.diff b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols.diff index b32c4fb19e..9f1daabc85 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.symbols.diff @@ -18,6 +18,9 @@ ->module : Symbol(export=, Decl(mod2.js, 2, 17)) ->exports : Symbol(export=, Decl(mod2.js, 2, 17)) ->ns : Symbol(ns, Decl(mod2.js, 1, 5), Decl(mod2.js, 1, 14)) ++>module.exports : Symbol(ns, Decl(mod2.js, 1, 5)) ++>module : Symbol(module.exports) ++>exports : Symbol(ns, Decl(mod2.js, 1, 5)) +>ns : Symbol(ns, Decl(mod2.js, 1, 5)) diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.types b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.types index bf416ab331..2cd97df031 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.types +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule3.types @@ -15,9 +15,9 @@ ns.Foo = class {} module.exports = ns; >module.exports = ns : {} ->module.exports : any ->module : any ->exports : any +>module.exports : {} +>module : { readonly ns: {}; } +>exports : {} >ns : {} diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.errors.txt b/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.errors.txt index 8ddc82f665..a7d9cbb9a3 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.errors.txt @@ -1,11 +1,11 @@ -mod3.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod3.js(3,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ==== mod3.js (1 errors) ==== /** @typedef {number} Foo */ class Bar { } module.exports = { Foo: Bar }; - ~~~~~~ -!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS2309: An export assignment cannot be used in a module with other exported elements. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.symbols b/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.symbols index f8f7211727..df71c02b02 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.symbols +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.symbols @@ -6,6 +6,9 @@ class Bar { } >Bar : Symbol(Bar, Decl(mod3.js, 0, 0)) module.exports = { Foo: Bar }; +>module.exports : Symbol(export=, Decl(mod3.js, 1, 13)) +>module : Symbol(module.exports) +>exports : Symbol(export=, Decl(mod3.js, 1, 13)) >Foo : Symbol(Foo, Decl(mod3.js, 2, 18)) >Bar : Symbol(Bar, Decl(mod3.js, 0, 0)) diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.symbols.diff b/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.symbols.diff index f1ac3903a7..4e2f592e09 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.symbols.diff @@ -6,7 +6,8 @@ module.exports = { Foo: Bar }; ->module.exports : Symbol(module.exports, Decl(mod3.js, 0, 0)) ->module : Symbol(export=, Decl(mod3.js, 1, 13)) -->exports : Symbol(export=, Decl(mod3.js, 1, 13)) ++>module.exports : Symbol(export=, Decl(mod3.js, 1, 13)) ++>module : Symbol(module.exports) + >exports : Symbol(export=, Decl(mod3.js, 1, 13)) >Foo : Symbol(Foo, Decl(mod3.js, 2, 18)) >Bar : Symbol(Bar, Decl(mod3.js, 0, 0)) - diff --git a/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.types b/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.types index 38aefb1251..8892473ed7 100644 --- a/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.types +++ b/testdata/baselines/reference/submodule/conformance/typedefCrossModule4.types @@ -7,9 +7,9 @@ class Bar { } module.exports = { Foo: Bar }; >module.exports = { Foo: Bar } : { Foo: typeof Bar; } ->module.exports : any ->module : any ->exports : any +>module.exports : { Foo: typeof Bar; } +>module : { export=: { Foo: typeof Bar; }; } +>exports : { Foo: typeof Bar; } >{ Foo: Bar } : { Foo: typeof Bar; } >Foo : typeof Bar >Bar : typeof Bar diff --git a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.errors.txt b/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.errors.txt deleted file mode 100644 index 4f39e42d21..0000000000 --- a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.errors.txt +++ /dev/null @@ -1,12 +0,0 @@ -/a.ts(1,17): error TS2307: Cannot find module 'foo' or its corresponding type declarations. - - -==== /a.ts (1 errors) ==== - import foo from "foo"; - ~~~~~ -!!! error TS2307: Cannot find module 'foo' or its corresponding type declarations. - foo.bar(); - -==== /node_modules/foo/index.js (0 errors) ==== - exports.default = { bar() { return 0; } } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.errors.txt.diff deleted file mode 100644 index 9cc6b6ff5d..0000000000 --- a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.untypedModuleImport_allowJs.errors.txt -+++ new.untypedModuleImport_allowJs.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+/a.ts(1,17): error TS2307: Cannot find module 'foo' or its corresponding type declarations. -+ -+ -+==== /a.ts (1 errors) ==== -+ import foo from "foo"; -+ ~~~~~ -+!!! error TS2307: Cannot find module 'foo' or its corresponding type declarations. -+ foo.bar(); -+ -+==== /node_modules/foo/index.js (0 errors) ==== -+ exports.default = { bar() { return 0; } } -+ diff --git a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols b/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols index 5ea4acb1be..99801b5b7e 100644 --- a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols +++ b/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols @@ -7,3 +7,10 @@ import foo from "foo"; foo.bar(); >foo : Symbol(foo, Decl(a.ts, 0, 6)) +=== /node_modules/foo/index.js === +exports.default = { bar() { return 0; } } +>exports.default : Symbol(default, Decl(index.js, 0, 0)) +>exports : Symbol("/node_modules/foo/index", Decl(index.js, 0, 0)) +>default : Symbol(default, Decl(index.js, 0, 0)) +>bar : Symbol(bar, Decl(index.js, 0, 19)) + diff --git a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols.diff b/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols.diff index ba7cd41297..e66df6a5b4 100644 --- a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.symbols.diff @@ -8,10 +8,11 @@ >foo : Symbol(foo, Decl(a.ts, 0, 6)) ->bar : Symbol(bar, Decl(index.js, 0, 19)) --=== /node_modules/foo/index.js === --exports.default = { bar() { return 0; } } -->exports.default : Symbol(default, Decl(index.js, 0, 0)) + === /node_modules/foo/index.js === + exports.default = { bar() { return 0; } } + >exports.default : Symbol(default, Decl(index.js, 0, 0)) ->exports : Symbol(default, Decl(index.js, 0, 0)) -->default : Symbol(default, Decl(index.js, 0, 0)) -->bar : Symbol(bar, Decl(index.js, 0, 19)) -- ++>exports : Symbol("/node_modules/foo/index", Decl(index.js, 0, 0)) + >default : Symbol(default, Decl(index.js, 0, 0)) + >bar : Symbol(bar, Decl(index.js, 0, 19)) + diff --git a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.types b/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.types index 097d7fa7f1..08c1820b1b 100644 --- a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.types +++ b/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.types @@ -10,3 +10,13 @@ foo.bar(); >foo : any >bar : any +=== /node_modules/foo/index.js === +exports.default = { bar() { return 0; } } +>exports.default = { bar() { return 0; } } : { bar: () => number; } +>exports.default : any +>exports : typeof import("/node_modules/foo/index") +>default : any +>{ bar() { return 0; } } : { bar: () => number; } +>bar : () => number +>0 : 0 + diff --git a/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.errors.txt b/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.errors.txt index d8c96807f4..f90e977bf7 100644 --- a/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.errors.txt @@ -1,35 +1,41 @@ -use.js(1,10): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -use.js(10,12): error TS2503: Cannot find namespace 'ex'. +ex.js(4,14): error TS2339: Property 'n' does not exist on type 'Crunch'. +ex.js(7,21): error TS2339: Property 'n' does not exist on type 'Crunch'. +use.js(5,8): error TS2339: Property 'n' does not exist on type 'Crunch'. +use.js(13,10): error TS2339: Property 'n' does not exist on type 'Crunch'. ==== use.js (2 errors) ==== var ex = require('./ex') - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. // values work var crunch = new ex.Crunch(1); crunch.n + ~ +!!! error TS2339: Property 'n' does not exist on type 'Crunch'. // types work /** * @param {ex.Crunch} wrap - ~~ -!!! error TS2503: Cannot find namespace 'ex'. */ function f(wrap) { wrap.n + ~ +!!! error TS2339: Property 'n' does not exist on type 'Crunch'. } -==== ex.js (0 errors) ==== +==== ex.js (2 errors) ==== export class Crunch { /** @param {number} n */ constructor(n) { this.n = n + ~ +!!! error TS2339: Property 'n' does not exist on type 'Crunch'. } m() { return this.n + ~ +!!! error TS2339: Property 'n' does not exist on type 'Crunch'. } } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.symbols b/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.symbols index d590a6ad82..cdb9a8ed34 100644 --- a/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.symbols +++ b/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.symbols @@ -3,11 +3,15 @@ === use.js === var ex = require('./ex') >ex : Symbol(ex, Decl(use.js, 0, 3)) +>require : Symbol(require) +>'./ex' : Symbol("ex", Decl(ex.js, 0, 0)) // values work var crunch = new ex.Crunch(1); >crunch : Symbol(crunch, Decl(use.js, 3, 3)) +>ex.Crunch : Symbol(Crunch, Decl(ex.js, 0, 0)) >ex : Symbol(ex, Decl(use.js, 0, 3)) +>Crunch : Symbol(Crunch, Decl(ex.js, 0, 0)) crunch.n >crunch : Symbol(crunch, Decl(use.js, 3, 3)) @@ -25,3 +29,23 @@ function f(wrap) { >wrap : Symbol(wrap, Decl(use.js, 11, 11)) } +=== ex.js === +export class Crunch { +>Crunch : Symbol(Crunch, Decl(ex.js, 0, 0)) + + /** @param {number} n */ + constructor(n) { +>n : Symbol(n, Decl(ex.js, 2, 16)) + + this.n = n +>this : Symbol(Crunch, Decl(ex.js, 0, 0)) +>n : Symbol(n, Decl(ex.js, 2, 16)) + } + m() { +>m : Symbol(m, Decl(ex.js, 4, 5)) + + return this.n +>this : Symbol(Crunch, Decl(ex.js, 0, 0)) + } +} + diff --git a/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.symbols.diff b/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.symbols.diff index f07f78d8dd..5f6c7a4876 100644 --- a/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.symbols.diff @@ -1,18 +1,20 @@ --- old.varRequireFromJavascript.symbols +++ new.varRequireFromJavascript.symbols -@@= skipped -2, +2 lines =@@ - === use.js === +@@= skipped -3, +3 lines =@@ var ex = require('./ex') >ex : Symbol(ex, Decl(use.js, 0, 3)) -->require : Symbol(require) + >require : Symbol(require) ->'./ex' : Symbol(ex, Decl(ex.js, 0, 0)) ++>'./ex' : Symbol("ex", Decl(ex.js, 0, 0)) // values work var crunch = new ex.Crunch(1); >crunch : Symbol(crunch, Decl(use.js, 3, 3)) ->ex.Crunch : Symbol(ex.Crunch, Decl(ex.js, 0, 0)) ++>ex.Crunch : Symbol(Crunch, Decl(ex.js, 0, 0)) >ex : Symbol(ex, Decl(use.js, 0, 3)) ->Crunch : Symbol(ex.Crunch, Decl(ex.js, 0, 0)) ++>Crunch : Symbol(Crunch, Decl(ex.js, 0, 0)) crunch.n ->crunch.n : Symbol(ex.Crunch.n, Decl(ex.js, 2, 20)) @@ -21,7 +23,7 @@ // types work -@@= skipped -25, +19 lines =@@ +@@= skipped -24, +22 lines =@@ >wrap : Symbol(wrap, Decl(use.js, 11, 11)) wrap.n @@ -30,27 +32,24 @@ ->n : Symbol(ex.Crunch.n, Decl(ex.js, 2, 20)) } --=== ex.js === --export class Crunch { -->Crunch : Symbol(Crunch, Decl(ex.js, 0, 0)) -- -- /** @param {number} n */ -- constructor(n) { -->n : Symbol(n, Decl(ex.js, 2, 16)) -- -- this.n = n + === ex.js === +@@= skipped -14, +12 lines =@@ + >n : Symbol(n, Decl(ex.js, 2, 16)) + + this.n = n ->this.n : Symbol(Crunch.n, Decl(ex.js, 2, 20)) -->this : Symbol(Crunch, Decl(ex.js, 0, 0)) + >this : Symbol(Crunch, Decl(ex.js, 0, 0)) ->n : Symbol(Crunch.n, Decl(ex.js, 2, 20)) -->n : Symbol(n, Decl(ex.js, 2, 16)) -- } -- m() { + >n : Symbol(n, Decl(ex.js, 2, 16)) + } + m() { ->m : Symbol(Crunch.m, Decl(ex.js, 4, 5)) -- -- return this.n ++>m : Symbol(m, Decl(ex.js, 4, 5)) + + return this.n ->this.n : Symbol(Crunch.n, Decl(ex.js, 2, 20)) -->this : Symbol(Crunch, Decl(ex.js, 0, 0)) + >this : Symbol(Crunch, Decl(ex.js, 0, 0)) ->n : Symbol(Crunch.n, Decl(ex.js, 2, 20)) -- } --} -- + } + } + diff --git a/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.types b/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.types index 139f19cb5f..01d67fd8f5 100644 --- a/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.types +++ b/testdata/baselines/reference/submodule/conformance/varRequireFromJavascript.types @@ -2,23 +2,23 @@ === use.js === var ex = require('./ex') ->ex : any ->require('./ex') : any +>ex : typeof import("ex") +>require('./ex') : typeof import("ex") >require : any >'./ex' : "./ex" // values work var crunch = new ex.Crunch(1); ->crunch : any ->new ex.Crunch(1) : any ->ex.Crunch : any ->ex : any ->Crunch : any +>crunch : Crunch +>new ex.Crunch(1) : Crunch +>ex.Crunch : typeof Crunch +>ex : typeof import("ex") +>Crunch : typeof Crunch >1 : 1 crunch.n >crunch.n : any ->crunch : any +>crunch : Crunch >n : any @@ -36,3 +36,28 @@ function f(wrap) { >n : any } +=== ex.js === +export class Crunch { +>Crunch : Crunch + + /** @param {number} n */ + constructor(n) { +>n : number + + this.n = n +>this.n = n : number +>this.n : any +>this : this +>n : any +>n : number + } + m() { +>m : () => any + + return this.n +>this.n : any +>this : this +>n : any + } +} + diff --git a/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.errors.txt b/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.errors.txt deleted file mode 100644 index f53556abb1..0000000000 --- a/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.errors.txt +++ /dev/null @@ -1,37 +0,0 @@ -use.js(1,10): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -use.js(10,12): error TS2503: Cannot find namespace 'ex'. -use.js(11,12): error TS2503: Cannot find namespace 'ex'. - - -==== use.js (3 errors) ==== - var ex = require('./ex') - ~~~~~~~ -!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - // values work - var crunch = new ex.Crunch(1); - crunch.n - - - // types work - /** - * @param {ex.Greatest} greatest - ~~ -!!! error TS2503: Cannot find namespace 'ex'. - * @param {ex.Crunch} wrap - ~~ -!!! error TS2503: Cannot find namespace 'ex'. - */ - function f(greatest, wrap) { - greatest.day - wrap.n - } - -==== ex.d.ts (0 errors) ==== - export type Greatest = { day: 1 } - export class Crunch { - n: number - m(): number - constructor(n: number) - } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.symbols b/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.symbols index 0136e0c9f9..681f5c15ac 100644 --- a/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.symbols +++ b/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.symbols @@ -3,14 +3,20 @@ === use.js === var ex = require('./ex') >ex : Symbol(ex, Decl(use.js, 0, 3)) +>require : Symbol(require) +>'./ex' : Symbol("ex", Decl(ex.d.ts, 0, 0)) // values work var crunch = new ex.Crunch(1); >crunch : Symbol(crunch, Decl(use.js, 3, 3)) +>ex.Crunch : Symbol(Crunch, Decl(ex.d.ts, 0, 33)) >ex : Symbol(ex, Decl(use.js, 0, 3)) +>Crunch : Symbol(Crunch, Decl(ex.d.ts, 0, 33)) crunch.n +>crunch.n : Symbol(n, Decl(ex.d.ts, 1, 21)) >crunch : Symbol(crunch, Decl(use.js, 3, 3)) +>n : Symbol(n, Decl(ex.d.ts, 1, 21)) // types work @@ -24,10 +30,14 @@ function f(greatest, wrap) { >wrap : Symbol(wrap, Decl(use.js, 12, 20)) greatest.day +>greatest.day : Symbol(day, Decl(ex.d.ts, 0, 24)) >greatest : Symbol(greatest, Decl(use.js, 12, 11)) +>day : Symbol(day, Decl(ex.d.ts, 0, 24)) wrap.n +>wrap.n : Symbol(n, Decl(ex.d.ts, 1, 21)) >wrap : Symbol(wrap, Decl(use.js, 12, 20)) +>n : Symbol(n, Decl(ex.d.ts, 1, 21)) } === ex.d.ts === diff --git a/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.symbols.diff b/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.symbols.diff index 0999049c39..27f5a8c987 100644 --- a/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.symbols.diff +++ b/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.symbols.diff @@ -1,42 +1,43 @@ --- old.varRequireFromTypescript.symbols +++ new.varRequireFromTypescript.symbols -@@= skipped -2, +2 lines =@@ - === use.js === +@@= skipped -3, +3 lines =@@ var ex = require('./ex') >ex : Symbol(ex, Decl(use.js, 0, 3)) -->require : Symbol(require) + >require : Symbol(require) ->'./ex' : Symbol(ex, Decl(ex.d.ts, 0, 0)) ++>'./ex' : Symbol("ex", Decl(ex.d.ts, 0, 0)) // values work var crunch = new ex.Crunch(1); >crunch : Symbol(crunch, Decl(use.js, 3, 3)) ->ex.Crunch : Symbol(ex.Crunch, Decl(ex.d.ts, 0, 33)) ++>ex.Crunch : Symbol(Crunch, Decl(ex.d.ts, 0, 33)) >ex : Symbol(ex, Decl(use.js, 0, 3)) ->Crunch : Symbol(ex.Crunch, Decl(ex.d.ts, 0, 33)) ++>Crunch : Symbol(Crunch, Decl(ex.d.ts, 0, 33)) crunch.n ->crunch.n : Symbol(ex.Crunch.n, Decl(ex.d.ts, 1, 21)) ++>crunch.n : Symbol(n, Decl(ex.d.ts, 1, 21)) >crunch : Symbol(crunch, Decl(use.js, 3, 3)) ->n : Symbol(ex.Crunch.n, Decl(ex.d.ts, 1, 21)) ++>n : Symbol(n, Decl(ex.d.ts, 1, 21)) // types work -@@= skipped -27, +21 lines =@@ - >wrap : Symbol(wrap, Decl(use.js, 12, 20)) - - greatest.day -->greatest.day : Symbol(day, Decl(ex.d.ts, 0, 24)) - >greatest : Symbol(greatest, Decl(use.js, 12, 11)) -->day : Symbol(day, Decl(ex.d.ts, 0, 24)) +@@= skipped -31, +31 lines =@@ + >day : Symbol(day, Decl(ex.d.ts, 0, 24)) wrap.n ->wrap.n : Symbol(ex.Crunch.n, Decl(ex.d.ts, 1, 21)) ++>wrap.n : Symbol(n, Decl(ex.d.ts, 1, 21)) >wrap : Symbol(wrap, Decl(use.js, 12, 20)) ->n : Symbol(ex.Crunch.n, Decl(ex.d.ts, 1, 21)) ++>n : Symbol(n, Decl(ex.d.ts, 1, 21)) } === ex.d.ts === -@@= skipped -19, +15 lines =@@ +@@= skipped -14, +14 lines =@@ >Crunch : Symbol(Crunch, Decl(ex.d.ts, 0, 33)) n: number diff --git a/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.types b/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.types index d0fa7caa43..38c297e698 100644 --- a/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.types +++ b/testdata/baselines/reference/submodule/conformance/varRequireFromTypescript.types @@ -2,24 +2,24 @@ === use.js === var ex = require('./ex') ->ex : any ->require('./ex') : any +>ex : typeof import("ex") +>require('./ex') : typeof import("ex") >require : any >'./ex' : "./ex" // values work var crunch = new ex.Crunch(1); ->crunch : any ->new ex.Crunch(1) : any ->ex.Crunch : any ->ex : any ->Crunch : any +>crunch : Crunch +>new ex.Crunch(1) : Crunch +>ex.Crunch : typeof Crunch +>ex : typeof import("ex") +>Crunch : typeof Crunch >1 : 1 crunch.n ->crunch.n : any ->crunch : any ->n : any +>crunch.n : number +>crunch : Crunch +>n : number // types work @@ -33,14 +33,14 @@ function f(greatest, wrap) { >wrap : Crunch greatest.day ->greatest.day : any +>greatest.day : 1 >greatest : Greatest ->day : any +>day : 1 wrap.n ->wrap.n : any +>wrap.n : number >wrap : Crunch ->n : any +>n : number } === ex.d.ts === diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/ambientRequireFunction(module=commonjs).types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/ambientRequireFunction(module=commonjs).types.diff index 33a9ec3d13..8399bed642 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/ambientRequireFunction(module=commonjs).types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/ambientRequireFunction(module=commonjs).types.diff @@ -6,22 +6,17 @@ const fs = require("fs"); ->fs : typeof fs ->require("fs") : typeof fs -+>fs : any -+>require("fs") : any ++>fs : typeof import("fs") ++>require("fs") : typeof import("fs") >require : (moduleName: string) => any >"fs" : "fs" - const text = fs.readFileSync("/a/b/c"); -->text : string -->fs.readFileSync("/a/b/c") : string -->fs.readFileSync : (s: string) => string +@@= skipped -9, +9 lines =@@ + >text : string + >fs.readFileSync("/a/b/c") : string + >fs.readFileSync : (s: string) => string ->fs : typeof fs -->readFileSync : (s: string) => string -+>text : any -+>fs.readFileSync("/a/b/c") : any -+>fs.readFileSync : any -+>fs : any -+>readFileSync : any ++>fs : typeof import("fs") + >readFileSync : (s: string) => string >"/a/b/c" : "/a/b/c" - === node.d.ts === diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/ambientRequireFunction(module=preserve).types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/ambientRequireFunction(module=preserve).types.diff index d39390d0cf..3dd73e781d 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/ambientRequireFunction(module=preserve).types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/ambientRequireFunction(module=preserve).types.diff @@ -6,22 +6,17 @@ const fs = require("fs"); ->fs : typeof fs ->require("fs") : typeof fs -+>fs : any -+>require("fs") : any ++>fs : typeof import("fs") ++>require("fs") : typeof import("fs") >require : (moduleName: string) => any >"fs" : "fs" - const text = fs.readFileSync("/a/b/c"); -->text : string -->fs.readFileSync("/a/b/c") : string -->fs.readFileSync : (s: string) => string +@@= skipped -9, +9 lines =@@ + >text : string + >fs.readFileSync("/a/b/c") : string + >fs.readFileSync : (s: string) => string ->fs : typeof fs -->readFileSync : (s: string) => string -+>text : any -+>fs.readFileSync("/a/b/c") : any -+>fs.readFileSync : any -+>fs : any -+>readFileSync : any ++>fs : typeof import("fs") + >readFileSync : (s: string) => string >"/a/b/c" : "/a/b/c" - === node.d.ts === diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/amdLikeInputDeclarationEmit.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/amdLikeInputDeclarationEmit.errors.txt.diff index 5215064b30..410731570b 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/amdLikeInputDeclarationEmit.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/amdLikeInputDeclarationEmit.errors.txt.diff @@ -3,6 +3,7 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ ++ExtendedClass.js(17,5): error TS1231: An export assignment must be at the top level of a file or module declaration. +ExtendedClass.js(17,12): error TS2339: Property 'exports' does not exist on type '{}'. +ExtendedClass.js(18,19): error TS2339: Property 'exports' does not exist on type '{}'. + @@ -16,7 +17,7 @@ + } + export = BaseClass; + } -+==== ExtendedClass.js (2 errors) ==== ++==== ExtendedClass.js (3 errors) ==== + define("lib/ExtendedClass", ["deps/BaseClass"], + /** + * {typeof import("deps/BaseClass")} @@ -34,6 +35,8 @@ + // Exports the module in a way tsc recognize class export + const module = {}; + module.exports = ExtendedClass ++ ~~~~~~ ++!!! error TS1231: An export assignment must be at the top level of a file or module declaration. + ~~~~~~~ +!!! error TS2339: Property 'exports' does not exist on type '{}'. + return module.exports; diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/checkJsTypeDefNoUnusedLocalMarked.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/checkJsTypeDefNoUnusedLocalMarked.errors.txt.diff new file mode 100644 index 0000000000..2b56dab6c7 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/compiler/checkJsTypeDefNoUnusedLocalMarked.errors.txt.diff @@ -0,0 +1,26 @@ +--- old.checkJsTypeDefNoUnusedLocalMarked.errors.txt ++++ new.checkJsTypeDefNoUnusedLocalMarked.errors.txt +@@= skipped -0, +-1 lines =@@ +- +@@= skipped --1, +1 lines =@@ ++something.js(5,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++ ++ ++==== file.ts (0 errors) ==== ++ class Foo { ++ x: number; ++ } ++ ++ declare global { ++ var module: any; // Just here to remove unrelated error from test ++ } ++ ++ export = Foo; ++==== something.js (1 errors) ==== ++ /** @typedef {typeof import("./file")} Foo */ ++ ++ /** @typedef {(foo: Foo) => string} FooFun */ ++ ++ module.exports = /** @type {FooFun} */(void 0); ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/checkJsTypeDefNoUnusedLocalMarked.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/checkJsTypeDefNoUnusedLocalMarked.types.diff index bda57e861e..723155380d 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/checkJsTypeDefNoUnusedLocalMarked.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/checkJsTypeDefNoUnusedLocalMarked.types.diff @@ -10,9 +10,9 @@ ->exports : (foo: Foo) => string ->(void 0) : FooFun +>module.exports = /** @type {FooFun} */(void 0) : (foo: typeof Foo) => string -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : (foo: typeof Foo) => string ++>module : { export=: (foo: typeof Foo) => string; } ++>exports : (foo: typeof Foo) => string +>(void 0) : (foo: typeof Foo) => string +>void 0 : (foo: typeof Foo) => string >void 0 : undefined diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsExportTypeDeclarationError.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/commonJsExportTypeDeclarationError.errors.txt.diff index 5e0d8973c8..d7786f56d0 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsExportTypeDeclarationError.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/commonJsExportTypeDeclarationError.errors.txt.diff @@ -2,29 +2,21 @@ +++ new.commonJsExportTypeDeclarationError.errors.txt @@= skipped -0, +0 lines =@@ -types1.ts(2,17): error TS1110: Type expected. -+test.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+types1.ts(1,18): error TS2306: File 'test.js' is not a module. types1.ts(3,1): error TS1005: '=' expected. -types2.ts(2,19): error TS1110: Type expected. --types3.ts(2,13): error TS2456: Type alias 'test' circularly references itself. -+types2.ts(1,18): error TS2306: File 'test.js' is not a module. +types2.ts(3,1): error TS1110: Type expected. -+types3.ts(1,18): error TS2306: File 'test.js' is not a module. + types3.ts(2,13): error TS2456: Type alias 'test' circularly references itself. -==== ./test.js (0 errors) ==== -+==== test.js (1 errors) ==== ++==== test.js (0 errors) ==== module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. message: "" } -==== ./types1.ts (2 errors) ==== -+==== types1.ts (2 errors) ==== ++==== types1.ts (1 errors) ==== import test from "./test"; -+ ~~~~~~~~ -+!!! error TS2306: File 'test.js' is not a module. export type test - -!!! error TS1110: Type expected. @@ -32,10 +24,8 @@ !!! error TS1005: '=' expected. -==== ./types2.ts (1 errors) ==== -+==== types2.ts (2 errors) ==== ++==== types2.ts (1 errors) ==== import test from "./test"; -+ ~~~~~~~~ -+!!! error TS2306: File 'test.js' is not a module. export type test = - -!!! error TS1110: Type expected. @@ -45,9 +35,5 @@ +!!! error TS1110: Type expected. +==== types3.ts (1 errors) ==== import test from "./test"; -+ ~~~~~~~~ -+!!! error TS2306: File 'test.js' is not a module. export type test = test; -- ~~~~ --!!! error TS2456: Type alias 'test' circularly references itself. - + ~~~~ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsExportTypeDeclarationError.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/commonJsExportTypeDeclarationError.types.diff index 51ffcbe6ea..406c9ae7bd 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsExportTypeDeclarationError.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/commonJsExportTypeDeclarationError.types.diff @@ -7,15 +7,12 @@ +=== test.js === module.exports = { >module.exports = { message: ""} : { message: string; } -->module.exports : { message: string; } + >module.exports : { message: string; } ->module : { exports: { message: string; }; } -->exports : { message: string; } -+>module.exports : any -+>module : any -+>exports : any ++>module : { export=: { message: string; }; } + >exports : { message: string; } >{ message: ""} : { message: string; } - message: "" @@= skipped -12, +12 lines =@@ >"" : "" } @@ -23,8 +20,7 @@ -=== ./types1.ts === +=== types1.ts === import test from "./test"; -->test : { message: string; } -+>test : any + >test : { message: string; } export type test >test : any @@ -32,8 +28,7 @@ -=== ./types2.ts === +=== types2.ts === import test from "./test"; -->test : { message: string; } -+>test : any + >test : { message: string; } export type test = >test : any @@ -41,10 +36,5 @@ -=== ./types3.ts === +=== types3.ts === import test from "./test"; -->test : { message: string; } -+>test : any - - export type test = test; -->test : any -+>test : test + >test : { message: string; } diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsIsolatedModules.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/commonJsIsolatedModules.errors.txt.diff deleted file mode 100644 index 451e124377..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsIsolatedModules.errors.txt.diff +++ /dev/null @@ -1,23 +0,0 @@ ---- old.commonJsIsolatedModules.errors.txt -+++ new.commonJsIsolatedModules.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== tsconfig.json (0 errors) ==== -+ { -+ "compilerOptions": { -+ "allowJs": true, -+ "outDir": "foo", -+ "isolatedModules": true, -+ } -+ } -+ -+==== index.js (1 errors) ==== -+ module.exports = {} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ var x = 1 -+ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsIsolatedModules.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/commonJsIsolatedModules.types.diff index f1b9ace380..ee9b35affd 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsIsolatedModules.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/commonJsIsolatedModules.types.diff @@ -9,9 +9,9 @@ ->module : { exports: typeof module.exports; } ->exports : typeof module.exports +>module.exports = {} : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} >{} : {} var x = 1 diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsUnusedLocals.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/commonJsUnusedLocals.errors.txt.diff deleted file mode 100644 index 5c9801188b..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsUnusedLocals.errors.txt.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.commonJsUnusedLocals.errors.txt -+++ new.commonJsUnusedLocals.errors.txt -@@= skipped -0, +0 lines =@@ --/a.js(1,7): error TS6133: 'x' is declared but its value is never read. -+/a.js(2,1): error TS2304: Cannot find name 'exports'. - - - ==== /a.js (1 errors) ==== - const x = 0; -- ~ --!!! error TS6133: 'x' is declared but its value is never read. - exports.y = 1; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. - diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsUnusedLocals.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/commonJsUnusedLocals.types.diff deleted file mode 100644 index 3327ed9300..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/commonJsUnusedLocals.types.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.commonJsUnusedLocals.types -+++ new.commonJsUnusedLocals.types -@@= skipped -6, +6 lines =@@ - - exports.y = 1; - >exports.y = 1 : 1 -->exports.y : 1 -->exports : typeof import("/a") -->y : 1 -+>exports.y : any -+>exports : any -+>y : any - >1 : 1 - diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/commonjsAccessExports.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/commonjsAccessExports.errors.txt.diff deleted file mode 100644 index caf752a8fd..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/commonjsAccessExports.errors.txt.diff +++ /dev/null @@ -1,33 +0,0 @@ ---- old.commonjsAccessExports.errors.txt -+++ new.commonjsAccessExports.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+/a.js(1,1): error TS2304: Cannot find name 'exports'. -+/a.js(2,1): error TS2304: Cannot find name 'exports'. -+/a.js(7,5): error TS2304: Cannot find name 'exports'. -+/a.js(12,22): error TS2304: Cannot find name 'exports'. -+ -+ -+==== /a.js (4 errors) ==== -+ exports.x = 0; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ exports.x; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ -+ // Works nested -+ { -+ // 'exports' does not provide a contextual type to a function-class -+ exports.Cls = function() { -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ this.x = 0; -+ } -+ } -+ -+ const instance = new exports.Cls(); -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/commonjsAccessExports.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/commonjsAccessExports.types.diff index 2afd7e5a20..9c8f4b83b5 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/commonjsAccessExports.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/commonjsAccessExports.types.diff @@ -1,37 +1,16 @@ --- old.commonjsAccessExports.types +++ new.commonjsAccessExports.types -@@= skipped -2, +2 lines =@@ - === /a.js === - exports.x = 0; - >exports.x = 0 : 0 -->exports.x : 0 -->exports : typeof import("/a") -->x : 0 -+>exports.x : any -+>exports : any -+>x : any - >0 : 0 - - exports.x; -->exports.x : 0 -->exports : typeof import("/a") -->x : 0 -+>exports.x : any -+>exports : any -+>x : any - - // Works nested +@@= skipped -16, +16 lines =@@ { // 'exports' does not provide a contextual type to a function-class exports.Cls = function() { ->exports.Cls = function() { this.x = 0; } : typeof Cls ->exports.Cls : typeof Cls -->exports : typeof import("/a") -->Cls : typeof Cls -->function() { this.x = 0; } : typeof Cls +>exports.Cls = function() { this.x = 0; } : () => void +>exports.Cls : any -+>exports : any + >exports : typeof import("/a") +->Cls : typeof Cls +->function() { this.x = 0; } : typeof Cls +>Cls : any +>function() { this.x = 0; } : () => void @@ -49,11 +28,10 @@ ->instance : Cls ->new exports.Cls() : Cls ->exports.Cls : typeof Cls -->exports : typeof import("/a") -->Cls : typeof Cls +>instance : any +>new exports.Cls() : any +>exports.Cls : any -+>exports : any + >exports : typeof import("/a") +->Cls : typeof Cls +>Cls : any diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff index 033e69af40..581ec9f0a6 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.errors.txt.diff @@ -3,33 +3,36 @@ @@= skipped -0, +0 lines =@@ -namespacer.js(2,1): error TS2323: Cannot redeclare exported variable 'NS'. -namespacer.js(3,1): error TS2323: Cannot redeclare exported variable 'NS'. -+index.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(3,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++namespacer.js(2,3): error TS2339: Property 'NS' does not exist on type '{}'. ++namespacer.js(2,8): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++namespacey.js(2,3): error TS2339: Property 'bar' does not exist on type '{}'. -==== index.js (0 errors) ==== -+==== index.js (3 errors) ==== ++==== index.js (1 errors) ==== const _item = require("./namespacer"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports = 12; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. Object.defineProperty(module, "exports", { value: "oh no" }); + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - ==== namespacey.js (0 errors) ==== +-==== namespacey.js (0 errors) ==== ++==== namespacey.js (1 errors) ==== const A = {} A.bar = class Q {} ++ ~~~ ++!!! error TS2339: Property 'bar' does not exist on type '{}'. module.exports = A; --==== namespacer.js (2 errors) ==== -+==== namespacer.js (0 errors) ==== + ==== namespacer.js (2 errors) ==== const B = {} B.NS = require("./namespacey"); - ~~~~ -!!! error TS2323: Cannot redeclare exported variable 'NS'. ++ ~~ ++!!! error TS2339: Property 'NS' does not exist on type '{}'. ++ ~~~~~~~ ++!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. Object.defineProperty(B, "NS", { value: "why though", writable: true }); - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Cannot redeclare exported variable 'NS'. diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types.diff index be1fc471ab..4a46c71ecb 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/ensureNoCrashExportAssignmentDefineProperrtyPotentialMerge.types.diff @@ -6,8 +6,8 @@ const _item = require("./namespacer"); ->_item : typeof _item ->require("./namespacer") : typeof _item -+>_item : any -+>require("./namespacer") : any ++>_item : {} ++>require("./namespacer") : {} >require : any >"./namespacer" : "./namespacer" @@ -17,9 +17,9 @@ ->module : typeof module ->exports : number +>module.exports = 12 : 12 -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : 12 ++>module : { export=: 12; } ++>exports : 12 >12 : 12 Object.defineProperty(module, "exports", { value: "oh no" }); @@ -33,59 +33,80 @@ >"exports" : "exports" >{ value: "oh no" } : { value: string; } >value : string - >"oh no" : "oh no" +@@= skipped -25, +25 lines =@@ --=== namespacey.js === --const A = {} + === namespacey.js === + const A = {} ->A : typeof A -->{} : {} -- --A.bar = class Q {} -->A.bar = class Q {} : typeof Q ++>A : {} + >{} : {} + + A.bar = class Q {} + >A.bar = class Q {} : typeof Q ->A.bar : typeof Q ->A : typeof A ->bar : typeof Q -->class Q {} : typeof Q -->Q : typeof Q -- --module.exports = A; ++>A.bar : any ++>A : {} ++>bar : any + >class Q {} : typeof Q + >Q : typeof Q + + module.exports = A; ->module.exports = A : typeof A ->module.exports : typeof A ->module : { exports: typeof A; } ->exports : typeof A ->A : typeof A -- --=== namespacer.js === --const B = {} ++>module.exports = A : {} ++>module.exports : {} ++>module : { readonly A: {}; } ++>exports : {} ++>A : {} + + === namespacer.js === + const B = {} ->B : typeof B -->{} : {} -- --B.NS = require("./namespacey"); ++>B : {} + >{} : {} + + B.NS = require("./namespacey"); ->B.NS = require("./namespacey") : typeof A ->B.NS : string | typeof A ->B : typeof B ->NS : string | typeof A ->require("./namespacey") : typeof A -->require : any -->"./namespacey" : "./namespacey" -- --Object.defineProperty(B, "NS", { value: "why though", writable: true }); ++>B.NS = require("./namespacey") : any ++>B.NS : any ++>B : {} ++>NS : any ++>require("./namespacey") : any + >require : any + >"./namespacey" : "./namespacey" + + Object.defineProperty(B, "NS", { value: "why though", writable: true }); ->Object.defineProperty(B, "NS", { value: "why though", writable: true }) : typeof B -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(B, "NS", { value: "why though", writable: true }) : {} + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->B : typeof B -->"NS" : "NS" -->{ value: "why though", writable: true } : { value: string; writable: true; } -->value : string -->"why though" : "why though" -->writable : true -->true : true -- --module.exports = B; ++>B : {} + >"NS" : "NS" + >{ value: "why though", writable: true } : { value: string; writable: true; } + >value : string +@@= skipped -46, +46 lines =@@ + >true : true + + module.exports = B; ->module.exports = B : typeof B ->module.exports : typeof B ->module : { exports: typeof B; } ->exports : typeof B ->B : typeof B -- ++>module.exports = B : {} ++>module.exports : {} ++>module : { readonly B: {}; } ++>exports : {} ++>B : {} + diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/expandoFunctionContextualTypesJs.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/expandoFunctionContextualTypesJs.errors.txt.diff index edb9efdfe1..8cc2e3f334 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/expandoFunctionContextualTypesJs.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/expandoFunctionContextualTypesJs.errors.txt.diff @@ -4,8 +4,10 @@ - @@= skipped --1, +1 lines =@@ +input.js(5,48): error TS2304: Cannot find name 'P'. -+input.js(48,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+input.js(52,24): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++input.js(48,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++input.js(52,17): error TS2322: Type '{ color: string; }' is not assignable to type '{ color: "blue" | "red"; }'. ++ Types of property 'color' are incompatible. ++ Type 'string' is not assignable to type '"blue" | "red"'. + + +==== input.js (3 errors) ==== @@ -59,12 +61,17 @@ + * @type {MyComponentProps} + */ + module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~ + color: "red" ++ ~~~~~~~~~~~~~~~~ + } ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + + expectLiteral({ props: module.exports }); -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~ ++!!! error TS2322: Type '{ color: string; }' is not assignable to type '{ color: "blue" | "red"; }'. ++!!! error TS2322: Types of property 'color' are incompatible. ++!!! error TS2322: Type 'string' is not assignable to type '"blue" | "red"'. ++!!! related TS6500 input.js:32:14: The expected type comes from property 'props' which is declared here on type '{ props: { color: "blue" | "red"; }; }' + diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/expandoFunctionContextualTypesJs.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/expandoFunctionContextualTypesJs.types.diff index 2601f4799d..785cc885b1 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/expandoFunctionContextualTypesJs.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/expandoFunctionContextualTypesJs.types.diff @@ -115,9 +115,9 @@ ->exports : MyComponentProps ->{ color: "red"} : { color: "red"; } +>module.exports = { color: "red"} : { color: string; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { color: string; } ++>module : { export=: { color: string; }; } ++>exports : { color: string; } +>{ color: "red"} : { color: string; } color: "red" @@ -135,9 +135,9 @@ ->module : { exports: MyComponentProps; } ->exports : MyComponentProps +>expectLiteral : (p: { props: { color: "blue" | "red"; }; }) => void -+>{ props: module.exports } : { props: any; } -+>props : any -+>module.exports : any -+>module : any -+>exports : any ++>{ props: module.exports } : { props: { color: string; }; } ++>props : { color: string; } ++>module.exports : { color: string; } ++>module : { export=: { color: string; }; } ++>exports : { color: string; } diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/functionExpressionNames.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/functionExpressionNames.errors.txt.diff deleted file mode 100644 index 638ddf8fe2..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/functionExpressionNames.errors.txt.diff +++ /dev/null @@ -1,44 +0,0 @@ ---- old.functionExpressionNames.errors.txt -+++ new.functionExpressionNames.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+b.js(1,1): error TS2304: Cannot find name 'exports'. -+b.js(4,13): error TS2304: Cannot find name 'exports'. -+ -+ -+==== b.js (2 errors) ==== -+ exports.E = function() { -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ this.e = 'exported' -+ } -+ var e = new exports.E(); -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ -+ var o = { -+ C: function () { -+ this.c = 'nested object' -+ } -+ } -+ var og = new o.C(); -+ -+ var V = function () { -+ this.v = 'simple' -+ } -+ var v = new V(); -+ -+ var A; -+ A = function () { -+ this.a = 'assignment' -+ } -+ var a = new A(); -+ -+ const { -+ B = function() { -+ this.b = 'binding pattern' -+ } -+ } = { B: undefined }; -+ var b = new B(); -+ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/functionExpressionNames.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/functionExpressionNames.types.diff index 4f4c5dd19f..ba288981b5 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/functionExpressionNames.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/functionExpressionNames.types.diff @@ -6,12 +6,11 @@ exports.E = function() { ->exports.E = function() { this.e = 'exported'} : typeof E ->exports.E : typeof E -->exports : typeof import("b") -->E : typeof E -->function() { this.e = 'exported'} : typeof E +>exports.E = function() { this.e = 'exported'} : () => void +>exports.E : any -+>exports : any + >exports : typeof import("b") +->E : typeof E +->function() { this.e = 'exported'} : typeof E +>E : any +>function() { this.e = 'exported'} : () => void @@ -27,12 +26,11 @@ ->e : E ->new exports.E() : E ->exports.E : typeof E -->exports : typeof import("b") -->E : typeof E +>e : any +>new exports.E() : any +>exports.E : any -+>exports : any + >exports : typeof import("b") +->E : typeof E +>E : any var o = { diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).errors.txt.diff deleted file mode 100644 index b67885a556..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).errors.txt.diff +++ /dev/null @@ -1,53 +0,0 @@ ---- old.importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).errors.txt -+++ new.importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+/index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== /node_modules/tslib/package.json (0 errors) ==== -+ { -+ "name": "tslib", -+ "main": "tslib.js", -+ "module": "tslib.es6.js", -+ "jsnext:main": "tslib.es6.js", -+ "typings": "tslib.d.ts", -+ "exports": { -+ ".": { -+ "module": { -+ "types": "./modules/index.d.ts", -+ "default": "./tslib.es6.mjs" -+ }, -+ "import": { -+ "node": "./modules/index.js", -+ "default": { -+ "types": "./modules/index.d.ts", -+ "default": "./tslib.es6.mjs" -+ } -+ }, -+ "default": "./tslib.js" -+ }, -+ "./*": "./*", -+ "./": "./" -+ } -+ } -+ -+==== /node_modules/tslib/tslib.d.ts (0 errors) ==== -+ export declare var __extends: any; -+ -+==== /node_modules/tslib/modules/package.json (0 errors) ==== -+ { "type": "module" } -+ -+==== /node_modules/tslib/modules/index.d.ts (0 errors) ==== -+ export {}; -+ -+==== /index.js (1 errors) ==== -+ class Foo {} -+ -+ class Bar extends Foo {} -+ -+ module.exports = Bar; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).types.diff index 9be450a3d4..ecd1ddf5dc 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).types.diff @@ -1,14 +1,11 @@ --- old.importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).types +++ new.importHelpersCommonJSJavaScript(verbatimmodulesyntax=false).types -@@= skipped -17, +17 lines =@@ - +@@= skipped -18, +18 lines =@@ module.exports = Bar; >module.exports = Bar : typeof Bar -->module.exports : typeof Bar + >module.exports : typeof Bar ->module : { exports: typeof Bar; } -->exports : typeof Bar -+>module.exports : any -+>module : any -+>exports : any ++>module : { Bar: typeof Bar; } + >exports : typeof Bar >Bar : typeof Bar diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).errors.txt.diff deleted file mode 100644 index 77ffcd1c9b..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).errors.txt.diff +++ /dev/null @@ -1,53 +0,0 @@ ---- old.importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).errors.txt -+++ new.importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+/index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== /node_modules/tslib/package.json (0 errors) ==== -+ { -+ "name": "tslib", -+ "main": "tslib.js", -+ "module": "tslib.es6.js", -+ "jsnext:main": "tslib.es6.js", -+ "typings": "tslib.d.ts", -+ "exports": { -+ ".": { -+ "module": { -+ "types": "./modules/index.d.ts", -+ "default": "./tslib.es6.mjs" -+ }, -+ "import": { -+ "node": "./modules/index.js", -+ "default": { -+ "types": "./modules/index.d.ts", -+ "default": "./tslib.es6.mjs" -+ } -+ }, -+ "default": "./tslib.js" -+ }, -+ "./*": "./*", -+ "./": "./" -+ } -+ } -+ -+==== /node_modules/tslib/tslib.d.ts (0 errors) ==== -+ export declare var __extends: any; -+ -+==== /node_modules/tslib/modules/package.json (0 errors) ==== -+ { "type": "module" } -+ -+==== /node_modules/tslib/modules/index.d.ts (0 errors) ==== -+ export {}; -+ -+==== /index.js (1 errors) ==== -+ class Foo {} -+ -+ class Bar extends Foo {} -+ -+ module.exports = Bar; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).types.diff index 041a0d39d5..028496c8a7 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).types.diff @@ -1,14 +1,11 @@ --- old.importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).types +++ new.importHelpersCommonJSJavaScript(verbatimmodulesyntax=true).types -@@= skipped -17, +17 lines =@@ - +@@= skipped -18, +18 lines =@@ module.exports = Bar; >module.exports = Bar : typeof Bar -->module.exports : typeof Bar + >module.exports : typeof Bar ->module : { exports: typeof Bar; } -->exports : typeof Bar -+>module.exports : any -+>module : any -+>exports : any ++>module : { Bar: typeof Bar; } + >exports : typeof Bar >Bar : typeof Bar diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/importNonExportedMember12.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/importNonExportedMember12.errors.txt.diff index 1bcf81b260..3b74c9f8ef 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/importNonExportedMember12.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/importNonExportedMember12.errors.txt.diff @@ -4,7 +4,7 @@ - @@= skipped --1, +1 lines =@@ +/a.js(1,18): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+/node_modules/foo/src/index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++/node_modules/foo/src/index.js(1,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + + +==== /node_modules/foo/package.json (0 errors) ==== @@ -12,8 +12,8 @@ + +==== /node_modules/foo/src/index.js (1 errors) ==== + module.exports = 1; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + +==== /a.js (1 errors) ==== + export const A = require("foo"); diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/importNonExportedMember12.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/importNonExportedMember12.types.diff index 05a5ea0519..59717313d3 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/importNonExportedMember12.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/importNonExportedMember12.types.diff @@ -9,9 +9,9 @@ ->module : { exports: number; } ->exports : number +>module.exports = 1 : 1 -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : 1 ++>module : { export=: 1; } ++>exports : 1 >1 : 1 === /a.js === diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptCommonjsModule.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/javascriptCommonjsModule.errors.txt.diff deleted file mode 100644 index bf5558ebd6..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptCommonjsModule.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.javascriptCommonjsModule.errors.txt -+++ new.javascriptCommonjsModule.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== index.js (1 errors) ==== -+ class Foo {} -+ -+ class Bar extends Foo {} -+ -+ module.exports = Bar; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptCommonjsModule.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/javascriptCommonjsModule.types.diff index 07c4471719..64af18c39c 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptCommonjsModule.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/javascriptCommonjsModule.types.diff @@ -1,14 +1,11 @@ --- old.javascriptCommonjsModule.types +++ new.javascriptCommonjsModule.types -@@= skipped -9, +9 lines =@@ - +@@= skipped -10, +10 lines =@@ module.exports = Bar; >module.exports = Bar : typeof Bar -->module.exports : typeof Bar + >module.exports : typeof Bar ->module : { exports: typeof Bar; } -->exports : typeof Bar -+>module.exports : any -+>module : any -+>exports : any ++>module : { Bar: typeof Bar; } + >exports : typeof Bar >Bar : typeof Bar diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.errors.txt.diff index 72e3814363..5f3566aa9a 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.errors.txt.diff @@ -1,23 +1,18 @@ --- old.javascriptImportDefaultBadExport.errors.txt +++ new.javascriptImportDefaultBadExport.errors.txt -@@= skipped -0, +0 lines =@@ +@@= skipped -0, +-1 lines =@@ -/b.js(1,8): error TS1259: Module '"/a"' can only be default-imported using the 'esModuleInterop' flag -+/a.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+/b.js(1,15): error TS2306: File '/a.js' is not a module. - - +- +- -==== /a.js (0 errors) ==== -+==== /a.js (1 errors) ==== - const alias = {}; - module.exports = alias; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - ==== /b.js (1 errors) ==== - import a from "./a"; +- const alias = {}; +- module.exports = alias; +- +-==== /b.js (1 errors) ==== +- import a from "./a"; - ~ -!!! error TS1259: Module '"/a"' can only be default-imported using the 'esModuleInterop' flag -!!! related TS2594 /a.js:2:1: This module is declared with 'export =', and can only be used with a default import when using the 'esModuleInterop' flag. -+ ~~~~~ -+!!! error TS2306: File '/a.js' is not a module. - +- +@@= skipped --1, +1 lines =@@ ++ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.types.diff index c59d8c5c7d..d0bf7f0d06 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/javascriptImportDefaultBadExport.types.diff @@ -1,15 +1,16 @@ --- old.javascriptImportDefaultBadExport.types +++ new.javascriptImportDefaultBadExport.types -@@= skipped -6, +6 lines =@@ - +@@= skipped -7, +7 lines =@@ module.exports = alias; >module.exports = alias : {} -->module.exports : {} + >module.exports : {} ->module : { exports: {}; } -->exports : {} -+>module.exports : any -+>module : any -+>exports : any ++>module : { readonly alias: {}; } + >exports : {} >alias : {} === /b.js === + import a from "./a"; +->a : any ++>a : {} + diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedArray.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedArray.errors.txt.diff deleted file mode 100644 index 20aa858484..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedArray.errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.jsDeclarationEmitExportAssignedArray.errors.txt -+++ new.jsDeclarationEmitExportAssignedArray.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+file.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== file.js (1 errors) ==== -+ module.exports = [{ name: 'other', displayName: 'Other', defaultEnabled: true }]; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedArray.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedArray.types.diff index f3164ff742..456a532efa 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedArray.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedArray.types.diff @@ -1,15 +1,11 @@ --- old.jsDeclarationEmitExportAssignedArray.types +++ new.jsDeclarationEmitExportAssignedArray.types -@@= skipped -2, +2 lines =@@ - === file.js === +@@= skipped -3, +3 lines =@@ module.exports = [{ name: 'other', displayName: 'Other', defaultEnabled: true }]; >module.exports = [{ name: 'other', displayName: 'Other', defaultEnabled: true }] : { name: string; displayName: string; defaultEnabled: boolean; }[] -->module.exports : { name: string; displayName: string; defaultEnabled: boolean; }[] + >module.exports : { name: string; displayName: string; defaultEnabled: boolean; }[] ->module : { exports: { name: string; displayName: string; defaultEnabled: boolean; }[]; } -->exports : { name: string; displayName: string; defaultEnabled: boolean; }[] -+>module.exports : any -+>module : any -+>exports : any ++>module : { export=: { name: string; displayName: string; defaultEnabled: boolean; }[]; } + >exports : { name: string; displayName: string; defaultEnabled: boolean; }[] >[{ name: 'other', displayName: 'Other', defaultEnabled: true }] : { name: string; displayName: string; defaultEnabled: boolean; }[] >{ name: 'other', displayName: 'Other', defaultEnabled: true } : { name: string; displayName: string; defaultEnabled: boolean; } - >name : string diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.errors.txt.diff index a81bd08825..e6da449bd1 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.errors.txt.diff @@ -3,7 +3,7 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+index.js(9,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(9,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +index.js(9,34): error TS7006: Parameter 'options' implicitly has an 'any' type. + + @@ -17,8 +17,8 @@ + * @param {Options} options + */ + module.exports = function loader(options) {} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + ~~~~~~~ +!!! error TS7006: Parameter 'options' implicitly has an 'any' type. + diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.types.diff index b1319ae885..a0cae279c7 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsDeclarationEmitExportAssignedFunctionWithExtraTypedefsMembers.types.diff @@ -12,9 +12,9 @@ ->loader : (options: Options) => void ->options : Options +>module.exports = function loader(options) {} : (options: any) => void -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : (options: any) => void ++>module : { export=: (options: any) => void; } ++>exports : (options: any) => void +>function loader(options) {} : (options: any) => void +>loader : (options: any) => void +>options : any diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumTagOnObjectFrozen.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumTagOnObjectFrozen.errors.txt.diff index 7354401ab1..b40792f447 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumTagOnObjectFrozen.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumTagOnObjectFrozen.errors.txt.diff @@ -3,13 +3,12 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+usage.js(1,38): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(10,12): error TS2749: 'Thing' refers to a value, but is being used as a type here. Did you mean 'typeof Thing'? ++index.js(17,16): error TS2749: 'Thing' refers to a value, but is being used as a type here. Did you mean 'typeof Thing'? + + -+==== usage.js (1 errors) ==== ++==== usage.js (0 errors) ==== + const { Thing, useThing, cbThing } = require("./index"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + useThing(Thing.a); + @@ -27,7 +26,7 @@ + }; + }); + -+==== index.js (0 errors) ==== ++==== index.js (2 errors) ==== + /** @enum {string} */ + const Thing = Object.freeze({ + a: "thing", @@ -38,6 +37,8 @@ + + /** + * @param {Thing} x ++ ~~~~~ ++!!! error TS2749: 'Thing' refers to a value, but is being used as a type here. Did you mean 'typeof Thing'? + */ + function useThing(x) {} + @@ -45,6 +46,8 @@ + + /** + * @param {(x: Thing) => void} x ++ ~~~~~ ++!!! error TS2749: 'Thing' refers to a value, but is being used as a type here. Did you mean 'typeof Thing'? + */ + function cbThing(x) {} + diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumTagOnObjectFrozen.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumTagOnObjectFrozen.types.diff index a408d5cc85..3591522a18 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumTagOnObjectFrozen.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsEnumTagOnObjectFrozen.types.diff @@ -1,117 +1,49 @@ --- old.jsEnumTagOnObjectFrozen.types +++ new.jsEnumTagOnObjectFrozen.types -@@= skipped -1, +1 lines =@@ - - === usage.js === - const { Thing, useThing, cbThing } = require("./index"); -->Thing : Readonly<{ a: "thing"; b: "chill"; }> -->useThing : (x: Thing) => void -->cbThing : (x: (x: Thing) => void) => void -->require("./index") : typeof import("index") -+>Thing : any -+>useThing : any -+>cbThing : any -+>require("./index") : any - >require : any - >"./index" : "./index" - - useThing(Thing.a); -->useThing(Thing.a) : void -->useThing : (x: Thing) => void -->Thing.a : "thing" -->Thing : Readonly<{ a: "thing"; b: "chill"; }> -->a : "thing" -+>useThing(Thing.a) : any -+>useThing : any -+>Thing.a : any -+>Thing : any -+>a : any - - /** - * @typedef {Object} LogEntry -@@= skipped -21, +21 lines =@@ - */ - +@@= skipped -24, +24 lines =@@ cbThing(type => { -->cbThing(type => { /** @type {LogEntry} */ const logEntry = { time: Date.now(), type, };}) : void -->cbThing : (x: (x: Thing) => void) => void + >cbThing(type => { /** @type {LogEntry} */ const logEntry = { time: Date.now(), type, };}) : void + >cbThing : (x: (x: Thing) => void) => void ->type => { /** @type {LogEntry} */ const logEntry = { time: Date.now(), type, };} : (type: string) => void ->type : string -+>cbThing(type => { /** @type {LogEntry} */ const logEntry = { time: Date.now(), type, };}) : any -+>cbThing : any -+>type => { /** @type {LogEntry} */ const logEntry = { time: Date.now(), type, };} : (type: any) => void -+>type : any ++>type => { /** @type {LogEntry} */ const logEntry = { time: Date.now(), type, };} : (type: Thing) => void ++>type : Thing /** @type {LogEntry} */ const logEntry = { >logEntry : LogEntry ->{ time: Date.now(), type, } : { time: number; type: string; } -+>{ time: Date.now(), type, } : { time: number; type: any; } ++>{ time: Date.now(), type, } : { time: number; type: Thing; } time: Date.now(), >time : number -@@= skipped -18, +18 lines =@@ +@@= skipped -16, +16 lines =@@ >now : () => number type, ->type : string -+>type : any ++>type : Thing }; }); - --=== index.js === --/** @enum {string} */ --const Thing = Object.freeze({ -->Thing : Readonly<{ a: "thing"; b: "chill"; }> -->Object.freeze({ a: "thing", b: "chill"}) : Readonly<{ a: "thing"; b: "chill"; }> +@@= skipped -10, +10 lines =@@ + const Thing = Object.freeze({ + >Thing : Readonly<{ a: "thing"; b: "chill"; }> + >Object.freeze({ a: "thing", b: "chill"}) : Readonly<{ a: "thing"; b: "chill"; }> ->Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } -->Object : ObjectConstructor ++>Object.freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } + >Object : ObjectConstructor ->freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } -->{ a: "thing", b: "chill"} : { a: "thing"; b: "chill"; } -- -- a: "thing", -->a : "thing" -->"thing" : "thing" -- -- b: "chill" -->b : "chill" -->"chill" : "chill" -- --}); -- --exports.Thing = Thing; -->exports.Thing = Thing : Readonly<{ a: "thing"; b: "chill"; }> -->exports.Thing : Readonly<{ a: "thing"; b: "chill"; }> -->exports : typeof import("index") -->Thing : Readonly<{ a: "thing"; b: "chill"; }> -->Thing : Readonly<{ a: "thing"; b: "chill"; }> -- --/** -- * @param {Thing} x -- */ --function useThing(x) {} -->useThing : (x: Thing) => void ++>freeze : { (f: T): T; (o: T): Readonly; (o: T): Readonly; } + >{ a: "thing", b: "chill"} : { a: "thing"; b: "chill"; } + + a: "thing", +@@= skipped -27, +27 lines =@@ + */ + function useThing(x) {} + >useThing : (x: Thing) => void ->x : string -- --exports.useThing = useThing; -->exports.useThing = useThing : (x: Thing) => void -->exports.useThing : (x: Thing) => void -->exports : typeof import("index") -->useThing : (x: Thing) => void -->useThing : (x: Thing) => void -- --/** -- * @param {(x: Thing) => void} x -- */ --function cbThing(x) {} -->cbThing : (x: (x: Thing) => void) => void -->x : (x: Thing) => void -- --exports.cbThing = cbThing; -->exports.cbThing = cbThing : (x: (x: Thing) => void) => void -->exports.cbThing : (x: (x: Thing) => void) => void -->exports : typeof import("index") -->cbThing : (x: (x: Thing) => void) => void -->cbThing : (x: (x: Thing) => void) => void -- ++>x : Thing + + exports.useThing = useThing; + >exports.useThing = useThing : (x: Thing) => void diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportAssignmentNonMutableLocation.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportAssignmentNonMutableLocation.errors.txt.diff index 65f67f6dd1..b12e9722d5 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportAssignmentNonMutableLocation.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportAssignmentNonMutableLocation.errors.txt.diff @@ -3,8 +3,8 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+file.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+file.js(8,1): error TS2304: Cannot find name 'exports'. ++file.js(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++file.js(8,9): error TS2339: Property 'customSymbol2' does not exist on type 'typeof import("file")'. + + +==== file.js (2 errors) ==== @@ -12,11 +12,13 @@ + + // This is a common pattern in Node’s built-in modules: + module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~ + customSymbol, ++ ~~~~~~~~~~~~~~~~~ + }; ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + + exports.customSymbol2 = Symbol("custom"); -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~~~~~~~~ ++!!! error TS2339: Property 'customSymbol2' does not exist on type 'typeof import("file")'. diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportAssignmentNonMutableLocation.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportAssignmentNonMutableLocation.types.diff index e8ecc31370..95bf453ea6 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportAssignmentNonMutableLocation.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportAssignmentNonMutableLocation.types.diff @@ -9,9 +9,9 @@ ->module : { exports: typeof module.exports; } ->exports : typeof module.exports +>module.exports = { customSymbol,} : { customSymbol: symbol; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { customSymbol: symbol; } ++>module : { export=: { customSymbol: symbol; }; } ++>exports : { customSymbol: symbol; } >{ customSymbol,} : { customSymbol: symbol; } customSymbol, @@ -21,12 +21,11 @@ exports.customSymbol2 = Symbol("custom"); ->exports.customSymbol2 = Symbol("custom") : unique symbol ->exports.customSymbol2 : unique symbol -->exports : typeof import("file") -->customSymbol2 : unique symbol -->Symbol("custom") : unique symbol +>exports.customSymbol2 = Symbol("custom") : symbol +>exports.customSymbol2 : any -+>exports : any + >exports : typeof import("file") +->customSymbol2 : unique symbol +->Symbol("custom") : unique symbol +>customSymbol2 : any +>Symbol("custom") : symbol >Symbol : SymbolConstructor diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation.errors.txt.diff index 549328c4e6..233e3819b2 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation.errors.txt.diff @@ -2,41 +2,35 @@ +++ new.jsExportMemberMergedWithModuleAugmentation.errors.txt @@= skipped -0, +0 lines =@@ -/index.ts(11,7): error TS2741: Property 'x' is missing in type '{ b: string; }' but required in type 'Abcde'. -+/index.ts(1,23): error TS2306: File '/test.js' is not a module. -+/index.ts(3,16): error TS2306: File '/test.js' is not a module. -+/test.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++/index.ts(1,23): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. ++/index.ts(3,16): error TS2671: Cannot augment module './test' because it resolves to a non-module entity. ++/index.ts(11,10): error TS2749: 'Abcde' refers to a value, but is being used as a type here. Did you mean 'typeof Abcde'? --==== /test.js (0 errors) ==== -+==== /test.js (1 errors) ==== - class Abcde { - /** @type {string} */ - x; - } - - module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ==== /test.js (0 errors) ==== +@@= skipped -10, +12 lines =@@ Abcde }; -==== /index.ts (1 errors) ==== -+==== /index.ts (2 errors) ==== ++==== /index.ts (3 errors) ==== import { Abcde } from "./test"; + ~~~~~~~~ -+!!! error TS2306: File '/test.js' is not a module. ++!!! error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. declare module "./test" { + ~~~~~~~~ -+!!! error TS2306: File '/test.js' is not a module. ++!!! error TS2671: Cannot augment module './test' because it resolves to a non-module entity. interface Abcde { b: string } } -@@= skipped -22, +30 lines =@@ +@@= skipped -12, +16 lines =@@ // Bug: the type meaning from /test.js does not // propagate through the object literal export. const x: Abcde = { b: "" }; - ~ -!!! error TS2741: Property 'x' is missing in type '{ b: string; }' but required in type 'Abcde'. -!!! related TS2728 /test.js:3:3: 'x' is declared here. ++ ~~~~~ ++!!! error TS2749: 'Abcde' refers to a value, but is being used as a type here. Did you mean 'typeof Abcde'? diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation.types.diff index 75821d6038..c7b6ae0e9f 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation.types.diff @@ -9,18 +9,14 @@ ->module : { exports: typeof module."./test"; } ->exports : typeof module."./test" +>module.exports = { Abcde} : { Abcde: typeof Abcde; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { Abcde: typeof Abcde; } ++>module : { export=: { Abcde: typeof Abcde; }; } ++>exports : { Abcde: typeof Abcde; } >{ Abcde} : { Abcde: typeof Abcde; } Abcde -@@= skipped -13, +13 lines =@@ - - === /index.ts === - import { Abcde } from "./test"; -->Abcde : typeof Abcde -+>Abcde : any +@@= skipped -16, +16 lines =@@ + >Abcde : typeof Abcde declare module "./test" { ->"./test" : typeof import("/test") @@ -28,17 +24,3 @@ interface Abcde { b: string } >b : string - } - - new Abcde().x; -->new Abcde().x : string -->new Abcde() : Abcde -->Abcde : typeof Abcde -->x : string -+>new Abcde().x : any -+>new Abcde() : any -+>Abcde : any -+>x : any - - // Bug: the type meaning from /test.js does not - // propagate through the object literal export. diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation2.errors.txt.diff index 0c135ec5b5..bf5b5d286a 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation2.errors.txt.diff @@ -2,31 +2,30 @@ +++ new.jsExportMemberMergedWithModuleAugmentation2.errors.txt @@= skipped -0, +0 lines =@@ -/index.ts(4,16): error TS2300: Duplicate identifier 'a'. --/index.ts(7,3): error TS2339: Property 'toFixed' does not exist on type 'string'. ++/index.ts(1,19): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. ++/index.ts(3,16): error TS2671: Cannot augment module './test' because it resolves to a non-module entity. + /index.ts(7,3): error TS2339: Property 'toFixed' does not exist on type 'string'. -/test.js(2,3): error TS2300: Duplicate identifier 'a'. -+/index.ts(1,19): error TS2306: File '/test.js' is not a module. -+/index.ts(3,16): error TS2306: File '/test.js' is not a module. -+/test.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - ==== /test.js (1 errors) ==== +-==== /test.js (1 errors) ==== ++==== /test.js (0 errors) ==== module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. a: "ok" - ~ -!!! error TS2300: Duplicate identifier 'a'. -!!! related TS6203 /index.ts:4:16: 'a' was also declared here. }; - ==== /index.ts (2 errors) ==== +-==== /index.ts (2 errors) ==== ++==== /index.ts (3 errors) ==== import { a } from "./test"; + ~~~~~~~~ -+!!! error TS2306: File '/test.js' is not a module. ++!!! error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. declare module "./test" { + ~~~~~~~~ -+!!! error TS2306: File '/test.js' is not a module. ++!!! error TS2671: Cannot augment module './test' because it resolves to a non-module entity. export const a: number; - ~ -!!! error TS2300: Duplicate identifier 'a'. @@ -34,6 +33,3 @@ } a.toFixed(); -- ~~~~~~~ --!!! error TS2339: Property 'toFixed' does not exist on type 'string'. - diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation2.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation2.types.diff index 7d56d98124..775c6093fb 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation2.types.diff @@ -9,18 +9,14 @@ ->module : { exports: { a: string | number; }; } ->exports : { a: string | number; } +>module.exports = { a: "ok"} : { a: string; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { a: string; } ++>module : { export=: { a: string; }; } ++>exports : { a: string; } >{ a: "ok"} : { a: string; } a: "ok" -@@= skipped -14, +14 lines =@@ - - === /index.ts === - import { a } from "./test"; -->a : string -+>a : any +@@= skipped -17, +17 lines =@@ + >a : string declare module "./test" { ->"./test" : { a: string | number; } @@ -28,11 +24,3 @@ export const a: number; >a : number -@@= skipped -12, +12 lines =@@ - a.toFixed(); - >a.toFixed() : any - >a.toFixed : any -->a : string -+>a : any - >toFixed : any - diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation3.errors.txt.diff index 6722ac7b84..bb995ef719 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation3.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation3.errors.txt.diff @@ -3,18 +3,15 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+/x.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+/x.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++/x.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +/x.js(2,18): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + -+==== /x.js (3 errors) ==== ++==== /x.js (2 errors) ==== + module.exports.x = 1; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + module.exports = require("./y.js"); -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + ~~~~~~~ +!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation3.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation3.types.diff index 6236b681c3..815367444e 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsExportMemberMergedWithModuleAugmentation3.types.diff @@ -11,7 +11,7 @@ ->x : 1 +>module.exports.x : any +>module.exports : any -+>module : any ++>module : { export=: any; } +>exports : any +>x : any >1 : 1 @@ -24,7 +24,7 @@ ->require("./y.js") : typeof import("/y") +>module.exports = require("./y.js") : any +>module.exports : any -+>module : any ++>module : { export=: any; } +>exports : any +>require("./y.js") : any >require : any diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsFileClassPropertyInitalizationInObjectLiteral.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsFileClassPropertyInitalizationInObjectLiteral.errors.txt.diff index ba503af1b3..11808bf085 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsFileClassPropertyInitalizationInObjectLiteral.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsFileClassPropertyInitalizationInObjectLiteral.errors.txt.diff @@ -3,14 +3,11 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+foo.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +foo.js(4,10): error TS2339: Property 'b' does not exist on type 'typeof A'. + + -+==== foo.js (2 errors) ==== ++==== foo.js (1 errors) ==== + module.exports = function () { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + class A { } + return { + c: A.b = 1, diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsFileClassPropertyInitalizationInObjectLiteral.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsFileClassPropertyInitalizationInObjectLiteral.types.diff index 49700d8d7a..1a40adc79c 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsFileClassPropertyInitalizationInObjectLiteral.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsFileClassPropertyInitalizationInObjectLiteral.types.diff @@ -1,19 +1,15 @@ --- old.jsFileClassPropertyInitalizationInObjectLiteral.types +++ new.jsFileClassPropertyInitalizationInObjectLiteral.types -@@= skipped -2, +2 lines =@@ - === foo.js === +@@= skipped -3, +3 lines =@@ module.exports = function () { >module.exports = function () { class A { } return { c: A.b = 1, }} : () => { c: number; } -->module.exports : () => { c: number; } + >module.exports : () => { c: number; } ->module : { exports: () => { c: number; }; } -->exports : () => { c: number; } -+>module.exports : any -+>module : any -+>exports : any ++>module : { export=: () => { c: number; }; } + >exports : () => { c: number; } >function () { class A { } return { c: A.b = 1, }} : () => { c: number; } - class A { } -@@= skipped -14, +14 lines =@@ +@@= skipped -13, +13 lines =@@ c: A.b = 1, >c : number >A.b = 1 : 1 diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsFileCompilationExternalPackageError.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsFileCompilationExternalPackageError.errors.txt.diff index b5ac179271..e9cd228753 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsFileCompilationExternalPackageError.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsFileCompilationExternalPackageError.errors.txt.diff @@ -5,9 +5,8 @@ @@= skipped --1, +1 lines =@@ +moduleA/a.js(1,17): error TS2306: File 'node_modules/b.ts' is not a module. +moduleA/a.js(2,1): error TS2632: Cannot assign to 'a' because it is an import. -+moduleA/a.js(3,17): error TS2306: File 'node_modules/c.js' is not a module. ++moduleA/a.js(3,9): error TS2305: Module '"node_modules/c"' has no exported member 'c'. +moduleA/a.js(4,1): error TS2632: Cannot assign to 'c' because it is an import. -+node_modules/c.js(1,1): error TS2304: Cannot find name 'exports'. +node_modules/c.js(2,1): error TS2304: Cannot find name 'c'. + + @@ -19,8 +18,8 @@ + ~ +!!! error TS2632: Cannot assign to 'a' because it is an import. + import {c} from "c"; -+ ~~~ -+!!! error TS2306: File 'node_modules/c.js' is not a module. ++ ~ ++!!! error TS2305: Module '"node_modules/c"' has no exported member 'c'. + c++; + ~ +!!! error TS2632: Cannot assign to 'c' because it is an import. @@ -28,10 +27,8 @@ +==== node_modules/b.ts (0 errors) ==== + var a = 10; + -+==== node_modules/c.js (2 errors) ==== ++==== node_modules/c.js (1 errors) ==== + exports.a = 10; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + c = 10; + ~ +!!! error TS2304: Cannot find name 'c'. diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsFileCompilationExternalPackageError.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsFileCompilationExternalPackageError.types.diff index 049132fc4d..97eea8dcf2 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsFileCompilationExternalPackageError.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsFileCompilationExternalPackageError.types.diff @@ -17,17 +17,7 @@ === node_modules/b.ts === var a = 10; -@@= skipped -17, +17 lines =@@ - === node_modules/c.js === - exports.a = 10; - >exports.a = 10 : 10 -->exports.a : 10 -->exports : typeof import("node_modules/c") -->a : 10 -+>exports.a : any -+>exports : any -+>a : any - >10 : 10 +@@= skipped -24, +24 lines =@@ c = 10; >c = 10 : 10 diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsdocReferenceGlobalTypeInCommonJs.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsdocReferenceGlobalTypeInCommonJs.errors.txt.diff deleted file mode 100644 index e403334068..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsdocReferenceGlobalTypeInCommonJs.errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.jsdocReferenceGlobalTypeInCommonJs.errors.txt -+++ new.jsdocReferenceGlobalTypeInCommonJs.errors.txt -@@= skipped -0, +0 lines =@@ --a.js(4,1): error TS2686: 'Puppeteer' refers to a UMD global, but the current file is a module. Consider adding an import instead. -+a.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - - ==== a.js (1 errors) ==== - const other = require('./other'); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - /** @type {Puppeteer.Keyboard} */ - var ppk; - Puppeteer.connect; -- ~~~~~~~~~ --!!! error TS2686: 'Puppeteer' refers to a UMD global, but the current file is a module. Consider adding an import instead. - ==== puppet.d.ts (0 errors) ==== - export as namespace Puppeteer; - export interface Keyboard { diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/jsdocReferenceGlobalTypeInCommonJs.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/jsdocReferenceGlobalTypeInCommonJs.types.diff index bc912162d7..4035adc4de 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/jsdocReferenceGlobalTypeInCommonJs.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/jsdocReferenceGlobalTypeInCommonJs.types.diff @@ -1,15 +1,6 @@ --- old.jsdocReferenceGlobalTypeInCommonJs.types +++ new.jsdocReferenceGlobalTypeInCommonJs.types -@@= skipped -1, +1 lines =@@ - - === a.js === - const other = require('./other'); -->other : () => string -->require('./other') : () => string -+>other : any -+>require('./other') : any - >require : any - >'./other' : "./other" +@@= skipped -8, +8 lines =@@ /** @type {Puppeteer.Keyboard} */ var ppk; diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/localRequireFunction.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/localRequireFunction.errors.txt.diff new file mode 100644 index 0000000000..2813e6e399 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/compiler/localRequireFunction.errors.txt.diff @@ -0,0 +1,20 @@ +--- old.localRequireFunction.errors.txt ++++ new.localRequireFunction.errors.txt +@@= skipped -0, +-1 lines =@@ +- +@@= skipped --1, +1 lines =@@ ++app.js(1,10): error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. ++app.js(5,20): error TS2307: Cannot find module 'fs' or its corresponding type declarations. ++ ++ ++==== app.js (2 errors) ==== ++ function require(a) { ++ ~~~~~~~ ++!!! error TS2441: Duplicate identifier 'require'. Compiler reserves name 'require' in top level scope of a module. ++ return a; ++ } ++ ++ const fs = require("fs"); ++ ~~~~ ++!!! error TS2307: Cannot find module 'fs' or its corresponding type declarations. ++ const text = fs.readFileSync("/a/b/c"); diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/maxNodeModuleJsDepthDefaultsToZero.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/maxNodeModuleJsDepthDefaultsToZero.types.diff new file mode 100644 index 0000000000..2779b86f3a --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/compiler/maxNodeModuleJsDepthDefaultsToZero.types.diff @@ -0,0 +1,53 @@ +--- old.maxNodeModuleJsDepthDefaultsToZero.types ++++ new.maxNodeModuleJsDepthDefaultsToZero.types +@@= skipped -10, +10 lines =@@ + === /index.ts === + /// + import * as foo from "shortid"; +->foo : typeof foo ++>foo : typeof import("shortid") + + foo.x // found in index.d.ts + >foo.x : number +->foo : typeof foo ++>foo : typeof import("shortid") + >x : number + + foo.y // ignored from shortid/index.js + >foo.y : any +->foo : typeof foo ++>foo : typeof import("shortid") + >y : any + + ++=== /node_modules/shortid/node_modules/z/index.js === ++// z will not be found because maxNodeModulesJsDepth: 0 ++module.exports = { z: 'no' }; ++>module.exports = { z: 'no' } : { z: string; } ++>module.exports : { z: string; } ++>module : { export=: { z: string; }; } ++>exports : { z: string; } ++>{ z: 'no' } : { z: string; } ++>z : string ++>'no' : "no" ++ ++=== /node_modules/shortid/index.js === ++var z = require('z'); ++>z : { z: string; } ++>require('z') : { z: string; } ++>require : any ++>'z' : "z" ++ ++var y = { y: 'foo' }; ++>y : { y: string; } ++>{ y: 'foo' } : { y: string; } ++>y : string ++>'foo' : "foo" ++ ++module.exports = y; ++>module.exports = y : { y: string; } ++>module.exports : { y: string; } ++>module : { y: { y: string; }; } ++>exports : { y: string; } ++>y : { y: string; } ++ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.errors.txt.diff index a4b3fcdc6c..2ae834d40c 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.errors.txt.diff @@ -3,17 +3,13 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+eslint.config.js(1,21): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+eslint.config.js(2,18): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++typescript-eslint.js(12,17): error TS7019: Rest parameter 'configs' implicitly has an 'any[]' type. ++typescript-eslint.js(14,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + -+==== eslint.config.js (2 errors) ==== ++==== eslint.config.js (0 errors) ==== + const eslintReact = require('./eslint-plugin-react.js'); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + const tseslint = require('./typescript-eslint.js'); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + tseslint.config(eslintReact) + @@ -35,7 +31,7 @@ + }, + }; + -+==== typescript-eslint.js (0 errors) ==== ++==== typescript-eslint.js (2 errors) ==== + /** + * @typedef {{ rules: Record }} Plugin + */ @@ -48,6 +44,10 @@ + * @type {(...configs: Config[]) => void} + */ + function config(...configs) { } ++ ~~~~~~~~~~ ++!!! error TS7019: Rest parameter 'configs' implicitly has an 'any[]' type. + + module.exports = { config }; ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.types.diff index a61d4c3cdb..61444ff180 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.types.diff @@ -1,102 +1,56 @@ --- old.moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.types +++ new.moduleExportsTypeNoExcessPropertyCheckFromContainedLiteral.types -@@= skipped -1, +1 lines =@@ - - === eslint.config.js === - const eslintReact = require('./eslint-plugin-react.js'); -->eslintReact : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } -->require('./eslint-plugin-react.js') : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } -+>eslintReact : any -+>require('./eslint-plugin-react.js') : any - >require : any +@@= skipped -7, +7 lines =@@ >'./eslint-plugin-react.js' : "./eslint-plugin-react.js" const tseslint = require('./typescript-eslint.js'); ->tseslint : typeof tseslint ->require('./typescript-eslint.js') : typeof tseslint -+>tseslint : any -+>require('./typescript-eslint.js') : any ++>tseslint : { config: (...configs: any[]) => void; } ++>require('./typescript-eslint.js') : { config: (...configs: any[]) => void; } >require : any >'./typescript-eslint.js' : "./typescript-eslint.js" tseslint.config(eslintReact) -->tseslint.config(eslintReact) : void + >tseslint.config(eslintReact) : void ->tseslint.config : (...configs: Config[]) => void ->tseslint : typeof tseslint ->config : (...configs: Config[]) => void -->eslintReact : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } -+>tseslint.config(eslintReact) : any -+>tseslint.config : any -+>tseslint : any -+>config : any -+>eslintReact : any ++>tseslint.config : (...configs: any[]) => void ++>tseslint : { config: (...configs: any[]) => void; } ++>config : (...configs: any[]) => void + >eslintReact : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } --=== eslint-plugin-react.js === --const deprecatedRules = { -->deprecatedRules : { "jsx-sort-default-props": boolean; } -->{ "jsx-sort-default-props": true} : { "jsx-sort-default-props": boolean; } -- -- "jsx-sort-default-props": true -->"jsx-sort-default-props" : boolean -->true : true --} -- --const allRules = { -->allRules : { 'no-unsafe': boolean; } -->{ 'no-unsafe': true} : { 'no-unsafe': boolean; } -- -- 'no-unsafe': true -->'no-unsafe' : boolean -->true : true --} -- --module.exports = { -->module.exports = { plugins: { react: { deprecatedRules, rules: allRules, }, },} : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } -->module.exports : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } + === eslint-plugin-react.js === +@@= skipped -34, +34 lines =@@ + module.exports = { + >module.exports = { plugins: { react: { deprecatedRules, rules: allRules, }, },} : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } + >module.exports : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } ->module : { exports: { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; }; } -->exports : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } -->{ plugins: { react: { deprecatedRules, rules: allRules, }, },} : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } -- -- plugins: { -->plugins : { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; } -->{ react: { deprecatedRules, rules: allRules, }, } : { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; } -- -- react: { -->react : { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; } -->{ deprecatedRules, rules: allRules, } : { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; } -- -- deprecatedRules, -->deprecatedRules : { "jsx-sort-default-props": boolean; } -- -- rules: allRules, -->rules : { 'no-unsafe': boolean; } -->allRules : { 'no-unsafe': boolean; } -- -- }, -- }, --}; -- --=== typescript-eslint.js === --/** -- * @typedef {{ rules: Record }} Plugin -- */ -- --/** -- * @typedef {{ plugins: Record }} Config -- */ -- --/** -- * @type {(...configs: Config[]) => void} -- */ --function config(...configs) { } ++>module : { export=: { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; }; } + >exports : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } + >{ plugins: { react: { deprecatedRules, rules: allRules, }, },} : { plugins: { react: { deprecatedRules: { "jsx-sort-default-props": boolean; }; rules: { 'no-unsafe': boolean; }; }; }; } + +@@= skipped -36, +36 lines =@@ + * @type {(...configs: Config[]) => void} + */ + function config(...configs) { } ->config : (...configs: Config[]) => void ->configs : Config[] -- --module.exports = { config }; ++>config : (...configs: any[]) => void ++>configs : any[] + + module.exports = { config }; ->module.exports = { config } : typeof module.exports ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports ->{ config } : { config: (...configs: Config[]) => void; } ->config : (...configs: Config[]) => void -- ++>module.exports = { config } : { config: (...configs: any[]) => void; } ++>module.exports : { config: (...configs: any[]) => void; } ++>module : { export=: { config: (...configs: any[]) => void; }; } ++>exports : { config: (...configs: any[]) => void; } ++>{ config } : { config: (...configs: any[]) => void; } ++>config : (...configs: any[]) => void + diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve2.errors.txt.diff index b2b4d30e2f..edec0bb963 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve2.errors.txt.diff @@ -4,16 +4,13 @@ - @@= skipped --1, +1 lines =@@ +/main.js(1,10): error TS2305: Module '"/node_modules/dep/require"' has no exported member 'esm'. -+/main.js(2,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + -+==== /main.js (2 errors) ==== ++==== /main.js (1 errors) ==== + import { esm } from "dep"; + ~~~ +!!! error TS2305: Module '"/node_modules/dep/require"' has no exported member 'esm'. + const cjs = require("dep"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + +==== /node_modules/dep/package.json (0 errors) ==== + { diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve2.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve2.types.diff index 74266af774..0a70f8deb7 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve2.types.diff @@ -8,10 +8,8 @@ +>esm : any const cjs = require("dep"); -->cjs : "cjs" -->require("dep") : "cjs" -+>cjs : any -+>require("dep") : any + >cjs : "cjs" +@@= skipped -8, +8 lines =@@ >require : any >"dep" : "dep" diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve4.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve4.errors.txt.diff index b474fc781d..cd7fd73808 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve4.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve4.errors.txt.diff @@ -1,18 +1,14 @@ --- old.modulePreserve4.errors.txt +++ new.modulePreserve4.errors.txt @@= skipped -0, +0 lines =@@ - /a.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-/a.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /f.cts(1,1): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -/main1.ts(1,13): error TS2305: Module '"./a"' has no exported member 'y'. -+/g.js(1,1): error TS2304: Cannot find name 'exports'. -+/main1.ts(1,13): error TS2305: Module '"/a"' has no exported member 'y'. /main1.ts(3,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /main1.ts(19,4): error TS2339: Property 'default' does not exist on type '() => void'. -/main1.ts(23,8): error TS1192: Module '"/e"' has no default export. -/main2.mts(1,13): error TS2305: Module '"./a"' has no exported member 'y'. -+/main1.ts(29,16): error TS2306: File '/g.js' is not a module. -+/main1.ts(31,21): error TS2306: File '/g.js' is not a module. -+/main2.mts(1,13): error TS2305: Module '"/a"' has no exported member 'y'. ++/main1.ts(30,4): error TS2339: Property 'default' does not exist on type '0'. /main2.mts(4,4): error TS2339: Property 'default' does not exist on type 'typeof import("/a")'. /main2.mts(5,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -/main2.mts(14,8): error TS1192: Module '"/e"' has no default export. @@ -25,48 +21,39 @@ -/main3.cjs(12,8): error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. -/main3.cjs(14,8): error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. -/main3.cjs(17,8): error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. -+/main2.mts(19,16): error TS2306: File '/g.js' is not a module. -+/main2.mts(20,21): error TS2306: File '/g.js' is not a module. +/main3.cjs(1,10): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -+/main3.cjs(1,13): error TS2305: Module '"/a"' has no exported member 'y'. -+/main3.cjs(3,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++/main3.cjs(1,13): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. +/main3.cjs(5,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -+/main3.cjs(6,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/main3.cjs(8,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -+/main3.cjs(9,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/main3.cjs(10,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -+/main3.cjs(11,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/main3.cjs(12,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -+/main3.cjs(13,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/main3.cjs(14,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. -+/main3.cjs(15,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+/main3.cjs(17,16): error TS2306: File '/g.js' is not a module. -+/main3.cjs(18,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+/main4.cjs(1,1): error TS2304: Cannot find name 'exports'. ++/main3.cjs(17,8): error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. +/main4.cjs(1,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - ==== /a.js (1 errors) ==== -@@= skipped -43, +54 lines =@@ - ~~~~~~~~~~~~~~~~~ - !!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. +-==== /a.js (1 errors) ==== ++==== /a.js (0 errors) ==== + export const x = 0; + module.exports.y = 0; // Error +- ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. --==== /g.js (0 errors) ==== -+==== /g.js (1 errors) ==== + ==== /b.ts (0 errors) ==== + export default 0; +@@= skipped -46, +40 lines =@@ + ==== /g.js (0 errors) ==== exports.default = 0; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -==== /main1.ts (4 errors) ==== -+==== /main1.ts (5 errors) ==== ++==== /main1.ts (3 errors) ==== import { x, y } from "./a"; // No y - ~ +- ~ -!!! error TS2305: Module '"./a"' has no exported member 'y'. -+!!! error TS2305: Module '"/a"' has no exported member 'y'. import a1 = require("./a"); // { x: 0 } const a2 = require("./a"); // Error in TS ~~~~~~~ -@@= skipped -33, +35 lines =@@ +@@= skipped -30, +28 lines =@@ d3.default(); import e1 from "./e.mjs"; // 0 @@ -75,27 +62,24 @@ import e2 = require("./e.mjs"); // 0 import f1 from "./f.cjs"; // 0 import f2 = require("./f.cjs"); // { default: 0 } - f2.default; +@@= skipped -9, +7 lines =@@ import g1 from "./g"; // { default: 0 } -+ ~~~~~ -+!!! error TS2306: File '/g.js' is not a module. g1.default; ++ ~~~~~~~ ++!!! error TS2339: Property 'default' does not exist on type '0'. import g2 = require("./g"); // { default: 0 } -+ ~~~~~ -+!!! error TS2306: File '/g.js' is not a module. g2.default; -==== /main2.mts (4 errors) ==== -+==== /main2.mts (5 errors) ==== ++==== /main2.mts (2 errors) ==== import { x, y } from "./a"; // No y - ~ +- ~ -!!! error TS2305: Module '"./a"' has no exported member 'y'. -+!!! error TS2305: Module '"/a"' has no exported member 'y'. import a1 = require("./a"); // { x: 0 } a1.x; a1.default.x; // Arguably should exist but doesn't -@@= skipped -33, +35 lines =@@ +@@= skipped -24, +24 lines =@@ import d1 from "./d"; // [Function: default] import d2 = require("./d"); // [Function: default] import e1 from "./e.mjs"; // 0 @@ -104,81 +88,60 @@ import e2 = require("./e.mjs"); // 0 import f1 from "./f.cjs"; // 0 import f2 = require("./f.cjs"); // { default: 0 } - +@@= skipped -9, +7 lines =@@ import g1 from "./g"; // { default: 0 } -+ ~~~~~ -+!!! error TS2306: File '/g.js' is not a module. import g2 = require("./g"); // { default: 0 } -+ ~~~~~ -+!!! error TS2306: File '/g.js' is not a module. -==== /main3.cjs (9 errors) ==== -+==== /main3.cjs (15 errors) ==== ++==== /main3.cjs (8 errors) ==== import { x, y } from "./a"; // No y ~ -!!! error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. +!!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. ~ -!!! error TS2305: Module '"./a"' has no exported member 'y'. -+!!! error TS2305: Module '"/a"' has no exported member 'y'. ++!!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. import a1 = require("./a"); // Error in JS - ~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS8002: 'import ... =' can only be used in TypeScript files. const a2 = require("./a"); // { x: 0 } -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import b1 from "./b"; // 0 ~~ -!!! error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. +!!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const b2 = require("./b"); // { default: 0 } -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import c1 from "./c"; // { default: [Function: default] } ~~ -!!! error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. +!!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const c2 = require("./c"); // { default: [Function: default] } -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import d1 from "./d"; // [Function: default] ~~ -!!! error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. +!!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const d2 = require("./d"); // [Function: default] -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import e1 from "./e.mjs"; // 0 ~~ -!!! error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. +!!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const e2 = require("./e.mjs"); // 0 -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import f1 from "./f.cjs"; // 0 ~~ -!!! error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. +!!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const f2 = require("./f.cjs"); // { default: 0 } -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. import g1 from "./g"; // { default: 0 } -- ~~ + ~~ -!!! error TS1293: ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'. -+ ~~~~~ -+!!! error TS2306: File '/g.js' is not a module. ++!!! error TS1286: ESM syntax is not allowed in a CommonJS module when 'verbatimModuleSyntax' is enabled. const g2 = require("./g"); // { default: 0 } -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== /main4.cjs (0 errors) ==== -+==== /main4.cjs (2 errors) ==== ++==== /main4.cjs (1 errors) ==== exports.x = require("./g"); -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + ~~~~~~~ +!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve4.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve4.types.diff index a033c92c10..80ea33512c 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve4.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/modulePreserve4.types.diff @@ -1,20 +1,28 @@ --- old.modulePreserve4.types +++ new.modulePreserve4.types -@@= skipped -42, +42 lines =@@ - === /g.js === - exports.default = 0; - >exports.default = 0 : 0 -->exports.default : 0 -->exports : typeof import("/g") -->default : 0 -+>exports.default : any -+>exports : any -+>default : any +@@= skipped -6, +6 lines =@@ + + module.exports.y = 0; // Error + >module.exports.y = 0 : 0 +->module.exports.y : any +->module.exports : any +->module : any +->exports : any +->y : any ++>module.exports.y : 0 ++>module.exports : typeof import("/a") ++>module : { "/a": typeof import("/a"); } ++>exports : typeof import("/a") ++>y : 0 >0 : 0 + === /b.ts === +@@= skipped -44, +44 lines =@@ === /main1.ts === -@@= skipped -11, +11 lines =@@ - >y : any + import { x, y } from "./a"; // No y + >x : 0 +->y : any ++>y : 0 import a1 = require("./a"); // { x: 0 } ->a1 : typeof a1 @@ -22,7 +30,7 @@ const a2 = require("./a"); // Error in TS >a2 : any -@@= skipped -9, +9 lines =@@ +@@= skipped -12, +12 lines =@@ >"./a" : "./a" const a3 = await import("./a"); // { x: 0 } @@ -93,32 +101,31 @@ import g1 from "./g"; // { default: 0 } ->g1 : typeof g1 -+>g1 : any ++>g1 : 0 g1.default; ->g1.default : 0 ->g1 : typeof g1 ->default : 0 +>g1.default : any -+>g1 : any ++>g1 : 0 +>default : any import g2 = require("./g"); // { default: 0 } ->g2 : typeof g1 -+>g2 : any ++>g2 : typeof import("/g") g2.default; -->g2.default : 0 + >g2.default : 0 ->g2 : typeof g1 -->default : 0 -+>g2.default : any -+>g2 : any -+>default : any ++>g2 : typeof import("/g") + >default : 0 === /main2.mts === import { x, y } from "./a"; // No y -@@= skipped -29, +29 lines =@@ - >y : any + >x : 0 +->y : any ++>y : 0 import a1 = require("./a"); // { x: 0 } ->a1 : typeof a1 @@ -138,7 +145,7 @@ >default : any >x : any -@@= skipped -24, +24 lines =@@ +@@= skipped -53, +53 lines =@@ >b1 : 0 import b2 = require("./b"); // { default: 0 } @@ -165,16 +172,17 @@ import g1 from "./g"; // { default: 0 } ->g1 : typeof g1 -+>g1 : any ++>g1 : 0 import g2 = require("./g"); // { default: 0 } ->g2 : typeof g1 -+>g2 : any ++>g2 : typeof import("/g") === /main3.cjs === import { x, y } from "./a"; // No y -@@= skipped -14, +14 lines =@@ - >y : any + >x : 0 +->y : any ++>y : 0 import a1 = require("./a"); // Error in JS ->a1 : typeof a1 @@ -183,75 +191,42 @@ const a2 = require("./a"); // { x: 0 } ->a2 : typeof a1 ->require("./a") : typeof a1 -+>a2 : any -+>require("./a") : any ++>a2 : typeof import("/a") ++>require("./a") : typeof import("/a") >require : any >"./a" : "./a" -@@= skipped -12, +12 lines =@@ +@@= skipped -26, +26 lines =@@ >b1 : 0 const b2 = require("./b"); // { default: 0 } ->b2 : typeof b2 ->require("./b") : typeof b2 -+>b2 : any -+>require("./b") : any ++>b2 : typeof import("/b") ++>require("./b") : typeof import("/b") >require : any >"./b" : "./b" -@@= skipped -9, +9 lines =@@ - >c1 : { default: () => void; } - - const c2 = require("./c"); // { default: [Function: default] } -->c2 : { default: () => void; } -->require("./c") : { default: () => void; } -+>c2 : any -+>require("./c") : any - >require : any - >"./c" : "./c" - -@@= skipped -9, +9 lines =@@ - >d1 : () => void - - const d2 = require("./d"); // [Function: default] -->d2 : () => void -->require("./d") : () => void -+>d2 : any -+>require("./d") : any - >require : any - >"./d" : "./d" - -@@= skipped -9, +9 lines =@@ - >e1 : 0 - - const e2 = require("./e.mjs"); // 0 -->e2 : 0 -->require("./e.mjs") : 0 -+>e2 : any -+>require("./e.mjs") : any - >require : any - >"./e.mjs" : "./e.mjs" - -@@= skipped -9, +9 lines =@@ +@@= skipped -36, +36 lines =@@ >f1 : 0 const f2 = require("./f.cjs"); // { default: 0 } ->f2 : typeof f2 ->require("./f.cjs") : typeof f2 -+>f2 : any -+>require("./f.cjs") : any ++>f2 : typeof import("/f") ++>require("./f.cjs") : typeof import("/f") >require : any >"./f.cjs" : "./f.cjs" import g1 from "./g"; // { default: 0 } ->g1 : typeof g1 -+>g1 : any ++>g1 : 0 const g2 = require("./g"); // { default: 0 } ->g2 : typeof g1 ->require("./g") : typeof g1 -+>g2 : any -+>require("./g") : any ++>g2 : typeof import("/g") ++>require("./g") : typeof import("/g") >require : any >"./g" : "./g" @@ -259,12 +234,11 @@ exports.x = require("./g"); ->exports.x = require("./g") : typeof import("/g") ->exports.x : typeof import("/g") -->exports : typeof import("/main4") -->x : typeof import("/g") -->require("./g") : typeof import("/g") +>exports.x = require("./g") : any +>exports.x : any -+>exports : any + >exports : typeof import("/main4") +->x : typeof import("/g") +->require("./g") : typeof import("/g") +>x : any +>require("./g") : any >require : any diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithExtensions_notSupported2.errors.txt.diff similarity index 72% rename from testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.errors.txt.diff rename to testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithExtensions_notSupported2.errors.txt.diff index e4089d557b..f14668cef4 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolutionWithExtensions_notSupported2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithExtensions_notSupported2.errors.txt.diff @@ -2,14 +2,14 @@ +++ new.moduleResolutionWithExtensions_notSupported2.errors.txt @@= skipped -0, +0 lines =@@ -/a.ts(1,17): error TS6142: Module './jsx' was resolved to '/jsx.jsx', but '--jsx' is not set. -+/a.ts(1,17): error TS2307: Cannot find module './jsx' or its corresponding type declarations. ++/a.ts(1,17): error TS2306: File '/jsx.jsx' is not a module. ==== /a.ts (1 errors) ==== import jsx from "./jsx"; ~~~~~~~ -!!! error TS6142: Module './jsx' was resolved to '/jsx.jsx', but '--jsx' is not set. -+!!! error TS2307: Cannot find module './jsx' or its corresponding type declarations. ++!!! error TS2306: File '/jsx.jsx' is not a module. -==== /jsx.jsx (0 errors) ==== - diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithExtensions_notSupported2.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithExtensions_notSupported2.types.diff new file mode 100644 index 0000000000..25d3e0fa11 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithExtensions_notSupported2.types.diff @@ -0,0 +1,8 @@ +--- old.moduleResolutionWithExtensions_notSupported2.types ++++ new.moduleResolutionWithExtensions_notSupported2.types +@@= skipped -3, +3 lines =@@ + import jsx from "./jsx"; + >jsx : any + ++=== /jsx.jsx === ++ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_jsModule.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_jsModule.errors.txt.diff deleted file mode 100644 index f344cec4bf..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_jsModule.errors.txt.diff +++ /dev/null @@ -1,35 +0,0 @@ ---- old.moduleResolutionWithSuffixes_one_jsModule.errors.txt -+++ new.moduleResolutionWithSuffixes_one_jsModule.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+/index.ts(1,21): error TS2306: File '/foo.ios.js' is not a module. -+ -+ -+==== /tsconfig.json (0 errors) ==== -+ { -+ "compilerOptions": { -+ "allowJs": true, -+ "checkJs": false, -+ "outDir": "bin", -+ "moduleResolution": "node", -+ "traceResolution": true, -+ "moduleSuffixes": [".ios"] -+ } -+ } -+ -+==== /index.ts (1 errors) ==== -+ import { ios } from "./foo.js"; -+ ~~~~~~~~~~ -+!!! error TS2306: File '/foo.ios.js' is not a module. -+==== /foo.ios.js (0 errors) ==== -+ "use strict"; -+ exports.__esModule = true; -+ function ios() {} -+ exports.ios = ios; -+==== /foo.js (0 errors) ==== -+ "use strict"; -+ exports.__esModule = true; -+ function base() {} -+ exports.base = base; -+ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_jsModule.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_jsModule.types.diff deleted file mode 100644 index 20cbda5dac..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolutionWithSuffixes_one_jsModule.types.diff +++ /dev/null @@ -1,63 +0,0 @@ ---- old.moduleResolutionWithSuffixes_one_jsModule.types -+++ new.moduleResolutionWithSuffixes_one_jsModule.types -@@= skipped -1, +1 lines =@@ - - === /index.ts === - import { ios } from "./foo.js"; -->ios : () => void -+>ios : any - - === /foo.ios.js === - "use strict"; -@@= skipped -8, +8 lines =@@ - - exports.__esModule = true; - >exports.__esModule = true : true -->exports.__esModule : true -->exports : typeof import("/foo.ios") -->__esModule : true -+>exports.__esModule : any -+>exports : any -+>__esModule : any - >true : true - - function ios() {} -@@= skipped -10, +10 lines =@@ - - exports.ios = ios; - >exports.ios = ios : () => void -->exports.ios : () => void -->exports : typeof import("/foo.ios") -+>exports.ios : any -+>exports : any -+>ios : any - >ios : () => void -->ios : () => void - - === /foo.js === - "use strict"; -@@= skipped -11, +11 lines =@@ - - exports.__esModule = true; - >exports.__esModule = true : true -->exports.__esModule : true -->exports : typeof import("/foo") -->__esModule : true -+>exports.__esModule : any -+>exports : any -+>__esModule : any - >true : true - - function base() {} -@@= skipped -10, +10 lines =@@ - - exports.base = base; - >exports.base = base : () => void -->exports.base : () => void -->exports : typeof import("/foo") -+>exports.base : any -+>exports : any -+>base : any - >base : () => void -->base : () => void - diff --git a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.errors.txt.diff similarity index 59% rename from testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.errors.txt.diff rename to testdata/baselines/reference/submoduleAccepted/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.errors.txt.diff index 3ad933889b..2fa4c3f8bb 100644 --- a/testdata/baselines/reference/submodule/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.errors.txt.diff @@ -3,13 +3,13 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+/src/index.ts(1,19): error TS2307: Cannot find module '../node_modules/foo' or its corresponding type declarations. ++/src/index.ts(1,10): error TS2305: Module '"/node_modules/foo/index"' has no exported member 'y'. + + +==== /src/index.ts (1 errors) ==== + import { y } from "../node_modules/foo"; -+ ~~~~~~~~~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module '../node_modules/foo' or its corresponding type declarations. ++ ~ ++!!! error TS2305: Module '"/node_modules/foo/index"' has no exported member 'y'. + +==== /node_modules/foo/index.js (0 errors) ==== + exports.x = 0; diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.types.diff new file mode 100644 index 0000000000..ec21c4398f --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/compiler/moduleResolution_explicitNodeModulesImport_implicitAny.types.diff @@ -0,0 +1,14 @@ +--- old.moduleResolution_explicitNodeModulesImport_implicitAny.types ++++ new.moduleResolution_explicitNodeModulesImport_implicitAny.types +@@= skipped -3, +3 lines =@@ + import { y } from "../node_modules/foo"; + >y : any + ++=== /node_modules/foo/index.js === ++exports.x = 0; ++>exports.x = 0 : 0 ++>exports.x : 0 ++>exports : typeof import("/node_modules/foo/index") ++>x : 0 ++>0 : 0 ++ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/noCrashOnParameterNamedRequire.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/noCrashOnParameterNamedRequire.errors.txt.diff deleted file mode 100644 index cebc268730..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/noCrashOnParameterNamedRequire.errors.txt.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.noCrashOnParameterNamedRequire.errors.txt -+++ new.noCrashOnParameterNamedRequire.errors.txt -@@= skipped -0, +-1 lines =@@ --index.js(2,25): error TS2307: Cannot find module './mod' or its corresponding type declarations. -- -- --==== index.js (1 errors) ==== -- (function(require, module, exports){ -- const mod = require("./mod"); -- ~~~~~~~ --!!! error TS2307: Cannot find module './mod' or its corresponding type declarations. -- mod.foo; -- })(null, null, null); -@@= skipped --1, +1 lines =@@ -+ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.errors.txt.diff deleted file mode 100644 index feb1ac38cb..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.errors.txt.diff +++ /dev/null @@ -1,32 +0,0 @@ ---- old.pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.errors.txt -+++ new.pathMappingBasedModuleResolution_rootImport_aliasWithRoot_realRootFile.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+/root/a.ts(2,21): error TS2307: Cannot find module '/bar' or its corresponding type declarations. -+ -+ -+==== /root/tsconfig.json (0 errors) ==== -+ { -+ "compilerOptions": { -+ "baseUrl": ".", -+ "paths": { -+ "/*": ["./src/*"] -+ }, -+ "allowJs": true, -+ "outDir": "bin" -+ } -+ } -+ -+==== /root/a.ts (1 errors) ==== -+ import { foo } from "/foo"; -+ import { bar } from "/bar"; -+ ~~~~~~ -+!!! error TS2307: Cannot find module '/bar' or its corresponding type declarations. -+ -+==== /foo.ts (0 errors) ==== -+ export function foo() {} -+ -+==== /bar.js (0 errors) ==== -+ export function bar() {} -+ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.errors.txt.diff deleted file mode 100644 index 8371593d5c..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.errors.txt.diff +++ /dev/null @@ -1,32 +0,0 @@ ---- old.pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.errors.txt -+++ new.pathMappingBasedModuleResolution_rootImport_noAliasWithRoot_realRootFile.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+/root/a.ts(2,21): error TS2307: Cannot find module '/bar' or its corresponding type declarations. -+ -+ -+==== /root/tsconfig.json (0 errors) ==== -+ { -+ "compilerOptions": { -+ "baseUrl": ".", -+ "paths": { -+ "*": ["./src/*"] -+ }, -+ "allowJs": true, -+ "outDir": "bin" -+ } -+ } -+ -+==== /root/a.ts (1 errors) ==== -+ import { foo } from "/foo"; -+ import { bar } from "/bar"; -+ ~~~~~~ -+!!! error TS2307: Cannot find module '/bar' or its corresponding type declarations. -+ -+==== /foo.ts (0 errors) ==== -+ export function foo() {} -+ -+==== /bar.js (0 errors) ==== -+ export function bar() {} -+ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.errors.txt.diff deleted file mode 100644 index 39efc75f77..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.errors.txt.diff +++ /dev/null @@ -1,28 +0,0 @@ ---- old.pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.errors.txt -+++ new.pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+/a.ts(1,20): error TS2307: Cannot find module 'foo/bar/foobar.js' or its corresponding type declarations. -+ -+ -+==== /tsconfig.json (0 errors) ==== -+ { -+ "compilerOptions": { -+ "baseUrl": ".", -+ "paths": { -+ "*": ["node_modules/*", "src/types"] -+ }, -+ "allowJs": true, -+ "outDir": "bin" -+ } -+ } -+ -+==== /a.ts (1 errors) ==== -+ import foobar from "foo/bar/foobar.js"; -+ ~~~~~~~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module 'foo/bar/foobar.js' or its corresponding type declarations. -+ -+==== /node_modules/foo/bar/foobar.js (0 errors) ==== -+ module.exports = { a: 10 }; -+ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.types.diff new file mode 100644 index 0000000000..5a9e393d26 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/compiler/pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.types.diff @@ -0,0 +1,19 @@ +--- old.pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.types ++++ new.pathMappingBasedModuleResolution_withExtension_MapedToNodeModules.types +@@= skipped -1, +1 lines =@@ + + === /a.ts === + import foobar from "foo/bar/foobar.js"; +->foobar : any ++>foobar : { a: number; } + ++=== /node_modules/foo/bar/foobar.js === ++module.exports = { a: 10 }; ++>module.exports = { a: 10 } : { a: number; } ++>module.exports : { a: number; } ++>module : { export=: { a: number; }; } ++>exports : { a: number; } ++>{ a: 10 } : { a: number; } ++>a : number ++>10 : 10 ++ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/pushTypeGetTypeOfAlias.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/pushTypeGetTypeOfAlias.errors.txt.diff index b3366f69b1..6192592b7a 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/pushTypeGetTypeOfAlias.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/pushTypeGetTypeOfAlias.errors.txt.diff @@ -3,22 +3,21 @@ @@= skipped -0, +0 lines =@@ -bar.js(2,1): error TS2303: Circular definition of import alias 'blah'. -bar.js(2,24): error TS2339: Property 'someProp' does not exist on type '{ (): void; blah: any; }'. -+bar.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+bar.js(2,1): error TS2304: Cannot find name 'exports'. -+bar.js(2,16): error TS2304: Cannot find name 'exports'. ++bar.js(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++bar.js(2,9): error TS2339: Property 'blah' does not exist on type 'typeof import("bar")'. ++bar.js(2,24): error TS2339: Property 'someProp' does not exist on type 'typeof import("bar")'. -==== bar.js (2 errors) ==== +==== bar.js (3 errors) ==== module.exports = function () {}; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. exports.blah = exports.someProp; - ~~~~~~~~~~~~ -!!! error TS2303: Circular definition of import alias 'blah'. -- ~~~~~~~~ ++ ~~~~ ++!!! error TS2339: Property 'blah' does not exist on type 'typeof import("bar")'. + ~~~~~~~~ -!!! error TS2339: Property 'someProp' does not exist on type '{ (): void; blah: any; }'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++!!! error TS2339: Property 'someProp' does not exist on type 'typeof import("bar")'. diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/pushTypeGetTypeOfAlias.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/pushTypeGetTypeOfAlias.types.diff index e7b50cb506..4a4feba33a 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/pushTypeGetTypeOfAlias.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/pushTypeGetTypeOfAlias.types.diff @@ -9,19 +9,19 @@ ->module : { exports: { (): void; blah: any; }; } ->exports : { (): void; blah: any; } +>module.exports = function () {} : () => void -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : () => void ++>module : { export=: () => void; } ++>exports : () => void >function () {} : () => void exports.blah = exports.someProp; >exports.blah = exports.someProp : any >exports.blah : any ->exports : { (): void; blah: any; } -+>exports : any ++>exports : typeof import("bar") >blah : any >exports.someProp : any ->exports : { (): void; blah: any; } -+>exports : any ++>exports : typeof import("bar") >someProp : any diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/requireOfJsonFileInJsFile.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/requireOfJsonFileInJsFile.errors.txt.diff index ebb97d5f57..d81985857f 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/requireOfJsonFileInJsFile.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/requireOfJsonFileInJsFile.errors.txt.diff @@ -1,23 +1,21 @@ --- old.requireOfJsonFileInJsFile.errors.txt +++ new.requireOfJsonFileInJsFile.errors.txt @@= skipped -0, +0 lines =@@ --/user.js(2,7): error TS2339: Property 'b' does not exist on type '{ a: number; }'. + /user.js(2,7): error TS2339: Property 'b' does not exist on type '{ a: number; }'. -/user.js(5,7): error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: number; }'. --/user.js(9,7): error TS2339: Property 'b' does not exist on type '{ a: number; }'. --/user.js(12,7): error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: number; }'. -+/user.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +/user.js(5,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+/user.js(8,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++/user.js(8,21): error TS2307: Cannot find module './js.js' or its corresponding type declarations. + /user.js(9,7): error TS2339: Property 'b' does not exist on type '{ a: number; }'. +-/user.js(12,7): error TS2741: Property 'b' is missing in type '{ a: number; }' but required in type '{ b: number; }'. +/user.js(12,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - ==== /user.js (4 errors) ==== +-==== /user.js (4 errors) ==== ++==== /user.js (5 errors) ==== const json0 = require("./json.json"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. json0.b; // Error (good) -- ~ --!!! error TS2339: Property 'b' does not exist on type '{ a: number; }'. + ~ +@@= skipped -11, +12 lines =@@ /** @type {{ b: number }} */ const json1 = require("./json.json"); // No error (bad) @@ -29,11 +27,11 @@ json1.b; // No error (OK since that's the type annotation) const js0 = require("./js.js"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~ ++!!! error TS2307: Cannot find module './js.js' or its corresponding type declarations. json0.b; // Error (good) -- ~ --!!! error TS2339: Property 'b' does not exist on type '{ a: number; }'. + ~ + !!! error TS2339: Property 'b' does not exist on type '{ a: number; }'. /** @type {{ b: number }} */ const js1 = require("./js.js"); // Error (good) diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/requireOfJsonFileInJsFile.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/requireOfJsonFileInJsFile.types.diff index 1b6fd0596b..eb98a6b600 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/requireOfJsonFileInJsFile.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/requireOfJsonFileInJsFile.types.diff @@ -1,22 +1,6 @@ --- old.requireOfJsonFileInJsFile.types +++ new.requireOfJsonFileInJsFile.types -@@= skipped -1, +1 lines =@@ - - === /user.js === - const json0 = require("./json.json"); -->json0 : { a: number; } -->require("./json.json") : { a: number; } -+>json0 : any -+>require("./json.json") : any - >require : any - >"./json.json" : "./json.json" - - json0.b; // Error (good) - >json0.b : any -->json0 : { a: number; } -+>json0 : any - >b : any - +@@= skipped -14, +14 lines =@@ /** @type {{ b: number }} */ const json1 = require("./json.json"); // No error (bad) >json1 : { b: number; } @@ -25,7 +9,7 @@ >require : any >"./json.json" : "./json.json" -@@= skipped -23, +23 lines =@@ +@@= skipped -10, +10 lines =@@ >b : number const js0 = require("./js.js"); @@ -36,12 +20,7 @@ >require : any >"./js.js" : "./js.js" - json0.b; // Error (good) - >json0.b : any -->json0 : { a: number; } -+>json0 : any - >b : any - +@@= skipped -13, +13 lines =@@ /** @type {{ b: number }} */ const js1 = require("./js.js"); // Error (good) >js1 : { b: number; } @@ -50,7 +29,7 @@ >require : any >"./js.js" : "./js.js" -@@= skipped -28, +28 lines =@@ +@@= skipped -15, +15 lines =@@ >"a" : number >0 : 0 diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/resolveNameWithNamspace.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/resolveNameWithNamspace.errors.txt.diff deleted file mode 100644 index 27026bbe8d..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/resolveNameWithNamspace.errors.txt.diff +++ /dev/null @@ -1,30 +0,0 @@ ---- old.resolveNameWithNamspace.errors.txt -+++ new.resolveNameWithNamspace.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+app.js(1,1): error TS2304: Cannot find name 'exports'. -+app.js(2,1): error TS2304: Cannot find name 'exports'. -+ -+ -+==== node.d.ts (0 errors) ==== -+ declare function require(moduleName: string): any; -+ -+ declare module "assert" { -+ export function equal(actual: any, expected: any, message?: string | Error): void; -+ } -+ -+==== ns.ts (0 errors) ==== -+ /// -+ namespace myAssert { -+ export type cool = 'cool' -+ } -+ var myAssert = require('assert') -+ -+==== app.js (2 errors) ==== -+ exports.equal = myAssert.equal -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ exports.equal() -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/resolveNameWithNamspace.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/resolveNameWithNamspace.types.diff index d535f90e23..0a7cb39cc8 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/resolveNameWithNamspace.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/resolveNameWithNamspace.types.diff @@ -5,20 +5,18 @@ exports.equal = myAssert.equal >exports.equal = myAssert.equal : any ->exports.equal : error -->exports : typeof import("app") +>exports.equal : any -+>exports : any + >exports : typeof import("app") >equal : any >myAssert.equal : any - >myAssert : any +@@= skipped -8, +8 lines =@@ >equal : any exports.equal() ->exports.equal() : error ->exports.equal : error -->exports : typeof import("app") +>exports.equal() : any +>exports.equal : any -+>exports : any + >exports : typeof import("app") >equal : any diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).types.diff new file mode 100644 index 0000000000..e1df9c921c --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/compiler/sideEffectImports4(nouncheckedsideeffectimports=false).types.diff @@ -0,0 +1,11 @@ +--- old.sideEffectImports4(nouncheckedsideeffectimports=false).types ++++ new.sideEffectImports4(nouncheckedsideeffectimports=false).types +@@= skipped -3, +3 lines =@@ + + import "server-only"; + ++=== node_modules/server-only/index.js === ++throw new Error(); ++>new Error() : Error ++>Error : ErrorConstructor ++ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).types.diff new file mode 100644 index 0000000000..bf7f6812d4 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/compiler/sideEffectImports4(nouncheckedsideeffectimports=true).types.diff @@ -0,0 +1,11 @@ +--- old.sideEffectImports4(nouncheckedsideeffectimports=true).types ++++ new.sideEffectImports4(nouncheckedsideeffectimports=true).types +@@= skipped -3, +3 lines =@@ + + import "server-only"; + ++=== node_modules/server-only/index.js === ++throw new Error(); ++>new Error() : Error ++>Error : ErrorConstructor ++ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/truthinessCallExpressionCoercion4.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/truthinessCallExpressionCoercion4.errors.txt.diff index f8f8687060..ed70bdbb43 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/truthinessCallExpressionCoercion4.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/truthinessCallExpressionCoercion4.errors.txt.diff @@ -4,20 +4,17 @@ - @@= skipped --1, +1 lines =@@ +a.js(3,12): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+a.js(3,35): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+a.js(4,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++a.js(4,5): error TS1231: An export assignment must be at the top level of a file or module declaration. + + -+==== a.js (3 errors) ==== ++==== a.js (2 errors) ==== + function fn() {} + + if (typeof module === 'object' && module.exports) { + ~~~~~~ +!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + module.exports = fn; + ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS1231: An export assignment must be at the top level of a file or module declaration. + } + diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/truthinessCallExpressionCoercion4.types.diff b/testdata/baselines/reference/submoduleAccepted/compiler/truthinessCallExpressionCoercion4.types.diff index 39a5347577..0654ff4e61 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/truthinessCallExpressionCoercion4.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/compiler/truthinessCallExpressionCoercion4.types.diff @@ -1,31 +1,22 @@ --- old.truthinessCallExpressionCoercion4.types +++ new.truthinessCallExpressionCoercion4.types -@@= skipped -4, +4 lines =@@ - >fn : () => void - - if (typeof module === 'object' && module.exports) { -->typeof module === 'object' && module.exports : false | (() => void) -+>typeof module === 'object' && module.exports : any +@@= skipped -7, +7 lines =@@ + >typeof module === 'object' && module.exports : false | (() => void) >typeof module === 'object' : boolean >typeof module : "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined" ->module : { exports: () => void; } +>module : any >'object' : "object" -->module.exports : () => void + >module.exports : () => void ->module : { exports: () => void; } -->exports : () => void -+>module.exports : any -+>module : any -+>exports : any ++>module : { fn: () => void; } + >exports : () => void module.exports = fn; >module.exports = fn : () => void -->module.exports : () => void + >module.exports : () => void ->module : { exports: () => void; } -->exports : () => void -+>module.exports : any -+>module : any -+>exports : any ++>module : { fn: () => void; } + >exports : () => void >fn : () => void } - diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/tslibInJs.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/compiler/tslibInJs.errors.txt.diff deleted file mode 100644 index c71e872083..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/compiler/tslibInJs.errors.txt.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.tslibInJs.errors.txt -+++ new.tslibInJs.errors.txt -@@= skipped -0, +0 lines =@@ --main.js(2,25): error TS2307: Cannot find module 'bar' or its corresponding type declarations. -+main.js(2,17): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - - ==== main.js (1 errors) ==== - "use strict"; - const { foo } = require("bar"); -- ~~~~~ --!!! error TS2307: Cannot find module 'bar' or its corresponding type declarations. -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero1.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero1.errors.txt.diff index 9a13a14a1f..c25f8ceade 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero1.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero1.errors.txt.diff @@ -3,23 +3,20 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+assignmentToVoidZero1.js(2,1): error TS2304: Cannot find name 'exports'. -+assignmentToVoidZero1.js(2,13): error TS2304: Cannot find name 'exports'. -+assignmentToVoidZero1.js(3,1): error TS2304: Cannot find name 'exports'. -+assignmentToVoidZero1.js(4,1): error TS2304: Cannot find name 'exports'. ++assignmentToVoidZero1.js(2,1): error TS2323: Cannot redeclare exported variable 'y'. ++assignmentToVoidZero1.js(4,1): error TS2322: Type '2' is not assignable to type 'undefined'. ++assignmentToVoidZero1.js(4,1): error TS2323: Cannot redeclare exported variable 'y'. + + -+==== assignmentToVoidZero1.js (4 errors) ==== ++==== assignmentToVoidZero1.js (3 errors) ==== + // #38552 + exports.y = exports.x = void 0; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2323: Cannot redeclare exported variable 'y'. + exports.x = 1; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + exports.y = 2; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~~~~ ++!!! error TS2322: Type '2' is not assignable to type 'undefined'. ++ ~~~~~~~~~~~~~ ++!!! error TS2323: Cannot redeclare exported variable 'y'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero1.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero1.types.diff index 7e0965a02b..d630eedb2a 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero1.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero1.types.diff @@ -5,38 +5,21 @@ exports.y = exports.x = void 0; >exports.y = exports.x = void 0 : undefined ->exports.y : 2 -->exports : typeof import("assignmentToVoidZero1") ++>exports.y : undefined + >exports : typeof import("assignmentToVoidZero1") ->y : 2 -+>exports.y : any -+>exports : any -+>y : any ++>y : undefined >exports.x = void 0 : undefined -->exports.x : 1 -->exports : typeof import("assignmentToVoidZero1") -->x : 1 -+>exports.x : any -+>exports : any -+>x : any - >void 0 : undefined - >0 : 0 - - exports.x = 1; - >exports.x = 1 : 1 -->exports.x : 1 -->exports : typeof import("assignmentToVoidZero1") -->x : 1 -+>exports.x : any -+>exports : any -+>x : any - >1 : 1 + >exports.x : 1 + >exports : typeof import("assignmentToVoidZero1") +@@= skipped -19, +19 lines =@@ exports.y = 2; >exports.y = 2 : 2 ->exports.y : 2 -->exports : typeof import("assignmentToVoidZero1") ++>exports.y : undefined + >exports : typeof import("assignmentToVoidZero1") ->y : 2 -+>exports.y : any -+>exports : any -+>y : any ++>y : undefined >2 : 2 diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.errors.txt.diff index 5f5121cb25..8d48d018e8 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.errors.txt.diff @@ -7,26 +7,19 @@ -assignmentToVoidZero2.js(10,10): error TS2339: Property 'q' does not exist on type 'C'. -assignmentToVoidZero2.js(13,9): error TS2339: Property 'q' does not exist on type 'C'. -importer.js(1,13): error TS2305: Module '"./assignmentToVoidZero2"' has no exported member 'k'. -+assignmentToVoidZero2.js(1,1): error TS2304: Cannot find name 'exports'. -+assignmentToVoidZero2.js(2,1): error TS2304: Cannot find name 'exports'. +assignmentToVoidZero2.js(4,3): error TS2339: Property 'x' does not exist on type '{}'. +assignmentToVoidZero2.js(5,3): error TS2339: Property 'y' does not exist on type '{}'. +assignmentToVoidZero2.js(6,3): error TS2339: Property 'x' does not exist on type '{}'. +assignmentToVoidZero2.js(6,9): error TS2339: Property 'y' does not exist on type '{}'. +assignmentToVoidZero2.js(12,9): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. -+importer.js(1,22): error TS2306: File 'assignmentToVoidZero2.js' is not a module. ++importer.js(2,1): error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. --==== assignmentToVoidZero2.js (5 errors) ==== -+==== assignmentToVoidZero2.js (7 errors) ==== + ==== assignmentToVoidZero2.js (5 errors) ==== exports.j = 1; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. exports.k = void 0; - ~ -!!! error TS2339: Property 'k' does not exist on type 'typeof import("assignmentToVoidZero2")'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. var o = {} o.x = 1 + ~ @@ -59,7 +52,7 @@ import { j, k } from './assignmentToVoidZero2' - ~ -!!! error TS2305: Module '"./assignmentToVoidZero2"' has no exported member 'k'. -+ ~~~~~~~~~~~~~~~~~~~~~~~~~ -+!!! error TS2306: File 'assignmentToVoidZero2.js' is not a module. j + k ++ ~~~~~ ++!!! error TS2365: Operator '+' cannot be applied to types '1' and 'undefined'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.types.diff index e135e767d3..d35cdac9a3 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/assignmentToVoidZero2.types.diff @@ -1,23 +1,14 @@ --- old.assignmentToVoidZero2.types +++ new.assignmentToVoidZero2.types -@@= skipped -2, +2 lines =@@ - === assignmentToVoidZero2.js === - exports.j = 1; - >exports.j = 1 : 1 -->exports.j : 1 -->exports : typeof import("assignmentToVoidZero2") -->j : 1 -+>exports.j : any -+>exports : any -+>j : any - >1 : 1 +@@= skipped -9, +9 lines =@@ exports.k = void 0; >exports.k = void 0 : undefined - >exports.k : any -->exports : typeof import("assignmentToVoidZero2") -+>exports : any - >k : any +->exports.k : any ++>exports.k : undefined + >exports : typeof import("assignmentToVoidZero2") +->k : any ++>k : undefined >void 0 : undefined >0 : 0 @@ -102,13 +93,13 @@ === importer.js === import { j, k } from './assignmentToVoidZero2' -->j : 1 -+>j : any - >k : any + >j : 1 +->k : any ++>k : undefined j + k >j + k : any -->j : 1 -+>j : any - >k : any + >j : 1 +->k : any ++>k : undefined diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/binderUninitializedModuleExportsAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/binderUninitializedModuleExportsAssignment.errors.txt.diff deleted file mode 100644 index c8fa274a0f..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/binderUninitializedModuleExportsAssignment.errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.binderUninitializedModuleExportsAssignment.errors.txt -+++ new.binderUninitializedModuleExportsAssignment.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+loop.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== loop.js (1 errors) ==== -+ var loop1 = loop2; -+ var loop2 = loop1; -+ -+ module.exports = loop2; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/binderUninitializedModuleExportsAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/binderUninitializedModuleExportsAssignment.types.diff index 2dacf31f93..c3a4614698 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/binderUninitializedModuleExportsAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/binderUninitializedModuleExportsAssignment.types.diff @@ -5,7 +5,7 @@ >module.exports = loop2 : any >module.exports : any ->module : { exports: any; } -+>module : any ++>module : { loop2: any; } >exports : any >loop2 : any diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/bundlerSyntaxRestrictions(module=esnext).types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/bundlerSyntaxRestrictions(module=esnext).types.diff index 5612a728a7..02221c5a54 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/bundlerSyntaxRestrictions(module=esnext).types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/bundlerSyntaxRestrictions(module=esnext).types.diff @@ -20,18 +20,16 @@ const _ = require("./a"); ->_ : typeof _ ->require("./a") : typeof _ -+>_ : any -+>require("./a") : any ++>_ : typeof import("/a") ++>require("./a") : typeof import("/a") >require : (...args: any[]) => any >"./a" : "./a" _.a; // any -->_.a : "a" + >_.a : "a" ->_ : typeof _ -->a : "a" -+>_.a : any -+>_ : any -+>a : any ++>_ : typeof import("/a") + >a : "a" === /main.ts === import {} from "./a"; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/bundlerSyntaxRestrictions(module=preserve).types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/bundlerSyntaxRestrictions(module=preserve).types.diff index fbc7833cc8..355c4f8147 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/bundlerSyntaxRestrictions(module=preserve).types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/bundlerSyntaxRestrictions(module=preserve).types.diff @@ -20,18 +20,16 @@ const _ = require("./a"); ->_ : typeof _ ->require("./a") : typeof _ -+>_ : any -+>require("./a") : any ++>_ : typeof import("/a") ++>require("./a") : typeof import("/a") >require : (...args: any[]) => any >"./a" : "./a" _.a; // any -->_.a : "a" + >_.a : "a" ->_ : typeof _ -->a : "a" -+>_.a : any -+>_ : any -+>a : any ++>_ : typeof import("/a") + >a : "a" === /main.ts === import {} from "./a"; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/callbackCrossModule.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/callbackCrossModule.errors.txt.diff index fc24b46f5c..00ec21d7b4 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/callbackCrossModule.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/callbackCrossModule.errors.txt.diff @@ -3,26 +3,23 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+mod1.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+use.js(1,20): error TS2306: File 'mod1.js' is not a module. ++use.js(1,30): error TS2694: Namespace 'C' has no exported member 'Con'. + + -+==== mod1.js (1 errors) ==== ++==== mod1.js (0 errors) ==== + /** @callback Con - some kind of continuation + * @param {object | undefined} error + * @return {any} I don't even know what this should return + */ + module.exports = C -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + function C() { + this.p = 1 + } + +==== use.js (1 errors) ==== + /** @param {import('./mod1').Con} k */ -+ ~~~~~~~~ -+!!! error TS2306: File 'mod1.js' is not a module. ++ ~~~ ++!!! error TS2694: Namespace 'C' has no exported member 'Con'. + function f(k) { + if (1 === 2 - 1) { + // I guess basic math works! diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/callbackCrossModule.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/callbackCrossModule.types.diff index d426a539bc..49bec7cbe0 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/callbackCrossModule.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/callbackCrossModule.types.diff @@ -10,9 +10,9 @@ ->exports : typeof C ->C : typeof C +>module.exports = C : () => void -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : () => void ++>module : { C: () => void; } ++>exports : () => void +>C : () => void function C() { diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.errors.txt.diff index 86e25d1853..c98a1453e8 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.errors.txt.diff @@ -1,41 +1,27 @@ --- old.chainedPrototypeAssignment.errors.txt +++ new.chainedPrototypeAssignment.errors.txt -@@= skipped -0, +-1 lines =@@ +@@= skipped -0, +0 lines =@@ -use.js(5,5): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -use.js(6,5): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -- -- --==== use.js (2 errors) ==== -- /// -- var mod = require('./mod'); -- var a = new mod.A() -- var b = new mod.B() -- a.m('nope') ++use.js(3,9): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. ++use.js(4,9): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. + + + ==== use.js (2 errors) ==== + /// + var mod = require('./mod'); + var a = new mod.A() ++ ~~~~~~~~~~~ ++!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. + var b = new mod.B() ++ ~~~~~~~~~~~ ++!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. + a.m('nope') - ~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -- b.m('not really') + b.m('not really') - ~~~~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -- --==== types.d.ts (0 errors) ==== -- declare function require(name: string): any; -- declare var exports: any; --==== mod.js (0 errors) ==== -- /// -- var A = function A() { -- this.a = 1 -- } -- var B = function B() { -- this.b = 2 -- } -- exports.A = A -- exports.B = B -- A.prototype = B.prototype = { -- /** @param {number} n */ -- m(n) { -- return n + 1 -- } -- } -- -@@= skipped --1, +1 lines =@@ -+ + + ==== types.d.ts (0 errors) ==== + declare function require(name: string): any; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.types.diff index 38216b6903..6e125cd460 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/chainedPrototypeAssignment.types.diff @@ -6,8 +6,8 @@ var mod = require('./mod'); ->mod : typeof mod ->require('./mod') : typeof mod -+>mod : any -+>require('./mod') : any ++>mod : typeof import("mod") ++>require('./mod') : typeof import("mod") >require : (name: string) => any >'./mod' : "./mod" @@ -19,9 +19,9 @@ ->A : typeof A +>a : any +>new mod.A() : any -+>mod.A : any -+>mod : any -+>A : any ++>mod.A : () => void ++>mod : typeof import("mod") ++>A : () => void var b = new mod.B() ->b : B @@ -31,9 +31,9 @@ ->B : typeof B +>b : any +>new mod.B() : any -+>mod.B : any -+>mod : any -+>B : any ++>mod.B : () => void ++>mod : typeof import("mod") ++>B : () => void a.m('nope') ->a.m('nope') : number @@ -58,51 +58,64 @@ >'not really' : "not really" === types.d.ts === -@@= skipped -41, +41 lines =@@ - declare var exports: any; - >exports : any - --=== mod.js === --/// --var A = function A() { +@@= skipped -44, +44 lines =@@ + === mod.js === + /// + var A = function A() { ->A : typeof A ->function A() { this.a = 1} : typeof A ->A : typeof A -- -- this.a = 1 -->this.a = 1 : 1 -->this.a : any ++>A : () => void ++>function A() { this.a = 1} : () => void ++>A : () => void + + this.a = 1 + >this.a = 1 : 1 + >this.a : any ->this : this -->a : any -->1 : 1 --} --var B = function B() { ++>this : any + >a : any + >1 : 1 + } + var B = function B() { ->B : typeof B ->function B() { this.b = 2} : typeof B ->B : typeof B -- -- this.b = 2 -->this.b = 2 : 2 -->this.b : any ++>B : () => void ++>function B() { this.b = 2} : () => void ++>B : () => void + + this.b = 2 + >this.b = 2 : 2 + >this.b : any ->this : this -->b : any -->2 : 2 --} --exports.A = A ++>this : any + >b : any + >2 : 2 + } + exports.A = A ->exports.A = A : typeof A ->exports.A : typeof A -->exports : typeof import("mod") ++>exports.A = A : () => void ++>exports.A : () => void + >exports : typeof import("mod") ->A : typeof A ->A : typeof A -- --exports.B = B ++>A : () => void ++>A : () => void + + exports.B = B ->exports.B = B : typeof B ->exports.B : typeof B -->exports : typeof import("mod") ++>exports.B = B : () => void ++>exports.B : () => void + >exports : typeof import("mod") ->B : typeof B ->B : typeof B -- --A.prototype = B.prototype = { ++>B : () => void ++>B : () => void + + A.prototype = B.prototype = { ->A.prototype = B.prototype = { /** @param {number} n */ m(n) { return n + 1 }} : { m(n: number): number; } ->A.prototype : { m(n: number): number; } ->A : typeof A @@ -112,16 +125,15 @@ ->B : typeof B ->prototype : { m(n: number): number; } ->{ /** @param {number} n */ m(n) { return n + 1 }} : { m(n: number): number; } -- -- /** @param {number} n */ -- m(n) { -->m : (n: number) => number -->n : number -- -- return n + 1 -->n + 1 : number -->n : number -->1 : 1 -- } --} -- ++>A.prototype = B.prototype = { /** @param {number} n */ m(n) { return n + 1 }} : { m: (n: number) => number; } ++>A.prototype : any ++>A : () => void ++>prototype : any ++>B.prototype = { /** @param {number} n */ m(n) { return n + 1 }} : { m: (n: number) => number; } ++>B.prototype : any ++>B : () => void ++>prototype : any ++>{ /** @param {number} n */ m(n) { return n + 1 }} : { m: (n: number) => number; } + + /** @param {number} n */ + m(n) { diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignProperty.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignProperty.errors.txt.diff new file mode 100644 index 0000000000..6bed5f9e3d --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignProperty.errors.txt.diff @@ -0,0 +1,145 @@ +--- old.checkExportsObjectAssignProperty.errors.txt ++++ new.checkExportsObjectAssignProperty.errors.txt +@@= skipped -0, +0 lines =@@ +-validator.ts(17,4): error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. +-validator.ts(18,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. +-validator.ts(19,1): error TS2322: Type 'string' is not assignable to type 'number'. +-validator.ts(20,1): error TS2322: Type 'string' is not assignable to type 'number'. +-validator.ts(21,1): error TS2322: Type 'number' is not assignable to type 'string'. +-validator.ts(37,4): error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. +-validator.ts(38,4): error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. +-validator.ts(39,1): error TS2322: Type 'number' is not assignable to type 'string'. +-validator.ts(40,1): error TS2322: Type 'string' is not assignable to type 'number'. +-validator.ts(41,1): error TS2322: Type 'number' is not assignable to type 'string'. ++index.js(4,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(9,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod1.js(1,23): error TS2304: Cannot find name 'exports'. ++mod1.js(2,23): error TS2304: Cannot find name 'exports'. ++mod1.js(3,23): error TS2304: Cannot find name 'exports'. ++mod1.js(4,23): error TS2304: Cannot find name 'exports'. ++mod1.js(5,23): error TS2304: Cannot find name 'exports'. ++mod2.js(1,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod2.js(2,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod2.js(3,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod2.js(4,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod2.js(5,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++validator.ts(3,21): error TS2306: File 'mod1.js' is not a module. ++validator.ts(23,21): error TS2306: File 'mod2.js' is not a module. + + +-==== validator.ts (10 errors) ==== ++==== validator.ts (2 errors) ==== + import "./"; + + import m1 = require("./mod1"); ++ ~~~~~~~~ ++!!! error TS2306: File 'mod1.js' is not a module. + + m1.thing; + m1.readonlyProp; +@@= skipped -27, +33 lines =@@ + + // disallowed assignments + m1.readonlyProp = "name"; +- ~~~~~~~~~~~~ +-!!! error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. + m1.readonlyAccessor = 12; +- ~~~~~~~~~~~~~~~~ +-!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. + m1.thing = "no"; +- ~~~~~~~~ +-!!! error TS2322: Type 'string' is not assignable to type 'number'. + m1.rwAccessors = "no"; +- ~~~~~~~~~~~~~~ +-!!! error TS2322: Type 'string' is not assignable to type 'number'. + m1.setonlyAccessor = 0; +- ~~~~~~~~~~~~~~~~~~ +-!!! error TS2322: Type 'number' is not assignable to type 'string'. + + import m2 = require("./mod2"); ++ ~~~~~~~~ ++!!! error TS2306: File 'mod2.js' is not a module. + + m2.thing; + m2.readonlyProp; +@@= skipped -30, +22 lines =@@ + + // disallowed assignments + m2.readonlyProp = "name"; +- ~~~~~~~~~~~~ +-!!! error TS2540: Cannot assign to 'readonlyProp' because it is a read-only property. + m2.readonlyAccessor = 12; +- ~~~~~~~~~~~~~~~~ +-!!! error TS2540: Cannot assign to 'readonlyAccessor' because it is a read-only property. + m2.thing = 0; +- ~~~~~~~~ +-!!! error TS2322: Type 'number' is not assignable to type 'string'. + m2.rwAccessors = "no"; +- ~~~~~~~~~~~~~~ +-!!! error TS2322: Type 'string' is not assignable to type 'number'. + m2.setonlyAccessor = 0; +- ~~~~~~~~~~~~~~~~~~ +-!!! error TS2322: Type 'number' is not assignable to type 'string'. + +-==== mod1.js (0 errors) ==== ++==== mod1.js (5 errors) ==== + Object.defineProperty(exports, "thing", { value: 42, writable: true }); ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. + Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. + Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. + Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. + Object.defineProperty(exports, "setonlyAccessor", { ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. + /** @param {string} str */ + set(str) { + this.rwAccessors = Number(str) + } + }); + +-==== mod2.js (0 errors) ==== ++==== mod2.js (5 errors) ==== + Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }); ++ ~~~~~~ ++!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }); ++ ~~~~~~ ++!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ++ ~~~~~~ ++!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }); ++ ~~~~~~ ++!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + Object.defineProperty(module.exports, "setonlyAccessor", { ++ ~~~~~~ ++!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + /** @param {string} str */ + set(str) { + this.rwAccessors = Number(str) + } + }); + +-==== index.js (0 errors) ==== ++==== index.js (2 errors) ==== + /** + * @type {number} + */ + const q = require("./mod1").thing; ++ ~~~~~~~ ++!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + /** + * @type {string} + */ + const u = require("./mod2").thing; ++ ~~~~~~~ ++!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignProperty.types.diff similarity index 58% rename from testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.types.diff rename to testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignProperty.types.diff index fd39444bf5..b3a6f906b5 100644 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignProperty.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignProperty.types.diff @@ -247,188 +247,198 @@ +>setonlyAccessor : any >0 : 0 --=== mod1.js === --Object.defineProperty(exports, "thing", { value: 42, writable: true }); + === mod1.js === + Object.defineProperty(exports, "thing", { value: 42, writable: true }); ->Object.defineProperty(exports, "thing", { value: 42, writable: true }) : typeof import("mod1") -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(exports, "thing", { value: 42, writable: true }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->exports : typeof import("mod1") -->"thing" : "thing" -->{ value: 42, writable: true } : { value: number; writable: true; } -->value : number -->42 : 42 -->writable : true -->true : true -- --Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); ++>exports : any + >"thing" : "thing" + >{ value: 42, writable: true } : { value: number; writable: true; } + >value : number +@@= skipped -186, +186 lines =@@ + >true : true + + Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }); ->Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }) : typeof import("mod1") -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(exports, "readonlyProp", { value: "Smith", writable: false }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->exports : typeof import("mod1") -->"readonlyProp" : "readonlyProp" -->{ value: "Smith", writable: false } : { value: string; writable: false; } -->value : string -->"Smith" : "Smith" -->writable : false -->false : false -- --Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ++>exports : any + >"readonlyProp" : "readonlyProp" + >{ value: "Smith", writable: false } : { value: string; writable: false; } + >value : string +@@= skipped -13, +13 lines =@@ + >false : false + + Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ->Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof import("mod1") -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->exports : typeof import("mod1") -->"rwAccessors" : "rwAccessors" ++>exports : any + >"rwAccessors" : "rwAccessors" ->{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } -->get : () => number -->98122 : 98122 -->set : (_: any) => void -->_ : any -- --Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); ++>{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get: () => number; set: (_: any) => void; } + >get : () => number + >98122 : 98122 + >set : (_: any) => void + >_ : any + + Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }); ->Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }) : typeof import("mod1") -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(exports, "readonlyAccessor", { get() { return 21.75 } }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->exports : typeof import("mod1") -->"readonlyAccessor" : "readonlyAccessor" ++>exports : any + >"readonlyAccessor" : "readonlyAccessor" ->{ get() { return 21.75 } } : { get(): number; } -->get : () => number -->21.75 : 21.75 -- --Object.defineProperty(exports, "setonlyAccessor", { ++>{ get() { return 21.75 } } : { get: () => number; } + >get : () => number + >21.75 : 21.75 + + Object.defineProperty(exports, "setonlyAccessor", { ->Object.defineProperty(exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : typeof import("mod1") -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->exports : typeof import("mod1") -->"setonlyAccessor" : "setonlyAccessor" ++>exports : any + >"setonlyAccessor" : "setonlyAccessor" ->{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set(str: string): void; } -- -- /** @param {string} str */ -- set(str) { -->set : (str: string) => void -->str : string -- -- this.rwAccessors = Number(str) -->this.rwAccessors = Number(str) : number -->this.rwAccessors : any -->this : any -->rwAccessors : any -->Number(str) : number -->Number : NumberConstructor -->str : string -- } --}); -- --=== mod2.js === --Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }); ++>{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set: (str: string) => void; } + + /** @param {string} str */ + set(str) { +@@= skipped -50, +50 lines =@@ + + === mod2.js === + Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }); ->Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }) : typeof module.exports -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(module.exports, "thing", { value: "yes", writable: true }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->"thing" : "thing" -->{ value: "yes", writable: true } : { value: string; writable: true; } -->value : string -->"yes" : "yes" -->writable : true -->true : true -- --Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }); ++>module.exports : any ++>module : any ++>exports : any + >"thing" : "thing" + >{ value: "yes", writable: true } : { value: string; writable: true; } + >value : string +@@= skipped -15, +15 lines =@@ + >true : true + + Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }); ->Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }) : typeof module.exports -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(module.exports, "readonlyProp", { value: "Smith", writable: false }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->"readonlyProp" : "readonlyProp" -->{ value: "Smith", writable: false } : { value: string; writable: false; } -->value : string -->"Smith" : "Smith" -->writable : false -->false : false -- --Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ++>module.exports : any ++>module : any ++>exports : any + >"readonlyProp" : "readonlyProp" + >{ value: "Smith", writable: false } : { value: string; writable: false; } + >value : string +@@= skipped -15, +15 lines =@@ + >false : false + + Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }); ->Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof module.exports -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(module.exports, "rwAccessors", { get() { return 98122 }, set(_) { /*ignore*/ } }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->"rwAccessors" : "rwAccessors" ++>module.exports : any ++>module : any ++>exports : any + >"rwAccessors" : "rwAccessors" ->{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } -->get : () => number -->98122 : 98122 -->set : (_: any) => void -->_ : any -- --Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }); ++>{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get: () => number; set: (_: any) => void; } + >get : () => number + >98122 : 98122 + >set : (_: any) => void + >_ : any + + Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }); ->Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }) : typeof module.exports -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(module.exports, "readonlyAccessor", { get() { return 21.75 } }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->"readonlyAccessor" : "readonlyAccessor" ++>module.exports : any ++>module : any ++>exports : any + >"readonlyAccessor" : "readonlyAccessor" ->{ get() { return 21.75 } } : { get(): number; } -->get : () => number -->21.75 : 21.75 -- --Object.defineProperty(module.exports, "setonlyAccessor", { ++>{ get() { return 21.75 } } : { get: () => number; } + >get : () => number + >21.75 : 21.75 + + Object.defineProperty(module.exports, "setonlyAccessor", { ->Object.defineProperty(module.exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : typeof module.exports -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(module.exports, "setonlyAccessor", { /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }}) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->"setonlyAccessor" : "setonlyAccessor" ++>module.exports : any ++>module : any ++>exports : any + >"setonlyAccessor" : "setonlyAccessor" ->{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set(str: string): void; } -- -- /** @param {string} str */ -- set(str) { -->set : (str: string) => void -->str : string -- -- this.rwAccessors = Number(str) -->this.rwAccessors = Number(str) : number -->this.rwAccessors : any -->this : any -->rwAccessors : any -->Number(str) : number -->Number : NumberConstructor -->str : string -- } --}); -- --=== index.js === --/** -- * @type {number} -- */ --const q = require("./mod1").thing; -->q : number ++>{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set: (str: string) => void; } + + /** @param {string} str */ + set(str) { +@@= skipped -60, +60 lines =@@ + */ + const q = require("./mod1").thing; + >q : number ->require("./mod1").thing : number ->require("./mod1") : typeof import("mod1") -->require : any -->"./mod1" : "./mod1" ++>require("./mod1").thing : any ++>require("./mod1") : any + >require : any + >"./mod1" : "./mod1" ->thing : number -- --/** -- * @type {string} -- */ --const u = require("./mod2").thing; -->u : string ++>thing : any + + /** + * @type {string} + */ + const u = require("./mod2").thing; + >u : string ->require("./mod2").thing : string ->require("./mod2") : typeof import("mod2") -->require : any -->"./mod2" : "./mod2" ++>require("./mod2").thing : any ++>require("./mod2") : any + >require : any + >"./mod2" : "./mod2" ->thing : string -- ++>thing : any + diff --git a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignPrototypeProperty.errors.txt.diff similarity index 63% rename from testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.errors.txt.diff rename to testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignPrototypeProperty.errors.txt.diff index 9949d1d3a9..c32b568858 100644 --- a/testdata/baselines/reference/submodule/conformance/checkExportsObjectAssignPrototypeProperty.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignPrototypeProperty.errors.txt.diff @@ -6,7 +6,8 @@ -validator.ts(21,1): error TS2322: Type 'string' is not assignable to type 'number'. -validator.ts(22,1): error TS2322: Type 'string' is not assignable to type 'number'. -validator.ts(23,1): error TS2322: Type 'number' is not assignable to type 'string'. -+validator.ts(3,25): error TS2307: Cannot find module './mod1' or its corresponding type declarations. ++mod1.js(6,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. ++validator.ts(5,12): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. -==== validator.ts (5 errors) ==== @@ -14,12 +15,14 @@ import "./"; import Person = require("./mod1"); -+ ~~~~~~~~ -+!!! error TS2307: Cannot find module './mod1' or its corresponding type declarations. const m1 = new Person("Name") ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. -@@= skipped -24, +22 lines =@@ + m1.thing; + m1.readonlyProp; +@@= skipped -24, +23 lines =@@ // disallowed assignments m1.readonlyProp = "name"; @@ -39,4 +42,16 @@ -!!! error TS2322: Type 'number' is not assignable to type 'string'. - ==== mod1.js (0 errors) ==== +-==== mod1.js (0 errors) ==== ++==== mod1.js (1 errors) ==== + /** + * @constructor + * @param {string} name + */ + function Person(name) { + this.name = name; ++ ~~~~ ++!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation. + } + Person.prototype.describe = function () { + return "Person called " + this.name; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignPrototypeProperty.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignPrototypeProperty.types.diff new file mode 100644 index 0000000000..037be55ee5 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkExportsObjectAssignPrototypeProperty.types.diff @@ -0,0 +1,259 @@ +--- old.checkExportsObjectAssignPrototypeProperty.types ++++ new.checkExportsObjectAssignPrototypeProperty.types +@@= skipped -3, +3 lines =@@ + import "./"; + + import Person = require("./mod1"); +->Person : typeof Person ++>Person : (name: string) => void + + const m1 = new Person("Name") +->m1 : Person +->new Person("Name") : Person +->Person : typeof Person ++>m1 : any ++>new Person("Name") : any ++>Person : (name: string) => void + >"Name" : "Name" + + m1.thing; +->m1.thing : number +->m1 : Person +->thing : number ++>m1.thing : any ++>m1 : any ++>thing : any + + m1.readonlyProp; +->m1.readonlyProp : string +->m1 : Person +->readonlyProp : string ++>m1.readonlyProp : any ++>m1 : any ++>readonlyProp : any + + m1.rwAccessors; +->m1.rwAccessors : number +->m1 : Person +->rwAccessors : number ++>m1.rwAccessors : any ++>m1 : any ++>rwAccessors : any + + m1.readonlyAccessor; +->m1.readonlyAccessor : number +->m1 : Person +->readonlyAccessor : number ++>m1.readonlyAccessor : any ++>m1 : any ++>readonlyAccessor : any + + m1.setonlyAccessor; +->m1.setonlyAccessor : string +->m1 : Person +->setonlyAccessor : string ++>m1.setonlyAccessor : any ++>m1 : any ++>setonlyAccessor : any + + // allowed assignments + m1.thing = 10; + >m1.thing = 10 : 10 +->m1.thing : number +->m1 : Person +->thing : number ++>m1.thing : any ++>m1 : any ++>thing : any + >10 : 10 + + m1.rwAccessors = 11; + >m1.rwAccessors = 11 : 11 +->m1.rwAccessors : number +->m1 : Person +->rwAccessors : number ++>m1.rwAccessors : any ++>m1 : any ++>rwAccessors : any + >11 : 11 + + m1.setonlyAccessor = "yes"; + >m1.setonlyAccessor = "yes" : "yes" +->m1.setonlyAccessor : string +->m1 : Person +->setonlyAccessor : string ++>m1.setonlyAccessor : any ++>m1 : any ++>setonlyAccessor : any + >"yes" : "yes" + + // disallowed assignments + m1.readonlyProp = "name"; + >m1.readonlyProp = "name" : "name" + >m1.readonlyProp : any +->m1 : Person ++>m1 : any + >readonlyProp : any + >"name" : "name" + + m1.readonlyAccessor = 12; + >m1.readonlyAccessor = 12 : 12 + >m1.readonlyAccessor : any +->m1 : Person ++>m1 : any + >readonlyAccessor : any + >12 : 12 + + m1.thing = "no"; + >m1.thing = "no" : "no" +->m1.thing : number +->m1 : Person +->thing : number ++>m1.thing : any ++>m1 : any ++>thing : any + >"no" : "no" + + m1.rwAccessors = "no"; + >m1.rwAccessors = "no" : "no" +->m1.rwAccessors : number +->m1 : Person +->rwAccessors : number ++>m1.rwAccessors : any ++>m1 : any ++>rwAccessors : any + >"no" : "no" + + m1.setonlyAccessor = 0; + >m1.setonlyAccessor = 0 : 0 +->m1.setonlyAccessor : string +->m1 : Person +->setonlyAccessor : string ++>m1.setonlyAccessor : any ++>m1 : any ++>setonlyAccessor : any + >0 : 0 + + +@@= skipped -98, +98 lines =@@ + * @param {string} name + */ + function Person(name) { +->Person : typeof Person ++>Person : (name: string) => void + >name : string + + this.name = name; + >this.name = name : string + >this.name : any +->this : this ++>this : any + >name : any + >name : string + } +@@= skipped -14, +14 lines =@@ + >Person.prototype.describe = function () { return "Person called " + this.name;} : () => string + >Person.prototype.describe : any + >Person.prototype : any +->Person : typeof Person ++>Person : (name: string) => void + >prototype : any + >describe : any + >function () { return "Person called " + this.name;} : () => string +@@= skipped -8, +8 lines =@@ + return "Person called " + this.name; + >"Person called " + this.name : string + >"Person called " : "Person called " +->this.name : string +->this : this +->name : string ++>this.name : any ++>this : any ++>name : any + + }; + Object.defineProperty(Person.prototype, "thing", { value: 42, writable: true }); +@@= skipped -11, +11 lines =@@ + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Person.prototype : any +->Person : typeof Person ++>Person : (name: string) => void + >prototype : any + >"thing" : "thing" + >{ value: 42, writable: true } : { value: number; writable: true; } +@@= skipped -15, +15 lines =@@ + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Person.prototype : any +->Person : typeof Person ++>Person : (name: string) => void + >prototype : any + >"readonlyProp" : "readonlyProp" + >{ value: "Smith", writable: false } : { value: string; writable: false; } +@@= skipped -15, +15 lines =@@ + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Person.prototype : any +->Person : typeof Person ++>Person : (name: string) => void + >prototype : any + >"rwAccessors" : "rwAccessors" +->{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } ++>{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get: () => number; set: (_: any) => void; } + >get : () => number + >98122 : 98122 + >set : (_: any) => void +@@= skipped -15, +15 lines =@@ + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Person.prototype : any +->Person : typeof Person ++>Person : (name: string) => void + >prototype : any + >"readonlyAccessor" : "readonlyAccessor" +->{ get() { return 21.75 } } : { get(): number; } ++>{ get() { return 21.75 } } : { get: () => number; } + >get : () => number + >21.75 : 21.75 + +@@= skipped -13, +13 lines =@@ + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Person.prototype : any +->Person : typeof Person ++>Person : (name: string) => void + >prototype : any + >"setonlyAccessor" : "setonlyAccessor" +->{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set(str: string): void; } ++>{ /** @param {string} str */ set(str) { this.rwAccessors = Number(str) }} : { set: (str: string) => void; } + + /** @param {string} str */ + set(str) { +@@= skipped -12, +12 lines =@@ + + this.rwAccessors = Number(str) + >this.rwAccessors = Number(str) : number +->this.rwAccessors : number +->this : this +->rwAccessors : number ++>this.rwAccessors : any ++>this : any ++>rwAccessors : any + >Number(str) : number + >Number : NumberConstructor + >str : string + } + }); + module.exports = Person; +->module.exports = Person : typeof Person +->module.exports : typeof Person +->module : { exports: typeof Person; } +->exports : typeof Person +->Person : typeof Person ++>module.exports = Person : (name: string) => void ++>module.exports : (name: string) => void ++>module : { Person: (name: string) => void; } ++>exports : (name: string) => void ++>Person : (name: string) => void + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkObjectDefineProperty.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkObjectDefineProperty.errors.txt.diff new file mode 100644 index 0000000000..57a2edd65c --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkObjectDefineProperty.errors.txt.diff @@ -0,0 +1,104 @@ +--- old.checkObjectDefineProperty.errors.txt ++++ new.checkObjectDefineProperty.errors.txt +@@= skipped -0, +0 lines =@@ +-validate.ts(14,3): error TS2540: Cannot assign to 'lastName' because it is a read-only property. +-validate.ts(15,3): error TS2540: Cannot assign to 'houseNumber' because it is a read-only property. +-validate.ts(16,1): error TS2322: Type 'number' is not assignable to type 'string'. +-validate.ts(17,3): error TS2540: Cannot assign to 'middleInit' because it is a read-only property. ++index.js(19,10): error TS2741: Property 'name' is missing in type '{}' but required in type '{ name: string; }'. ++index.js(23,11): error TS2339: Property 'zip' does not exist on type '{}'. ++index.js(28,11): error TS2339: Property 'houseNumber' does not exist on type '{}'. ++validate.ts(3,3): error TS2339: Property 'name' does not exist on type '{}'. ++validate.ts(4,3): error TS2339: Property 'middleInit' does not exist on type '{}'. ++validate.ts(5,3): error TS2339: Property 'lastName' does not exist on type '{}'. ++validate.ts(6,3): error TS2339: Property 'zip' does not exist on type '{}'. ++validate.ts(7,3): error TS2339: Property 'houseNumber' does not exist on type '{}'. ++validate.ts(8,3): error TS2339: Property 'zipStr' does not exist on type '{}'. ++validate.ts(10,3): error TS2339: Property 'name' does not exist on type '{}'. ++validate.ts(11,3): error TS2339: Property 'zip' does not exist on type '{}'. ++validate.ts(12,3): error TS2339: Property 'zipStr' does not exist on type '{}'. ++validate.ts(14,3): error TS2339: Property 'lastName' does not exist on type '{}'. ++validate.ts(15,3): error TS2339: Property 'houseNumber' does not exist on type '{}'. ++validate.ts(16,3): error TS2339: Property 'zipStr' does not exist on type '{}'. ++validate.ts(17,3): error TS2339: Property 'middleInit' does not exist on type '{}'. + + +-==== validate.ts (4 errors) ==== ++==== validate.ts (13 errors) ==== + // Validate in TS as simple validations would usually be interpreted as more special assignments + import x = require("./"); + x.name; ++ ~~~~ ++!!! error TS2339: Property 'name' does not exist on type '{}'. + x.middleInit; ++ ~~~~~~~~~~ ++!!! error TS2339: Property 'middleInit' does not exist on type '{}'. + x.lastName; ++ ~~~~~~~~ ++!!! error TS2339: Property 'lastName' does not exist on type '{}'. + x.zip; ++ ~~~ ++!!! error TS2339: Property 'zip' does not exist on type '{}'. + x.houseNumber; ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'houseNumber' does not exist on type '{}'. + x.zipStr; ++ ~~~~~~ ++!!! error TS2339: Property 'zipStr' does not exist on type '{}'. + + x.name = "Another"; ++ ~~~~ ++!!! error TS2339: Property 'name' does not exist on type '{}'. + x.zip = 98123; ++ ~~~ ++!!! error TS2339: Property 'zip' does not exist on type '{}'. + x.zipStr = "OK"; ++ ~~~~~~ ++!!! error TS2339: Property 'zipStr' does not exist on type '{}'. + + x.lastName = "should fail"; + ~~~~~~~~ +-!!! error TS2540: Cannot assign to 'lastName' because it is a read-only property. ++!!! error TS2339: Property 'lastName' does not exist on type '{}'. + x.houseNumber = 12; // should also fail + ~~~~~~~~~~~ +-!!! error TS2540: Cannot assign to 'houseNumber' because it is a read-only property. ++!!! error TS2339: Property 'houseNumber' does not exist on type '{}'. + x.zipStr = 12; // should fail +- ~~~~~~~~ +-!!! error TS2322: Type 'number' is not assignable to type 'string'. ++ ~~~~~~ ++!!! error TS2339: Property 'zipStr' does not exist on type '{}'. + x.middleInit = "R"; // should also fail + ~~~~~~~~~~ +-!!! error TS2540: Cannot assign to 'middleInit' because it is a read-only property. ++!!! error TS2339: Property 'middleInit' does not exist on type '{}'. + +-==== index.js (0 errors) ==== ++==== index.js (3 errors) ==== + const x = {}; + Object.defineProperty(x, "name", { value: "Charles", writable: true }); + Object.defineProperty(x, "middleInit", { value: "H" }); +@@= skipped -50, +80 lines =@@ + function takeName(named) { return named.name; } + + takeName(x); ++ ~ ++!!! error TS2741: Property 'name' is missing in type '{}' but required in type '{ name: string; }'. ++!!! related TS2728 index.js:15:13: 'name' is declared here. + /** + * @type {number} + */ + var a = x.zip; ++ ~~~ ++!!! error TS2339: Property 'zip' does not exist on type '{}'. + + /** + * @type {number} + */ + var b = x.houseNumber; ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'houseNumber' does not exist on type '{}'. + + const returnExemplar = () => x; + const needsExemplar = (_ = x) => void 0; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkObjectDefineProperty.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkObjectDefineProperty.types.diff new file mode 100644 index 0000000000..536c926ed7 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkObjectDefineProperty.types.diff @@ -0,0 +1,309 @@ +--- old.checkObjectDefineProperty.types ++++ new.checkObjectDefineProperty.types +@@= skipped -2, +2 lines =@@ + === validate.ts === + // Validate in TS as simple validations would usually be interpreted as more special assignments + import x = require("./"); +->x : typeof x ++>x : {} + + x.name; +->x.name : string +->x : typeof x +->name : string ++>x.name : any ++>x : {} ++>name : any + + x.middleInit; +->x.middleInit : string +->x : typeof x +->middleInit : string ++>x.middleInit : any ++>x : {} ++>middleInit : any + + x.lastName; +->x.lastName : string +->x : typeof x +->lastName : string ++>x.lastName : any ++>x : {} ++>lastName : any + + x.zip; +->x.zip : number +->x : typeof x +->zip : number ++>x.zip : any ++>x : {} ++>zip : any + + x.houseNumber; +->x.houseNumber : number +->x : typeof x +->houseNumber : number ++>x.houseNumber : any ++>x : {} ++>houseNumber : any + + x.zipStr; +->x.zipStr : string +->x : typeof x +->zipStr : string ++>x.zipStr : any ++>x : {} ++>zipStr : any + + x.name = "Another"; + >x.name = "Another" : "Another" +->x.name : string +->x : typeof x +->name : string ++>x.name : any ++>x : {} ++>name : any + >"Another" : "Another" + + x.zip = 98123; + >x.zip = 98123 : 98123 +->x.zip : number +->x : typeof x +->zip : number ++>x.zip : any ++>x : {} ++>zip : any + >98123 : 98123 + + x.zipStr = "OK"; + >x.zipStr = "OK" : "OK" +->x.zipStr : string +->x : typeof x +->zipStr : string ++>x.zipStr : any ++>x : {} ++>zipStr : any + >"OK" : "OK" + + x.lastName = "should fail"; + >x.lastName = "should fail" : "should fail" + >x.lastName : any +->x : typeof x ++>x : {} + >lastName : any + >"should fail" : "should fail" + + x.houseNumber = 12; // should also fail + >x.houseNumber = 12 : 12 + >x.houseNumber : any +->x : typeof x ++>x : {} + >houseNumber : any + >12 : 12 + + x.zipStr = 12; // should fail + >x.zipStr = 12 : 12 +->x.zipStr : string +->x : typeof x +->zipStr : string ++>x.zipStr : any ++>x : {} ++>zipStr : any + >12 : 12 + + x.middleInit = "R"; // should also fail + >x.middleInit = "R" : "R" + >x.middleInit : any +->x : typeof x ++>x : {} + >middleInit : any + >"R" : "R" + + === index.js === + const x = {}; +->x : typeof x ++>x : {} + >{} : {} + + Object.defineProperty(x, "name", { value: "Charles", writable: true }); +->Object.defineProperty(x, "name", { value: "Charles", writable: true }) : typeof x ++>Object.defineProperty(x, "name", { value: "Charles", writable: true }) : {} + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +->x : typeof x ++>x : {} + >"name" : "name" + >{ value: "Charles", writable: true } : { value: string; writable: true; } + >value : string +@@= skipped -100, +100 lines =@@ + >true : true + + Object.defineProperty(x, "middleInit", { value: "H" }); +->Object.defineProperty(x, "middleInit", { value: "H" }) : typeof x ++>Object.defineProperty(x, "middleInit", { value: "H" }) : {} + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +->x : typeof x ++>x : {} + >"middleInit" : "middleInit" + >{ value: "H" } : { value: string; } + >value : string + >"H" : "H" + + Object.defineProperty(x, "lastName", { value: "Smith", writable: false }); +->Object.defineProperty(x, "lastName", { value: "Smith", writable: false }) : typeof x ++>Object.defineProperty(x, "lastName", { value: "Smith", writable: false }) : {} + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +->x : typeof x ++>x : {} + >"lastName" : "lastName" + >{ value: "Smith", writable: false } : { value: string; writable: false; } + >value : string +@@= skipped -24, +24 lines =@@ + >false : false + + Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }); +->Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }) : typeof x ++>Object.defineProperty(x, "zip", { get() { return 98122 }, set(_) { /*ignore*/ } }) : {} + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +->x : typeof x ++>x : {} + >"zip" : "zip" +->{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get(): number; set(_: any): void; } ++>{ get() { return 98122 }, set(_) { /*ignore*/ } } : { get: () => number; set: (_: any) => void; } + >get : () => number + >98122 : 98122 + >set : (_: any) => void + >_ : any + + Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }); +->Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }) : typeof x ++>Object.defineProperty(x, "houseNumber", { get() { return 21.75 } }) : {} + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +->x : typeof x ++>x : {} + >"houseNumber" : "houseNumber" +->{ get() { return 21.75 } } : { get(): number; } ++>{ get() { return 21.75 } } : { get: () => number; } + >get : () => number + >21.75 : 21.75 + + Object.defineProperty(x, "zipStr", { +->Object.defineProperty(x, "zipStr", { /** @param {string} str */ set(str) { this.zip = Number(str) }}) : typeof x ++>Object.defineProperty(x, "zipStr", { /** @param {string} str */ set(str) { this.zip = Number(str) }}) : {} + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T +->x : typeof x ++>x : {} + >"zipStr" : "zipStr" +->{ /** @param {string} str */ set(str) { this.zip = Number(str) }} : { set(str: string): void; } ++>{ /** @param {string} str */ set(str) { this.zip = Number(str) }} : { set: (str: string) => void; } + + /** @param {string} str */ + set(str) { +@@= skipped -61, +61 lines =@@ + takeName(x); + >takeName(x) : string + >takeName : (named: { name: string; }) => string +->x : typeof x ++>x : {} + + /** + * @type {number} + */ + var a = x.zip; + >a : number +->x.zip : number +->x : typeof x +->zip : number ++>x.zip : any ++>x : {} ++>zip : any + + /** + * @type {number} + */ + var b = x.houseNumber; + >b : number +->x.houseNumber : number +->x : typeof x +->houseNumber : number ++>x.houseNumber : any ++>x : {} ++>houseNumber : any + + const returnExemplar = () => x; +->returnExemplar : () => typeof x +->() => x : () => typeof x +->x : typeof x ++>returnExemplar : () => {} ++>() => x : () => {} ++>x : {} + + const needsExemplar = (_ = x) => void 0; +->needsExemplar : (_?: typeof x) => undefined +->(_ = x) => void 0 : (_?: typeof x) => undefined +->_ : typeof x +->x : typeof x ++>needsExemplar : (_?: {}) => undefined ++>(_ = x) => void 0 : (_?: {}) => undefined ++>_ : {} ++>x : {} + >void 0 : undefined + >0 : 0 + + const expected = /** @type {{name: string, readonly middleInit: string, readonly lastName: string, zip: number, readonly houseNumber: number, zipStr: string}} */(/** @type {*} */(null)); + >expected : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } + >(/** @type {*} */(null)) : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } ++>(null) : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } + >(null) : any ++>null : any + + /** + * +@@= skipped -44, +46 lines =@@ + * @param {typeof needsExemplar} b + */ + function match(a, b) {} +->match : (a: typeof returnExemplar, b: typeof needsExemplar) => void +->a : () => typeof x +->b : (_?: typeof x) => undefined ++>match : (a: () => {}, b: (_?: {}) => undefined) => void ++>a : () => {} ++>b : (_?: {}) => undefined + + match(() => expected, (x = expected) => void 0); + >match(() => expected, (x = expected) => void 0) : void +->match : (a: typeof returnExemplar, b: typeof needsExemplar) => void ++>match : (a: () => {}, b: (_?: {}) => undefined) => void + >() => expected : () => { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } + >expected : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } +->(x = expected) => void 0 : (x?: typeof x | undefined) => undefined +->x : typeof x | undefined ++>(x = expected) => void 0 : (x?: {} | undefined) => undefined ++>x : {} | undefined + >expected : { name: string; readonly middleInit: string; readonly lastName: string; zip: number; readonly houseNumber: number; zipStr: string; } + >void 0 : undefined + >0 : 0 + + module.exports = x; +->module.exports = x : typeof x +->module.exports : typeof x +->module : { exports: typeof x; } +->exports : typeof x +->x : typeof x ++>module.exports = x : {} ++>module.exports : {} ++>module : { readonly x: {}; } ++>exports : {} ++>x : {} + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkOtherObjectAssignProperty.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkOtherObjectAssignProperty.errors.txt.diff index b7cd8728ae..c6768e4db2 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/checkOtherObjectAssignProperty.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkOtherObjectAssignProperty.errors.txt.diff @@ -8,14 +8,20 @@ -importer.js(13,5): error TS2540: Cannot assign to 'bad1' because it is a read-only property. -importer.js(14,5): error TS2540: Cannot assign to 'bad2' because it is a read-only property. -importer.js(15,5): error TS2540: Cannot assign to 'bad3' because it is a read-only property. -+importer.js(1,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++importer.js(1,21): error TS2306: File 'mod1.js' is not a module. ++mod1.js(2,23): error TS2304: Cannot find name 'exports'. ++mod1.js(8,23): error TS2304: Cannot find name 'exports'. ++mod1.js(11,23): error TS2304: Cannot find name 'exports'. ++mod1.js(14,23): error TS2304: Cannot find name 'exports'. ++mod1.js(15,23): error TS2304: Cannot find name 'exports'. ++mod1.js(16,23): error TS2304: Cannot find name 'exports'. -==== importer.js (7 errors) ==== +==== importer.js (1 errors) ==== const mod = require("./mod1"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~ ++!!! error TS2306: File 'mod1.js' is not a module. mod.thing; mod.other; - ~~~~~ @@ -26,7 +32,7 @@ mod.bad1; mod.bad2; mod.bad3; -@@= skipped -22, +14 lines =@@ +@@= skipped -22, +20 lines =@@ mod.thing = 0; mod.other = 0; @@ -45,5 +51,34 @@ - ~~~~ -!!! error TS2540: Cannot assign to 'bad3' because it is a read-only property. - ==== mod1.js (0 errors) ==== +-==== mod1.js (0 errors) ==== ++==== mod1.js (6 errors) ==== const obj = { value: 42, writable: true }; + Object.defineProperty(exports, "thing", obj); ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. + + /** + * @type {string} + */ + let str = /** @type {string} */("other"); + Object.defineProperty(exports, str, { value: 42, writable: true }); ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. + + const propName = "prop" + Object.defineProperty(exports, propName, { value: 42, writable: true }); ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. + + + Object.defineProperty(exports, "bad1", { }); ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. + Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. + Object.defineProperty(exports, "bad3", { writable: true }); ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/checkOtherObjectAssignProperty.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/checkOtherObjectAssignProperty.types.diff index e06d095db0..4925343a57 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/checkOtherObjectAssignProperty.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/checkOtherObjectAssignProperty.types.diff @@ -102,93 +102,90 @@ >bad3 : any >0 : 0 --=== mod1.js === --const obj = { value: 42, writable: true }; -->obj : { value: number; writable: boolean; } -->{ value: 42, writable: true } : { value: number; writable: boolean; } -->value : number -->42 : 42 -->writable : boolean -->true : true -- --Object.defineProperty(exports, "thing", obj); +@@= skipped -88, +88 lines =@@ + >true : true + + Object.defineProperty(exports, "thing", obj); ->Object.defineProperty(exports, "thing", obj) : typeof import("mod1") -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(exports, "thing", obj) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->exports : typeof import("mod1") -->"thing" : "thing" -->obj : { value: number; writable: boolean; } -- --/** -- * @type {string} -- */ --let str = /** @type {string} */("other"); -->str : string -->("other") : string -->"other" : "other" -- --Object.defineProperty(exports, str, { value: 42, writable: true }); ++>exports : any + >"thing" : "thing" + >obj : { value: number; writable: boolean; } + +@@= skipped -14, +14 lines =@@ + let str = /** @type {string} */("other"); + >str : string + >("other") : string ++>"other" : string + >"other" : "other" + + Object.defineProperty(exports, str, { value: 42, writable: true }); ->Object.defineProperty(exports, str, { value: 42, writable: true }) : typeof import("mod1") -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(exports, str, { value: 42, writable: true }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->exports : typeof import("mod1") -->str : string -->{ value: 42, writable: true } : { value: number; writable: true; } -->value : number -->42 : 42 -->writable : true -->true : true -- --const propName = "prop" -->propName : "prop" -->"prop" : "prop" -- --Object.defineProperty(exports, propName, { value: 42, writable: true }); ++>exports : any + >str : string + >{ value: 42, writable: true } : { value: number; writable: true; } + >value : number +@@= skipped -20, +21 lines =@@ + >"prop" : "prop" + + Object.defineProperty(exports, propName, { value: 42, writable: true }); ->Object.defineProperty(exports, propName, { value: 42, writable: true }) : typeof import("mod1") -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(exports, propName, { value: 42, writable: true }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->exports : typeof import("mod1") -->propName : "prop" -->{ value: 42, writable: true } : { value: number; writable: true; } -->value : number -->42 : 42 -->writable : true -->true : true -- -- --Object.defineProperty(exports, "bad1", { }); ++>exports : any + >propName : "prop" + >{ value: 42, writable: true } : { value: number; writable: true; } + >value : number +@@= skipped -14, +14 lines =@@ + + + Object.defineProperty(exports, "bad1", { }); ->Object.defineProperty(exports, "bad1", { }) : typeof import("mod1") -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(exports, "bad1", { }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->exports : typeof import("mod1") -->"bad1" : "bad1" -->{ } : {} -- --Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); ++>exports : any + >"bad1" : "bad1" + >{ } : {} + + Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }); ->Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }) : typeof import("mod1") -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(exports, "bad2", { get() { return 12 }, value: "no" }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->exports : typeof import("mod1") -->"bad2" : "bad2" ++>exports : any + >"bad2" : "bad2" ->{ get() { return 12 }, value: "no" } : { get(): number; value: string; } -->get : () => number -->12 : 12 -->value : string -->"no" : "no" -- --Object.defineProperty(exports, "bad3", { writable: true }); ++>{ get() { return 12 }, value: "no" } : { get: () => number; value: string; } + >get : () => number + >12 : 12 + >value : string + >"no" : "no" + + Object.defineProperty(exports, "bad3", { writable: true }); ->Object.defineProperty(exports, "bad3", { writable: true }) : typeof import("mod1") -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(exports, "bad3", { writable: true }) : any + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->exports : typeof import("mod1") -->"bad3" : "bad3" -->{ writable: true } : { writable: true; } -->writable : true -->true : true -- ++>exports : any + >"bad3" : "bad3" + >{ writable: true } : { writable: true; } + >writable : true diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSAliasedExport.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSAliasedExport.errors.txt.diff index 7f0494c1d4..3270c963bb 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSAliasedExport.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSAliasedExport.errors.txt.diff @@ -3,13 +3,13 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+bug43713.js(1,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++bug43713.js(1,27): error TS2307: Cannot find module './commonJSAliasedExport' or its corresponding type declarations. + + +==== bug43713.js (1 errors) ==== + const { funky } = require('./commonJSAliasedExport'); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2307: Cannot find module './commonJSAliasedExport' or its corresponding type declarations. + /** @type {boolean} */ + var diddy + var diddy = funky(1) diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportClassTypeReference.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportClassTypeReference.errors.txt.diff index d2f2ce6611..66d8da707e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportClassTypeReference.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportClassTypeReference.errors.txt.diff @@ -3,20 +3,11 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+main.js(1,9): error TS2451: Cannot redeclare block-scoped variable 'K'. -+main.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +main.js(2,13): error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? -+mod1.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'K'. -+mod1.js(6,1): error TS2304: Cannot find name 'exports'. + + -+==== main.js (3 errors) ==== ++==== main.js (1 errors) ==== + const { K } = require("./mod1"); -+ ~ -+!!! error TS2451: Cannot redeclare block-scoped variable 'K'. -+!!! related TS6203 mod1.js:1:7: 'K' was also declared here. -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + /** @param {K} k */ + ~ +!!! error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? @@ -24,16 +15,11 @@ + k.values() + } + -+==== mod1.js (2 errors) ==== ++==== mod1.js (0 errors) ==== + class K { -+ ~ -+!!! error TS2451: Cannot redeclare block-scoped variable 'K'. -+!!! related TS6203 main.js:1:9: 'K' was also declared here. + values() { + return new K() + } + } + exports.K = K; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportClassTypeReference.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportClassTypeReference.types.diff index 74df8199ac..87bcea7dd6 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportClassTypeReference.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportClassTypeReference.types.diff @@ -1,17 +1,6 @@ --- old.commonJSImportClassTypeReference.types +++ new.commonJSImportClassTypeReference.types -@@= skipped -1, +1 lines =@@ - - === main.js === - const { K } = require("./mod1"); -->K : typeof K -->require("./mod1") : typeof import("mod1") -+>K : any -+>require("./mod1") : any - >require : any - >"./mod1" : "./mod1" - -@@= skipped -11, +11 lines =@@ +@@= skipped -12, +12 lines =@@ >k : K k.values() @@ -25,29 +14,3 @@ } === mod1.js === -@@= skipped -11, +11 lines =@@ - >K : K - - values() { -->values : () => K -+>values : () => any - - return new K() -->new K() : K -->K : typeof K -+>new K() : any -+>K : any - } - } - exports.K = K; -->exports.K = K : typeof K -->exports.K : typeof K -->exports : typeof import("mod1") -->K : typeof K -->K : typeof K -+>exports.K = K : any -+>exports.K : any -+>exports : any -+>K : any -+>K : any - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportExportedClassExpression.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportExportedClassExpression.errors.txt.diff index bf8c296755..c125eb1cd7 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportExportedClassExpression.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportExportedClassExpression.errors.txt.diff @@ -3,15 +3,11 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+main.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +main.js(2,13): error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? -+mod1.js(1,1): error TS2304: Cannot find name 'exports'. + + -+==== main.js (2 errors) ==== ++==== main.js (1 errors) ==== + const { K } = require("./mod1"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + /** @param {K} k */ + ~ +!!! error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? @@ -19,10 +15,8 @@ + k.values() + } + -+==== mod1.js (1 errors) ==== ++==== mod1.js (0 errors) ==== + exports.K = class K { -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + values() { + } + }; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportExportedClassExpression.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportExportedClassExpression.types.diff index 48f2524416..1708ced17a 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportExportedClassExpression.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportExportedClassExpression.types.diff @@ -1,17 +1,6 @@ --- old.commonJSImportExportedClassExpression.types +++ new.commonJSImportExportedClassExpression.types -@@= skipped -1, +1 lines =@@ - - === main.js === - const { K } = require("./mod1"); -->K : typeof K -->require("./mod1") : typeof import("mod1") -+>K : any -+>require("./mod1") : any - >require : any - >"./mod1" : "./mod1" - -@@= skipped -11, +11 lines =@@ +@@= skipped -12, +12 lines =@@ >k : K k.values() @@ -25,14 +14,3 @@ } === mod1.js === - exports.K = class K { - >exports.K = class K { values() { }} : typeof K -->exports.K : typeof K -->exports : typeof import("mod1") -->K : typeof K -+>exports.K : any -+>exports : any -+>K : any - >class K { values() { }} : typeof K - >K : typeof K - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.errors.txt.diff index 89b004e1e7..bafa2c142f 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.errors.txt.diff @@ -3,18 +3,14 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+main.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +main.js(2,13): error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? +mod1.js(2,4): error TS2339: Property 'K' does not exist on type '{}'. +mod1.js(4,23): error TS2339: Property 'K' does not exist on type '{}'. -+mod1.js(7,1): error TS2304: Cannot find name 'exports'. +mod1.js(7,16): error TS2339: Property 'K' does not exist on type '{}'. + + -+==== main.js (2 errors) ==== ++==== main.js (1 errors) ==== + const { K } = require("./mod1"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + /** @param {K} k */ + ~ +!!! error TS2749: 'K' refers to a value, but is being used as a type here. Did you mean 'typeof K'? @@ -22,7 +18,7 @@ + k.values() + } + -+==== mod1.js (4 errors) ==== ++==== mod1.js (3 errors) ==== + var NS = {} + NS.K =class { + ~ @@ -34,8 +30,6 @@ + } + } + exports.K = NS.K; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + ~ +!!! error TS2339: Property 'K' does not exist on type '{}'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.types.diff index 448c40f37d..85e59ebc64 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/commonJSImportNestedClassTypeReference.types.diff @@ -5,12 +5,10 @@ === main.js === const { K } = require("./mod1"); ->K : typeof K -->require("./mod1") : typeof import("mod1") +>K : any -+>require("./mod1") : any + >require("./mod1") : typeof import("mod1") >require : any >"./mod1" : "./mod1" - @@= skipped -11, +11 lines =@@ >k : K @@ -58,14 +56,13 @@ exports.K = NS.K; ->exports.K = NS.K : typeof K ->exports.K : typeof K -->exports : typeof import("mod1") ++>exports.K = NS.K : any ++>exports.K : any + >exports : typeof import("mod1") ->K : typeof K ->NS.K : typeof K ->NS : typeof NS ->K : typeof K -+>exports.K = NS.K : any -+>exports.K : any -+>exports : any +>K : any +>NS.K : any +>NS : {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/commonJsImportBindingElementNarrowType.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/commonJsImportBindingElementNarrowType.errors.txt.diff deleted file mode 100644 index 1fe365df59..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/commonJsImportBindingElementNarrowType.errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.commonJsImportBindingElementNarrowType.errors.txt -+++ new.commonJsImportBindingElementNarrowType.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+/bar.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== /bar.js (1 errors) ==== -+ const { a } = require("./foo"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ if (a) { -+ var x = a + 1; -+ } -+==== /foo.d.ts (0 errors) ==== -+ export const a: number | null; -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/commonJsImportBindingElementNarrowType.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/commonJsImportBindingElementNarrowType.types.diff deleted file mode 100644 index 6c0c20d92c..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/commonJsImportBindingElementNarrowType.types.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- old.commonJsImportBindingElementNarrowType.types -+++ new.commonJsImportBindingElementNarrowType.types -@@= skipped -1, +1 lines =@@ - - === /bar.js === - const { a } = require("./foo"); -->a : number | null -->require("./foo") : typeof import("/foo") -+>a : any -+>require("./foo") : any - >require : any - >"./foo" : "./foo" - - if (a) { -->a : number | null -+>a : any - - var x = a + 1; -->x : number -->a + 1 : number -->a : number -+>x : any -+>a + 1 : any -+>a : any - >1 : 1 - } - === /foo.d.ts === diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/conflictingCommonJSES2015Exports.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/conflictingCommonJSES2015Exports.errors.txt.diff new file mode 100644 index 0000000000..2cebdbe40a --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/conflictingCommonJSES2015Exports.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.conflictingCommonJSES2015Exports.errors.txt ++++ new.conflictingCommonJSES2015Exports.errors.txt +@@= skipped -0, +0 lines =@@ +-bug24934.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++bug24934.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++use.js(1,21): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. + + + ==== bug24934.js (1 errors) ==== + export function abc(a, b, c) { return 5; } + module.exports = { abc }; +- ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-==== use.js (0 errors) ==== ++ ~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. ++==== use.js (1 errors) ==== + import { abc } from './bug24934'; ++ ~~~~~~~~~~~~ ++!!! error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. + abc(1, 2, 3); + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/conflictingCommonJSES2015Exports.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/conflictingCommonJSES2015Exports.types.diff index 5fcdc64a3e..028a1a2bda 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/conflictingCommonJSES2015Exports.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/conflictingCommonJSES2015Exports.types.diff @@ -5,7 +5,13 @@ module.exports = { abc }; ->module.exports = { abc } : any +->module.exports : any +->module : any +->exports : any +>module.exports = { abc } : { abc: (a: any, b: any, c: any) => number; } - >module.exports : any - >module : any - >exports : any ++>module.exports : { abc: (a: any, b: any, c: any) => number; } ++>module : { export=: { abc: (a: any, b: any, c: any) => number; }; } ++>exports : { abc: (a: any, b: any, c: any) => number; } + >{ abc } : { abc: (a: any, b: any, c: any) => number; } + >abc : (a: any, b: any, c: any) => number + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/constructorFunctions2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/constructorFunctions2.errors.txt.diff deleted file mode 100644 index 8db5f057b8..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/constructorFunctions2.errors.txt.diff +++ /dev/null @@ -1,32 +0,0 @@ ---- old.constructorFunctions2.errors.txt -+++ new.constructorFunctions2.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'A'. -+other.js(1,10): error TS2451: Cannot redeclare block-scoped variable 'A'. -+ -+ -+==== node.d.ts (0 errors) ==== -+ declare function require(id: string): any; -+ declare var module: any, exports: any; -+ -+==== index.js (1 errors) ==== -+ const A = require("./other"); -+ ~ -+!!! error TS2451: Cannot redeclare block-scoped variable 'A'. -+!!! related TS6203 other.js:1:10: 'A' was also declared here. -+ const a = new A().id; -+ -+ const B = function() { this.id = 1; } -+ B.prototype.m = function() { this.x = 2; } -+ const b = new B(); -+ b.id; -+ b.x; -+ -+==== other.js (1 errors) ==== -+ function A() { this.id = 1; } -+ ~ -+!!! error TS2451: Cannot redeclare block-scoped variable 'A'. -+!!! related TS6203 index.js:1:7: 'A' was also declared here. -+ module.exports = A; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/constructorFunctions2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/constructorFunctions2.types.diff index 5d0ffd75ac..70e1af57c6 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/constructorFunctions2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/constructorFunctions2.types.diff @@ -6,8 +6,8 @@ const A = require("./other"); ->A : typeof A ->require("./other") : typeof A -+>A : any -+>require("./other") : any ++>A : () => void ++>require("./other") : () => void >require : (id: string) => any >"./other" : "./other" @@ -20,7 +20,7 @@ +>a : any +>new A().id : any +>new A() : any -+>A : any ++>A : () => void +>id : any const B = function() { this.id = 1; } @@ -94,9 +94,9 @@ ->module : { exports: typeof A; } ->exports : typeof A ->A : typeof A -+>module.exports = A : any -+>module.exports : any -+>module : any -+>exports : any -+>A : any ++>module.exports = A : () => void ++>module.exports : () => void ++>module : { A: () => void; } ++>exports : () => void ++>A : () => void diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.errors.txt.diff index e6a75ff5d0..e272d3b2a9 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.errors.txt.diff @@ -3,7 +3,6 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+mod.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod.js(5,7): error TS7006: Parameter 'n' implicitly has an 'any' type. +test.js(9,4): error TS2339: Property 'x' does not exist on type '{}'. +test.js(11,7): error TS7006: Parameter 'n' implicitly has an 'any' type. @@ -14,19 +13,17 @@ +test.js(27,15): error TS7006: Parameter 'n' implicitly has an 'any' type. +test.js(32,14): error TS2339: Property 's' does not exist on type 'Thing'. +test.js(34,15): error TS7006: Parameter 'n' implicitly has an 'any' type. -+test.js(42,1): error TS2304: Cannot find name 'exports'. ++test.js(42,1): error TS7022: 'x' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +test.js(44,7): error TS7006: Parameter 'n' implicitly has an 'any' type. -+test.js(46,1): error TS2304: Cannot find name 'exports'. -+test.js(49,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++test.js(49,1): error TS7022: 'y' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +test.js(51,7): error TS7006: Parameter 'n' implicitly has an 'any' type. -+test.js(53,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +test.js(57,17): error TS2339: Property 'x' does not exist on type 'Thing'. +test.js(59,7): error TS7006: Parameter 'n' implicitly has an 'any' type. +test.js(61,17): error TS2339: Property 'x' does not exist on type 'Thing'. +test.js(69,7): error TS7006: Parameter 'n' implicitly has an 'any' type. + + -+==== test.js (19 errors) ==== ++==== test.js (17 errors) ==== + /** @typedef {{ + status: 'done' + m(n: number): void @@ -87,29 +84,31 @@ + + /** @type {DoneStatus} */ + exports.x = { -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~~~~~~~~ + status: "done", ++ ~~~~~~~~~~~~~~~~~~~ + m(n) { } ++ ~~~~~~~~~~~~ + ~ +!!! error TS7006: Parameter 'n' implicitly has an 'any' type. + } ++ ~ ++!!! error TS7022: 'x' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. + exports.x -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + + /** @type {DoneStatus} */ + module.exports.y = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~ + status: "done", ++ ~~~~~~~~~~~~~~~~~~~ + m(n) { } ++ ~~~~~~~~~~~~ + ~ +!!! error TS7006: Parameter 'n' implicitly has an 'any' type. + } ++ ~ ++!!! error TS7022: 'y' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. + module.exports.y -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + // prototype-property assignment + /** @type {DoneStatus} */ @@ -136,12 +135,10 @@ +!!! error TS7006: Parameter 'n' implicitly has an 'any' type. + } + -+==== mod.js (2 errors) ==== ++==== mod.js (1 errors) ==== + // module.exports assignment + /** @type {{ status: 'done', m(n: number): void }} */ + module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + status: "done", + m(n) { } + ~ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.types.diff index 98fd6fec42..15d15c6db1 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/contextualTypedSpecialAssignment.types.diff @@ -126,12 +126,11 @@ exports.x = { ->exports.x = { status: "done", m(n) { }} : { status: "done"; m(n: number): void; } ->exports.x : DoneStatus -->exports : typeof import("test") -->x : DoneStatus -->{ status: "done", m(n) { }} : { status: "done"; m(n: number): void; } +>exports.x = { status: "done", m(n) { }} : { status: string; m: (n: any) => void; } +>exports.x : any -+>exports : any + >exports : typeof import("test") +->x : DoneStatus +->{ status: "done", m(n) { }} : { status: "done"; m(n: number): void; } +>x : any +>{ status: "done", m(n) { }} : { status: string; m: (n: any) => void; } @@ -148,10 +147,9 @@ } exports.x ->exports.x : DoneStatus -->exports : typeof import("test") -->x : DoneStatus +>exports.x : any -+>exports : any + >exports : typeof import("test") +->x : DoneStatus +>x : any /** @type {DoneStatus} */ @@ -165,9 +163,9 @@ ->{ status: "done", m(n) { }} : { status: "done"; m(n: number): void; } +>module.exports.y = { status: "done", m(n) { }} : { status: string; m: (n: any) => void; } +>module.exports.y : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("test") ++>module : { "test": typeof import("test"); } ++>exports : typeof import("test") +>y : any +>{ status: "done", m(n) { }} : { status: string; m: (n: any) => void; } @@ -189,9 +187,9 @@ ->exports : typeof module.exports ->y : DoneStatus +>module.exports.y : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("test") ++>module : { "test": typeof import("test"); } ++>exports : typeof import("test") +>y : any // prototype-property assignment @@ -269,9 +267,9 @@ ->exports : { status: "done"; m(n: number): void; } ->{ status: "done", m(n) { }} : { status: "done"; m(n: number): void; } +>module.exports = { status: "done", m(n) { }} : { status: string; m: (n: any) => void; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { status: string; m: (n: any) => void; } ++>module : { export=: { status: string; m: (n: any) => void; }; } ++>exports : { status: string; m: (n: any) => void; } +>{ status: "done", m(n) { }} : { status: string; m: (n: any) => void; } status: "done", diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports.errors.txt.diff deleted file mode 100644 index f2600950bb..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports.errors.txt.diff +++ /dev/null @@ -1,20 +0,0 @@ ---- old.enumTagOnExports.errors.txt -+++ new.enumTagOnExports.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+enumTagOnExports.js(2,1): error TS2304: Cannot find name 'exports'. -+enumTagOnExports.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== enumTagOnExports.js (2 errors) ==== -+ /** @enum {number} */ -+ exports.a = {}; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ -+ /** @enum {string} */ -+ module.exports.b = {}; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports.types.diff index fca4a6b32c..29129e9206 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports.types.diff @@ -5,10 +5,9 @@ exports.a = {}; >exports.a = {} : {} ->exports.a : typeof a -->exports : typeof import("enumTagOnExports") -->a : typeof a +>exports.a : any -+>exports : any + >exports : typeof import("enumTagOnExports") +->a : typeof a +>a : any >{} : {} @@ -21,9 +20,9 @@ ->exports : typeof module.exports ->b : typeof b +>module.exports.b : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("enumTagOnExports") ++>module : { "enumTagOnExports": typeof import("enumTagOnExports"); } ++>exports : typeof import("enumTagOnExports") +>b : any >{} : {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports2.errors.txt.diff deleted file mode 100644 index 58cc01b608..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports2.errors.txt.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.enumTagOnExports2.errors.txt -+++ new.enumTagOnExports2.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+enumTagOnExports.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== enumTagOnExports.js (1 errors) ==== -+ /** @enum {string} */ -+ module.exports = {}; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports2.types.diff index 4d57a8af5e..cf6f2b0395 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/enumTagOnExports2.types.diff @@ -9,8 +9,8 @@ ->module : { exports: typeof module.exports; } ->exports : typeof module.exports +>module.exports = {} : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} >{} : {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces.errors.txt.diff index 056b7d5e35..56ba5a5321 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces.errors.txt.diff @@ -3,25 +3,17 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+mod.js(1,1): error TS2304: Cannot find name 'exports'. -+mod.js(2,1): error TS2304: Cannot find name 'exports'. -+mod.js(5,1): error TS2304: Cannot find name 'exports'. +mod.js(7,14): error TS2339: Property 'p' does not exist on type 'Classic'. -+use.js(1,20): error TS2306: File 'mod.js' is not a module. ++use.js(8,15): error TS2694: Namespace '"mod"' has no exported member 'n'. ++use.js(9,13): error TS2749: 's.Classic' refers to a value, but is being used as a type here. Did you mean 'typeof s.Classic'? + + -+==== mod.js (4 errors) ==== ++==== mod.js (1 errors) ==== + exports.n = {}; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + exports.n.K = function () { -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + this.x = 10; + } + exports.Classic = class { -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + constructor() { + this.p = 1 + ~ @@ -29,10 +21,8 @@ + } + } + -+==== use.js (1 errors) ==== ++==== use.js (2 errors) ==== + import * as s from './mod' -+ ~~~~~~~ -+!!! error TS2306: File 'mod.js' is not a module. + + var k = new s.n.K() + k.x @@ -40,7 +30,11 @@ + + + /** @param {s.n.K} c ++ ~ ++!!! error TS2694: Namespace '"mod"' has no exported member 'n'. + @param {s.Classic} classic */ ++ ~~~~~~~~~ ++!!! error TS2749: 's.Classic' refers to a value, but is being used as a type here. Did you mean 'typeof s.Classic'? + function f(c, classic) { + c.x + classic.p diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces.types.diff index ab20ffea84..61bfaad816 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces.types.diff @@ -6,11 +6,10 @@ exports.n = {}; ->exports.n = {} : typeof n ->exports.n : typeof n -->exports : typeof import("mod") -->n : typeof n +>exports.n = {} : {} +>exports.n : any -+>exports : any + >exports : typeof import("mod") +->n : typeof n +>n : any >{} : {} @@ -18,14 +17,13 @@ ->exports.n.K = function () { this.x = 10;} : typeof K ->exports.n.K : typeof K ->exports.n : typeof n -->exports : typeof import("mod") -->n : typeof n -->K : typeof K -->function () { this.x = 10;} : typeof K +>exports.n.K = function () { this.x = 10;} : () => void +>exports.n.K : any +>exports.n : any -+>exports : any + >exports : typeof import("mod") +->n : typeof n +->K : typeof K +->function () { this.x = 10;} : typeof K +>n : any +>K : any +>function () { this.x = 10;} : () => void @@ -38,23 +36,12 @@ >x : any >10 : 10 } - exports.Classic = class { - >exports.Classic = class { constructor() { this.p = 1 }} : typeof Classic -->exports.Classic : typeof Classic -->exports : typeof import("mod") -->Classic : typeof Classic -+>exports.Classic : any -+>exports : any -+>Classic : any - >class { constructor() { this.p = 1 }} : typeof Classic - - constructor() { @@= skipped -41, +41 lines =@@ === use.js === import * as s from './mod' ->s : typeof s -+>s : any ++>s : typeof import("mod") var k = new s.n.K() ->k : K @@ -68,7 +55,7 @@ +>new s.n.K() : any +>s.n.K : any +>s.n : any -+>s : any ++>s : typeof import("mod") +>n : any +>K : any @@ -86,11 +73,11 @@ ->s.Classic : typeof s.Classic ->s : typeof s ->Classic : typeof s.Classic -+>classic : any -+>new s.Classic() : any -+>s.Classic : any -+>s : any -+>Classic : any ++>classic : Classic ++>new s.Classic() : Classic ++>s.Classic : typeof Classic ++>s : typeof import("mod") ++>Classic : typeof Classic /** @param {s.n.K} c diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces2.errors.txt.diff index c1dc88d5e9..4ed7083ca5 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces2.errors.txt.diff @@ -6,20 +6,15 @@ +first.js(1,1): error TS2304: Cannot find name 'exports'. +first.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +first.js(2,1): error TS2304: Cannot find name 'exports'. -+mod.js(2,1): error TS2304: Cannot find name 'exports'. +second.js(1,1): error TS2304: Cannot find name 'exports'. +second.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +second.js(2,1): error TS2304: Cannot find name 'exports'. -+use.js(1,24): error TS2306: File 'mod.js' is not a module. --==== mod.js (0 errors) ==== -+==== mod.js (1 errors) ==== + ==== mod.js (0 errors) ==== // Based on a pattern from adonis exports.formatters = {} -==== first.js (1 errors) ==== -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. +==== first.js (3 errors) ==== exports = require('./mod') + ~~~~~~~ @@ -48,11 +43,3 @@ return v } --==== use.js (0 errors) ==== -+==== use.js (1 errors) ==== - import * as debug from './mod' -+ ~~~~~~~ -+!!! error TS2306: File 'mod.js' is not a module. - - debug.formatters.j - var one = debug.formatters.o(1) diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces2.types.diff index 28f257c9ac..6f7996934d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/exportNestedNamespaces2.types.diff @@ -5,10 +5,9 @@ exports.formatters = {} >exports.formatters = {} : {} ->exports.formatters : {} -->exports : typeof import("mod") -->formatters : {} +>exports.formatters : any -+>exports : any + >exports : typeof import("mod") +->formatters : {} +>formatters : any >{} : {} @@ -59,7 +58,7 @@ === use.js === import * as debug from './mod' ->debug : typeof debug -+>debug : any ++>debug : typeof import("mod") debug.formatters.j >debug.formatters.j : any @@ -67,7 +66,7 @@ ->debug : typeof debug ->formatters : {} +>debug.formatters : any -+>debug : any ++>debug : typeof import("mod") +>formatters : any >j : any @@ -79,7 +78,7 @@ ->debug : typeof debug ->formatters : {} +>debug.formatters : any -+>debug : any ++>debug : typeof import("mod") +>formatters : any >o : any >1 : 1 diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/exportPropertyAssignmentNameResolution.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/exportPropertyAssignmentNameResolution.errors.txt.diff index 45519bf308..9e0a08bb9e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/exportPropertyAssignmentNameResolution.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/exportPropertyAssignmentNameResolution.errors.txt.diff @@ -1,15 +1,14 @@ --- old.exportPropertyAssignmentNameResolution.errors.txt +++ new.exportPropertyAssignmentNameResolution.errors.txt -@@= skipped -0, +0 lines =@@ -+bug24492.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - bug24492.js(2,5): error TS2304: Cannot find name 'D'. - - +@@= skipped -0, +-1 lines =@@ +-bug24492.js(2,5): error TS2304: Cannot find name 'D'. +- +- -==== bug24492.js (1 errors) ==== -+==== bug24492.js (2 errors) ==== - module.exports.D = class { } -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - new D() - ~ - !!! error TS2304: Cannot find name 'D'. +- module.exports.D = class { } +- new D() +- ~ +-!!! error TS2304: Cannot find name 'D'. +- +@@= skipped --1, +1 lines =@@ ++ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/exportPropertyAssignmentNameResolution.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/exportPropertyAssignmentNameResolution.types.diff index a392048baf..7ce8af45d6 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/exportPropertyAssignmentNameResolution.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/exportPropertyAssignmentNameResolution.types.diff @@ -1,19 +1,21 @@ --- old.exportPropertyAssignmentNameResolution.types +++ new.exportPropertyAssignmentNameResolution.types -@@= skipped -2, +2 lines =@@ - === bug24492.js === +@@= skipped -3, +3 lines =@@ module.exports.D = class { } >module.exports.D = class { } : typeof D -->module.exports.D : typeof D + >module.exports.D : typeof D ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->D : typeof D -+>module.exports.D : any -+>module.exports : any -+>module : any -+>exports : any -+>D : any ++>module.exports : typeof import("bug24492") ++>module : { "bug24492": typeof import("bug24492"); } ++>exports : typeof import("bug24492") + >D : typeof D >class { } : typeof D new D() +->new D() : any +->D : any ++>new D() : D ++>D : typeof D + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/globalMergeWithCommonJSAssignmentDeclaration.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/globalMergeWithCommonJSAssignmentDeclaration.errors.txt.diff deleted file mode 100644 index b3d953c298..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/globalMergeWithCommonJSAssignmentDeclaration.errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.globalMergeWithCommonJSAssignmentDeclaration.errors.txt -+++ new.globalMergeWithCommonJSAssignmentDeclaration.errors.txt -@@= skipped -0, +0 lines =@@ - bug27099.js(1,1): error TS2322: Type 'number' is not assignable to type 'string'. -+bug27099.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - --==== bug27099.js (1 errors) ==== -+==== bug27099.js (2 errors) ==== - window.name = 1; - ~~~~~~~~~~~ - !!! error TS2322: Type 'number' is not assignable to type 'string'. - window.console; // should not have error: Property 'console' does not exist on type 'typeof window'. - module.exports = 'anything'; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/globalMergeWithCommonJSAssignmentDeclaration.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/globalMergeWithCommonJSAssignmentDeclaration.types.diff index b8794aa2c1..c192ba0e3f 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/globalMergeWithCommonJSAssignmentDeclaration.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/globalMergeWithCommonJSAssignmentDeclaration.types.diff @@ -9,9 +9,9 @@ ->module : { exports: string; } ->exports : string +>module.exports = 'anything' : "anything" -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : "anything" ++>module : { export=: "anything"; } ++>exports : "anything" >'anything' : "anything" diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/importAliasModuleExports.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/importAliasModuleExports.errors.txt.diff index e81ac339a0..535eab362e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/importAliasModuleExports.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/importAliasModuleExports.errors.txt.diff @@ -1,47 +1,27 @@ --- old.importAliasModuleExports.errors.txt +++ new.importAliasModuleExports.errors.txt @@= skipped -0, +0 lines =@@ --main.js(2,13): error TS2339: Property 'foo' does not exist on type 'Alias'. --main.js(3,13): error TS2339: Property 'func' does not exist on type 'Alias'. + main.js(2,13): error TS2339: Property 'foo' does not exist on type 'Alias'. + main.js(3,13): error TS2339: Property 'func' does not exist on type 'Alias'. -main.js(3,38): error TS2339: Property '_func' does not exist on type 'Alias'. --main.js(6,9): error TS2339: Property 'foo' does not exist on type 'Alias'. --main.js(7,9): error TS2339: Property 'func' does not exist on type 'Alias'. --main.js(8,9): error TS2339: Property 'def' does not exist on type 'Alias'. -+main.js(1,15): error TS2306: File 'mod1.js' is not a module. -+mod1.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - --==== mod1.js (0 errors) ==== -+==== mod1.js (1 errors) ==== - class Alias { - bar() { return 1 } + main.js(6,9): error TS2339: Property 'foo' does not exist on type 'Alias'. + main.js(7,9): error TS2339: Property 'func' does not exist on type 'Alias'. + main.js(8,9): error TS2339: Property 'def' does not exist on type 'Alias'. +@@= skipped -11, +10 lines =@@ } module.exports = Alias; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== main.js (6 errors) ==== -+==== main.js (1 errors) ==== ++==== main.js (5 errors) ==== import A from './mod1' -+ ~~~~~~~~ -+!!! error TS2306: File 'mod1.js' is not a module. A.prototype.foo = 0 -- ~~~ --!!! error TS2339: Property 'foo' does not exist on type 'Alias'. + ~~~ +@@= skipped -8, +8 lines =@@ A.prototype.func = function() { this._func = 0; } -- ~~~~ --!!! error TS2339: Property 'func' does not exist on type 'Alias'. + ~~~~ + !!! error TS2339: Property 'func' does not exist on type 'Alias'. - ~~~~~ -!!! error TS2339: Property '_func' does not exist on type 'Alias'. Object.defineProperty(A.prototype, "def", { value: 0 }); new A().bar new A().foo -- ~~~ --!!! error TS2339: Property 'foo' does not exist on type 'Alias'. - new A().func() -- ~~~~ --!!! error TS2339: Property 'func' does not exist on type 'Alias'. - new A().def -- ~~~ --!!! error TS2339: Property 'def' does not exist on type 'Alias'. - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/importAliasModuleExports.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/importAliasModuleExports.types.diff index 8f97ed6b5e..5c4fda6af4 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/importAliasModuleExports.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/importAliasModuleExports.types.diff @@ -1,21 +1,18 @@ --- old.importAliasModuleExports.types +++ new.importAliasModuleExports.types -@@= skipped -9, +9 lines =@@ - } +@@= skipped -10, +10 lines =@@ module.exports = Alias; >module.exports = Alias : typeof Alias -->module.exports : typeof Alias + >module.exports : typeof Alias ->module : { exports: typeof Alias; } -->exports : typeof Alias -+>module.exports : any -+>module : any -+>exports : any ++>module : { Alias: typeof Alias; } + >exports : typeof Alias >Alias : typeof Alias === main.js === import A from './mod1' ->A : typeof A -+>A : any ++>A : typeof Alias A.prototype.foo = 0 >A.prototype.foo = 0 : 0 @@ -23,9 +20,9 @@ ->A.prototype : A ->A : typeof A ->prototype : A -+>A.prototype : any -+>A : any -+>prototype : any ++>A.prototype : Alias ++>A : typeof Alias ++>prototype : Alias >foo : any >0 : 0 @@ -35,9 +32,9 @@ ->A.prototype : A ->A : typeof A ->prototype : A -+>A.prototype : any -+>A : any -+>prototype : any ++>A.prototype : Alias ++>A : typeof Alias ++>prototype : Alias >func : any >function() { this._func = 0; } : () => void >this._func = 0 : 0 @@ -49,37 +46,35 @@ Object.defineProperty(A.prototype, "def", { value: 0 }); ->Object.defineProperty(A.prototype, "def", { value: 0 }) : A -+>Object.defineProperty(A.prototype, "def", { value: 0 }) : any ++>Object.defineProperty(A.prototype, "def", { value: 0 }) : Alias >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T >Object : ObjectConstructor >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->A.prototype : A ->A : typeof A ->prototype : A -+>A.prototype : any -+>A : any -+>prototype : any ++>A.prototype : Alias ++>A : typeof Alias ++>prototype : Alias >"def" : "def" >{ value: 0 } : { value: number; } >value : number - >0 : 0 +@@= skipped -46, +46 lines =@@ new A().bar -->new A().bar : () => number + >new A().bar : () => number ->new A() : A ->A : typeof A -->bar : () => number -+>new A().bar : any -+>new A() : any -+>A : any -+>bar : any ++>new A() : Alias ++>A : typeof Alias + >bar : () => number new A().foo >new A().foo : any ->new A() : A ->A : typeof A -+>new A() : any -+>A : any ++>new A() : Alias ++>A : typeof Alias >foo : any new A().func() @@ -87,15 +82,15 @@ >new A().func : any ->new A() : A ->A : typeof A -+>new A() : any -+>A : any ++>new A() : Alias ++>A : typeof Alias >func : any new A().def >new A().def : any ->new A() : A ->A : typeof A -+>new A() : any -+>A : any ++>new A() : Alias ++>A : typeof Alias >def : any diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassExtendsVisibility.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassExtendsVisibility.errors.txt.diff index 0e9de90edc..436bf89b0c 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassExtendsVisibility.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassExtendsVisibility.errors.txt.diff @@ -3,26 +3,23 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+cls.js(1,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+cls.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+cls.js(8,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++cls.js(7,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++cls.js(8,16): error TS2339: Property 'Strings' does not exist on type 'typeof Foo'. + + -+==== cls.js (3 errors) ==== ++==== cls.js (2 errors) ==== + const Bar = require("./bar"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + const Strings = { + a: "A", + b: "B" + }; + class Foo extends Bar {} + module.exports = Foo; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.Strings = Strings; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~ ++!!! error TS2339: Property 'Strings' does not exist on type 'typeof Foo'. +==== bar.js (0 errors) ==== + class Bar {} + module.exports = Bar; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassExtendsVisibility.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassExtendsVisibility.types.diff index 68385d2d58..f746697ab2 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassExtendsVisibility.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassExtendsVisibility.types.diff @@ -1,55 +1,34 @@ --- old.jsDeclarationsClassExtendsVisibility.types +++ new.jsDeclarationsClassExtendsVisibility.types -@@= skipped -1, +1 lines =@@ - - === cls.js === - const Bar = require("./bar"); -->Bar : typeof Bar -->require("./bar") : typeof Bar -+>Bar : any -+>require("./bar") : any - >require : any - >"./bar" : "./bar" - -@@= skipped -20, +20 lines =@@ - }; - class Foo extends Bar {} - >Foo : Foo -->Bar : Bar -+>Bar : any - +@@= skipped -26, +26 lines =@@ module.exports = Foo; >module.exports = Foo : typeof Foo -->module.exports : typeof Foo + >module.exports : typeof Foo ->module : { exports: typeof Foo; } -->exports : typeof Foo -+>module.exports : any -+>module : any -+>exports : any ++>module : { Foo: typeof Foo; } + >exports : typeof Foo >Foo : typeof Foo module.exports.Strings = Strings; >module.exports.Strings = Strings : { a: string; b: string; } ->module.exports.Strings : { a: string; b: string; } -->module.exports : typeof Foo -->module : { exports: typeof Foo; } -->exports : typeof Foo +>module.exports.Strings : any -+>module.exports : any -+>module : any -+>exports : any + >module.exports : typeof Foo +->module : { exports: typeof Foo; } ++>module : { Foo: typeof Foo; } + >exports : typeof Foo +>Strings : any >Strings : { a: string; b: string; } ->Strings : { a: string; b: string; } --=== bar.js === --class Bar {} -->Bar : Bar -- --module.exports = Bar; -->module.exports = Bar : typeof Bar -->module.exports : typeof Bar + === bar.js === + class Bar {} +@@= skipped -20, +20 lines =@@ + module.exports = Bar; + >module.exports = Bar : typeof Bar + >module.exports : typeof Bar ->module : { exports: typeof Bar; } -->exports : typeof Bar -->Bar : typeof Bar -- ++>module : { Bar: typeof Bar; } + >exports : typeof Bar + >Bar : typeof Bar + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.errors.txt.diff index becb88aa06..9f95f0d97c 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.errors.txt.diff @@ -4,8 +4,8 @@ - @@= skipped --1, +1 lines =@@ +source.js(9,9): error TS2339: Property 'statische' does not exist on type 'typeof Handler'. -+source.js(15,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+source.js(16,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++source.js(15,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++source.js(16,16): error TS2339: Property 'Strings' does not exist on type 'typeof Handler'. + + +==== source.js (3 errors) ==== @@ -26,11 +26,11 @@ + } + + module.exports = Handler; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.Strings = Strings -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~ ++!!! error TS2339: Property 'Strings' does not exist on type 'typeof Handler'. + + /** + * @typedef {Object} HandlerOptions diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.types.diff index ad553260b6..36ebdcaf64 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsClassStatic.types.diff @@ -12,28 +12,23 @@ >function() { } : () => void const Strings = { -@@= skipped -20, +20 lines =@@ - +@@= skipped -21, +21 lines =@@ module.exports = Handler; >module.exports = Handler : typeof Handler -->module.exports : typeof Handler + >module.exports : typeof Handler ->module : { exports: typeof Handler; } -->exports : typeof Handler -+>module.exports : any -+>module : any -+>exports : any ++>module : { Handler: typeof Handler; } + >exports : typeof Handler >Handler : typeof Handler module.exports.Strings = Strings >module.exports.Strings = Strings : { a: string; b: string; } ->module.exports.Strings : { a: string; b: string; } -->module.exports : typeof Handler -->module : { exports: typeof Handler; } -->exports : typeof Handler +>module.exports.Strings : any -+>module.exports : any -+>module : any -+>exports : any + >module.exports : typeof Handler +->module : { exports: typeof Handler; } ++>module : { Handler: typeof Handler; } + >exports : typeof Handler +>Strings : any >Strings : { a: string; b: string; } ->Strings : { a: string; b: string; } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCommonjsRelativePath.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCommonjsRelativePath.errors.txt.diff index 8048a38ddc..d592b0947e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCommonjsRelativePath.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCommonjsRelativePath.errors.txt.diff @@ -4,17 +4,14 @@ - @@= skipped --1, +1 lines =@@ +reexport.js(2,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+reexport.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + -+==== reexport.js (2 errors) ==== ++==== reexport.js (1 errors) ==== + 'use strict'; + const Thing = require('./thing').Thing + ~~~~~~~ +!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + module.exports = { Thing } -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + +==== thing.js (0 errors) ==== + 'use strict'; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCommonjsRelativePath.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCommonjsRelativePath.types.diff index 63d4a493ad..b84c0ab8bc 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCommonjsRelativePath.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCommonjsRelativePath.types.diff @@ -23,9 +23,9 @@ ->{ Thing } : { Thing: typeof Thing; } ->Thing : typeof Thing +>module.exports = { Thing } : { Thing: any; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { Thing: any; } ++>module : { export=: { Thing: any; }; } ++>exports : { Thing: any; } +>{ Thing } : { Thing: any; } +>Thing : any diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsComputedNames.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsComputedNames.errors.txt.diff deleted file mode 100644 index 693131cda3..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsComputedNames.errors.txt.diff +++ /dev/null @@ -1,37 +0,0 @@ ---- old.jsDeclarationsComputedNames.errors.txt -+++ new.jsDeclarationsComputedNames.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== index.js (1 errors) ==== -+ const TopLevelSym = Symbol(); -+ const InnerSym = Symbol(); -+ module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ [TopLevelSym](x = 12) { -+ return x; -+ }, -+ items: { -+ [InnerSym]: (arg = {x: 12}) => arg.x -+ } -+ } -+ -+==== index2.js (0 errors) ==== -+ const TopLevelSym = Symbol(); -+ const InnerSym = Symbol(); -+ -+ export class MyClass { -+ static [TopLevelSym] = 12; -+ [InnerSym] = "ok"; -+ /** -+ * @param {typeof TopLevelSym | typeof InnerSym} _p -+ */ -+ constructor(_p = InnerSym) { -+ // switch on _p -+ } -+ } -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsComputedNames.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsComputedNames.types.diff index 7b4fcb9acf..73f139cb18 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsComputedNames.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsComputedNames.types.diff @@ -10,9 +10,9 @@ ->exports : { [TopLevelSym](x?: number): number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; } ->{ [TopLevelSym](x = 12) { return x; }, items: { [InnerSym]: (arg = {x: 12}) => arg.x }} : { [TopLevelSym](x?: number): number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; } +>module.exports = { [TopLevelSym](x = 12) { return x; }, items: { [InnerSym]: (arg = {x: 12}) => arg.x }} : { [TopLevelSym]: (x?: number) => number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { [TopLevelSym]: (x?: number) => number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; } ++>module : { export=: { [TopLevelSym]: (x?: number) => number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; }; } ++>exports : { [TopLevelSym]: (x?: number) => number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; } +>{ [TopLevelSym](x = 12) { return x; }, items: { [InnerSym]: (arg = {x: 12}) => arg.x }} : { [TopLevelSym]: (x?: number) => number; items: { [InnerSym]: (arg?: { x: number; }) => number; }; } [TopLevelSym](x = 12) { diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCrossfileMerge.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCrossfileMerge.errors.txt.diff index 6cf94c63b2..a446c19c87 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCrossfileMerge.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCrossfileMerge.errors.txt.diff @@ -2,26 +2,23 @@ +++ new.jsDeclarationsCrossfileMerge.errors.txt @@= skipped -0, +0 lines =@@ -index.js(4,1): error TS6232: Declaration augments declaration in another file. This cannot be serialized. -+index.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(3,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++index.js(4,16): error TS2339: Property 'memberName' does not exist on type '() => void'. -==== index.js (1 errors) ==== -+==== index.js (3 errors) ==== ++==== index.js (2 errors) ==== const m = require("./exporter"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports = m.default; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.memberName = "thing"; - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6232: Declaration augments declaration in another file. This cannot be serialized. -!!! related TS6233 exporter.js:1:10: This is the declaration being augmented. Consider moving the augmenting declaration into the same file. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~ ++!!! error TS2339: Property 'memberName' does not exist on type '() => void'. ==== exporter.js (0 errors) ==== function validate() {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCrossfileMerge.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCrossfileMerge.types.diff index e564145c3a..aef3237f2a 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCrossfileMerge.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsCrossfileMerge.types.diff @@ -6,8 +6,8 @@ const m = require("./exporter"); ->m : typeof m ->require("./exporter") : typeof m -+>m : any -+>require("./exporter") : any ++>m : typeof import("exporter") ++>require("./exporter") : typeof import("exporter") >require : any >"./exporter" : "./exporter" @@ -19,13 +19,13 @@ ->m.default : { (): void; memberName: "thing"; } ->m : typeof m ->default : { (): void; memberName: "thing"; } -+>module.exports = m.default : any -+>module.exports : any -+>module : any -+>exports : any -+>m.default : any -+>m : any -+>default : any ++>module.exports = m.default : () => void ++>module.exports : () => void ++>module : { validate: () => void; } ++>exports : () => void ++>m.default : () => void ++>m : typeof import("exporter") ++>default : () => void module.exports.memberName = "thing"; >module.exports.memberName = "thing" : "thing" @@ -35,9 +35,9 @@ ->exports : typeof m.default ->memberName : "thing" +>module.exports.memberName : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : () => void ++>module : { validate: () => void; } ++>exports : () => void +>memberName : any >"thing" : "thing" diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsDocCommentsOnConsts.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsDocCommentsOnConsts.errors.txt.diff deleted file mode 100644 index 6aa6250920..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsDocCommentsOnConsts.errors.txt.diff +++ /dev/null @@ -1,26 +0,0 @@ ---- old.jsDeclarationsDocCommentsOnConsts.errors.txt -+++ new.jsDeclarationsDocCommentsOnConsts.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index1.js(15,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== index1.js (1 errors) ==== -+ /** -+ * const doc comment -+ */ -+ const x = (a) => { -+ return ''; -+ }; -+ -+ /** -+ * function doc comment -+ */ -+ function b() { -+ return 0; -+ } -+ -+ module.exports = {x, b} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsDocCommentsOnConsts.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsDocCommentsOnConsts.types.diff index 965f20ba83..320db1ae2e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsDocCommentsOnConsts.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsDocCommentsOnConsts.types.diff @@ -9,9 +9,9 @@ ->module : { exports: typeof module.exports; } ->exports : typeof module.exports +>module.exports = {x, b} : { x: (a: any) => string; b: () => number; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { x: (a: any) => string; b: () => number; } ++>module : { export=: { x: (a: any) => string; b: () => number; }; } ++>exports : { x: (a: any) => string; b: () => number; } >{x, b} : { x: (a: any) => string; b: () => number; } >x : (a: any) => string >b : () => number diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpression.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpression.errors.txt.diff index 533ce432b5..288a40cae0 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpression.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpression.errors.txt.diff @@ -3,14 +3,11 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(6,14): error TS2339: Property 't' does not exist on type 'Thing'. + + -+==== index.js (2 errors) ==== ++==== index.js (1 errors) ==== + module.exports = class Thing { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + /** + * @param {number} p + */ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpression.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpression.types.diff index c83a1e0bdf..3153f160e4 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpression.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpression.types.diff @@ -11,9 +11,9 @@ ->class Thing { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof import("index") ->Thing : typeof import("index") +>module.exports = class Thing { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof Thing -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof Thing ++>module : { Thing: typeof Thing; } ++>exports : typeof Thing +>class Thing { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof Thing +>Thing : typeof Thing diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.errors.txt.diff index aba6d55556..0e5f5cccca 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.errors.txt.diff @@ -3,14 +3,11 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(6,14): error TS2339: Property 't' does not exist on type 'exports'. + + -+==== index.js (2 errors) ==== ++==== index.js (1 errors) ==== + module.exports = class { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + /** + * @param {number} p + */ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.types.diff index 2278b6ed71..2d6648eddc 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymous.types.diff @@ -10,9 +10,9 @@ ->exports : typeof import("index") ->class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof import("index") +>module.exports = class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof exports -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof exports ++>module : { exports: typeof exports; } ++>exports : typeof exports +>class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof exports /** diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.errors.txt.diff index 91d1615e8c..612c1b8ec9 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.errors.txt.diff @@ -3,35 +3,39 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +index.js(6,14): error TS2339: Property 't' does not exist on type 'exports'. -+index.js(9,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(9,16): error TS2339: Property 'Sub' does not exist on type 'typeof exports'. +index.js(11,14): error TS2339: Property 'instance' does not exist on type 'Sub'. -+index.js(11,29): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + -+==== index.js (5 errors) ==== ++==== index.js (4 errors) ==== + module.exports = class { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~ + /** ++ ~~~~~~~ + * @param {number} p ++ ~~~~~~~~~~~~~~~~~~~~~~~~ + */ ++ ~~~~~~~ + constructor(p) { ++ ~~~~~~~~~~~~~~~~~~~~ + this.t = 12 + p; ++ ~~~~~~~~~~~~~~~~~~~~~~~~ + ~ +!!! error TS2339: Property 't' does not exist on type 'exports'. + } ++ ~~~~~ + } ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.Sub = class { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~ ++!!! error TS2339: Property 'Sub' does not exist on type 'typeof exports'. + constructor() { + this.instance = new module.exports(10); + ~~~~~~~~ +!!! error TS2339: Property 'instance' does not exist on type 'Sub'. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + } + } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.types.diff index 6472276902..8e8fe32d4f 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionAnonymousWithSub.types.diff @@ -10,9 +10,9 @@ ->exports : typeof import("index") ->class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof import("index") +>module.exports = class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof exports -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof exports ++>module : { exports: typeof exports; } ++>exports : typeof exports +>class { /** * @param {number} p */ constructor(p) { this.t = 12 + p; }} : typeof exports /** @@ -27,16 +27,16 @@ ->exports : typeof import("index") ->Sub : typeof Sub +>module.exports.Sub : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof exports ++>module : { exports: typeof exports; } ++>exports : typeof exports +>Sub : any >class { constructor() { this.instance = new module.exports(10); }} : typeof Sub constructor() { this.instance = new module.exports(10); ->this.instance = new module.exports(10) : import("index") -+>this.instance = new module.exports(10) : any ++>this.instance = new module.exports(10) : exports >this.instance : any >this : this >instance : any @@ -44,10 +44,10 @@ ->module.exports : typeof import("index") ->module : { exports: typeof import("index"); } ->exports : typeof import("index") -+>new module.exports(10) : any -+>module.exports : any -+>module : any -+>exports : any ++>new module.exports(10) : exports ++>module.exports : typeof exports ++>module : { exports: typeof exports; } ++>exports : typeof exports >10 : 10 } } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.errors.txt.diff index b7217e728a..276eb00680 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.errors.txt.diff @@ -3,9 +3,9 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+index.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(7,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +index.js(9,14): error TS2339: Property 'x' does not exist on type 'Q'. -+index.js(12,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(12,16): error TS2339: Property 'Another' does not exist on type 'typeof Q'. + + +==== index.js (3 errors) ==== @@ -16,15 +16,19 @@ + x = 42; + } + module.exports = class Q { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~ + constructor() { ++ ~~~~~~~~~~~~~~~~~~~ + this.x = new A(); ++ ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~ +!!! error TS2339: Property 'x' does not exist on type 'Q'. + } ++ ~~~~~ + } ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.Another = Q; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~ ++!!! error TS2339: Property 'Another' does not exist on type 'typeof Q'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.types.diff index ab888aec42..f92d4274cb 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassExpressionShadowing.types.diff @@ -11,9 +11,9 @@ ->class Q { constructor() { this.x = new A(); }} : typeof import("index") ->Q : typeof import("index") +>module.exports = class Q { constructor() { this.x = new A(); }} : typeof Q -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof Q ++>module : { Q: typeof Q; } ++>exports : typeof Q +>class Q { constructor() { this.x = new A(); }} : typeof Q +>Q : typeof Q @@ -29,9 +29,9 @@ ->exports : typeof import("index") ->Another : typeof Q +>module.exports.Another : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof Q ++>module : { Q: typeof Q; } ++>exports : typeof Q +>Another : any >Q : typeof Q diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance1.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance1.errors.txt.diff deleted file mode 100644 index 85f0428786..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance1.errors.txt.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.jsDeclarationsExportAssignedClassInstance1.errors.txt -+++ new.jsDeclarationsExportAssignedClassInstance1.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== index.js (1 errors) ==== -+ class Foo {} -+ -+ module.exports = new Foo(); -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance1.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance1.types.diff index 37a88825d4..b88af68313 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance1.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance1.types.diff @@ -1,15 +1,11 @@ --- old.jsDeclarationsExportAssignedClassInstance1.types +++ new.jsDeclarationsExportAssignedClassInstance1.types -@@= skipped -5, +5 lines =@@ - +@@= skipped -6, +6 lines =@@ module.exports = new Foo(); >module.exports = new Foo() : Foo -->module.exports : Foo + >module.exports : Foo ->module : { exports: Foo; } -->exports : Foo -+>module.exports : any -+>module : any -+>exports : any ++>module : { export=: Foo; } + >exports : Foo >new Foo() : Foo >Foo : typeof Foo - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance2.errors.txt.diff deleted file mode 100644 index ebda0005aa..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance2.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.jsDeclarationsExportAssignedClassInstance2.errors.txt -+++ new.jsDeclarationsExportAssignedClassInstance2.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== index.js (1 errors) ==== -+ class Foo { -+ static stat = 10; -+ member = 10; -+ } -+ -+ module.exports = new Foo(); -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance2.types.diff index 5aa3d9fa4c..f99202e7a7 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance2.types.diff @@ -1,15 +1,11 @@ --- old.jsDeclarationsExportAssignedClassInstance2.types +++ new.jsDeclarationsExportAssignedClassInstance2.types -@@= skipped -14, +14 lines =@@ - +@@= skipped -15, +15 lines =@@ module.exports = new Foo(); >module.exports = new Foo() : Foo -->module.exports : Foo + >module.exports : Foo ->module : { exports: Foo; } -->exports : Foo -+>module.exports : any -+>module : any -+>exports : any ++>module : { export=: Foo; } + >exports : Foo >new Foo() : Foo >Foo : typeof Foo - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance3.errors.txt.diff index e043e58a57..8199f3f765 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance3.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance3.errors.txt.diff @@ -3,8 +3,8 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+index.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(8,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++index.js(8,16): error TS2339: Property 'additional' does not exist on type 'Foo'. + + +==== index.js (2 errors) ==== @@ -14,9 +14,9 @@ + } + + module.exports = new Foo(); -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + + module.exports.additional = 20; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~ ++!!! error TS2339: Property 'additional' does not exist on type 'Foo'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance3.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance3.types.diff index 063390b207..0a8b5d2761 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedClassInstance3.types.diff @@ -9,9 +9,9 @@ ->module : { exports: { member: number; additional: 20; }; } ->exports : { member: number; additional: 20; } +>module.exports = new Foo() : Foo -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : Foo ++>module : { export=: Foo; } ++>exports : Foo >new Foo() : Foo >Foo : typeof Foo @@ -23,9 +23,9 @@ ->exports : { member: number; additional: 20; } ->additional : 20 +>module.exports.additional : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : Foo ++>module : { export=: Foo; } ++>exports : Foo +>additional : any >20 : 20 diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunction.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunction.errors.txt.diff deleted file mode 100644 index 5078a845a9..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunction.errors.txt.diff +++ /dev/null @@ -1,23 +0,0 @@ ---- old.jsDeclarationsExportAssignedConstructorFunction.errors.txt -+++ new.jsDeclarationsExportAssignedConstructorFunction.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+jsDeclarationsExportAssignedConstructorFunction.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+jsDeclarationsExportAssignedConstructorFunction.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== jsDeclarationsExportAssignedConstructorFunction.js (2 errors) ==== -+ /** @constructor */ -+ module.exports.MyClass = function() { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ this.x = 1 -+ } -+ module.exports.MyClass.prototype = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ a: function() { -+ } -+ } -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunction.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunction.types.diff index e943d7c957..0ad8216533 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunction.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunction.types.diff @@ -13,9 +13,9 @@ ->function() { this.x = 1} : typeof MyClass +>module.exports.MyClass = function() { this.x = 1} : () => void +>module.exports.MyClass : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("jsDeclarationsExportAssignedConstructorFunction") ++>module : { "jsDeclarationsExportAssignedConstructorFunction": typeof import("jsDeclarationsExportAssignedConstructorFunction"); } ++>exports : typeof import("jsDeclarationsExportAssignedConstructorFunction") +>MyClass : any +>function() { this.x = 1} : () => void @@ -38,9 +38,9 @@ ->prototype : { a: () => void; } +>module.exports.MyClass.prototype : any +>module.exports.MyClass : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("jsDeclarationsExportAssignedConstructorFunction") ++>module : { "jsDeclarationsExportAssignedConstructorFunction": typeof import("jsDeclarationsExportAssignedConstructorFunction"); } ++>exports : typeof import("jsDeclarationsExportAssignedConstructorFunction") +>MyClass : any +>prototype : any >{ a: function() { }} : { a: () => void; } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.errors.txt.diff index 9980192d47..52c8a09e67 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.errors.txt.diff @@ -3,33 +3,33 @@ @@= skipped -0, +0 lines =@@ -jsDeclarationsExportAssignedConstructorFunctionWithSub.js(4,1): error TS9005: Declaration emit for this file requires using private name 'Sub'. An explicit type annotation may unblock declaration emit. -jsDeclarationsExportAssignedConstructorFunctionWithSub.js(4,1): error TS9005: Declaration emit for this file requires using private name 'exports'. An explicit type annotation may unblock declaration emit. -+jsDeclarationsExportAssignedConstructorFunctionWithSub.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+jsDeclarationsExportAssignedConstructorFunctionWithSub.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+jsDeclarationsExportAssignedConstructorFunctionWithSub.js(8,25): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+jsDeclarationsExportAssignedConstructorFunctionWithSub.js(10,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++jsDeclarationsExportAssignedConstructorFunctionWithSub.js(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++jsDeclarationsExportAssignedConstructorFunctionWithSub.js(7,16): error TS2339: Property 'Sub' does not exist on type '(p: any) => void'. ++jsDeclarationsExportAssignedConstructorFunctionWithSub.js(10,16): error TS2339: Property 'Sub' does not exist on type '(p: any) => void'. -==== jsDeclarationsExportAssignedConstructorFunctionWithSub.js (2 errors) ==== -+==== jsDeclarationsExportAssignedConstructorFunctionWithSub.js (4 errors) ==== ++==== jsDeclarationsExportAssignedConstructorFunctionWithSub.js (3 errors) ==== /** * @param {number} p */ module.exports = function (p) { - ~~~~~~ +- ~~~~~~ -!!! error TS9005: Declaration emit for this file requires using private name 'Sub'. An explicit type annotation may unblock declaration emit. - ~~~~~~ -!!! error TS9005: Declaration emit for this file requires using private name 'exports'. An explicit type annotation may unblock declaration emit. -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ this.t = 12 + p; ++ ~~~~~~~~~~~~~~~~~~~~ } ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. module.exports.Sub = function() { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~ ++!!! error TS2339: Property 'Sub' does not exist on type '(p: any) => void'. this.instance = new module.exports(10); -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. } module.exports.Sub.prototype = { } -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~ ++!!! error TS2339: Property 'Sub' does not exist on type '(p: any) => void'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.types.diff index d61394c9fd..3e1ab324e8 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedConstructorFunctionWithSub.types.diff @@ -11,9 +11,9 @@ ->function (p) { this.t = 12 + p;} : typeof exports ->p : number +>module.exports = function (p) { this.t = 12 + p;} : (p: any) => void -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : (p: any) => void ++>module : { export=: (p: any) => void; } ++>exports : (p: any) => void +>function (p) { this.t = 12 + p;} : (p: any) => void +>p : any @@ -40,9 +40,9 @@ ->function() { this.instance = new module.exports(10);} : typeof Sub +>module.exports.Sub = function() { this.instance = new module.exports(10);} : () => void +>module.exports.Sub : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : (p: any) => void ++>module : { export=: (p: any) => void; } ++>exports : (p: any) => void +>Sub : any +>function() { this.instance = new module.exports(10);} : () => void @@ -58,9 +58,9 @@ ->module : { exports: { (p: number): void; new (p: number): exports; Sub: typeof Sub; }; } ->exports : { (p: number): void; new (p: number): exports; Sub: typeof Sub; } +>new module.exports(10) : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : (p: any) => void ++>module : { export=: (p: any) => void; } ++>exports : (p: any) => void >10 : 10 } module.exports.Sub.prototype = { } @@ -74,9 +74,9 @@ ->prototype : {} +>module.exports.Sub.prototype : any +>module.exports.Sub : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : (p: any) => void ++>module : { export=: (p: any) => void; } ++>exports : (p: any) => void +>Sub : any +>prototype : any >{ } : {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedVisibility.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedVisibility.errors.txt.diff index 11f95ac1e2..2aec7c2868 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedVisibility.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedVisibility.errors.txt.diff @@ -3,15 +3,12 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+index.js(1,13): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(5,14): error TS2339: Property 'usage' does not exist on type 'Container'. -+index.js(9,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++obj.js(3,14): error TS2339: Property 'x' does not exist on type 'Obj'. + + -+==== index.js (3 errors) ==== ++==== index.js (1 errors) ==== + const Obj = require("./obj"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + class Container { + constructor() { @@ -22,11 +19,11 @@ + } + + module.exports = Container; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+==== obj.js (0 errors) ==== ++==== obj.js (1 errors) ==== + module.exports = class Obj { + constructor() { + this.x = 12; ++ ~ ++!!! error TS2339: Property 'x' does not exist on type 'Obj'. + } + } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedVisibility.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedVisibility.types.diff index feaad54778..3831550e5e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedVisibility.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignedVisibility.types.diff @@ -1,57 +1,28 @@ --- old.jsDeclarationsExportAssignedVisibility.types +++ new.jsDeclarationsExportAssignedVisibility.types -@@= skipped -1, +1 lines =@@ - - === index.js === - const Obj = require("./obj"); -->Obj : typeof Obj -->require("./obj") : typeof Obj -+>Obj : any -+>require("./obj") : any - >require : any - >"./obj" : "./obj" - -@@= skipped -10, +10 lines =@@ - - constructor() { - this.usage = new Obj(); -->this.usage = new Obj() : Obj -+>this.usage = new Obj() : any - >this.usage : any - >this : this - >usage : any -->new Obj() : Obj -->Obj : typeof Obj -+>new Obj() : any -+>Obj : any - } - } - +@@= skipped -23, +23 lines =@@ module.exports = Container; >module.exports = Container : typeof Container -->module.exports : typeof Container + >module.exports : typeof Container ->module : { exports: typeof Container; } -->exports : typeof Container -+>module.exports : any -+>module : any -+>exports : any ++>module : { Container: typeof Container; } + >exports : typeof Container >Container : typeof Container --=== obj.js === --module.exports = class Obj { + === obj.js === + module.exports = class Obj { ->module.exports = class Obj { constructor() { this.x = 12; }} : typeof import("obj") ->module.exports : typeof import("obj") ->module : { exports: typeof import("obj"); } ->exports : typeof import("obj") ->class Obj { constructor() { this.x = 12; }} : typeof import("obj") ->Obj : typeof import("obj") -- -- constructor() { -- this.x = 12; -->this.x = 12 : 12 -->this.x : any -->this : this -->x : any -->12 : 12 -- } --} ++>module.exports = class Obj { constructor() { this.x = 12; }} : typeof Obj ++>module.exports : typeof Obj ++>module : { Obj: typeof Obj; } ++>exports : typeof Obj ++>class Obj { constructor() { this.x = 12; }} : typeof Obj ++>Obj : typeof Obj + + constructor() { + this.x = 12; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.errors.txt.diff index a7221b8278..71c9109f1d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.errors.txt.diff @@ -3,8 +3,8 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(12,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(5,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++index.js(12,16): error TS2339: Property 'Strings' does not exist on type '{ thing: string; also: string; desc: { item: string; }; }'. + + +==== index.js (2 errors) ==== @@ -13,15 +13,21 @@ + b: "B" + }; + module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~ + thing: "ok", ++ ~~~~~~~~~~~~~~~~ + also: "ok", ++ ~~~~~~~~~~~~~~~ + desc: { ++ ~~~~~~~~~~~ + item: "ok" ++ ~~~~~~~~~~~~~~~~~~ + } ++ ~~~~~ + }; ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.Strings = Strings; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~ ++!!! error TS2339: Property 'Strings' does not exist on type '{ thing: string; also: string; desc: { item: string; }; }'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.types.diff index b181f77542..e5ba1f0999 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentExpressionPlusSecondary.types.diff @@ -9,9 +9,9 @@ ->module : { exports: { thing: string; also: string; desc: { item: string; }; Strings: { a: string; b: string; }; }; } ->exports : { thing: string; also: string; desc: { item: string; }; Strings: { a: string; b: string; }; } +>module.exports = { thing: "ok", also: "ok", desc: { item: "ok" }} : { thing: string; also: string; desc: { item: string; }; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { thing: string; also: string; desc: { item: string; }; } ++>module : { export=: { thing: string; also: string; desc: { item: string; }; }; } ++>exports : { thing: string; also: string; desc: { item: string; }; } >{ thing: "ok", also: "ok", desc: { item: "ok" }} : { thing: string; also: string; desc: { item: string; }; } thing: "ok", @@ -24,9 +24,9 @@ ->module : { exports: { thing: string; also: string; desc: { item: string; }; Strings: { a: string; b: string; }; }; } ->exports : { thing: string; also: string; desc: { item: string; }; Strings: { a: string; b: string; }; } +>module.exports.Strings : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { thing: string; also: string; desc: { item: string; }; } ++>module : { export=: { thing: string; also: string; desc: { item: string; }; }; } ++>exports : { thing: string; also: string; desc: { item: string; }; } +>Strings : any >Strings : { a: string; b: string; } ->Strings : { a: string; b: string; } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentWithKeywordName.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentWithKeywordName.errors.txt.diff deleted file mode 100644 index fb8e97ff58..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentWithKeywordName.errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.jsDeclarationsExportAssignmentWithKeywordName.errors.txt -+++ new.jsDeclarationsExportAssignmentWithKeywordName.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== index.js (1 errors) ==== -+ var x = 12; -+ module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ extends: 'base', -+ more: { -+ others: ['strs'] -+ }, -+ x -+ }; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentWithKeywordName.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentWithKeywordName.types.diff index 942b22c27a..7e54a23878 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentWithKeywordName.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportAssignmentWithKeywordName.types.diff @@ -1,15 +1,11 @@ --- old.jsDeclarationsExportAssignmentWithKeywordName.types +++ new.jsDeclarationsExportAssignmentWithKeywordName.types -@@= skipped -6, +6 lines =@@ - +@@= skipped -7, +7 lines =@@ module.exports = { >module.exports = { extends: 'base', more: { others: ['strs'] }, x} : { extends: string; more: { others: string[]; }; x: number; } -->module.exports : { extends: string; more: { others: string[]; }; x: number; } + >module.exports : { extends: string; more: { others: string[]; }; x: number; } ->module : { exports: { extends: string; more: { others: string[]; }; x: number; }; } -->exports : { extends: string; more: { others: string[]; }; x: number; } -+>module.exports : any -+>module : any -+>exports : any ++>module : { export=: { extends: string; more: { others: string[]; }; x: number; }; } + >exports : { extends: string; more: { others: string[]; }; x: number; } >{ extends: 'base', more: { others: ['strs'] }, x} : { extends: string; more: { others: string[]; }; x: number; } - extends: 'base', diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportDoubleAssignmentInClosure.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportDoubleAssignmentInClosure.types.diff index d48a7d5112..49419545ea 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportDoubleAssignmentInClosure.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportDoubleAssignmentInClosure.types.diff @@ -9,9 +9,9 @@ ->module : { exports: { (o: any): any; methods: () => void; }; } ->exports : { (o: any): any; methods: () => void; } +>module.exports = exports = function (o) { return (o == null) ? create(base) : defineProperties(Object(o), descriptors); } : (o: any) => any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : (o: any) => any ++>module : { export=: (o: any) => any; } ++>exports : (o: any) => any >exports = function (o) { return (o == null) ? create(base) : defineProperties(Object(o), descriptors); } : (o: any) => any >exports : any >function (o) { return (o == null) ? create(base) : defineProperties(Object(o), descriptors); } : (o: any) => any @@ -41,3 +41,12 @@ }; const m = function () { +@@= skipped -34, +34 lines =@@ + exports.methods = m; + >exports.methods = m : () => void + >exports.methods : any +->exports : any ++>exports : typeof import("index") + >methods : any + >m : () => void + } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportForms.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportForms.errors.txt.diff deleted file mode 100644 index 8dda047344..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportForms.errors.txt.diff +++ /dev/null @@ -1,106 +0,0 @@ ---- old.jsDeclarationsExportForms.errors.txt -+++ new.jsDeclarationsExportForms.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+cjs.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'ns'. -+cjs.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+cjs.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+cjs2.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'ns'. -+cjs2.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+cjs2.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+cjs3.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'ns'. -+cjs3.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+cjs3.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+cjs4.js(1,7): error TS2451: Cannot redeclare block-scoped variable 'ns'. -+cjs4.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+cjs4.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== cls.js (0 errors) ==== -+ export class Foo {} -+ -+==== func.js (0 errors) ==== -+ export function func() {} -+ -+==== bar.js (0 errors) ==== -+ export * from "./cls"; -+ -+==== bar2.js (0 errors) ==== -+ export * from "./func"; -+ export * from "./cls"; -+ -+==== baz.js (0 errors) ==== -+ import {Foo} from "./cls"; -+ export {Foo}; -+ -+==== bat.js (0 errors) ==== -+ import * as ns from "./cls"; -+ export default ns; -+ -+==== ban.js (0 errors) ==== -+ import * as ns from "./cls"; -+ export {ns}; -+ -+==== bol.js (0 errors) ==== -+ import * as ns from "./cls"; -+ export { ns as classContainer }; -+ -+==== cjs.js (3 errors) ==== -+ const ns = require("./cls"); -+ ~~ -+!!! error TS2451: Cannot redeclare block-scoped variable 'ns'. -+!!! related TS6203 cjs2.js:1:7: 'ns' was also declared here. -+!!! related TS6203 cjs3.js:1:7: 'ns' was also declared here. -+!!! related TS6203 cjs4.js:1:7: 'ns' was also declared here. -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ module.exports = { ns }; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+==== cjs2.js (3 errors) ==== -+ const ns = require("./cls"); -+ ~~ -+!!! error TS2451: Cannot redeclare block-scoped variable 'ns'. -+!!! related TS6203 cjs.js:1:7: 'ns' was also declared here. -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ module.exports = ns; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+==== cjs3.js (3 errors) ==== -+ const ns = require("./cls"); -+ ~~ -+!!! error TS2451: Cannot redeclare block-scoped variable 'ns'. -+!!! related TS6203 cjs.js:1:7: 'ns' was also declared here. -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ module.exports.ns = ns; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+==== cjs4.js (3 errors) ==== -+ const ns = require("./cls"); -+ ~~ -+!!! error TS2451: Cannot redeclare block-scoped variable 'ns'. -+!!! related TS6203 cjs.js:1:7: 'ns' was also declared here. -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ module.exports.names = ns; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+==== includeAll.js (0 errors) ==== -+ import "./cjs4"; -+ import "./cjs3"; -+ import "./cjs2"; -+ import "./cjs"; -+ import "./bol"; -+ import "./ban"; -+ import "./bat"; -+ import "./baz"; -+ import "./bar"; -+ import "./bar2"; -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportForms.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportForms.types.diff index fbb1d5de87..b930780c3b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportForms.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportForms.types.diff @@ -35,8 +35,8 @@ const ns = require("./cls"); ->ns : typeof ns ->require("./cls") : typeof ns -+>ns : any -+>require("./cls") : any ++>ns : typeof import("cls") ++>require("./cls") : typeof import("cls") >require : any >"./cls" : "./cls" @@ -47,19 +47,19 @@ ->exports : typeof module.exports ->{ ns } : { ns: typeof ns; } ->ns : typeof ns -+>module.exports = { ns } : { ns: any; } -+>module.exports : any -+>module : any -+>exports : any -+>{ ns } : { ns: any; } -+>ns : any ++>module.exports = { ns } : { ns: typeof import("cls"); } ++>module.exports : { ns: typeof import("cls"); } ++>module : { export=: { ns: typeof import("cls"); }; } ++>exports : { ns: typeof import("cls"); } ++>{ ns } : { ns: typeof import("cls"); } ++>ns : typeof import("cls") === cjs2.js === const ns = require("./cls"); ->ns : typeof ns ->require("./cls") : typeof ns -+>ns : any -+>require("./cls") : any ++>ns : typeof import("cls") ++>require("./cls") : typeof import("cls") >require : any >"./cls" : "./cls" @@ -69,18 +69,18 @@ ->module : { exports: typeof ns; } ->exports : typeof ns ->ns : typeof ns -+>module.exports = ns : any -+>module.exports : any -+>module : any -+>exports : any -+>ns : any ++>module.exports = ns : typeof import("cls") ++>module.exports : typeof import("cls") ++>module : { "cls": typeof import("cls"); } ++>exports : typeof import("cls") ++>ns : typeof import("cls") === cjs3.js === const ns = require("./cls"); ->ns : typeof ns ->require("./cls") : typeof ns -+>ns : any -+>require("./cls") : any ++>ns : typeof import("cls") ++>require("./cls") : typeof import("cls") >require : any >"./cls" : "./cls" @@ -92,20 +92,20 @@ ->exports : typeof module.exports ->ns : typeof ns ->ns : typeof ns -+>module.exports.ns = ns : any -+>module.exports.ns : any -+>module.exports : any -+>module : any -+>exports : any -+>ns : any -+>ns : any ++>module.exports.ns = ns : typeof import("cls") ++>module.exports.ns : typeof import("cls") ++>module.exports : typeof import("cjs3") ++>module : { "cjs3": typeof import("cjs3"); } ++>exports : typeof import("cjs3") ++>ns : typeof import("cls") ++>ns : typeof import("cls") === cjs4.js === const ns = require("./cls"); ->ns : typeof ns ->require("./cls") : typeof ns -+>ns : any -+>require("./cls") : any ++>ns : typeof import("cls") ++>require("./cls") : typeof import("cls") >require : any >"./cls" : "./cls" @@ -117,13 +117,13 @@ ->exports : typeof module.exports ->names : typeof ns ->ns : typeof ns -+>module.exports.names = ns : any -+>module.exports.names : any -+>module.exports : any -+>module : any -+>exports : any -+>names : any -+>ns : any ++>module.exports.names = ns : typeof import("cls") ++>module.exports.names : typeof import("cls") ++>module.exports : typeof import("cjs4") ++>module : { "cjs4": typeof import("cjs4"); } ++>exports : typeof import("cjs4") ++>names : typeof import("cls") ++>ns : typeof import("cls") === includeAll.js === diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportFormsErr.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportFormsErr.errors.txt.diff index 0018d14269..bec8338bd0 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportFormsErr.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportFormsErr.errors.txt.diff @@ -3,10 +3,10 @@ @@= skipped -0, +0 lines =@@ -bar.js(1,1): error TS8002: 'import ... =' can only be used in TypeScript files. -bar.js(2,1): error TS8003: 'export =' can only be used in TypeScript files. - bin.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-bin.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. globalNs.js(2,1): error TS1315: Global module exports may only appear in declaration files. -@@= skipped -6, +4 lines =@@ + ==== cls.js (0 errors) ==== export class Foo {} @@ -19,5 +19,12 @@ - ~~~~~~~~~~~~ -!!! error TS8003: 'export =' can only be used in TypeScript files. - ==== bin.js (1 errors) ==== +-==== bin.js (1 errors) ==== ++==== bin.js (0 errors) ==== import * as ns from "./cls"; + module.exports = ns; // We refuse to bind cjs module exports assignments in the same file we find an import in +- ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + ==== globalNs.js (1 errors) ==== + export * from "./cls"; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportFormsErr.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportFormsErr.types.diff index a64148fdc6..6f997b9cdc 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportFormsErr.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportFormsErr.types.diff @@ -18,11 +18,14 @@ module.exports = ns; // We refuse to bind cjs module exports assignments in the same file we find an import in ->module.exports = ns : any -+>module.exports = ns : typeof import("cls") - >module.exports : any - >module : any - >exports : any +->module.exports : any +->module : any +->exports : any ->ns : typeof ns ++>module.exports = ns : typeof import("cls") ++>module.exports : typeof import("cls") ++>module : { "cls": typeof import("cls"); } ++>exports : typeof import("cls") +>ns : typeof import("cls") === globalNs.js === diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportSubAssignments.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportSubAssignments.errors.txt.diff index 18233c49ff..4f0c0ca156 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportSubAssignments.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportSubAssignments.errors.txt.diff @@ -3,8 +3,8 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+cls.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+cls.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++cls.js(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++cls.js(7,16): error TS2339: Property 'Strings' does not exist on type 'typeof Foo'. + + +==== cls.js (2 errors) ==== @@ -14,8 +14,8 @@ + }; + class Foo {} + module.exports = Foo; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.Strings = Strings; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~ ++!!! error TS2339: Property 'Strings' does not exist on type 'typeof Foo'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportSubAssignments.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportSubAssignments.types.diff index ec8b143fce..1289987dca 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportSubAssignments.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportSubAssignments.types.diff @@ -1,27 +1,22 @@ --- old.jsDeclarationsExportSubAssignments.types +++ new.jsDeclarationsExportSubAssignments.types -@@= skipped -18, +18 lines =@@ - +@@= skipped -19, +19 lines =@@ module.exports = Foo; >module.exports = Foo : typeof Foo -->module.exports : typeof Foo + >module.exports : typeof Foo ->module : { exports: typeof Foo; } -->exports : typeof Foo -+>module.exports : any -+>module : any -+>exports : any ++>module : { Foo: typeof Foo; } + >exports : typeof Foo >Foo : typeof Foo module.exports.Strings = Strings; >module.exports.Strings = Strings : { a: string; b: string; } ->module.exports.Strings : { a: string; b: string; } -->module.exports : typeof Foo -->module : { exports: typeof Foo; } -->exports : typeof Foo +>module.exports.Strings : any -+>module.exports : any -+>module : any -+>exports : any + >module.exports : typeof Foo +->module : { exports: typeof Foo; } ++>module : { Foo: typeof Foo; } + >exports : typeof Foo +>Strings : any >Strings : { a: string; b: string; } ->Strings : { a: string; b: string; } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportedClassAliases.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportedClassAliases.errors.txt.diff deleted file mode 100644 index 04b7de5529..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportedClassAliases.errors.txt.diff +++ /dev/null @@ -1,31 +0,0 @@ ---- old.jsDeclarationsExportedClassAliases.errors.txt -+++ new.jsDeclarationsExportedClassAliases.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+utils/index.js(2,16): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+utils/index.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== utils/index.js (2 errors) ==== -+ // issue arises here on compilation -+ const errors = require("./errors"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ errors -+ }; -+==== utils/errors.js (0 errors) ==== -+ class FancyError extends Error { -+ constructor(status) { -+ super(`error with status ${status}`); -+ } -+ } -+ -+ module.exports = { -+ FancyError -+ }; -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportedClassAliases.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportedClassAliases.types.diff index 71b6237e8b..95c75f6de6 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportedClassAliases.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsExportedClassAliases.types.diff @@ -6,8 +6,8 @@ const errors = require("./errors"); ->errors : typeof errors ->require("./errors") : typeof errors -+>errors : any -+>require("./errors") : any ++>errors : { FancyError: typeof FancyError; } ++>require("./errors") : { FancyError: typeof FancyError; } >require : any >"./errors" : "./errors" @@ -17,42 +17,30 @@ ->module : { exports: typeof module.exports; } ->exports : typeof module.exports ->{ errors} : { errors: typeof errors; } -+>module.exports = { errors} : { errors: any; } -+>module.exports : any -+>module : any -+>exports : any -+>{ errors} : { errors: any; } ++>module.exports = { errors} : { errors: { FancyError: typeof FancyError; }; } ++>module.exports : { errors: { FancyError: typeof FancyError; }; } ++>module : { export=: { errors: { FancyError: typeof FancyError; }; }; } ++>exports : { errors: { FancyError: typeof FancyError; }; } ++>{ errors} : { errors: { FancyError: typeof FancyError; }; } errors ->errors : typeof errors -+>errors : any ++>errors : { FancyError: typeof FancyError; } }; --=== utils/errors.js === --class FancyError extends Error { -->FancyError : FancyError -->Error : Error -- -- constructor(status) { -->status : any -- -- super(`error with status ${status}`); -->super(`error with status ${status}`) : void -->super : ErrorConstructor -->`error with status ${status}` : string -->status : any -- } --} -- --module.exports = { + === utils/errors.js === +@@= skipped -33, +33 lines =@@ + } + + module.exports = { ->module.exports = { FancyError} : typeof module.exports ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->{ FancyError} : { FancyError: typeof FancyError; } -- -- FancyError -->FancyError : typeof FancyError -- --}; -- ++>module.exports = { FancyError} : { FancyError: typeof FancyError; } ++>module.exports : { FancyError: typeof FancyError; } ++>module : { export=: { FancyError: typeof FancyError; }; } ++>exports : { FancyError: typeof FancyError; } + >{ FancyError} : { FancyError: typeof FancyError; } + + FancyError diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.errors.txt.diff index 6f27b694f5..2c1cb5b2a6 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.errors.txt.diff @@ -3,16 +3,16 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+context.js(4,21): error TS2306: File 'timer.js' is not a module. ++context.js(4,14): error TS1340: Module './timer' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./timer')'? +context.js(5,14): error TS1340: Module './hook' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./hook')'? ++context.js(6,31): error TS2694: Namespace 'Hook' has no exported member 'HookHandler'. +context.js(34,14): error TS2350: Only a void function can be called with the 'new' keyword. -+context.js(48,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++context.js(48,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +hook.js(2,20): error TS1340: Module './context' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./context')'? -+hook.js(10,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+timer.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++hook.js(10,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + -+==== timer.js (1 errors) ==== ++==== timer.js (0 errors) ==== + /** + * @param {number} timeout + */ @@ -20,8 +20,6 @@ + this.timeout = timeout; + } + module.exports = Timer; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +==== hook.js (2 errors) ==== + /** + * @typedef {(arg: import("./context")) => void} HookHandler @@ -35,20 +33,22 @@ + this.handle = handle; + } + module.exports = Hook; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + -+==== context.js (4 errors) ==== ++==== context.js (5 errors) ==== + /** + * Imports + * + * @typedef {import("./timer")} Timer -+ ~~~~~~~~~ -+!!! error TS2306: File 'timer.js' is not a module. ++ ~~~~~~~~~~~~~~~~~ ++!!! error TS1340: Module './timer' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./timer')'? + * @typedef {import("./hook")} Hook + ~~~~~~~~~~~~~~~~ +!!! error TS1340: Module './hook' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./hook')'? + * @typedef {import("./hook").HookHandler} HookHandler ++ ~~~~~~~~~~~ ++!!! error TS2694: Namespace 'Hook' has no exported member 'HookHandler'. + */ + + /** @@ -93,6 +93,6 @@ + } + } + module.exports = Context; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.types.diff index e0c212aa58..2f9e134bc7 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionClassesCjsExportAssignment.types.diff @@ -23,9 +23,9 @@ ->exports : typeof Timer ->Timer : typeof Timer +>module.exports = Timer : (timeout: number) => void -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : (timeout: number) => void ++>module : { Timer: (timeout: number) => void; } ++>exports : (timeout: number) => void +>Timer : (timeout: number) => void === hook.js === @@ -53,9 +53,9 @@ ->exports : typeof Hook ->Hook : typeof Hook +>module.exports = Hook : (handle: HookHandler) => void -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : (handle: HookHandler) => void ++>module : { Hook: (handle: HookHandler) => void; } ++>exports : (handle: HookHandler) => void +>Hook : (handle: HookHandler) => void === context.js === @@ -65,7 +65,7 @@ function Context(input) { ->Context : typeof Context -+>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } ++>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } >input : Input if (!(this instanceof Context)) { @@ -75,13 +75,13 @@ ->this : this ->Context : typeof Context +>this : any -+>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } ++>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } return new Context(input) ->new Context(input) : Context ->Context : typeof Context +>new Context(input) : any -+>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } ++>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } >input : Input } this.state = this.construct(input); @@ -107,11 +107,11 @@ ->Context : typeof Context ->prototype : { construct(input: Input, handle?: HookHandler | undefined): State; } ->{ /** * @param {Input} input * @param {HookHandler=} handle * @returns {State} */ construct(input, handle = () => void 0) { return input; }} : { construct(input: Input, handle?: HookHandler | undefined): State; } -+>Context.prototype = { /** * @param {Input} input * @param {HookHandler=} handle * @returns {State} */ construct(input, handle = () => void 0) { return input; }} : { construct: (input: Input, handle?: HookHandler) => State; } -+>Context.prototype : { construct: (input: Input, handle?: HookHandler) => State; } -+>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } -+>prototype : { construct: (input: Input, handle?: HookHandler) => State; } -+>{ /** * @param {Input} input * @param {HookHandler=} handle * @returns {State} */ construct(input, handle = () => void 0) { return input; }} : { construct: (input: Input, handle?: HookHandler) => State; } ++>Context.prototype = { /** * @param {Input} input * @param {HookHandler=} handle * @returns {State} */ construct(input, handle = () => void 0) { return input; }} : { construct: (input: Input, handle?: any) => State; } ++>Context.prototype : { construct: (input: Input, handle?: any) => State; } ++>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } ++>prototype : { construct: (input: Input, handle?: any) => State; } ++>{ /** * @param {Input} input * @param {HookHandler=} handle * @returns {State} */ construct(input, handle = () => void 0) { return input; }} : { construct: (input: Input, handle?: any) => State; } /** * @param {Input} input @@ -120,10 +120,10 @@ */ construct(input, handle = () => void 0) { ->construct : (input: Input, handle?: HookHandler | undefined) => State -+>construct : (input: Input, handle?: HookHandler) => State ++>construct : (input: Input, handle?: any) => State >input : Input ->handle : import("hook").HookHandler -+>handle : HookHandler ++>handle : any >() => void 0 : () => any >void 0 : undefined >0 : 0 @@ -136,9 +136,9 @@ ->module : { exports: { (input: Input): Context; new (input: Input): Context; prototype: { construct(input: Input, handle?: HookHandler | undefined): State; }; }; } ->exports : { (input: Input): Context; new (input: Input): Context; prototype: { construct(input: Input, handle?: HookHandler | undefined): State; }; } ->Context : typeof Context -+>module.exports = Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } -+>module.exports : any -+>module : any -+>exports : any -+>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: HookHandler) => State; }; } ++>module.exports = Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } ++>module.exports : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } ++>module : { Context: { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; }; } ++>exports : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } ++>Context : { (input: Input): any; prototype: { construct: (input: Input, handle?: any) => State; }; } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionPrototypeStatic.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionPrototypeStatic.errors.txt.diff deleted file mode 100644 index cec8e72a41..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionPrototypeStatic.errors.txt.diff +++ /dev/null @@ -1,24 +0,0 @@ ---- old.jsDeclarationsFunctionPrototypeStatic.errors.txt -+++ new.jsDeclarationsFunctionPrototypeStatic.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+source.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== source.js (1 errors) ==== -+ module.exports = MyClass; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ function MyClass() {} -+ MyClass.staticMethod = function() {} -+ MyClass.prototype.method = function() {} -+ MyClass.staticProperty = 123; -+ -+ /** -+ * Callback to be invoked when test execution is complete. -+ * -+ * @callback DoneCB -+ * @param {number} failures - Number of failures that occurred. -+ */ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionPrototypeStatic.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionPrototypeStatic.types.diff index ee19b83afd..da667dfdb2 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionPrototypeStatic.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionPrototypeStatic.types.diff @@ -10,9 +10,9 @@ ->exports : typeof MyClass ->MyClass : typeof MyClass +>module.exports = MyClass : { (): void; staticMethod: () => void; staticProperty: number; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { (): void; staticMethod: () => void; staticProperty: number; } ++>module : { MyClass: { (): void; staticMethod: () => void; staticProperty: number; }; } ++>exports : { (): void; staticMethod: () => void; staticProperty: number; } +>MyClass : { (): void; staticMethod: () => void; staticProperty: number; } function MyClass() {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.errors.txt.diff deleted file mode 100644 index b8f4707909..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.jsDeclarationsFunctionWithDefaultAssignedMember.errors.txt -+++ new.jsDeclarationsFunctionWithDefaultAssignedMember.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== index.js (1 errors) ==== -+ function foo() {} -+ -+ foo.foo = foo; -+ foo.default = foo; -+ module.exports = foo; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.types.diff index 4523130906..4e77a5275a 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionWithDefaultAssignedMember.types.diff @@ -38,8 +38,8 @@ ->exports : typeof foo ->foo : typeof foo +>module.exports = foo : { (): void; foo: ???; default: ???; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { (): void; foo: ???; default: ???; } ++>module : { foo: { (): void; foo: ???; default: ???; }; } ++>exports : { (): void; foo: ???; default: ???; } +>foo : { (): void; foo: ???; default: ???; } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionsCjs.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionsCjs.errors.txt.diff index 1d33520fdf..e4d0ce909f 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionsCjs.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionsCjs.errors.txt.diff @@ -3,46 +3,18 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+index.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(14,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(22,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(28,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(31,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(31,25): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(35,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(41,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +index.js(45,23): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(51,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(53,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(54,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(54,21): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(57,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(57,21): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(58,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + -+==== index.js (20 errors) ==== ++==== index.js (2 errors) ==== + module.exports.a = function a() {} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + module.exports.b = function b() {} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + module.exports.b.cat = "cat"; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + module.exports.c = function c() {} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + module.exports.c.Cls = class {} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + /** + * @param {number} a @@ -50,8 +22,6 @@ + * @return {string} + */ + module.exports.d = function d(a, b) { return /** @type {*} */(null); } -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + /** + * @template T,U @@ -60,23 +30,15 @@ + * @return {T & U} + */ + module.exports.e = function e(a, b) { return /** @type {*} */(null); } -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + /** + * @template T + * @param {T} a + */ + module.exports.f = function f(a) { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + return a; + } + module.exports.f.self = module.exports.f; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + /** + * @param {{x: string}} a @@ -89,8 +51,6 @@ + } + + module.exports.g = g; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + /** + * @param {{x: string}} a @@ -103,25 +63,11 @@ + } + + module.exports.h = hh; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + module.exports.i = function i() {} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + module.exports.ii = module.exports.i; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + // note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings + module.exports.jj = module.exports.j; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + module.exports.j = function j() {} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionsCjs.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionsCjs.types.diff index 9709f467ba..87abbd55ce 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionsCjs.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsFunctionsCjs.types.diff @@ -10,9 +10,9 @@ ->exports : typeof module.exports ->a : () => void +>module.exports.a : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>a : any >function a() {} : () => void >a : () => void @@ -28,9 +28,9 @@ ->b : { (): void; cat: string; } +>module.exports.b = function b() {} : () => void +>module.exports.b : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>b : any +>function b() {} : () => void +>b : () => void @@ -46,9 +46,9 @@ ->cat : string +>module.exports.b.cat : any +>module.exports.b : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>b : any +>cat : any >"cat" : "cat" @@ -64,9 +64,9 @@ ->c : { (): void; Cls: typeof Cls; } +>module.exports.c = function c() {} : () => void +>module.exports.c : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>c : any +>function c() {} : () => void +>c : () => void @@ -82,9 +82,9 @@ ->Cls : typeof Cls +>module.exports.c.Cls : any +>module.exports.c : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>c : any +>Cls : any >class {} : typeof Cls @@ -106,9 +106,9 @@ ->b : number +>module.exports.d = function d(a, b) { return /** @type {*} */(null); } : (a: any, b: any) => any +>module.exports.d : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>d : any +>function d(a, b) { return /** @type {*} */(null); } : (a: any, b: any) => any +>d : (a: any, b: any) => any @@ -135,9 +135,9 @@ ->b : U +>module.exports.e = function e(a, b) { return /** @type {*} */(null); } : (a: any, b: any) => any +>module.exports.e : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>e : any +>function e(a, b) { return /** @type {*} */(null); } : (a: any, b: any) => any +>e : (a: any, b: any) => any @@ -162,9 +162,9 @@ ->a : T +>module.exports.f = function f(a) { return a;} : (a: any) => any +>module.exports.f : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>f : any +>function f(a) { return a;} : (a: any) => any +>f : (a: any) => any @@ -191,15 +191,15 @@ +>module.exports.f.self = module.exports.f : any +>module.exports.f.self : any +>module.exports.f : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>f : any +>self : any +>module.exports.f : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>f : any /** @@ -238,11 +238,11 @@ ->g : (a: { x: string; }, b: { y: { (): void; cat: string; }; }) => void ->g : (a: { x: string; }, b: { y: { (): void; cat: string; }; }) => void +>module.exports.g = g : (a: { x: string; }, b: { y: any; }) => any -+>module.exports.g : any -+>module.exports : any -+>module : any -+>exports : any -+>g : any ++>module.exports.g : (a: { x: string; }, b: { y: any; }) => any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") ++>g : (a: { x: string; }, b: { y: any; }) => any +>g : (a: { x: string; }, b: { y: any; }) => any /** @@ -281,11 +281,11 @@ ->h : (a: { x: string; }, b: { y: { (): void; cat: string; }; }) => void ->hh : (a: { x: string; }, b: { y: { (): void; cat: string; }; }) => void +>module.exports.h = hh : (a: { x: string; }, b: { y: any; }) => any -+>module.exports.h : any -+>module.exports : any -+>module : any -+>exports : any -+>h : any ++>module.exports.h : (a: { x: string; }, b: { y: any; }) => any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") ++>h : (a: { x: string; }, b: { y: any; }) => any +>hh : (a: { x: string; }, b: { y: any; }) => any module.exports.i = function i() {} @@ -296,9 +296,9 @@ ->exports : typeof module.exports ->i : () => void +>module.exports.i : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>i : any >function i() {} : () => void >i : () => void @@ -317,14 +317,14 @@ ->i : () => void +>module.exports.ii = module.exports.i : any +>module.exports.ii : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>ii : any +>module.exports.i : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>i : any // note that this last one doesn't make much sense in cjs, since exports aren't hoisted bindings @@ -342,14 +342,14 @@ ->j : () => void +>module.exports.jj = module.exports.j : any +>module.exports.jj : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>jj : any +>module.exports.j : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>j : any module.exports.j = function j() {} @@ -360,9 +360,9 @@ ->exports : typeof module.exports ->j : () => void +>module.exports.j : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>j : any >function j() {} : () => void >j : () => void diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.errors.txt.diff index 0153236330..c567ce510a 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.errors.txt.diff @@ -3,17 +3,19 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+file2.js(1,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++file.js(4,11): error TS2315: Type 'Object' is not generic. ++file.js(10,51): error TS2300: Duplicate identifier 'myTypes'. ++file.js(13,13): error TS2300: Duplicate identifier 'myTypes'. ++file.js(18,15): error TS2702: 'myTypes' only refers to a type, but is being used as a namespace here. ++file.js(18,39): error TS2300: Duplicate identifier 'myTypes'. +file2.js(6,11): error TS2315: Type 'Object' is not generic. -+file2.js(12,23): error TS2503: Cannot find namespace 'myTypes'. ++file2.js(12,23): error TS2702: 'myTypes' only refers to a type, but is being used as a namespace here. +file2.js(17,12): error TS2702: 'testFnTypes' only refers to a type, but is being used as a namespace here. -+file2.js(28,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++file2.js(28,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + -+==== file2.js (5 errors) ==== ++==== file2.js (4 errors) ==== + const {myTypes} = require('./file.js'); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + /** + * @namespace testFnTypes @@ -28,7 +30,7 @@ + + /** @typedef {boolean|myTypes.typeC} testFnTypes.input */ + ~~~~~~~ -+!!! error TS2503: Cannot find namespace 'myTypes'. ++!!! error TS2702: 'myTypes' only refers to a type, but is being used as a namespace here. + + /** + * @function testFn @@ -47,26 +49,36 @@ + } + + module.exports = {testFn, testFnTypes}; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+==== file.js (0 errors) ==== ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. ++==== file.js (5 errors) ==== + /** + * @namespace myTypes + * @global + * @type {Object} ++ ~~~~~~~~~~~~~~~~ ++!!! error TS2315: Type 'Object' is not generic. + */ + const myTypes = { + // SOME PROPS HERE + }; + + /** @typedef {string|RegExp|Array} myTypes.typeA */ ++ ~~~~~~~ ++!!! error TS2300: Duplicate identifier 'myTypes'. + + /** + * @typedef myTypes.typeB ++ ~~~~~~~ ++!!! error TS2300: Duplicate identifier 'myTypes'. + * @property {myTypes.typeA} prop1 - Prop 1. + * @property {string} prop2 - Prop 2. + */ + + /** @typedef {myTypes.typeB|Function} myTypes.typeC */ ++ ~~~~~~~ ++!!! error TS2702: 'myTypes' only refers to a type, but is being used as a namespace here. ++ ~~~~~~~ ++!!! error TS2300: Duplicate identifier 'myTypes'. + + exports.myTypes = myTypes; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types.diff index e4b4d3e25a..7e3414b3ae 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportAliasExposedWithinNamespaceCjs.types.diff @@ -5,12 +5,10 @@ === file2.js === const {myTypes} = require('./file.js'); ->myTypes : { [x: string]: any; } -->require('./file.js') : typeof import("file") +>myTypes : any -+>require('./file.js') : any + >require('./file.js') : typeof import("file") >require : any >'./file.js' : "./file.js" - @@= skipped -11, +11 lines =@@ * @type {Object} */ @@ -56,40 +54,35 @@ ->testFn : (input: testFnTypes.input) => number | null ->testFnTypes : { [x: string]: any; } +>module.exports = {testFn, testFnTypes} : { testFn: (input: input) => number; testFnTypes: any; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { testFn: (input: input) => number; testFnTypes: any; } ++>module : { export=: { testFn: (input: input) => number; testFnTypes: any; }; } ++>exports : { testFn: (input: input) => number; testFnTypes: any; } +>{testFn, testFnTypes} : { testFn: (input: input) => number; testFnTypes: any; } +>testFn : (input: input) => number +>testFnTypes : any --=== file.js === --/** -- * @namespace myTypes -- * @global -- * @type {Object} -- */ --const myTypes = { + === file.js === + /** +@@= skipped -15, +15 lines =@@ + * @type {Object} + */ + const myTypes = { ->myTypes : { [x: string]: any; } -->{ // SOME PROPS HERE} : {} -- -- // SOME PROPS HERE --}; -- --/** @typedef {string|RegExp|Array} myTypes.typeA */ -- --/** -- * @typedef myTypes.typeB -- * @property {myTypes.typeA} prop1 - Prop 1. -- * @property {string} prop2 - Prop 2. -- */ -- --/** @typedef {myTypes.typeB|Function} myTypes.typeC */ -- --exports.myTypes = myTypes; ++>myTypes : any + >{ // SOME PROPS HERE} : {} + + // SOME PROPS HERE +@@= skipped -17, +17 lines =@@ + /** @typedef {myTypes.typeB|Function} myTypes.typeC */ + + exports.myTypes = myTypes; ->exports.myTypes = myTypes : { [x: string]: any; } ->exports.myTypes : { [x: string]: any; } -->exports : typeof import("file") ++>exports.myTypes = myTypes : any ++>exports.myTypes : any + >exports : typeof import("file") ->myTypes : { [x: string]: any; } ->myTypes : { [x: string]: any; } -- ++>myTypes : any ++>myTypes : any + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportTypeBundled.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportTypeBundled.errors.txt.diff index 071cda2aad..a5394bab86 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportTypeBundled.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportTypeBundled.errors.txt.diff @@ -3,8 +3,7 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+folder/mod1.js(8,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++folder/mod1.js(8,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + +==== folder/mod1.js (1 errors) ==== @@ -16,11 +15,9 @@ + */ + const x = {x: 12}; + module.exports = x; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+==== index.js (1 errors) ==== ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. ++==== index.js (0 errors) ==== + /** @type {(typeof import("./folder/mod1"))[]} */ + const items = [{x: 12}]; + module.exports = items; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportTypeBundled.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportTypeBundled.types.diff index 9f3ba05a86..66da7cbb1d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportTypeBundled.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsImportTypeBundled.types.diff @@ -9,23 +9,21 @@ >{x: 12} : { x: number; } >x : number >12 : 12 - +@@= skipped -8, +8 lines =@@ module.exports = x; >module.exports = x : { x: number; } -->module.exports : { x: number; } + >module.exports : { x: number; } ->module : { exports: { x: number; }; } -->exports : { x: number; } ++>module : { readonly x: { x: number; }; } + >exports : { x: number; } ->x : Item -+>module.exports : any -+>module : any -+>exports : any +>x : { x: number; } === index.js === /** @type {(typeof import("./folder/mod1"))[]} */ const items = [{x: 12}]; ->items : import("folder/mod1").Item[] -+>items : typeof import("folder/mod1")[] ++>items : { x: number; }[] >[{x: 12}] : { x: number; }[] >{x: 12} : { x: number; } >x : number @@ -37,9 +35,9 @@ ->module : { exports: import("folder/mod1").Item[]; } ->exports : import("folder/mod1").Item[] ->items : import("folder/mod1").Item[] -+>module.exports = items : typeof import("folder/mod1")[] -+>module.exports : any -+>module : any -+>exports : any -+>items : typeof import("folder/mod1")[] ++>module.exports = items : { x: number; }[] ++>module.exports : { x: number; }[] ++>module : { readonly items: { x: number; }[]; } ++>exports : { x: number; }[] ++>items : { x: number; }[] diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsJson.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsJson.errors.txt.diff deleted file mode 100644 index b738c6c223..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsJson.errors.txt.diff +++ /dev/null @@ -1,24 +0,0 @@ ---- old.jsDeclarationsJson.errors.txt -+++ new.jsDeclarationsJson.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== index.js (2 errors) ==== -+ const j = require("./obj.json"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ module.exports = j; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+==== obj.json (0 errors) ==== -+ { -+ "x": 12, -+ "y": 12, -+ "obj": { -+ "items": [{"x": 12}, {"x": 12, "y": 12}, {"x": 0}, {"x": -1, "err": true}] -+ } -+ } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsJson.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsJson.types.diff index 389645f5c8..f58fad341b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsJson.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsJson.types.diff @@ -1,27 +1,11 @@ --- old.jsDeclarationsJson.types +++ new.jsDeclarationsJson.types -@@= skipped -1, +1 lines =@@ - - === index.js === - const j = require("./obj.json"); -->j : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } -->require("./obj.json") : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } -+>j : any -+>require("./obj.json") : any - >require : any - >"./obj.json" : "./obj.json" - +@@= skipped -9, +9 lines =@@ module.exports = j; -->module.exports = j : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } -->module.exports : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } + >module.exports = j : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } + >module.exports : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } ->module : { exports: { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; }; } -->exports : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } -->j : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } -+>module.exports = j : any -+>module.exports : any -+>module : any -+>exports : any -+>j : any ++>module : { export=: { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; }; } + >exports : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } + >j : { x: number; y: number; obj: { items: ({ x: number; y?: undefined; err?: undefined; } | { x: number; y: number; err?: undefined; } | { y?: undefined; x: number; err: boolean; })[]; }; } - === obj.json === - { diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsPackageJson.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsPackageJson.errors.txt.diff deleted file mode 100644 index 2e892ff65f..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsPackageJson.errors.txt.diff +++ /dev/null @@ -1,49 +0,0 @@ ---- old.jsDeclarationsPackageJson.errors.txt -+++ new.jsDeclarationsPackageJson.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== index.js (2 errors) ==== -+ const j = require("./package.json"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ module.exports = j; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+==== package.json (0 errors) ==== -+ { -+ "name": "pkg", -+ "version": "0.1.0", -+ "description": "A package", -+ "main": "./dist/index.js", -+ "bin": { -+ "cli": "./bin/cli.js", -+ }, -+ "engines": { -+ "node": ">=0" -+ }, -+ "scripts": { -+ "scriptname": "run && run again", -+ }, -+ "devDependencies": { -+ "@ns/dep": "0.1.2", -+ }, -+ "dependencies": { -+ "dep": "1.2.3", -+ }, -+ "repository": "microsoft/TypeScript", -+ "keywords": [ -+ "kw" -+ ], -+ "author": "Auth", -+ "license": "See Licensce", -+ "homepage": "https://site", -+ "config": { -+ "o": ["a"] -+ } -+ } -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsPackageJson.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsPackageJson.types.diff index f6c71f74f9..716a901433 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsPackageJson.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsPackageJson.types.diff @@ -1,27 +1,11 @@ --- old.jsDeclarationsPackageJson.types +++ new.jsDeclarationsPackageJson.types -@@= skipped -1, +1 lines =@@ - - === index.js === - const j = require("./package.json"); -->j : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } -->require("./package.json") : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } -+>j : any -+>require("./package.json") : any - >require : any - >"./package.json" : "./package.json" - +@@= skipped -9, +9 lines =@@ module.exports = j; -->module.exports = j : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } -->module.exports : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } + >module.exports = j : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } + >module.exports : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } ->module : { exports: { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; }; } -->exports : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } -->j : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } -+>module.exports = j : any -+>module.exports : any -+>module : any -+>exports : any -+>j : any ++>module : { export=: { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; }; } + >exports : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } + >j : { name: string; version: string; description: string; main: string; bin: { cli: string; }; engines: { node: string; }; scripts: { scriptname: string; }; devDependencies: { "@ns/dep": string; }; dependencies: { dep: string; }; repository: string; keywords: string[]; author: string; license: string; homepage: string; config: { o: string[]; }; } - === package.json === - { diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.errors.txt.diff index ab6b8594d0..0e89ce5575 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.errors.txt.diff @@ -3,8 +3,8 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+base.js(11,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+file.js(1,22): error TS2306: File 'base.js' is not a module. ++base.js(11,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. ++file.js(1,15): error TS1340: Module './base' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./base')'? + + +==== base.js (1 errors) ==== @@ -19,13 +19,13 @@ + BaseFactory.Base = Base; + + module.exports = BaseFactory; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + +==== file.js (1 errors) ==== + /** @typedef {import('./base')} BaseFactory */ -+ ~~~~~~~~ -+!!! error TS2306: File 'base.js' is not a module. ++ ~~~~~~~~~~~~~~~~ ++!!! error TS1340: Module './base' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./base')'? + /** + * @callback BaseFactoryFactory + * @param {import('./base')} factory diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.types.diff index 2e1c6c6c7d..74ace1313c 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit1.types.diff @@ -1,19 +1,15 @@ --- old.jsDeclarationsParameterTagReusesInputNodeInEmit1.types +++ new.jsDeclarationsParameterTagReusesInputNodeInEmit1.types -@@= skipped -25, +25 lines =@@ - +@@= skipped -26, +26 lines =@@ module.exports = BaseFactory; >module.exports = BaseFactory : { (): Base; Base: typeof Base; } -->module.exports : { (): Base; Base: typeof Base; } + >module.exports : { (): Base; Base: typeof Base; } ->module : { exports: { (): Base; Base: typeof Base; }; } -->exports : { (): Base; Base: typeof Base; } -+>module.exports : any -+>module : any -+>exports : any ++>module : { readonly BaseFactory: { (): Base; Base: typeof Base; }; } + >exports : { (): Base; Base: typeof Base; } >BaseFactory : { (): Base; Base: typeof Base; } - === file.js === -@@= skipped -22, +22 lines =@@ +@@= skipped -21, +21 lines =@@ * @returns {InstanceType} */ const test = (base) => { diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.errors.txt.diff index bc3ee2343a..6c777dd16e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.errors.txt.diff @@ -3,8 +3,7 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+base.js(11,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+file.js(1,29): error TS2306: File 'base.js' is not a module. ++base.js(11,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + + +==== base.js (1 errors) ==== @@ -19,13 +18,11 @@ + BaseFactory.Base = Base; + + module.exports = BaseFactory; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + -+==== file.js (1 errors) ==== ++==== file.js (0 errors) ==== + /** @typedef {typeof import('./base')} BaseFactory */ -+ ~~~~~~~~ -+!!! error TS2306: File 'base.js' is not a module. + + /** + * diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.types.diff index 0d97f79029..4404d4fa58 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsParameterTagReusesInputNodeInEmit2.types.diff @@ -1,32 +1,22 @@ --- old.jsDeclarationsParameterTagReusesInputNodeInEmit2.types +++ new.jsDeclarationsParameterTagReusesInputNodeInEmit2.types -@@= skipped -25, +25 lines =@@ - +@@= skipped -26, +26 lines =@@ module.exports = BaseFactory; >module.exports = BaseFactory : { (): Base; Base: typeof Base; } -->module.exports : { (): Base; Base: typeof Base; } + >module.exports : { (): Base; Base: typeof Base; } ->module : { exports: { (): Base; Base: typeof Base; }; } -->exports : { (): Base; Base: typeof Base; } -+>module.exports : any -+>module : any -+>exports : any ++>module : { readonly BaseFactory: { (): Base; Base: typeof Base; }; } + >exports : { (): Base; Base: typeof Base; } >BaseFactory : { (): Base; Base: typeof Base; } - === file.js === -@@= skipped -14, +14 lines =@@ +@@= skipped -13, +13 lines =@@ * @returns {InstanceType} */ const test = (base) => { ->test : (base: InstanceType) => InstanceType ->(base) => { return base;} : (base: InstanceType) => InstanceType -->base : Base -+>test : (base: any) => any -+>(base) => { return base;} : (base: any) => any -+>base : any ++>test : (base: Base) => Base ++>(base) => { return base;} : (base: Base) => Base + >base : Base return base; -->base : Base -+>base : any - - }; - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportAliasesEsModuleInterop.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportAliasesEsModuleInterop.errors.txt.diff deleted file mode 100644 index 3ba19ca5f6..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportAliasesEsModuleInterop.errors.txt.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- old.jsDeclarationsReexportAliasesEsModuleInterop.errors.txt -+++ new.jsDeclarationsReexportAliasesEsModuleInterop.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+cls.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+usage.js(1,31): error TS2306: File 'cls.js' is not a module. -+usage.js(5,31): error TS2306: File 'cls.js' is not a module. -+ -+ -+==== cls.js (1 errors) ==== -+ class Foo {} -+ module.exports = Foo; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+==== usage.js (2 errors) ==== -+ import {default as Fooa} from "./cls"; -+ ~~~~~~~ -+!!! error TS2306: File 'cls.js' is not a module. -+ -+ export const x = new Fooa(); -+ -+ export {default as Foob} from "./cls"; -+ ~~~~~~~ -+!!! error TS2306: File 'cls.js' is not a module. -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportAliasesEsModuleInterop.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportAliasesEsModuleInterop.types.diff index 8c08cf73ee..9a2661c062 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportAliasesEsModuleInterop.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportAliasesEsModuleInterop.types.diff @@ -1,35 +1,32 @@ --- old.jsDeclarationsReexportAliasesEsModuleInterop.types +++ new.jsDeclarationsReexportAliasesEsModuleInterop.types -@@= skipped -5, +5 lines =@@ - +@@= skipped -6, +6 lines =@@ module.exports = Foo; >module.exports = Foo : typeof Foo -->module.exports : typeof Foo + >module.exports : typeof Foo ->module : { exports: typeof Foo; } -->exports : typeof Foo -+>module.exports : any -+>module : any -+>exports : any ++>module : { Foo: typeof Foo; } + >exports : typeof Foo >Foo : typeof Foo === usage.js === import {default as Fooa} from "./cls"; ->default : typeof Fooa ->Fooa : typeof Fooa -+>default : any -+>Fooa : any ++>default : typeof Foo ++>Fooa : typeof Foo export const x = new Fooa(); ->x : Fooa ->new Fooa() : Fooa ->Fooa : typeof Fooa -+>x : any -+>new Fooa() : any -+>Fooa : any ++>x : Foo ++>new Fooa() : Foo ++>Fooa : typeof Foo export {default as Foob} from "./cls"; ->default : typeof Fooa ->Foob : typeof Fooa -+>default : any -+>Foob : any ++>default : typeof Foo ++>Foob : typeof Foo diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportedCjsAlias.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportedCjsAlias.errors.txt.diff deleted file mode 100644 index 572a08b811..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportedCjsAlias.errors.txt.diff +++ /dev/null @@ -1,38 +0,0 @@ ---- old.jsDeclarationsReexportedCjsAlias.errors.txt -+++ new.jsDeclarationsReexportedCjsAlias.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+main.js(1,43): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+main.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== main.js (2 errors) ==== -+ const { SomeClass, SomeClass: Another } = require('./lib'); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ SomeClass, -+ Another -+ } -+==== lib.js (0 errors) ==== -+ /** -+ * @param {string} a -+ */ -+ function bar(a) { -+ return a + a; -+ } -+ -+ class SomeClass { -+ a() { -+ return 1; -+ } -+ } -+ -+ module.exports = { -+ bar, -+ SomeClass -+ } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportedCjsAlias.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportedCjsAlias.types.diff index dbafabc835..2f83605ef6 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportedCjsAlias.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReexportedCjsAlias.types.diff @@ -1,16 +1,11 @@ --- old.jsDeclarationsReexportedCjsAlias.types +++ new.jsDeclarationsReexportedCjsAlias.types -@@= skipped -1, +1 lines =@@ - - === main.js === - const { SomeClass, SomeClass: Another } = require('./lib'); -->SomeClass : typeof SomeClass +@@= skipped -4, +4 lines =@@ + >SomeClass : typeof SomeClass >SomeClass : any -->Another : typeof SomeClass + >Another : typeof SomeClass ->require('./lib') : typeof import("lib") -+>SomeClass : any -+>Another : any -+>require('./lib') : any ++>require('./lib') : { bar: (a: string) => string; SomeClass: typeof SomeClass; } >require : any >'./lib' : "./lib" @@ -19,56 +14,25 @@ ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->{ SomeClass, Another} : { SomeClass: typeof SomeClass; Another: typeof SomeClass; } -+>module.exports = { SomeClass, Another} : { SomeClass: any; Another: any; } -+>module.exports : any -+>module : any -+>exports : any -+>{ SomeClass, Another} : { SomeClass: any; Another: any; } ++>module.exports = { SomeClass, Another} : { SomeClass: typeof SomeClass; Another: typeof SomeClass; } ++>module.exports : { SomeClass: typeof SomeClass; Another: typeof SomeClass; } ++>module : { export=: { SomeClass: typeof SomeClass; Another: typeof SomeClass; }; } ++>exports : { SomeClass: typeof SomeClass; Another: typeof SomeClass; } + >{ SomeClass, Another} : { SomeClass: typeof SomeClass; Another: typeof SomeClass; } SomeClass, -->SomeClass : typeof SomeClass -+>SomeClass : any - - Another -->Another : typeof SomeClass -+>Another : any +@@= skipped -43, +43 lines =@@ } --=== lib.js === --/** -- * @param {string} a -- */ --function bar(a) { -->bar : (a: string) => string -->a : string -- -- return a + a; -->a + a : string -->a : string -->a : string --} -- --class SomeClass { -->SomeClass : SomeClass -- -- a() { -->a : () => number -- -- return 1; -->1 : 1 -- } --} -- --module.exports = { + + module.exports = { ->module.exports = { bar, SomeClass} : typeof module.exports ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->{ bar, SomeClass} : { bar: (a: string) => string; SomeClass: typeof SomeClass; } -- -- bar, -->bar : (a: string) => string -- -- SomeClass -->SomeClass : typeof SomeClass --} ++>module.exports = { bar, SomeClass} : { bar: (a: string) => string; SomeClass: typeof SomeClass; } ++>module.exports : { bar: (a: string) => string; SomeClass: typeof SomeClass; } ++>module : { export=: { bar: (a: string) => string; SomeClass: typeof SomeClass; }; } ++>exports : { bar: (a: string) => string; SomeClass: typeof SomeClass; } + >{ bar, SomeClass} : { bar: (a: string) => string; SomeClass: typeof SomeClass; } + + bar, diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.errors.txt.diff index 6589dee3b8..5027c64965 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.errors.txt.diff @@ -3,17 +3,20 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+test.js(1,18): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(9,14): error TS2339: Property 'objects' does not exist on type 'Render'. ++index.js(14,18): error TS2749: 'Rectangle' refers to a value, but is being used as a type here. Did you mean 'typeof Rectangle'? ++index.js(18,14): error TS2339: Property 'objects' does not exist on type 'Render'. ++test.js(5,31): error TS2339: Property 'objects' does not exist on type 'Render'. + + +==== test.js (1 errors) ==== + const {Render} = require("./index"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + let render = new Render(); + + render.addRectangle(); + console.log("Objects", render.objects); ++ ~~~~~~~ ++!!! error TS2339: Property 'objects' does not exist on type 'Render'. +==== rectangle.js (0 errors) ==== + class Rectangle { + constructor() { @@ -22,7 +25,7 @@ + } + + module.exports = { Rectangle }; -+==== index.js (0 errors) ==== ++==== index.js (3 errors) ==== + const {Rectangle} = require('./rectangle'); + + class Render { @@ -32,15 +35,21 @@ + * @type {Rectangle[]} + */ + this.objects = []; ++ ~~~~~~~ ++!!! error TS2339: Property 'objects' does not exist on type 'Render'. + } + /** + * Adds a rectangle + * + * @returns {Rectangle} the rect ++ ~~~~~~~~~ ++!!! error TS2749: 'Rectangle' refers to a value, but is being used as a type here. Did you mean 'typeof Rectangle'? + */ + addRectangle() { + const obj = new Rectangle(); + this.objects.push(obj); ++ ~~~~~~~ ++!!! error TS2339: Property 'objects' does not exist on type 'Render'. + return obj; + } + } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.types.diff index faa42e6e67..58686a8ded 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsReferenceToClassInstanceCrossFile.types.diff @@ -1,123 +1,105 @@ --- old.jsDeclarationsReferenceToClassInstanceCrossFile.types +++ new.jsDeclarationsReferenceToClassInstanceCrossFile.types -@@= skipped -1, +1 lines =@@ - +@@= skipped -2, +2 lines =@@ === test.js === const {Render} = require("./index"); -->Render : typeof Render + >Render : typeof Render ->require("./index") : typeof import("index") -+>Render : any -+>require("./index") : any ++>require("./index") : { Render: typeof Render; } >require : any >"./index" : "./index" - let render = new Render(); -->render : Render -->new Render() : Render -->Render : typeof Render -+>render : any -+>new Render() : any -+>Render : any +@@= skipped -10, +10 lines =@@ + >Render : typeof Render render.addRectangle(); ->render.addRectangle() : import("rectangle").Rectangle ->render.addRectangle : () => import("rectangle").Rectangle -->render : Render ++>render.addRectangle() : Rectangle ++>render.addRectangle : () => Rectangle + >render : Render ->addRectangle : () => import("rectangle").Rectangle -+>render.addRectangle() : any -+>render.addRectangle : any -+>render : any -+>addRectangle : any ++>addRectangle : () => Rectangle console.log("Objects", render.objects); >console.log("Objects", render.objects) : void -@@= skipped -22, +22 lines =@@ +@@= skipped -11, +11 lines =@@ >console : Console >log : (...data: any[]) => void >"Objects" : "Objects" ->render.objects : import("rectangle").Rectangle[] -->render : Render -->objects : import("rectangle").Rectangle[] +>render.objects : any -+>render : any + >render : Render +->objects : import("rectangle").Rectangle[] +>objects : any --=== rectangle.js === --class Rectangle { -->Rectangle : Rectangle -- -- constructor() { -- console.log("I'm a rectangle!"); -->console.log("I'm a rectangle!") : void -->console.log : (...data: any[]) => void -->console : Console -->log : (...data: any[]) => void -->"I'm a rectangle!" : "I'm a rectangle!" -- } --} -- --module.exports = { Rectangle }; + === rectangle.js === + class Rectangle { +@@= skipped -19, +19 lines =@@ + } + + module.exports = { Rectangle }; ->module.exports = { Rectangle } : typeof module.exports ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->{ Rectangle } : { Rectangle: typeof Rectangle; } -->Rectangle : typeof Rectangle -- --=== index.js === --const {Rectangle} = require('./rectangle'); -->Rectangle : typeof Rectangle ++>module.exports = { Rectangle } : { Rectangle: typeof Rectangle; } ++>module.exports : { Rectangle: typeof Rectangle; } ++>module : { export=: { Rectangle: typeof Rectangle; }; } ++>exports : { Rectangle: typeof Rectangle; } + >{ Rectangle } : { Rectangle: typeof Rectangle; } + >Rectangle : typeof Rectangle + + === index.js === + const {Rectangle} = require('./rectangle'); + >Rectangle : typeof Rectangle ->require('./rectangle') : typeof import("rectangle") -->require : any -->'./rectangle' : "./rectangle" -- --class Render { -->Render : Render -- -- constructor() { -- /** -- * Object list -- * @type {Rectangle[]} -- */ -- this.objects = []; -->this.objects = [] : undefined[] ++>require('./rectangle') : { Rectangle: typeof Rectangle; } + >require : any + >'./rectangle' : "./rectangle" + +@@= skipped -24, +24 lines =@@ + */ + this.objects = []; + >this.objects = [] : undefined[] ->this.objects : Rectangle[] -->this : this ++>this.objects : any + >this : this ->objects : Rectangle[] -->[] : undefined[] -- } -- /** -- * Adds a rectangle -- * -- * @returns {Rectangle} the rect -- */ -- addRectangle() { -->addRectangle : () => Rectangle -- -- const obj = new Rectangle(); -->obj : Rectangle -->new Rectangle() : Rectangle -->Rectangle : typeof Rectangle -- -- this.objects.push(obj); ++>objects : any + >[] : undefined[] + } + /** +@@= skipped -19, +19 lines =@@ + >Rectangle : typeof Rectangle + + this.objects.push(obj); ->this.objects.push(obj) : number ->this.objects.push : (...items: Rectangle[]) => number ->this.objects : Rectangle[] -->this : this ++>this.objects.push(obj) : any ++>this.objects.push : any ++>this.objects : any + >this : this ->objects : Rectangle[] ->push : (...items: Rectangle[]) => number -->obj : Rectangle -- -- return obj; -->obj : Rectangle -- } --} -- --module.exports = { Render }; ++>objects : any ++>push : any + >obj : Rectangle + + return obj; +@@= skipped -14, +14 lines =@@ + } + + module.exports = { Render }; ->module.exports = { Render } : typeof module.exports ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->{ Render } : { Render: typeof Render; } -->Render : typeof Render -- ++>module.exports = { Render } : { Render: typeof Render; } ++>module.exports : { Render: typeof Render; } ++>module : { export=: { Render: typeof Render; }; } ++>exports : { Render: typeof Render; } + >{ Render } : { Render: typeof Render; } + >Render : typeof Render + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeAliases.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeAliases.errors.txt.diff index 4d6fadf8b9..a69443eda3 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeAliases.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeAliases.errors.txt.diff @@ -3,7 +3,7 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+mixed.js(14,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mixed.js(14,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + +==== index.js (0 errors) ==== @@ -49,11 +49,14 @@ + z = "ok" + } + module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~ + doTheThing, ++ ~~~~~~~~~~~~~~~ + ExportedThing, ++ ~~~~~~~~~~~~~~~~~~ + }; ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + class LocalThing { + y = "ok" + } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeAliases.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeAliases.types.diff index 294b6a424b..3abbab0f08 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeAliases.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeAliases.types.diff @@ -9,9 +9,9 @@ ->module : { exports: typeof module.exports; } ->exports : typeof module.exports +>module.exports = { doTheThing, ExportedThing,} : { doTheThing: (x: number) => SomeType; ExportedThing: typeof ExportedThing; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { doTheThing: (x: number) => SomeType; ExportedThing: typeof ExportedThing; } ++>module : { export=: { doTheThing: (x: number) => SomeType; ExportedThing: typeof ExportedThing; }; } ++>exports : { doTheThing: (x: number) => SomeType; ExportedThing: typeof ExportedThing; } >{ doTheThing, ExportedThing,} : { doTheThing: (x: number) => SomeType; ExportedThing: typeof ExportedThing; } doTheThing, diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration.errors.txt.diff deleted file mode 100644 index f064302e7a..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration.errors.txt.diff +++ /dev/null @@ -1,20 +0,0 @@ ---- old.jsDeclarationsTypeReassignmentFromDeclaration.errors.txt -+++ new.jsDeclarationsTypeReassignmentFromDeclaration.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+index.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== /some-mod.d.ts (0 errors) ==== -+ interface Item { -+ x: string; -+ } -+ declare const items: Item[]; -+ export = items; -+==== index.js (1 errors) ==== -+ /** @type {typeof import("/some-mod")} */ -+ const items = []; -+ module.exports = items; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration.types.diff index 9cac2c44f6..33db5def84 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration.types.diff @@ -1,14 +1,11 @@ --- old.jsDeclarationsTypeReassignmentFromDeclaration.types +++ new.jsDeclarationsTypeReassignmentFromDeclaration.types -@@= skipped -18, +18 lines =@@ - +@@= skipped -19, +19 lines =@@ module.exports = items; >module.exports = items : Item[] -->module.exports : Item[] + >module.exports : Item[] ->module : { exports: Item[]; } -->exports : Item[] -+>module.exports : any -+>module : any -+>exports : any ++>module : { readonly items: Item[]; } + >exports : Item[] >items : Item[] diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.errors.txt.diff index 668fe4b1fc..2c92d9aebe 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.errors.txt.diff @@ -3,19 +3,14 @@ @@= skipped -0, +0 lines =@@ -index.js(1,1): error TS9006: Declaration emit for this file requires using private name 'Item' from module '"some-mod"'. An explicit type annotation may unblock declaration emit. +index.js(1,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. --==== index.js (1 errors) ==== -+==== index.js (2 errors) ==== + ==== index.js (1 errors) ==== const items = require("./some-mod")(); - ~~~~~ -!!! error TS9006: Declaration emit for this file requires using private name 'Item' from module '"some-mod"'. An explicit type annotation may unblock declaration emit. + ~~~~~~~ +!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. module.exports = items; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ==== some-mod.d.ts (0 errors) ==== interface Item { - x: string; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.types.diff index 931c332dda..96e75d15e0 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReassignmentFromDeclaration2.types.diff @@ -21,7 +21,7 @@ ->items : Item[] +>module.exports = items : any +>module.exports : any -+>module : any ++>module : { readonly items: any; } +>exports : any +>items : any diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences.errors.txt.diff index 3c8cf3e885..6371309377 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences.errors.txt.diff @@ -4,10 +4,9 @@ - @@= skipped --1, +1 lines =@@ +index.js(3,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + -+==== index.js (2 errors) ==== ++==== index.js (1 errors) ==== + /// + + const Something = require("fs").Something; @@ -17,8 +16,6 @@ + const thing = new Something(); + + module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + thing + }; + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences.types.diff index f265662da1..66e901ad13 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences.types.diff @@ -30,9 +30,9 @@ ->exports : typeof module.exports ->{ thing} : { thing: Something; } +>module.exports = { thing} : { thing: any; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { thing: any; } ++>module : { export=: { thing: any; }; } ++>exports : { thing: any; } +>{ thing} : { thing: any; } thing diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences2.errors.txt.diff index d7a15359f4..1165c7b9fe 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences2.errors.txt.diff @@ -4,10 +4,9 @@ - @@= skipped --1, +1 lines =@@ +index.js(1,17): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + -+==== index.js (2 errors) ==== ++==== index.js (1 errors) ==== + const{ a, m } = require("./something").o; + ~~~~~~~ +!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. @@ -15,8 +14,6 @@ + const thing = a + m + + module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + thing + }; + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences2.types.diff index 99bff20ffb..8be58e04b4 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences2.types.diff @@ -34,9 +34,9 @@ ->exports : typeof module.exports ->{ thing} : { thing: number; } +>module.exports = { thing} : { thing: any; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { thing: any; } ++>module : { export=: { thing: any; }; } ++>exports : { thing: any; } +>{ thing} : { thing: any; } thing diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences3.errors.txt.diff index ff1d2c9004..7548c048e9 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences3.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences3.errors.txt.diff @@ -4,22 +4,16 @@ - @@= skipped --1, +1 lines =@@ +index.js(3,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + -+==== index.js (3 errors) ==== ++==== index.js (1 errors) ==== + /// + + const Something = require("fs").Something; + ~~~~~~~ +!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + module.exports.A = {} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + module.exports.A.B = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + thing: new Something() + } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences3.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences3.types.diff index 52e0ff9f36..07b5facafa 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypeReferences3.types.diff @@ -24,9 +24,9 @@ ->A : typeof A +>module.exports.A = {} : {} +>module.exports.A : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>A : any >{} : {} @@ -43,9 +43,9 @@ +>module.exports.A.B = { thing: new Something()} : { thing: any; } +>module.exports.A.B : any +>module.exports.A : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("index") ++>module : { "index": typeof import("index"); } ++>exports : typeof import("index") +>A : any +>B : any +>{ thing: new Something()} : { thing: any; } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndImportTypes.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndImportTypes.errors.txt.diff index f71263fffb..b57df579ed 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndImportTypes.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndImportTypes.errors.txt.diff @@ -3,11 +3,10 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+conn.js(11,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+usage.js(2,14): error TS1340: Module './conn' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./conn')'? ++conn.js(11,1): error TS2309: An export assignment cannot be used in a module with other exported elements. +usage.js(10,14): error TS2339: Property 'connItem' does not exist on type 'Wrap'. +usage.js(12,14): error TS2339: Property 'another' does not exist on type 'Wrap'. -+usage.js(16,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++usage.js(16,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + +==== conn.js (1 errors) ==== @@ -22,14 +21,12 @@ + } + + module.exports = Conn; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + -+==== usage.js (4 errors) ==== ++==== usage.js (3 errors) ==== + /** + * @typedef {import("./conn")} Conn -+ ~~~~~~~~~~~~~~~~ -+!!! error TS1340: Module './conn' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./conn')'? + */ + + class Wrap { @@ -48,8 +45,10 @@ + } + + module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~ + Wrap ++ ~~~~~~~~ + }; ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndImportTypes.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndImportTypes.types.diff index d0c2c9e3f5..486a0fd3c3 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndImportTypes.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndImportTypes.types.diff @@ -1,37 +1,30 @@ --- old.jsDeclarationsTypedefAndImportTypes.types +++ new.jsDeclarationsTypedefAndImportTypes.types -@@= skipped -18, +18 lines =@@ - +@@= skipped -19, +19 lines =@@ module.exports = Conn; >module.exports = Conn : typeof Conn -->module.exports : typeof Conn + >module.exports : typeof Conn ->module : { exports: typeof Conn; } -->exports : typeof Conn -+>module.exports : any -+>module : any -+>exports : any ++>module : { Conn: typeof Conn; } + >exports : typeof Conn >Conn : typeof Conn - === usage.js === -@@= skipped -17, +17 lines =@@ +@@= skipped -16, +16 lines =@@ * @param {Conn} c */ constructor(c) { ->c : import("conn") -+>c : any ++>c : Conn this.connItem = c.item; -->this.connItem = c.item : number -+>this.connItem = c.item : any - >this.connItem : any + >this.connItem = c.item : number +@@= skipped -8, +8 lines =@@ >this : this >connItem : any -->c.item : number + >c.item : number ->c : import("conn") -->item : number -+>c.item : any -+>c : any -+>item : any ++>c : Conn + >item : number /** @type {import("./conn").Whatever} */ this.another = ""; @@ -51,9 +44,9 @@ ->module : { exports: typeof module.exports; } ->exports : typeof module.exports +>module.exports = { Wrap} : { Wrap: typeof Wrap; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { Wrap: typeof Wrap; } ++>module : { export=: { Wrap: typeof Wrap; }; } ++>exports : { Wrap: typeof Wrap; } >{ Wrap} : { Wrap: typeof Wrap; } Wrap diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndLatebound.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndLatebound.errors.txt.diff index e8f0b635bd..fed430bfc6 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndLatebound.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndLatebound.errors.txt.diff @@ -3,19 +3,13 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+LazySet.js(13,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(1,17): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(3,12): error TS2749: 'LazySet' refers to a value, but is being used as a type here. Did you mean 'typeof LazySet'? ++LazySet.js(13,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + -+==== index.js (2 errors) ==== ++==== index.js (0 errors) ==== + const LazySet = require("./LazySet"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + /** @type {LazySet} */ -+ ~~~~~~~ -+!!! error TS2749: 'LazySet' refers to a value, but is being used as a type here. Did you mean 'typeof LazySet'? + const stringSet = undefined; + stringSet.addAll(stringSet); + @@ -34,6 +28,6 @@ + } + + module.exports = LazySet; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndLatebound.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndLatebound.types.diff index fcb2ee58f9..d966bec7bd 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndLatebound.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefAndLatebound.types.diff @@ -1,31 +1,6 @@ --- old.jsDeclarationsTypedefAndLatebound.types +++ new.jsDeclarationsTypedefAndLatebound.types -@@= skipped -1, +1 lines =@@ - - === index.js === - const LazySet = require("./LazySet"); -->LazySet : typeof LazySet -->require("./LazySet") : typeof LazySet -+>LazySet : any -+>require("./LazySet") : any - >require : any - >"./LazySet" : "./LazySet" - -@@= skipped -11, +11 lines =@@ - >undefined : undefined - - stringSet.addAll(stringSet); -->stringSet.addAll(stringSet) : void -->stringSet.addAll : (iterable: LazySet) => void -+>stringSet.addAll(stringSet) : any -+>stringSet.addAll : any - >stringSet : LazySet -->addAll : (iterable: LazySet) => void -+>addAll : any - >stringSet : LazySet - - -@@= skipped -20, +20 lines =@@ +@@= skipped -32, +32 lines =@@ */ addAll(iterable) {} >addAll : (iterable: LazySet) => void @@ -34,15 +9,12 @@ [Symbol.iterator]() {} >[Symbol.iterator] : () => void -@@= skipped -11, +11 lines =@@ - +@@= skipped -12, +12 lines =@@ module.exports = LazySet; >module.exports = LazySet : typeof LazySet -->module.exports : typeof LazySet + >module.exports : typeof LazySet ->module : { exports: typeof LazySet; } -->exports : typeof LazySet -+>module.exports : any -+>module : any -+>exports : any ++>module : { LazySet: typeof LazySet; } + >exports : typeof LazySet >LazySet : typeof LazySet diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.errors.txt.diff index 67bf093500..4cf617b60f 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.errors.txt.diff @@ -3,19 +3,19 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+index.js(1,39): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+index.js(3,22): error TS2307: Cannot find module './module.js' or its corresponding type declarations. -+index.js(21,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++index.js(3,37): error TS2694: Namespace '"module".export=' has no exported member 'TaskGroup'. ++index.js(21,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++module.js(11,38): error TS2304: Cannot find name 'P'. ++module.js(24,12): error TS2315: Type 'Object' is not generic. ++module.js(27,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + -+==== index.js (3 errors) ==== ++==== index.js (2 errors) ==== + const {taskGroups, taskNameToGroup} = require('./module.js'); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + /** @typedef {import('./module.js').TaskGroup} TaskGroup */ -+ ~~~~~~~~~~~~~ -+!!! error TS2307: Cannot find module './module.js' or its corresponding type declarations. ++ ~~~~~~~~~ ++!!! error TS2694: Namespace '"module".export=' has no exported member 'TaskGroup'. + + /** + * @typedef TaskNode @@ -34,9 +34,9 @@ + } + + module.exports = MainThreadTasks; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+==== module.js (0 errors) ==== ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. ++==== module.js (3 errors) ==== + /** @typedef {'parseHTML'|'styleLayout'} TaskGroupIds */ + + /** @@ -48,6 +48,8 @@ + + /** + * @type {{[P in TaskGroupIds]: {id: P, label: string}}} ++ ~ ++!!! error TS2304: Cannot find name 'P'. + */ + const taskGroups = { + parseHTML: { @@ -61,9 +63,16 @@ + } + + /** @type {Object} */ ++ ~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2315: Type 'Object' is not generic. + const taskNameToGroup = {}; + + module.exports = { ++ ~~~~~~~~~~~~~~~~~~ + taskGroups, ++ ~~~~~~~~~~~~~~~ + taskNameToGroup, ++ ~~~~~~~~~~~~~~~~~~~~ + }; ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.types.diff index 73ec43650c..e94038e6f9 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsDeclarationsTypedefPropertyAndExportAssignment.types.diff @@ -7,9 +7,9 @@ ->taskGroups : { parseHTML: { id: "parseHTML"; label: string; }; styleLayout: { id: "styleLayout"; label: string; }; } ->taskNameToGroup : { [x: string]: import("module").TaskGroup; } ->require('./module.js') : typeof import("module") -+>taskGroups : any ++>taskGroups : { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; } +>taskNameToGroup : any -+>require('./module.js') : any ++>require('./module.js') : { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; } >require : any >'./module.js' : "./module.js" @@ -24,75 +24,74 @@ module.exports = MainThreadTasks; >module.exports = MainThreadTasks : typeof MainThreadTasks -->module.exports : typeof MainThreadTasks + >module.exports : typeof MainThreadTasks ->module : { exports: typeof MainThreadTasks; } -->exports : typeof MainThreadTasks -+>module.exports : any -+>module : any -+>exports : any ++>module : { MainThreadTasks: typeof MainThreadTasks; } + >exports : typeof MainThreadTasks >MainThreadTasks : typeof MainThreadTasks --=== module.js === --/** @typedef {'parseHTML'|'styleLayout'} TaskGroupIds */ -- --/** -- * @typedef TaskGroup -- * @property {TaskGroupIds} id -- * @property {string} label -- * @property {string[]} traceEventNames -- */ -- --/** -- * @type {{[P in TaskGroupIds]: {id: P, label: string}}} -- */ --const taskGroups = { +@@= skipped -25, +25 lines =@@ + * @type {{[P in TaskGroupIds]: {id: P, label: string}}} + */ + const taskGroups = { ->taskGroups : { parseHTML: { id: "parseHTML"; label: string; }; styleLayout: { id: "styleLayout"; label: string; }; } ->{ parseHTML: { id: 'parseHTML', label: 'Parse HTML & CSS' }, styleLayout: { id: 'styleLayout', label: 'Style & Layout' },} : { parseHTML: { id: "parseHTML"; label: string; }; styleLayout: { id: "styleLayout"; label: string; }; } -- -- parseHTML: { ++>taskGroups : { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; } ++>{ parseHTML: { id: 'parseHTML', label: 'Parse HTML & CSS' }, styleLayout: { id: 'styleLayout', label: 'Style & Layout' },} : { parseHTML: { id: string; label: string; }; styleLayout: { id: string; label: string; }; } + + parseHTML: { ->parseHTML : { id: "parseHTML"; label: string; } ->{ id: 'parseHTML', label: 'Parse HTML & CSS' } : { id: "parseHTML"; label: string; } -- -- id: 'parseHTML', ++>parseHTML : { id: string; label: string; } ++>{ id: 'parseHTML', label: 'Parse HTML & CSS' } : { id: string; label: string; } + + id: 'parseHTML', ->id : "parseHTML" -->'parseHTML' : "parseHTML" -- -- label: 'Parse HTML & CSS' -->label : string -->'Parse HTML & CSS' : "Parse HTML & CSS" -- -- }, -- styleLayout: { ++>id : string + >'parseHTML' : "parseHTML" + + label: 'Parse HTML & CSS' +@@= skipped -17, +17 lines =@@ + + }, + styleLayout: { ->styleLayout : { id: "styleLayout"; label: string; } ->{ id: 'styleLayout', label: 'Style & Layout' } : { id: "styleLayout"; label: string; } -- -- id: 'styleLayout', ++>styleLayout : { id: string; label: string; } ++>{ id: 'styleLayout', label: 'Style & Layout' } : { id: string; label: string; } + + id: 'styleLayout', ->id : "styleLayout" -->'styleLayout' : "styleLayout" -- -- label: 'Style & Layout' -->label : string -->'Style & Layout' : "Style & Layout" -- -- }, --} -- --/** @type {Object} */ --const taskNameToGroup = {}; ++>id : string + >'styleLayout' : "styleLayout" + + label: 'Style & Layout' +@@= skipped -16, +16 lines =@@ + + /** @type {Object} */ + const taskNameToGroup = {}; ->taskNameToGroup : { [x: string]: TaskGroup; } -->{} : {} -- --module.exports = { ++>taskNameToGroup : any + >{} : {} + + module.exports = { ->module.exports = { taskGroups, taskNameToGroup,} : typeof module.exports ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports ->{ taskGroups, taskNameToGroup,} : { taskGroups: { parseHTML: { id: "parseHTML"; label: string; }; styleLayout: { id: "styleLayout"; label: string; }; }; taskNameToGroup: { [x: string]: TaskGroup; }; } -- -- taskGroups, ++>module.exports = { taskGroups, taskNameToGroup,} : { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; } ++>module.exports : { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; } ++>module : { export=: { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; }; } ++>exports : { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; } ++>{ taskGroups, taskNameToGroup,} : { taskGroups: { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; }; taskNameToGroup: any; } + + taskGroups, ->taskGroups : { parseHTML: { id: "parseHTML"; label: string; }; styleLayout: { id: "styleLayout"; label: string; }; } -- -- taskNameToGroup, ++>taskGroups : { parseHTML: { id: P; label: string; }; styleLayout: { id: P; label: string; }; } + + taskNameToGroup, ->taskNameToGroup : { [x: string]: TaskGroup; } -- --}; ++>taskNameToGroup : any + + }; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType.errors.txt.diff index 5b9e9bb1c1..03bb8c02fb 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType.errors.txt.diff @@ -3,35 +3,38 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+use.js(2,22): error TS2307: Cannot find module './mod1' or its corresponding type declarations. -+use.js(8,12): error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? ++mod1.js(4,14): error TS2339: Property 'chunk' does not exist on type 'Chunk'. ++use.js(5,3): error TS2339: Property 'chunk' does not exist on type 'Chunk'. ++use.js(10,3): error TS2339: Property 'chunk' does not exist on type 'Chunk'. + + +==== use.js (2 errors) ==== + /// + /** @typedef {import("./mod1")} C -+ ~~~~~~~~ -+!!! error TS2307: Cannot find module './mod1' or its corresponding type declarations. + * @type {C} */ + var c; + c.chunk; ++ ~~~~~ ++!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. + + const D = require("./mod1"); + /** @type {D} */ -+ ~ -+!!! error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? + var d; + d.chunk; ++ ~~~~~ ++!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. + +==== types.d.ts (0 errors) ==== + declare function require(name: string): any; + declare var exports: any; + declare var module: { exports: any }; -+==== mod1.js (0 errors) ==== ++==== mod1.js (1 errors) ==== + /// + class Chunk { + constructor() { + this.chunk = 1; ++ ~~~~~ ++!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. + } + } + module.exports = Chunk; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType.types.diff index 0080237768..e8fd4b4a33 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType.types.diff @@ -5,58 +5,45 @@ * @type {C} */ var c; ->c : D -+>c : any ++>c : Chunk c.chunk; ->c.chunk : number ->c : D ->chunk : number +>c.chunk : any -+>c : any ++>c : Chunk +>chunk : any const D = require("./mod1"); ->D : typeof D ->require("./mod1") : typeof D -+>D : any -+>require("./mod1") : any ++>D : typeof Chunk ++>require("./mod1") : typeof Chunk >require : (name: string) => any >"./mod1" : "./mod1" -@@= skipped -18, +18 lines =@@ - >d : D + /** @type {D} */ + var d; +->d : D ++>d : Chunk d.chunk; ->d.chunk : number -+>d.chunk : any - >d : D +->d : D ->chunk : number ++>d.chunk : any ++>d : Chunk +>chunk : any === types.d.ts === declare function require(name: string): any; -@@= skipped -16, +16 lines =@@ - >module : { exports: any; } - >exports : any - --=== mod1.js === --/// --class Chunk { -->Chunk : Chunk -- -- constructor() { -- this.chunk = 1; -->this.chunk = 1 : 1 -->this.chunk : any -->this : this -->chunk : any -->1 : 1 -- } --} --module.exports = Chunk; -->module.exports = Chunk : typeof Chunk -->module.exports : typeof Chunk +@@= skipped -51, +51 lines =@@ + module.exports = Chunk; + >module.exports = Chunk : typeof Chunk + >module.exports : typeof Chunk ->module : { exports: typeof Chunk; } -->exports : typeof Chunk -->Chunk : typeof Chunk -- ++>module : { Chunk: typeof Chunk; } + >exports : typeof Chunk + >Chunk : typeof Chunk + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType2.errors.txt.diff index 09508f12a1..12f4ebdfcd 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType2.errors.txt.diff @@ -3,35 +3,38 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+use.js(2,22): error TS2307: Cannot find module './mod1' or its corresponding type declarations. -+use.js(8,12): error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? ++mod1.js(4,14): error TS2339: Property 'chunk' does not exist on type 'Chunk'. ++use.js(5,3): error TS2339: Property 'chunk' does not exist on type 'Chunk'. ++use.js(10,3): error TS2339: Property 'chunk' does not exist on type 'Chunk'. + + +==== use.js (2 errors) ==== + /// + /** @typedef {import("./mod1")} C -+ ~~~~~~~~ -+!!! error TS2307: Cannot find module './mod1' or its corresponding type declarations. + * @type {C} */ + var c; + c.chunk; ++ ~~~~~ ++!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. + + const D = require("./mod1"); + /** @type {D} */ -+ ~ -+!!! error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? + var d; + d.chunk; ++ ~~~~~ ++!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. + +==== types.d.ts (0 errors) ==== + declare function require(name: string): any; + declare var exports: any; + declare var module: { exports: any }; -+==== mod1.js (0 errors) ==== ++==== mod1.js (1 errors) ==== + /// + module.exports = class Chunk { + constructor() { + this.chunk = 1; ++ ~~~~~ ++!!! error TS2339: Property 'chunk' does not exist on type 'Chunk'. + } + } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType2.types.diff index a307c6c1c9..c7fb6a7a42 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportType2.types.diff @@ -5,57 +5,55 @@ * @type {C} */ var c; ->c : D -+>c : any ++>c : Chunk c.chunk; ->c.chunk : number ->c : D ->chunk : number +>c.chunk : any -+>c : any ++>c : Chunk +>chunk : any const D = require("./mod1"); ->D : typeof D ->require("./mod1") : typeof D -+>D : any -+>require("./mod1") : any ++>D : typeof Chunk ++>require("./mod1") : typeof Chunk >require : (name: string) => any >"./mod1" : "./mod1" -@@= skipped -18, +18 lines =@@ - >d : D + /** @type {D} */ + var d; +->d : D ++>d : Chunk d.chunk; ->d.chunk : number -+>d.chunk : any - >d : D +->d : D ->chunk : number ++>d.chunk : any ++>d : Chunk +>chunk : any === types.d.ts === declare function require(name: string): any; -@@= skipped -16, +16 lines =@@ - >module : { exports: any; } - >exports : any - --=== mod1.js === --/// --module.exports = class Chunk { +@@= skipped -37, +37 lines =@@ + === mod1.js === + /// + module.exports = class Chunk { ->module.exports = class Chunk { constructor() { this.chunk = 1; }} : typeof import("mod1") ->module.exports : typeof import("mod1") ->module : { exports: typeof import("mod1"); } ->exports : typeof import("mod1") ->class Chunk { constructor() { this.chunk = 1; }} : typeof import("mod1") ->Chunk : typeof import("mod1") -- -- constructor() { -- this.chunk = 1; -->this.chunk = 1 : 1 -->this.chunk : any -->this : this -->chunk : any -->1 : 1 -- } --} -- ++>module.exports = class Chunk { constructor() { this.chunk = 1; }} : typeof Chunk ++>module.exports : typeof Chunk ++>module : { Chunk: typeof Chunk; } ++>exports : typeof Chunk ++>class Chunk { constructor() { this.chunk = 1; }} : typeof Chunk ++>Chunk : typeof Chunk + + constructor() { + this.chunk = 1; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportTypeReferenceToClassAlias.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportTypeReferenceToClassAlias.errors.txt.diff index 5bb0ac21ec..5f24c65345 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportTypeReferenceToClassAlias.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportTypeReferenceToClassAlias.errors.txt.diff @@ -3,22 +3,19 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+mod1.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+test.js(1,22): error TS2306: File 'mod1.js' is not a module. ++test.js(1,32): error TS2694: Namespace '"mod1"' has no exported member 'C'. + + -+==== mod1.js (1 errors) ==== ++==== mod1.js (0 errors) ==== + class C { + s() { } + } + module.exports.C = C -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + +==== test.js (1 errors) ==== + /** @typedef {import('./mod1').C} X */ -+ ~~~~~~~~ -+!!! error TS2306: File 'mod1.js' is not a module. ++ ~ ++!!! error TS2694: Namespace '"mod1"' has no exported member 'C'. + /** @param {X} c */ + function demo(c) { + c.s diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportTypeReferenceToClassAlias.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportTypeReferenceToClassAlias.types.diff index 13ace9c048..cdcb194f76 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportTypeReferenceToClassAlias.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocImportTypeReferenceToClassAlias.types.diff @@ -1,22 +1,19 @@ --- old.jsdocImportTypeReferenceToClassAlias.types +++ new.jsdocImportTypeReferenceToClassAlias.types -@@= skipped -8, +8 lines =@@ - } +@@= skipped -9, +9 lines =@@ module.exports.C = C >module.exports.C = C : typeof C -->module.exports.C : typeof C + >module.exports.C : typeof C ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -+>module.exports.C : any -+>module.exports : any -+>module : any -+>exports : any -+>C : any ++>module.exports : typeof import("mod1") ++>module : { "mod1": typeof import("mod1"); } ++>exports : typeof import("mod1") + >C : typeof C >C : typeof C -->C : typeof C - === test.js === +@@= skipped -10, +10 lines =@@ /** @typedef {import('./mod1').C} X */ /** @param {X} c */ function demo(c) { diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment2.errors.txt.diff index cb7f156808..105a553196 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment2.errors.txt.diff @@ -5,26 +5,50 @@ -use.js(3,7): error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. -use.js(4,7): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -use.js(5,7): error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. -+use.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod.js(2,21): error TS2339: Property 'g' does not exist on type 'typeof import("mod")'. ++mod.js(2,37): error TS7006: Parameter 'n' implicitly has an 'any' type. ++mod.js(6,35): error TS2339: Property 'i' does not exist on type 'typeof import("mod")'. ++mod.js(6,51): error TS7006: Parameter 'mom' implicitly has an 'any' type. ++use.js(3,5): error TS2339: Property 'g' does not exist on type 'typeof import("mod")'. ++use.js(5,5): error TS2339: Property 'i' does not exist on type 'typeof import("mod")'. -==== use.js (4 errors) ==== -+==== use.js (1 errors) ==== ++==== use.js (2 errors) ==== var mod = require('./mod'); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. mod.f('no') - ~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. mod.g('also no') - ~~~~~~~~~ -!!! error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'. ++ ~ ++!!! error TS2339: Property 'g' does not exist on type 'typeof import("mod")'. mod.h(0) - ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. mod.i(1) - ~ -!!! error TS2345: Argument of type 'number' is not assignable to parameter of type 'string'. ++ ~ ++!!! error TS2339: Property 'i' does not exist on type 'typeof import("mod")'. - ==== mod.js (0 errors) ==== +-==== mod.js (0 errors) ==== ++==== mod.js (4 errors) ==== /** @param {number} n */ + exports.f = exports.g = function fg(n) { ++ ~ ++!!! error TS2339: Property 'g' does not exist on type 'typeof import("mod")'. ++ ~ ++!!! error TS7006: Parameter 'n' implicitly has an 'any' type. + return n + 1 + } + /** @param {string} mom */ + module.exports.h = module.exports.i = function hi(mom) { ++ ~ ++!!! error TS2339: Property 'i' does not exist on type 'typeof import("mod")'. ++ ~~~ ++!!! error TS7006: Parameter 'mom' implicitly has an 'any' type. + return `hi, ${mom}!`; + } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment2.types.diff index 7aa3d47f8c..15429d2ad4 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment2.types.diff @@ -6,8 +6,8 @@ var mod = require('./mod'); ->mod : typeof mod ->require('./mod') : typeof mod -+>mod : any -+>require('./mod') : any ++>mod : typeof import("mod") ++>require('./mod') : typeof import("mod") >require : any >'./mod' : "./mod" @@ -17,9 +17,9 @@ ->mod : typeof mod ->f : (n: number) => number +>mod.f('no') : any -+>mod.f : any -+>mod : any -+>f : any ++>mod.f : (n: any) => any ++>mod : typeof import("mod") ++>f : (n: any) => any >'no' : "no" mod.g('also no') @@ -29,19 +29,18 @@ ->g : (n: number) => number +>mod.g('also no') : any +>mod.g : any -+>mod : any ++>mod : typeof import("mod") +>g : any >'also no' : "also no" mod.h(0) -->mod.h(0) : string + >mod.h(0) : string ->mod.h : (mom: string) => string ->mod : typeof mod ->h : (mom: string) => string -+>mod.h(0) : any -+>mod.h : any -+>mod : any -+>h : any ++>mod.h : (mom: any) => string ++>mod : typeof import("mod") ++>h : (mom: any) => string >0 : 0 mod.i(1) @@ -51,32 +50,43 @@ ->i : (mom: string) => string +>mod.i(1) : any +>mod.i : any -+>mod : any ++>mod : typeof import("mod") +>i : any >1 : 1 --=== mod.js === --/** @param {number} n */ --exports.f = exports.g = function fg(n) { + === mod.js === + /** @param {number} n */ + exports.f = exports.g = function fg(n) { ->exports.f = exports.g = function fg(n) { return n + 1} : (n: number) => number ->exports.f : (n: number) => number -->exports : typeof import("mod") ++>exports.f = exports.g = function fg(n) { return n + 1} : (n: any) => any ++>exports.f : (n: any) => any + >exports : typeof import("mod") ->f : (n: number) => number ->exports.g = function fg(n) { return n + 1} : (n: number) => number ->exports.g : (n: number) => number -->exports : typeof import("mod") ++>f : (n: any) => any ++>exports.g = function fg(n) { return n + 1} : (n: any) => any ++>exports.g : any + >exports : typeof import("mod") ->g : (n: number) => number ->function fg(n) { return n + 1} : (n: number) => number ->fg : (n: number) => number ->n : number -- -- return n + 1 ++>g : any ++>function fg(n) { return n + 1} : (n: any) => any ++>fg : (n: any) => any ++>n : any + + return n + 1 ->n + 1 : number ->n : number -->1 : 1 --} --/** @param {string} mom */ --module.exports.h = module.exports.i = function hi(mom) { ++>n + 1 : any ++>n : any + >1 : 1 + } + /** @param {string} mom */ + module.exports.h = module.exports.i = function hi(mom) { ->module.exports.h = module.exports.i = function hi(mom) { return `hi, ${mom}!`;} : (mom: string) => string ->module.exports.h : (mom: string) => string ->module.exports : typeof module.exports @@ -92,9 +102,25 @@ ->function hi(mom) { return `hi, ${mom}!`;} : (mom: string) => string ->hi : (mom: string) => string ->mom : string -- -- return `hi, ${mom}!`; -->`hi, ${mom}!` : string ++>module.exports.h = module.exports.i = function hi(mom) { return `hi, ${mom}!`;} : (mom: any) => string ++>module.exports.h : (mom: any) => string ++>module.exports : typeof import("mod") ++>module : { "mod": typeof import("mod"); } ++>exports : typeof import("mod") ++>h : (mom: any) => string ++>module.exports.i = function hi(mom) { return `hi, ${mom}!`;} : (mom: any) => string ++>module.exports.i : any ++>module.exports : typeof import("mod") ++>module : { "mod": typeof import("mod"); } ++>exports : typeof import("mod") ++>i : any ++>function hi(mom) { return `hi, ${mom}!`;} : (mom: any) => string ++>hi : (mom: any) => string ++>mom : any + + return `hi, ${mom}!`; + >`hi, ${mom}!` : string ->mom : string --} -- ++>mom : any + } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment3.errors.txt.diff index 077840bfdb..ee4240b4f9 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment3.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment3.errors.txt.diff @@ -3,304 +3,301 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+a.js(1,1): error TS2304: Cannot find name 'exports'. -+a.js(1,20): error TS2304: Cannot find name 'exports'. -+a.js(1,43): error TS2304: Cannot find name 'exports'. -+a.js(1,65): error TS2304: Cannot find name 'exports'. -+a.js(1,82): error TS2304: Cannot find name 'exports'. -+a.js(1,98): error TS2304: Cannot find name 'exports'. -+a.js(1,114): error TS2304: Cannot find name 'exports'. -+a.js(1,131): error TS2304: Cannot find name 'exports'. -+a.js(1,156): error TS2304: Cannot find name 'exports'. -+a.js(1,182): error TS2304: Cannot find name 'exports'. -+a.js(1,202): error TS2304: Cannot find name 'exports'. -+a.js(1,225): error TS2304: Cannot find name 'exports'. -+a.js(1,249): error TS2304: Cannot find name 'exports'. -+a.js(1,267): error TS2304: Cannot find name 'exports'. -+a.js(1,288): error TS2304: Cannot find name 'exports'. -+a.js(1,308): error TS2304: Cannot find name 'exports'. -+a.js(1,323): error TS2304: Cannot find name 'exports'. -+a.js(1,343): error TS2304: Cannot find name 'exports'. -+a.js(1,362): error TS2304: Cannot find name 'exports'. -+a.js(1,376): error TS2304: Cannot find name 'exports'. -+a.js(1,396): error TS2304: Cannot find name 'exports'. -+a.js(1,415): error TS2304: Cannot find name 'exports'. -+a.js(1,429): error TS2304: Cannot find name 'exports'. -+a.js(1,446): error TS2304: Cannot find name 'exports'. -+a.js(1,466): error TS2304: Cannot find name 'exports'. -+a.js(1,482): error TS2304: Cannot find name 'exports'. -+a.js(1,502): error TS2304: Cannot find name 'exports'. -+a.js(1,520): error TS2304: Cannot find name 'exports'. -+a.js(1,540): error TS2304: Cannot find name 'exports'. -+a.js(1,562): error TS2304: Cannot find name 'exports'. -+a.js(1,583): error TS2304: Cannot find name 'exports'. -+a.js(1,599): error TS2304: Cannot find name 'exports'. -+a.js(1,617): error TS2304: Cannot find name 'exports'. -+a.js(1,634): error TS2304: Cannot find name 'exports'. -+a.js(1,655): error TS2304: Cannot find name 'exports'. -+a.js(1,675): error TS2304: Cannot find name 'exports'. -+a.js(1,690): error TS2304: Cannot find name 'exports'. -+a.js(1,713): error TS2304: Cannot find name 'exports'. -+a.js(1,730): error TS2304: Cannot find name 'exports'. -+a.js(1,744): error TS2304: Cannot find name 'exports'. -+a.js(1,764): error TS2304: Cannot find name 'exports'. -+a.js(1,780): error TS2304: Cannot find name 'exports'. -+a.js(1,803): error TS2304: Cannot find name 'exports'. -+a.js(1,825): error TS2304: Cannot find name 'exports'. -+a.js(1,842): error TS2304: Cannot find name 'exports'. -+a.js(1,863): error TS2304: Cannot find name 'exports'. -+a.js(1,881): error TS2304: Cannot find name 'exports'. -+a.js(1,903): error TS2304: Cannot find name 'exports'. -+a.js(1,920): error TS2304: Cannot find name 'exports'. -+a.js(1,935): error TS2304: Cannot find name 'exports'. -+a.js(1,951): error TS2304: Cannot find name 'exports'. -+a.js(1,975): error TS2304: Cannot find name 'exports'. -+a.js(1,999): error TS2304: Cannot find name 'exports'. -+a.js(1,1018): error TS2304: Cannot find name 'exports'. -+a.js(1,1037): error TS2304: Cannot find name 'exports'. -+a.js(1,1055): error TS2304: Cannot find name 'exports'. -+a.js(1,1081): error TS2304: Cannot find name 'exports'. -+a.js(1,1106): error TS2304: Cannot find name 'exports'. -+a.js(1,1126): error TS2304: Cannot find name 'exports'. -+a.js(1,1146): error TS2304: Cannot find name 'exports'. -+a.js(1,1165): error TS2304: Cannot find name 'exports'. -+a.js(1,1179): error TS2304: Cannot find name 'exports'. -+a.js(1,1193): error TS2304: Cannot find name 'exports'. -+a.js(1,1217): error TS2304: Cannot find name 'exports'. -+a.js(1,1240): error TS2304: Cannot find name 'exports'. -+a.js(1,1258): error TS2304: Cannot find name 'exports'. -+a.js(1,1276): error TS2304: Cannot find name 'exports'. -+a.js(1,1299): error TS2304: Cannot find name 'exports'. -+a.js(1,1321): error TS2304: Cannot find name 'exports'. -+a.js(1,1338): error TS2304: Cannot find name 'exports'. -+a.js(1,1360): error TS2304: Cannot find name 'exports'. -+a.js(1,1381): error TS2304: Cannot find name 'exports'. -+a.js(1,1397): error TS2304: Cannot find name 'exports'. -+a.js(1,1419): error TS2304: Cannot find name 'exports'. -+a.js(1,1440): error TS2304: Cannot find name 'exports'. -+a.js(1,1463): error TS2304: Cannot find name 'exports'. -+a.js(1,1485): error TS2304: Cannot find name 'exports'. -+a.js(1,1502): error TS2304: Cannot find name 'exports'. -+a.js(1,1522): error TS2304: Cannot find name 'exports'. -+a.js(1,1537): error TS2304: Cannot find name 'exports'. -+a.js(1,1554): error TS2304: Cannot find name 'exports'. -+a.js(1,1573): error TS2304: Cannot find name 'exports'. -+a.js(1,1591): error TS2304: Cannot find name 'exports'. -+a.js(1,1610): error TS2304: Cannot find name 'exports'. -+a.js(1,1624): error TS2304: Cannot find name 'exports'. -+a.js(1,1647): error TS2304: Cannot find name 'exports'. -+a.js(1,1669): error TS2304: Cannot find name 'exports'. -+a.js(1,1686): error TS2304: Cannot find name 'exports'. -+a.js(1,1705): error TS2304: Cannot find name 'exports'. -+a.js(1,1728): error TS2304: Cannot find name 'exports'. -+a.js(1,1750): error TS2304: Cannot find name 'exports'. -+a.js(1,1767): error TS2304: Cannot find name 'exports'. -+a.js(1,1785): error TS2304: Cannot find name 'exports'. -+a.js(1,1801): error TS2304: Cannot find name 'exports'. -+a.js(1,1822): error TS2304: Cannot find name 'exports'. -+a.js(1,1837): error TS2304: Cannot find name 'exports'. -+a.js(1,1856): error TS2304: Cannot find name 'exports'. -+a.js(1,1882): error TS2304: Cannot find name 'exports'. -+a.js(1,1902): error TS2304: Cannot find name 'exports'. ++a.js(1,28): error TS2339: Property 'selectSeries' does not exist on type 'typeof import("a")'. ++a.js(1,51): error TS2339: Property 'selectLimit' does not exist on type 'typeof import("a")'. ++a.js(1,73): error TS2339: Property 'select' does not exist on type 'typeof import("a")'. ++a.js(1,90): error TS2339: Property 'foldr' does not exist on type 'typeof import("a")'. ++a.js(1,106): error TS2339: Property 'foldl' does not exist on type 'typeof import("a")'. ++a.js(1,122): error TS2339: Property 'inject' does not exist on type 'typeof import("a")'. ++a.js(1,139): error TS2339: Property 'forEachOfLimit' does not exist on type 'typeof import("a")'. ++a.js(1,164): error TS2339: Property 'forEachOfSeries' does not exist on type 'typeof import("a")'. ++a.js(1,190): error TS2339: Property 'forEachOf' does not exist on type 'typeof import("a")'. ++a.js(1,210): error TS2339: Property 'forEachLimit' does not exist on type 'typeof import("a")'. ++a.js(1,233): error TS2339: Property 'forEachSeries' does not exist on type 'typeof import("a")'. ++a.js(1,257): error TS2339: Property 'forEach' does not exist on type 'typeof import("a")'. ++a.js(1,275): error TS2339: Property 'findSeries' does not exist on type 'typeof import("a")'. ++a.js(1,296): error TS2339: Property 'findLimit' does not exist on type 'typeof import("a")'. ++a.js(1,316): error TS2339: Property 'find' does not exist on type 'typeof import("a")'. ++a.js(1,331): error TS2339: Property 'anySeries' does not exist on type 'typeof import("a")'. ++a.js(1,351): error TS2339: Property 'anyLimit' does not exist on type 'typeof import("a")'. ++a.js(1,370): error TS2339: Property 'any' does not exist on type 'typeof import("a")'. ++a.js(1,384): error TS2339: Property 'allSeries' does not exist on type 'typeof import("a")'. ++a.js(1,404): error TS2339: Property 'allLimit' does not exist on type 'typeof import("a")'. ++a.js(1,423): error TS2339: Property 'all' does not exist on type 'typeof import("a")'. ++a.js(1,437): error TS2339: Property 'whilst' does not exist on type 'typeof import("a")'. ++a.js(1,454): error TS2339: Property 'waterfall' does not exist on type 'typeof import("a")'. ++a.js(1,474): error TS2339: Property 'until' does not exist on type 'typeof import("a")'. ++a.js(1,490): error TS2339: Property 'unmemoize' does not exist on type 'typeof import("a")'. ++a.js(1,510): error TS2339: Property 'tryEach' does not exist on type 'typeof import("a")'. ++a.js(1,528): error TS2339: Property 'transform' does not exist on type 'typeof import("a")'. ++a.js(1,548): error TS2339: Property 'timesSeries' does not exist on type 'typeof import("a")'. ++a.js(1,570): error TS2339: Property 'timesLimit' does not exist on type 'typeof import("a")'. ++a.js(1,591): error TS2339: Property 'times' does not exist on type 'typeof import("a")'. ++a.js(1,607): error TS2339: Property 'timeout' does not exist on type 'typeof import("a")'. ++a.js(1,625): error TS2339: Property 'sortBy' does not exist on type 'typeof import("a")'. ++a.js(1,642): error TS2339: Property 'someSeries' does not exist on type 'typeof import("a")'. ++a.js(1,663): error TS2339: Property 'someLimit' does not exist on type 'typeof import("a")'. ++a.js(1,683): error TS2339: Property 'some' does not exist on type 'typeof import("a")'. ++a.js(1,698): error TS2339: Property 'setImmediate' does not exist on type 'typeof import("a")'. ++a.js(1,721): error TS2339: Property 'series' does not exist on type 'typeof import("a")'. ++a.js(1,738): error TS2339: Property 'seq' does not exist on type 'typeof import("a")'. ++a.js(1,752): error TS2339: Property 'retryable' does not exist on type 'typeof import("a")'. ++a.js(1,772): error TS2339: Property 'retry' does not exist on type 'typeof import("a")'. ++a.js(1,788): error TS2339: Property 'rejectSeries' does not exist on type 'typeof import("a")'. ++a.js(1,811): error TS2339: Property 'rejectLimit' does not exist on type 'typeof import("a")'. ++a.js(1,833): error TS2339: Property 'reject' does not exist on type 'typeof import("a")'. ++a.js(1,850): error TS2339: Property 'reflectAll' does not exist on type 'typeof import("a")'. ++a.js(1,871): error TS2339: Property 'reflect' does not exist on type 'typeof import("a")'. ++a.js(1,889): error TS2339: Property 'reduceRight' does not exist on type 'typeof import("a")'. ++a.js(1,911): error TS2339: Property 'reduce' does not exist on type 'typeof import("a")'. ++a.js(1,928): error TS2339: Property 'race' does not exist on type 'typeof import("a")'. ++a.js(1,943): error TS2339: Property 'queue' does not exist on type 'typeof import("a")'. ++a.js(1,959): error TS2339: Property 'priorityQueue' does not exist on type 'typeof import("a")'. ++a.js(1,983): error TS2339: Property 'parallelLimit' does not exist on type 'typeof import("a")'. ++a.js(1,1007): error TS2339: Property 'parallel' does not exist on type 'typeof import("a")'. ++a.js(1,1026): error TS2339: Property 'nextTick' does not exist on type 'typeof import("a")'. ++a.js(1,1045): error TS2339: Property 'memoize' does not exist on type 'typeof import("a")'. ++a.js(1,1063): error TS2339: Property 'mapValuesSeries' does not exist on type 'typeof import("a")'. ++a.js(1,1089): error TS2339: Property 'mapValuesLimit' does not exist on type 'typeof import("a")'. ++a.js(1,1114): error TS2339: Property 'mapValues' does not exist on type 'typeof import("a")'. ++a.js(1,1134): error TS2339: Property 'mapSeries' does not exist on type 'typeof import("a")'. ++a.js(1,1154): error TS2339: Property 'mapLimit' does not exist on type 'typeof import("a")'. ++a.js(1,1173): error TS2339: Property 'map' does not exist on type 'typeof import("a")'. ++a.js(1,1187): error TS2339: Property 'log' does not exist on type 'typeof import("a")'. ++a.js(1,1201): error TS2339: Property 'groupBySeries' does not exist on type 'typeof import("a")'. ++a.js(1,1225): error TS2339: Property 'groupByLimit' does not exist on type 'typeof import("a")'. ++a.js(1,1248): error TS2339: Property 'groupBy' does not exist on type 'typeof import("a")'. ++a.js(1,1266): error TS2339: Property 'forever' does not exist on type 'typeof import("a")'. ++a.js(1,1284): error TS2339: Property 'filterSeries' does not exist on type 'typeof import("a")'. ++a.js(1,1307): error TS2339: Property 'filterLimit' does not exist on type 'typeof import("a")'. ++a.js(1,1329): error TS2339: Property 'filter' does not exist on type 'typeof import("a")'. ++a.js(1,1346): error TS2339: Property 'everySeries' does not exist on type 'typeof import("a")'. ++a.js(1,1368): error TS2339: Property 'everyLimit' does not exist on type 'typeof import("a")'. ++a.js(1,1389): error TS2339: Property 'every' does not exist on type 'typeof import("a")'. ++a.js(1,1405): error TS2339: Property 'ensureAsync' does not exist on type 'typeof import("a")'. ++a.js(1,1427): error TS2339: Property 'eachSeries' does not exist on type 'typeof import("a")'. ++a.js(1,1448): error TS2339: Property 'eachOfSeries' does not exist on type 'typeof import("a")'. ++a.js(1,1471): error TS2339: Property 'eachOfLimit' does not exist on type 'typeof import("a")'. ++a.js(1,1493): error TS2339: Property 'eachOf' does not exist on type 'typeof import("a")'. ++a.js(1,1510): error TS2339: Property 'eachLimit' does not exist on type 'typeof import("a")'. ++a.js(1,1530): error TS2339: Property 'each' does not exist on type 'typeof import("a")'. ++a.js(1,1545): error TS2339: Property 'during' does not exist on type 'typeof import("a")'. ++a.js(1,1562): error TS2339: Property 'doWhilst' does not exist on type 'typeof import("a")'. ++a.js(1,1581): error TS2339: Property 'doUntil' does not exist on type 'typeof import("a")'. ++a.js(1,1599): error TS2339: Property 'doDuring' does not exist on type 'typeof import("a")'. ++a.js(1,1618): error TS2339: Property 'dir' does not exist on type 'typeof import("a")'. ++a.js(1,1632): error TS2339: Property 'detectSeries' does not exist on type 'typeof import("a")'. ++a.js(1,1655): error TS2339: Property 'detectLimit' does not exist on type 'typeof import("a")'. ++a.js(1,1677): error TS2339: Property 'detect' does not exist on type 'typeof import("a")'. ++a.js(1,1694): error TS2339: Property 'constant' does not exist on type 'typeof import("a")'. ++a.js(1,1713): error TS2339: Property 'concatSeries' does not exist on type 'typeof import("a")'. ++a.js(1,1736): error TS2339: Property 'concatLimit' does not exist on type 'typeof import("a")'. ++a.js(1,1758): error TS2339: Property 'concat' does not exist on type 'typeof import("a")'. ++a.js(1,1775): error TS2339: Property 'compose' does not exist on type 'typeof import("a")'. ++a.js(1,1793): error TS2339: Property 'cargo' does not exist on type 'typeof import("a")'. ++a.js(1,1809): error TS2339: Property 'autoInject' does not exist on type 'typeof import("a")'. ++a.js(1,1830): error TS2339: Property 'auto' does not exist on type 'typeof import("a")'. ++a.js(1,1845): error TS2339: Property 'asyncify' does not exist on type 'typeof import("a")'. ++a.js(1,1864): error TS2339: Property 'applyEachSeries' does not exist on type 'typeof import("a")'. ++a.js(1,1890): error TS2339: Property 'applyEach' does not exist on type 'typeof import("a")'. ++a.js(1,1910): error TS2339: Property 'apply' does not exist on type 'typeof import("a")'. + + -+==== a.js (99 errors) ==== ++==== a.js (98 errors) ==== + exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'selectSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'selectLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'select' does not exist on type 'typeof import("a")'. ++ ~~~~~ ++!!! error TS2339: Property 'foldr' does not exist on type 'typeof import("a")'. ++ ~~~~~ ++!!! error TS2339: Property 'foldl' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'inject' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~~~ ++!!! error TS2339: Property 'forEachOfLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~~~~ ++!!! error TS2339: Property 'forEachOfSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'forEachOf' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'forEachLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~~ ++!!! error TS2339: Property 'forEachSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~ ++!!! error TS2339: Property 'forEach' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~ ++!!! error TS2339: Property 'findSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'findLimit' does not exist on type 'typeof import("a")'. ++ ~~~~ ++!!! error TS2339: Property 'find' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'anySeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~ ++!!! error TS2339: Property 'anyLimit' does not exist on type 'typeof import("a")'. ++ ~~~ ++!!! error TS2339: Property 'any' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'allSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~ ++!!! error TS2339: Property 'allLimit' does not exist on type 'typeof import("a")'. ++ ~~~ ++!!! error TS2339: Property 'all' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'whilst' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'waterfall' does not exist on type 'typeof import("a")'. ++ ~~~~~ ++!!! error TS2339: Property 'until' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'unmemoize' does not exist on type 'typeof import("a")'. ++ ~~~~~~~ ++!!! error TS2339: Property 'tryEach' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'transform' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'timesSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~ ++!!! error TS2339: Property 'timesLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~ ++!!! error TS2339: Property 'times' does not exist on type 'typeof import("a")'. ++ ~~~~~~~ ++!!! error TS2339: Property 'timeout' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'sortBy' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~ ++!!! error TS2339: Property 'someSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'someLimit' does not exist on type 'typeof import("a")'. ++ ~~~~ ++!!! error TS2339: Property 'some' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'setImmediate' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'series' does not exist on type 'typeof import("a")'. ++ ~~~ ++!!! error TS2339: Property 'seq' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'retryable' does not exist on type 'typeof import("a")'. ++ ~~~~~ ++!!! error TS2339: Property 'retry' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'rejectSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'rejectLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'reject' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~ ++!!! error TS2339: Property 'reflectAll' does not exist on type 'typeof import("a")'. ++ ~~~~~~~ ++!!! error TS2339: Property 'reflect' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'reduceRight' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'reduce' does not exist on type 'typeof import("a")'. ++ ~~~~ ++!!! error TS2339: Property 'race' does not exist on type 'typeof import("a")'. ++ ~~~~~ ++!!! error TS2339: Property 'queue' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~~ ++!!! error TS2339: Property 'priorityQueue' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~~ ++!!! error TS2339: Property 'parallelLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~ ++!!! error TS2339: Property 'parallel' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~ ++!!! error TS2339: Property 'nextTick' does not exist on type 'typeof import("a")'. ++ ~~~~~~~ ++!!! error TS2339: Property 'memoize' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~~~~ ++!!! error TS2339: Property 'mapValuesSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~~~ ++!!! error TS2339: Property 'mapValuesLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'mapValues' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'mapSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~ ++!!! error TS2339: Property 'mapLimit' does not exist on type 'typeof import("a")'. ++ ~~~ ++!!! error TS2339: Property 'map' does not exist on type 'typeof import("a")'. ++ ~~~ ++!!! error TS2339: Property 'log' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~~ ++!!! error TS2339: Property 'groupBySeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'groupByLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~~~ ++!!! error TS2339: Property 'groupBy' does not exist on type 'typeof import("a")'. ++ ~~~~~~~ ++!!! error TS2339: Property 'forever' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'filterSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'filterLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'filter' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'everySeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~ ++!!! error TS2339: Property 'everyLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~ ++!!! error TS2339: Property 'every' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'ensureAsync' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~ ++!!! error TS2339: Property 'eachSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'eachOfSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'eachOfLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'eachOf' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'eachLimit' does not exist on type 'typeof import("a")'. ++ ~~~~ ++!!! error TS2339: Property 'each' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'during' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~ ++!!! error TS2339: Property 'doWhilst' does not exist on type 'typeof import("a")'. ++ ~~~~~~~ ++!!! error TS2339: Property 'doUntil' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~ ++!!! error TS2339: Property 'doDuring' does not exist on type 'typeof import("a")'. ++ ~~~ ++!!! error TS2339: Property 'dir' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'detectSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'detectLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'detect' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~ ++!!! error TS2339: Property 'constant' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'concatSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~ ++!!! error TS2339: Property 'concatLimit' does not exist on type 'typeof import("a")'. ++ ~~~~~~ ++!!! error TS2339: Property 'concat' does not exist on type 'typeof import("a")'. ++ ~~~~~~~ ++!!! error TS2339: Property 'compose' does not exist on type 'typeof import("a")'. ++ ~~~~~ ++!!! error TS2339: Property 'cargo' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~ ++!!! error TS2339: Property 'autoInject' does not exist on type 'typeof import("a")'. ++ ~~~~ ++!!! error TS2339: Property 'auto' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~ ++!!! error TS2339: Property 'asyncify' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~~~~~~~ ++!!! error TS2339: Property 'applyEachSeries' does not exist on type 'typeof import("a")'. ++ ~~~~~~~~~ ++!!! error TS2339: Property 'applyEach' does not exist on type 'typeof import("a")'. ++ ~~~~~ ++!!! error TS2339: Property 'apply' does not exist on type 'typeof import("a")'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment3.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment3.types.diff index ecffb5cf4e..2acfbfb3cb 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeFromChainedAssignment3.types.diff @@ -1,503 +1,25 @@ --- old.jsdocTypeFromChainedAssignment3.types +++ new.jsdocTypeFromChainedAssignment3.types -@@= skipped -3, +3 lines =@@ +@@= skipped -2, +2 lines =@@ + === a.js === exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined; >exports.wrapSync = exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.wrapSync : any -->exports : typeof import("a") -+>exports : any - >wrapSync : any +->exports.wrapSync : any ++>exports.wrapSync : undefined + >exports : typeof import("a") +->wrapSync : any ++>wrapSync : undefined >exports.selectSeries = exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined >exports.selectSeries : any -->exports : typeof import("a") -+>exports : any - >selectSeries : any - >exports.selectLimit = exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.selectLimit : any -->exports : typeof import("a") -+>exports : any - >selectLimit : any - >exports.select = exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.select : any -->exports : typeof import("a") -+>exports : any - >select : any - >exports.foldr = exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.foldr : any -->exports : typeof import("a") -+>exports : any - >foldr : any - >exports.foldl = exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.foldl : any -->exports : typeof import("a") -+>exports : any - >foldl : any - >exports.inject = exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.inject : any -->exports : typeof import("a") -+>exports : any - >inject : any - >exports.forEachOfLimit = exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.forEachOfLimit : any -->exports : typeof import("a") -+>exports : any - >forEachOfLimit : any - >exports.forEachOfSeries = exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.forEachOfSeries : any -->exports : typeof import("a") -+>exports : any - >forEachOfSeries : any - >exports.forEachOf = exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.forEachOf : any -->exports : typeof import("a") -+>exports : any - >forEachOf : any - >exports.forEachLimit = exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.forEachLimit : any -->exports : typeof import("a") -+>exports : any - >forEachLimit : any - >exports.forEachSeries = exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.forEachSeries : any -->exports : typeof import("a") -+>exports : any - >forEachSeries : any - >exports.forEach = exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.forEach : any -->exports : typeof import("a") -+>exports : any - >forEach : any - >exports.findSeries = exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.findSeries : any -->exports : typeof import("a") -+>exports : any - >findSeries : any - >exports.findLimit = exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.findLimit : any -->exports : typeof import("a") -+>exports : any - >findLimit : any - >exports.find = exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.find : any -->exports : typeof import("a") -+>exports : any - >find : any - >exports.anySeries = exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.anySeries : any -->exports : typeof import("a") -+>exports : any - >anySeries : any - >exports.anyLimit = exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.anyLimit : any -->exports : typeof import("a") -+>exports : any - >anyLimit : any - >exports.any = exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.any : any -->exports : typeof import("a") -+>exports : any - >any : any - >exports.allSeries = exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.allSeries : any -->exports : typeof import("a") -+>exports : any - >allSeries : any - >exports.allLimit = exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.allLimit : any -->exports : typeof import("a") -+>exports : any - >allLimit : any - >exports.all = exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.all : any -->exports : typeof import("a") -+>exports : any - >all : any - >exports.whilst = exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.whilst : any -->exports : typeof import("a") -+>exports : any - >whilst : any - >exports.waterfall = exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.waterfall : any -->exports : typeof import("a") -+>exports : any - >waterfall : any - >exports.until = exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.until : any -->exports : typeof import("a") -+>exports : any - >until : any - >exports.unmemoize = exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.unmemoize : any -->exports : typeof import("a") -+>exports : any - >unmemoize : any - >exports.tryEach = exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.tryEach : any -->exports : typeof import("a") -+>exports : any - >tryEach : any - >exports.transform = exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.transform : any -->exports : typeof import("a") -+>exports : any - >transform : any - >exports.timesSeries = exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.timesSeries : any -->exports : typeof import("a") -+>exports : any - >timesSeries : any - >exports.timesLimit = exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.timesLimit : any -->exports : typeof import("a") -+>exports : any - >timesLimit : any - >exports.times = exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.times : any -->exports : typeof import("a") -+>exports : any - >times : any - >exports.timeout = exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.timeout : any -->exports : typeof import("a") -+>exports : any - >timeout : any - >exports.sortBy = exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.sortBy : any -->exports : typeof import("a") -+>exports : any - >sortBy : any - >exports.someSeries = exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.someSeries : any -->exports : typeof import("a") -+>exports : any - >someSeries : any - >exports.someLimit = exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.someLimit : any -->exports : typeof import("a") -+>exports : any - >someLimit : any - >exports.some = exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.some : any -->exports : typeof import("a") -+>exports : any - >some : any - >exports.setImmediate = exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.setImmediate : any -->exports : typeof import("a") -+>exports : any - >setImmediate : any - >exports.series = exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.series : any -->exports : typeof import("a") -+>exports : any - >series : any - >exports.seq = exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.seq : any -->exports : typeof import("a") -+>exports : any - >seq : any - >exports.retryable = exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.retryable : any -->exports : typeof import("a") -+>exports : any - >retryable : any - >exports.retry = exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.retry : any -->exports : typeof import("a") -+>exports : any - >retry : any - >exports.rejectSeries = exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.rejectSeries : any -->exports : typeof import("a") -+>exports : any - >rejectSeries : any - >exports.rejectLimit = exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.rejectLimit : any -->exports : typeof import("a") -+>exports : any - >rejectLimit : any - >exports.reject = exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.reject : any -->exports : typeof import("a") -+>exports : any - >reject : any - >exports.reflectAll = exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.reflectAll : any -->exports : typeof import("a") -+>exports : any - >reflectAll : any - >exports.reflect = exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.reflect : any -->exports : typeof import("a") -+>exports : any - >reflect : any - >exports.reduceRight = exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.reduceRight : any -->exports : typeof import("a") -+>exports : any - >reduceRight : any - >exports.reduce = exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.reduce : any -->exports : typeof import("a") -+>exports : any - >reduce : any - >exports.race = exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.race : any -->exports : typeof import("a") -+>exports : any - >race : any - >exports.queue = exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.queue : any -->exports : typeof import("a") -+>exports : any - >queue : any - >exports.priorityQueue = exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.priorityQueue : any -->exports : typeof import("a") -+>exports : any - >priorityQueue : any - >exports.parallelLimit = exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.parallelLimit : any -->exports : typeof import("a") -+>exports : any - >parallelLimit : any - >exports.parallel = exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.parallel : any -->exports : typeof import("a") -+>exports : any - >parallel : any - >exports.nextTick = exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.nextTick : any -->exports : typeof import("a") -+>exports : any - >nextTick : any - >exports.memoize = exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.memoize : any -->exports : typeof import("a") -+>exports : any - >memoize : any - >exports.mapValuesSeries = exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.mapValuesSeries : any -->exports : typeof import("a") -+>exports : any - >mapValuesSeries : any - >exports.mapValuesLimit = exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.mapValuesLimit : any -->exports : typeof import("a") -+>exports : any - >mapValuesLimit : any - >exports.mapValues = exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.mapValues : any -->exports : typeof import("a") -+>exports : any - >mapValues : any - >exports.mapSeries = exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.mapSeries : any -->exports : typeof import("a") -+>exports : any - >mapSeries : any - >exports.mapLimit = exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.mapLimit : any -->exports : typeof import("a") -+>exports : any - >mapLimit : any - >exports.map = exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.map : any -->exports : typeof import("a") -+>exports : any - >map : any - >exports.log = exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.log : any -->exports : typeof import("a") -+>exports : any - >log : any - >exports.groupBySeries = exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.groupBySeries : any -->exports : typeof import("a") -+>exports : any - >groupBySeries : any - >exports.groupByLimit = exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.groupByLimit : any -->exports : typeof import("a") -+>exports : any - >groupByLimit : any - >exports.groupBy = exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.groupBy : any -->exports : typeof import("a") -+>exports : any - >groupBy : any - >exports.forever = exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.forever : any -->exports : typeof import("a") -+>exports : any - >forever : any - >exports.filterSeries = exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.filterSeries : any -->exports : typeof import("a") -+>exports : any - >filterSeries : any - >exports.filterLimit = exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.filterLimit : any -->exports : typeof import("a") -+>exports : any - >filterLimit : any - >exports.filter = exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.filter : any -->exports : typeof import("a") -+>exports : any - >filter : any - >exports.everySeries = exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.everySeries : any -->exports : typeof import("a") -+>exports : any - >everySeries : any - >exports.everyLimit = exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.everyLimit : any -->exports : typeof import("a") -+>exports : any - >everyLimit : any - >exports.every = exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.every : any -->exports : typeof import("a") -+>exports : any - >every : any - >exports.ensureAsync = exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.ensureAsync : any -->exports : typeof import("a") -+>exports : any - >ensureAsync : any - >exports.eachSeries = exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.eachSeries : any -->exports : typeof import("a") -+>exports : any - >eachSeries : any - >exports.eachOfSeries = exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.eachOfSeries : any -->exports : typeof import("a") -+>exports : any - >eachOfSeries : any - >exports.eachOfLimit = exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.eachOfLimit : any -->exports : typeof import("a") -+>exports : any - >eachOfLimit : any - >exports.eachOf = exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.eachOf : any -->exports : typeof import("a") -+>exports : any - >eachOf : any - >exports.eachLimit = exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.eachLimit : any -->exports : typeof import("a") -+>exports : any - >eachLimit : any - >exports.each = exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.each : any -->exports : typeof import("a") -+>exports : any - >each : any - >exports.during = exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.during : any -->exports : typeof import("a") -+>exports : any - >during : any - >exports.doWhilst = exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.doWhilst : any -->exports : typeof import("a") -+>exports : any - >doWhilst : any - >exports.doUntil = exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.doUntil : any -->exports : typeof import("a") -+>exports : any - >doUntil : any - >exports.doDuring = exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.doDuring : any -->exports : typeof import("a") -+>exports : any - >doDuring : any - >exports.dir = exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.dir : any -->exports : typeof import("a") -+>exports : any - >dir : any - >exports.detectSeries = exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.detectSeries : any -->exports : typeof import("a") -+>exports : any - >detectSeries : any - >exports.detectLimit = exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.detectLimit : any -->exports : typeof import("a") -+>exports : any - >detectLimit : any - >exports.detect = exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.detect : any -->exports : typeof import("a") -+>exports : any - >detect : any - >exports.constant = exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.constant : any -->exports : typeof import("a") -+>exports : any - >constant : any - >exports.concatSeries = exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.concatSeries : any -->exports : typeof import("a") -+>exports : any - >concatSeries : any - >exports.concatLimit = exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.concatLimit : any -->exports : typeof import("a") -+>exports : any - >concatLimit : any - >exports.concat = exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.concat : any -->exports : typeof import("a") -+>exports : any - >concat : any - >exports.compose = exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.compose : any -->exports : typeof import("a") -+>exports : any - >compose : any - >exports.cargo = exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.cargo : any -->exports : typeof import("a") -+>exports : any - >cargo : any - >exports.autoInject = exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.autoInject : any -->exports : typeof import("a") -+>exports : any - >autoInject : any - >exports.auto = exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.auto : any -->exports : typeof import("a") -+>exports : any - >auto : any - >exports.asyncify = exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.asyncify : any -->exports : typeof import("a") -+>exports : any - >asyncify : any - >exports.applyEachSeries = exports.applyEach = exports.apply = undefined : undefined - >exports.applyEachSeries : any -->exports : typeof import("a") -+>exports : any - >applyEachSeries : any - >exports.applyEach = exports.apply = undefined : undefined - >exports.applyEach : any -->exports : typeof import("a") -+>exports : any + >exports : typeof import("a") +@@= skipped -392, +392 lines =@@ + >exports : typeof import("a") >applyEach : any >exports.apply = undefined : undefined ->exports.apply : undefined -->exports : typeof import("a") -->apply : undefined +>exports.apply : any -+>exports : any + >exports : typeof import("a") +->apply : undefined +>apply : any >undefined : undefined diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceExports.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceExports.errors.txt.diff index 262c292351..19c305b268 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceExports.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceExports.errors.txt.diff @@ -3,18 +3,15 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+bug27342.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+bug27342.js(3,11): error TS2304: Cannot find name 'exports'. ++bug27342.js(3,11): error TS2709: Cannot use namespace 'exports' as a type. + + -+==== bug27342.js (2 errors) ==== ++==== bug27342.js (1 errors) ==== + module.exports = {} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + /** + * @type {exports} + ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++!!! error TS2709: Cannot use namespace 'exports' as a type. + */ + var x + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceExports.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceExports.types.diff index 350242544a..a2ca9d813d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceExports.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceExports.types.diff @@ -9,9 +9,9 @@ ->module : { exports: typeof module.exports; } ->exports : typeof module.exports +>module.exports = {} : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} >{} : {} /** diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfClassExpression.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfClassExpression.errors.txt.diff index 05a6b458d4..50c492237b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfClassExpression.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfClassExpression.errors.txt.diff @@ -3,26 +3,29 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+MC.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+MC.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++MC.js(5,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++MW.js(8,10): error TS2339: Property 'compiler' does not exist on type 'MW'. ++MW.js(12,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + -+==== MC.js (2 errors) ==== ++==== MC.js (1 errors) ==== + const MW = require("./MW"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + /** @typedef {number} Cictema */ + + module.exports = class MC { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ + watch() { ++ ~~~~~~~~~~~ + return new MW(this); ++ ~~~~~~~~~~~~~~~~~~~~~~~~ + } ++ ~~~ + }; ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + -+==== MW.js (0 errors) ==== ++==== MW.js (2 errors) ==== + /** @typedef {import("./MC")} MC */ + + class MW { @@ -31,8 +34,12 @@ + */ + constructor(compiler) { + this.compiler = compiler; ++ ~~~~~~~~ ++!!! error TS2339: Property 'compiler' does not exist on type 'MW'. + } + } + + module.exports = MW; ++ ~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfClassExpression.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfClassExpression.types.diff index bb54742cd7..63eba2591e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfClassExpression.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfClassExpression.types.diff @@ -1,16 +1,6 @@ --- old.jsdocTypeReferenceToImportOfClassExpression.types +++ new.jsdocTypeReferenceToImportOfClassExpression.types -@@= skipped -1, +1 lines =@@ - - === MC.js === - const MW = require("./MW"); -->MW : typeof MW -->require("./MW") : typeof MW -+>MW : any -+>require("./MW") : any - >require : any - >"./MW" : "./MW" - +@@= skipped -9, +9 lines =@@ /** @typedef {number} Cictema */ module.exports = class MC { @@ -21,50 +11,37 @@ ->class MC { watch() { return new MW(this); }} : typeof import("MC") ->MC : typeof import("MC") +>module.exports = class MC { watch() { return new MW(this); }} : typeof MC -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof MC ++>module : { MC: typeof MC; } ++>exports : typeof MC +>class MC { watch() { return new MW(this); }} : typeof MC +>MC : typeof MC watch() { -->watch : () => MW -+>watch : () => any + >watch : () => MW +@@= skipped -27, +27 lines =@@ + * @param {MC} compiler the compiler + */ + constructor(compiler) { +->compiler : import("MC") ++>compiler : MC - return new MW(this); -->new MW(this) : MW -->MW : typeof MW -+>new MW(this) : any -+>MW : any + this.compiler = compiler; +->this.compiler = compiler : import("MC") ++>this.compiler = compiler : MC + >this.compiler : any >this : this + >compiler : any +->compiler : import("MC") ++>compiler : MC } - }; + } --=== MW.js === --/** @typedef {import("./MC")} MC */ -- --class MW { -->MW : MW -- -- /** -- * @param {MC} compiler the compiler -- */ -- constructor(compiler) { -->compiler : import("MC") -- -- this.compiler = compiler; -->this.compiler = compiler : import("MC") -->this.compiler : any -->this : this -->compiler : any -->compiler : import("MC") -- } --} -- --module.exports = MW; -->module.exports = MW : typeof MW -->module.exports : typeof MW + module.exports = MW; + >module.exports = MW : typeof MW + >module.exports : typeof MW ->module : { exports: typeof MW; } -->exports : typeof MW -->MW : typeof MW -- ++>module : { MW: typeof MW; } + >exports : typeof MW + >MW : typeof MW + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfFunctionExpression.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfFunctionExpression.errors.txt.diff index 369b68c425..a46248685e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfFunctionExpression.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfFunctionExpression.errors.txt.diff @@ -3,28 +3,34 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+MC.js(1,12): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+MC.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++MC.js(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++MW.js(1,15): error TS1340: Module './MC' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./MC')'? ++MW.js(8,10): error TS2339: Property 'compiler' does not exist on type 'MW'. ++MW.js(12,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + -+==== MC.js (2 errors) ==== ++==== MC.js (1 errors) ==== + const MW = require("./MW"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + /** @typedef {number} Meyerhauser */ + + /** @class */ + module.exports = function MC() { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + /** @type {any} */ ++ ~~~~~~~~~~~~~~~~~~~~~~ + var x = {} ++ ~~~~~~~~~~~~~~ + return new MW(x); ++ ~~~~~~~~~~~~~~~~~~~~~ + }; ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + -+==== MW.js (0 errors) ==== ++==== MW.js (3 errors) ==== + /** @typedef {import("./MC")} MC */ ++ ~~~~~~~~~~~~~~ ++!!! error TS1340: Module './MC' does not refer to a type, but is used as a type here. Did you mean 'typeof import('./MC')'? + + class MW { + /** @@ -32,8 +38,12 @@ + */ + constructor(compiler) { + this.compiler = compiler; ++ ~~~~~~~~ ++!!! error TS2339: Property 'compiler' does not exist on type 'MW'. + } + } + + module.exports = MW; ++ ~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfFunctionExpression.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfFunctionExpression.types.diff index e72ddd96ef..94dd3dc913 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfFunctionExpression.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/jsdocTypeReferenceToImportOfFunctionExpression.types.diff @@ -1,17 +1,6 @@ --- old.jsdocTypeReferenceToImportOfFunctionExpression.types +++ new.jsdocTypeReferenceToImportOfFunctionExpression.types -@@= skipped -1, +1 lines =@@ - - === MC.js === - const MW = require("./MW"); -->MW : typeof MW -->require("./MW") : typeof MW -+>MW : any -+>require("./MW") : any - >require : any - >"./MW" : "./MW" - -@@= skipped -9, +9 lines =@@ +@@= skipped -10, +10 lines =@@ /** @class */ module.exports = function MC() { @@ -21,52 +10,38 @@ ->exports : { (): MW; new (): MC; } ->function MC() { /** @type {any} */ var x = {} return new MW(x);} : typeof MC ->MC : typeof MC -+>module.exports = function MC() { /** @type {any} */ var x = {} return new MW(x);} : () => any -+>module.exports : any -+>module : any -+>exports : any -+>function MC() { /** @type {any} */ var x = {} return new MW(x);} : () => any -+>MC : () => any ++>module.exports = function MC() { /** @type {any} */ var x = {} return new MW(x);} : () => MW ++>module.exports : () => MW ++>module : { export=: () => MW; } ++>exports : () => MW ++>function MC() { /** @type {any} */ var x = {} return new MW(x);} : () => MW ++>MC : () => MW /** @type {any} */ var x = {} -@@= skipped -13, +13 lines =@@ - >{} : {} - - return new MW(x); -->new MW(x) : MW -->MW : typeof MW -+>new MW(x) : any -+>MW : any - >x : any - - }; - --=== MW.js === --/** @typedef {import("./MC")} MC */ -- --class MW { -->MW : MW -- -- /** -- * @param {MC} compiler the compiler -- */ -- constructor(compiler) { +@@= skipped -29, +29 lines =@@ + * @param {MC} compiler the compiler + */ + constructor(compiler) { ->compiler : { (): MW; new (): MC; } -- -- this.compiler = compiler; ++>compiler : any + + this.compiler = compiler; ->this.compiler = compiler : { (): MW; new (): MC; } -->this.compiler : any -->this : this -->compiler : any ++>this.compiler = compiler : any + >this.compiler : any + >this : this + >compiler : any ->compiler : { (): MW; new (): MC; } -- } --} -- --module.exports = MW; -->module.exports = MW : typeof MW -->module.exports : typeof MW ++>compiler : any + } + } + + module.exports = MW; + >module.exports = MW : typeof MW + >module.exports : typeof MW ->module : { exports: typeof MW; } -->exports : typeof MW -->MW : typeof MW -- ++>module : { MW: typeof MW; } + >exports : typeof MW + >MW : typeof MW + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport1.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport1.errors.txt.diff deleted file mode 100644 index f810c6a5b0..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport1.errors.txt.diff +++ /dev/null @@ -1,43 +0,0 @@ ---- old.lateBoundAssignmentDeclarationSupport1.errors.txt -+++ new.lateBoundAssignmentDeclarationSupport1.errors.txt -@@= skipped -0, +0 lines =@@ --lateBoundAssignmentDeclarationSupport1.js(5,1): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. -- Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. --lateBoundAssignmentDeclarationSupport1.js(6,1): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. -- Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. --usage.js(2,11): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. -- Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. --usage.js(3,11): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. -- Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. -+usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - --==== usage.js (2 errors) ==== -+==== usage.js (1 errors) ==== - const x = require("./lateBoundAssignmentDeclarationSupport1.js"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - const y = x["my-fake-sym"]; -- ~~~~~~~~~~~~~~~~ --!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. --!!! error TS7053: Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. - const z = x[x.S]; -- ~~~~~~ --!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. --!!! error TS7053: Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. - --==== lateBoundAssignmentDeclarationSupport1.js (2 errors) ==== -+==== lateBoundAssignmentDeclarationSupport1.js (0 errors) ==== - // currently unsupported - const _sym = Symbol(); - const _str = "my-fake-sym"; - - exports[_sym] = "ok"; -- ~~~~~~~~~~~~~ --!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. --!!! error TS7053: Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. - exports[_str] = "ok"; -- ~~~~~~~~~~~~~ --!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. --!!! error TS7053: Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport1")'. - exports.S = _sym; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport1.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport1.types.diff index e93bdb34cb..f266936ef1 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport1.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport1.types.diff @@ -6,8 +6,8 @@ const x = require("./lateBoundAssignmentDeclarationSupport1.js"); ->x : typeof x ->require("./lateBoundAssignmentDeclarationSupport1.js") : typeof x -+>x : any -+>require("./lateBoundAssignmentDeclarationSupport1.js") : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport1") ++>require("./lateBoundAssignmentDeclarationSupport1.js") : typeof import("lateBoundAssignmentDeclarationSupport1") >require : any >"./lateBoundAssignmentDeclarationSupport1.js" : "./lateBoundAssignmentDeclarationSupport1.js" @@ -15,50 +15,17 @@ >y : any >x["my-fake-sym"] : any ->x : typeof x -+>x : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport1") >"my-fake-sym" : "my-fake-sym" const z = x[x.S]; >z : any >x[x.S] : any ->x : typeof x -->x.S : unique symbol ++>x : typeof import("lateBoundAssignmentDeclarationSupport1") + >x.S : unique symbol ->x : typeof x -->S : unique symbol -+>x : any -+>x.S : any -+>x : any -+>S : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport1") + >S : unique symbol --=== lateBoundAssignmentDeclarationSupport1.js === --// currently unsupported --const _sym = Symbol(); -->_sym : unique symbol -->Symbol() : unique symbol -->Symbol : SymbolConstructor -- --const _str = "my-fake-sym"; -->_str : "my-fake-sym" -->"my-fake-sym" : "my-fake-sym" -- --exports[_sym] = "ok"; -->exports[_sym] = "ok" : "ok" -->exports[_sym] : any -->exports : typeof import("lateBoundAssignmentDeclarationSupport1") -->_sym : unique symbol -->"ok" : "ok" -- --exports[_str] = "ok"; -->exports[_str] = "ok" : "ok" -->exports[_str] : any -->exports : typeof import("lateBoundAssignmentDeclarationSupport1") -->_str : "my-fake-sym" -->"ok" : "ok" -- --exports.S = _sym; -->exports.S = _sym : unique symbol -->exports.S : unique symbol -->exports : typeof import("lateBoundAssignmentDeclarationSupport1") -->S : unique symbol -->_sym : unique symbol -- + === lateBoundAssignmentDeclarationSupport1.js === diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport2.errors.txt.diff index 6f492c4676..e4ace7bf62 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport2.errors.txt.diff @@ -5,39 +5,25 @@ - Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2.js")'. -lateBoundAssignmentDeclarationSupport2.js(6,1): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2.js")'. - Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2.js")'. --usage.js(2,11): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. -- Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. --usage.js(3,11): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. -- Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. -+usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - --==== usage.js (2 errors) ==== -+==== usage.js (1 errors) ==== - const x = require("./lateBoundAssignmentDeclarationSupport2.js"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - const y = x["my-fake-sym"]; -- ~~~~~~~~~~~~~~~~ --!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. --!!! error TS7053: Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. - const z = x[x.S]; -- ~~~~~~ --!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. --!!! error TS7053: Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. - --==== lateBoundAssignmentDeclarationSupport2.js (2 errors) ==== -+==== lateBoundAssignmentDeclarationSupport2.js (0 errors) ==== - // currently unsupported - const _sym = Symbol(); - const _str = "my-fake-sym"; ++lateBoundAssignmentDeclarationSupport2.js(5,1): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. ++ Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. ++lateBoundAssignmentDeclarationSupport2.js(6,1): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. ++ Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. + usage.js(2,11): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. + Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. + usage.js(3,11): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. +@@= skipped -25, +25 lines =@@ module.exports[_sym] = "ok"; -- ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2.js")'. -!!! error TS7053: Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2.js")'. ++!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. ++!!! error TS7053: Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. module.exports[_str] = "ok"; -- ~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2.js")'. -!!! error TS7053: Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2.js")'. ++!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. ++!!! error TS7053: Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport2")'. module.exports.S = _sym; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport2.types.diff index e422488a63..4a9ebf8c6e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport2.types.diff @@ -6,8 +6,8 @@ const x = require("./lateBoundAssignmentDeclarationSupport2.js"); ->x : typeof x ->require("./lateBoundAssignmentDeclarationSupport2.js") : typeof x -+>x : any -+>require("./lateBoundAssignmentDeclarationSupport2.js") : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport2") ++>require("./lateBoundAssignmentDeclarationSupport2.js") : typeof import("lateBoundAssignmentDeclarationSupport2") >require : any >"./lateBoundAssignmentDeclarationSupport2.js" : "./lateBoundAssignmentDeclarationSupport2.js" @@ -15,56 +15,54 @@ >y : any >x["my-fake-sym"] : any ->x : typeof x -+>x : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport2") >"my-fake-sym" : "my-fake-sym" const z = x[x.S]; >z : any >x[x.S] : any ->x : typeof x -->x.S : unique symbol ++>x : typeof import("lateBoundAssignmentDeclarationSupport2") + >x.S : unique symbol ->x : typeof x -->S : unique symbol -+>x : any -+>x.S : any -+>x : any -+>S : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport2") + >S : unique symbol --=== lateBoundAssignmentDeclarationSupport2.js === --// currently unsupported --const _sym = Symbol(); -->_sym : unique symbol -->Symbol() : unique symbol -->Symbol : SymbolConstructor -- --const _str = "my-fake-sym"; -->_str : "my-fake-sym" -->"my-fake-sym" : "my-fake-sym" -- --module.exports[_sym] = "ok"; -->module.exports[_sym] = "ok" : "ok" -->module.exports[_sym] : any + === lateBoundAssignmentDeclarationSupport2.js === +@@= skipped -33, +33 lines =@@ + module.exports[_sym] = "ok"; + >module.exports[_sym] = "ok" : "ok" + >module.exports[_sym] : any ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->_sym : unique symbol -->"ok" : "ok" -- --module.exports[_str] = "ok"; -->module.exports[_str] = "ok" : "ok" -->module.exports[_str] : any ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport2") ++>module : { "lateBoundAssignmentDeclarationSupport2": typeof import("lateBoundAssignmentDeclarationSupport2"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport2") + >_sym : unique symbol + >"ok" : "ok" + + module.exports[_str] = "ok"; + >module.exports[_str] = "ok" : "ok" + >module.exports[_str] : any ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->_str : "my-fake-sym" -->"ok" : "ok" -- --module.exports.S = _sym; -->module.exports.S = _sym : unique symbol -->module.exports.S : unique symbol ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport2") ++>module : { "lateBoundAssignmentDeclarationSupport2": typeof import("lateBoundAssignmentDeclarationSupport2"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport2") + >_str : "my-fake-sym" + >"ok" : "ok" + + module.exports.S = _sym; + >module.exports.S = _sym : unique symbol + >module.exports.S : unique symbol ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->S : unique symbol -->_sym : unique symbol -- ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport2") ++>module : { "lateBoundAssignmentDeclarationSupport2": typeof import("lateBoundAssignmentDeclarationSupport2"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport2") + >S : unique symbol + >_sym : unique symbol + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport3.errors.txt.diff deleted file mode 100644 index ccebcc0cf4..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport3.errors.txt.diff +++ /dev/null @@ -1,26 +0,0 @@ ---- old.lateBoundAssignmentDeclarationSupport3.errors.txt -+++ new.lateBoundAssignmentDeclarationSupport3.errors.txt -@@= skipped -0, +0 lines =@@ --usage.js(2,11): error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. -- Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. --usage.js(3,11): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. -- Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. -+usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - --==== usage.js (2 errors) ==== -+==== usage.js (1 errors) ==== - const x = require("./lateBoundAssignmentDeclarationSupport3.js"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - const y = x["my-fake-sym"]; -- ~~~~~~~~~~~~~~~~ --!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. --!!! error TS7053: Property 'my-fake-sym' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. - const z = x[x.S]; -- ~~~~~~ --!!! error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. --!!! error TS7053: Property '[_sym]' does not exist on type 'typeof import("lateBoundAssignmentDeclarationSupport3")'. - - ==== lateBoundAssignmentDeclarationSupport3.js (0 errors) ==== - // currently unsupported diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport3.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport3.types.diff index 788e1c0c75..55aaf9a537 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport3.types.diff @@ -6,8 +6,8 @@ const x = require("./lateBoundAssignmentDeclarationSupport3.js"); ->x : typeof x ->require("./lateBoundAssignmentDeclarationSupport3.js") : typeof x -+>x : any -+>require("./lateBoundAssignmentDeclarationSupport3.js") : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport3") ++>require("./lateBoundAssignmentDeclarationSupport3.js") : typeof import("lateBoundAssignmentDeclarationSupport3") >require : any >"./lateBoundAssignmentDeclarationSupport3.js" : "./lateBoundAssignmentDeclarationSupport3.js" @@ -15,64 +15,65 @@ >y : any >x["my-fake-sym"] : any ->x : typeof x -+>x : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport3") >"my-fake-sym" : "my-fake-sym" const z = x[x.S]; >z : any >x[x.S] : any ->x : typeof x -->x.S : unique symbol ++>x : typeof import("lateBoundAssignmentDeclarationSupport3") + >x.S : unique symbol ->x : typeof x -->S : unique symbol -+>x : any -+>x.S : any -+>x : any -+>S : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport3") + >S : unique symbol --=== lateBoundAssignmentDeclarationSupport3.js === --// currently unsupported --const _sym = Symbol(); -->_sym : unique symbol -->Symbol() : unique symbol -->Symbol : SymbolConstructor -- --const _str = "my-fake-sym"; -->_str : "my-fake-sym" -->"my-fake-sym" : "my-fake-sym" -- --Object.defineProperty(module.exports, _sym, { value: "ok" }); + === lateBoundAssignmentDeclarationSupport3.js === +@@= skipped -31, +31 lines =@@ + >"my-fake-sym" : "my-fake-sym" + + Object.defineProperty(module.exports, _sym, { value: "ok" }); ->Object.defineProperty(module.exports, _sym, { value: "ok" }) : typeof module.exports -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(module.exports, _sym, { value: "ok" }) : typeof import("lateBoundAssignmentDeclarationSupport3") + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->_sym : unique symbol -->{ value: "ok" } : { value: string; } -->value : string -->"ok" : "ok" -- --Object.defineProperty(module.exports, _str, { value: "ok" }); ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport3") ++>module : { "lateBoundAssignmentDeclarationSupport3": typeof import("lateBoundAssignmentDeclarationSupport3"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport3") + >_sym : unique symbol + >{ value: "ok" } : { value: string; } + >value : string + >"ok" : "ok" + + Object.defineProperty(module.exports, _str, { value: "ok" }); ->Object.defineProperty(module.exports, _str, { value: "ok" }) : typeof module.exports -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ++>Object.defineProperty(module.exports, _str, { value: "ok" }) : typeof import("lateBoundAssignmentDeclarationSupport3") + >Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->_str : "my-fake-sym" -->{ value: "ok" } : { value: string; } -->value : string -->"ok" : "ok" -- --module.exports.S = _sym; -->module.exports.S = _sym : unique symbol -->module.exports.S : unique symbol ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport3") ++>module : { "lateBoundAssignmentDeclarationSupport3": typeof import("lateBoundAssignmentDeclarationSupport3"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport3") + >_str : "my-fake-sym" + >{ value: "ok" } : { value: string; } + >value : string +@@= skipped -28, +28 lines =@@ + module.exports.S = _sym; + >module.exports.S = _sym : unique symbol + >module.exports.S : unique symbol ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->S : unique symbol -->_sym : unique symbol -- ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport3") ++>module : { "lateBoundAssignmentDeclarationSupport3": typeof import("lateBoundAssignmentDeclarationSupport3"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport3") + >S : unique symbol + >_sym : unique symbol + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport4.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport4.errors.txt.diff index b7d0bfee68..fc220d5df1 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport4.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport4.errors.txt.diff @@ -9,15 +9,16 @@ - Property 'my-fake-sym' does not exist on type 'F'. -usage.js(4,11): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'F'. - Property '[_sym]' does not exist on type 'F'. -+usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++lateBoundAssignmentDeclarationSupport4.js(9,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. ++usage.js(2,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. -==== usage.js (2 errors) ==== +==== usage.js (1 errors) ==== const x = require("./lateBoundAssignmentDeclarationSupport4.js"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. const inst = new x.F(); ++ ~~~~~~~~~ ++!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const y = inst["my-fake-sym"]; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'F'. @@ -28,13 +29,16 @@ -!!! error TS7053: Property '[_sym]' does not exist on type 'F'. -==== lateBoundAssignmentDeclarationSupport4.js (2 errors) ==== -+==== lateBoundAssignmentDeclarationSupport4.js (0 errors) ==== ++==== lateBoundAssignmentDeclarationSupport4.js (1 errors) ==== // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; -@@= skipped -30, +19 lines =@@ +@@= skipped -29, +19 lines =@@ + F.prototype[_sym] = "ok"; F.prototype[_str] = "ok"; const inst = new F(); ++ ~~~~~~~ ++!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const _y = inst[_str]; - ~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'F'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport4.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport4.types.diff index fdf49f3af5..48fe372e3b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport4.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport4.types.diff @@ -6,8 +6,8 @@ const x = require("./lateBoundAssignmentDeclarationSupport4.js"); ->x : typeof x ->require("./lateBoundAssignmentDeclarationSupport4.js") : typeof x -+>x : any -+>require("./lateBoundAssignmentDeclarationSupport4.js") : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport4") ++>require("./lateBoundAssignmentDeclarationSupport4.js") : typeof import("lateBoundAssignmentDeclarationSupport4") >require : any >"./lateBoundAssignmentDeclarationSupport4.js" : "./lateBoundAssignmentDeclarationSupport4.js" @@ -19,9 +19,9 @@ ->F : typeof x.F +>inst : any +>new x.F() : any -+>x.F : any -+>x : any -+>F : any ++>x.F : () => void ++>x : typeof import("lateBoundAssignmentDeclarationSupport4") ++>F : () => void const y = inst["my-fake-sym"]; >y : any @@ -34,64 +34,62 @@ >z : any >inst[x.S] : any ->inst : x.F -->x.S : unique symbol -->x : typeof x -->S : unique symbol +>inst : any -+>x.S : any -+>x : any -+>S : any + >x.S : unique symbol +->x : typeof x ++>x : typeof import("lateBoundAssignmentDeclarationSupport4") + >S : unique symbol + + === lateBoundAssignmentDeclarationSupport4.js === +@@= skipped -38, +38 lines =@@ + >"my-fake-sym" : "my-fake-sym" --=== lateBoundAssignmentDeclarationSupport4.js === --// currently unsupported --const _sym = Symbol(); -->_sym : unique symbol -->Symbol() : unique symbol -->Symbol : SymbolConstructor -- --const _str = "my-fake-sym"; -->_str : "my-fake-sym" -->"my-fake-sym" : "my-fake-sym" -- --function F() { + function F() { ->F : typeof F --} --F.prototype[_sym] = "ok"; -->F.prototype[_sym] = "ok" : "ok" -->F.prototype[_sym] : any -->F.prototype : any ++>F : () => void + } + F.prototype[_sym] = "ok"; + >F.prototype[_sym] = "ok" : "ok" + >F.prototype[_sym] : any + >F.prototype : any ->F : typeof F -->prototype : any -->_sym : unique symbol -->"ok" : "ok" -- --F.prototype[_str] = "ok"; -->F.prototype[_str] = "ok" : "ok" -->F.prototype[_str] : any -->F.prototype : any ++>F : () => void + >prototype : any + >_sym : unique symbol + >"ok" : "ok" +@@= skipped -15, +15 lines =@@ + >F.prototype[_str] = "ok" : "ok" + >F.prototype[_str] : any + >F.prototype : any ->F : typeof F -->prototype : any -->_str : "my-fake-sym" -->"ok" : "ok" -- --const inst = new F(); ++>F : () => void + >prototype : any + >_str : "my-fake-sym" + >"ok" : "ok" + + const inst = new F(); ->inst : F ->new F() : F ->F : typeof F -- --const _y = inst[_str]; -->_y : any -->inst[_str] : any ++>inst : any ++>new F() : any ++>F : () => void + + const _y = inst[_str]; + >_y : any + >inst[_str] : any ->inst : F -->_str : "my-fake-sym" -- --const _z = inst[_sym]; -->_z : any -->inst[_sym] : any ++>inst : any + >_str : "my-fake-sym" + + const _z = inst[_sym]; + >_z : any + >inst[_sym] : any ->inst : F -->_sym : unique symbol -- --module.exports.F = F; ++>inst : any + >_sym : unique symbol + + module.exports.F = F; ->module.exports.F = F : typeof F ->module.exports.F : typeof F ->module.exports : typeof module.exports @@ -99,13 +97,23 @@ ->exports : typeof module.exports ->F : typeof F ->F : typeof F -- --module.exports.S = _sym; -->module.exports.S = _sym : unique symbol -->module.exports.S : unique symbol ++>module.exports.F = F : () => void ++>module.exports.F : () => void ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport4") ++>module : { "lateBoundAssignmentDeclarationSupport4": typeof import("lateBoundAssignmentDeclarationSupport4"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport4") ++>F : () => void ++>F : () => void + + module.exports.S = _sym; + >module.exports.S = _sym : unique symbol + >module.exports.S : unique symbol ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->S : unique symbol -->_sym : unique symbol -- ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport4") ++>module : { "lateBoundAssignmentDeclarationSupport4": typeof import("lateBoundAssignmentDeclarationSupport4"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport4") + >S : unique symbol + >_sym : unique symbol + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport5.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport5.errors.txt.diff index a3a288a486..d8a20f6622 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport5.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport5.errors.txt.diff @@ -9,15 +9,16 @@ - Property 'my-fake-sym' does not exist on type 'F'. -usage.js(4,11): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'F'. - Property '[_sym]' does not exist on type 'F'. -+usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++lateBoundAssignmentDeclarationSupport5.js(11,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. ++usage.js(2,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. -==== usage.js (2 errors) ==== +==== usage.js (1 errors) ==== const x = require("./lateBoundAssignmentDeclarationSupport5.js"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. const inst = new x.F(); ++ ~~~~~~~~~ ++!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const y = inst["my-fake-sym"]; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'F'. @@ -28,13 +29,16 @@ -!!! error TS7053: Property '[_sym]' does not exist on type 'F'. -==== lateBoundAssignmentDeclarationSupport5.js (2 errors) ==== -+==== lateBoundAssignmentDeclarationSupport5.js (0 errors) ==== ++==== lateBoundAssignmentDeclarationSupport5.js (1 errors) ==== // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; -@@= skipped -32, +21 lines =@@ +@@= skipped -31, +21 lines =@@ + [_str]: "ok" } const inst = new F(); ++ ~~~~~~~ ++!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const _y = inst[_str]; - ~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'F'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport5.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport5.types.diff index 4f193ab8f4..11618e7336 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport5.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport5.types.diff @@ -6,8 +6,8 @@ const x = require("./lateBoundAssignmentDeclarationSupport5.js"); ->x : typeof x ->require("./lateBoundAssignmentDeclarationSupport5.js") : typeof x -+>x : any -+>require("./lateBoundAssignmentDeclarationSupport5.js") : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport5") ++>require("./lateBoundAssignmentDeclarationSupport5.js") : typeof import("lateBoundAssignmentDeclarationSupport5") >require : any >"./lateBoundAssignmentDeclarationSupport5.js" : "./lateBoundAssignmentDeclarationSupport5.js" @@ -19,9 +19,9 @@ ->F : typeof x.F +>inst : any +>new x.F() : any -+>x.F : any -+>x : any -+>F : any ++>x.F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } ++>x : typeof import("lateBoundAssignmentDeclarationSupport5") ++>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } const y = inst["my-fake-sym"]; >y : any @@ -34,63 +34,60 @@ >z : any >inst[x.S] : any ->inst : x.F -->x.S : unique symbol -->x : typeof x -->S : unique symbol +>inst : any -+>x.S : any -+>x : any -+>S : any + >x.S : unique symbol +->x : typeof x ++>x : typeof import("lateBoundAssignmentDeclarationSupport5") + >S : unique symbol + + === lateBoundAssignmentDeclarationSupport5.js === +@@= skipped -38, +38 lines =@@ + >"my-fake-sym" : "my-fake-sym" --=== lateBoundAssignmentDeclarationSupport5.js === --// currently unsupported --const _sym = Symbol(); -->_sym : unique symbol -->Symbol() : unique symbol -->Symbol : SymbolConstructor -- --const _str = "my-fake-sym"; -->_str : "my-fake-sym" -->"my-fake-sym" : "my-fake-sym" -- --function F() { + function F() { ->F : typeof F --} --F.prototype = { ++>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } + } + F.prototype = { ->F.prototype = { [_sym]: "ok", [_str]: "ok"} : { [_sym]: string; "my-fake-sym": string; } ->F.prototype : { [_sym]: string; "my-fake-sym": string; } ->F : typeof F ->prototype : { [_sym]: string; "my-fake-sym": string; } ->{ [_sym]: "ok", [_str]: "ok"} : { [_sym]: string; "my-fake-sym": string; } -- -- [_sym]: "ok", -->[_sym] : string -->_sym : unique symbol -->"ok" : "ok" -- -- [_str]: "ok" -->[_str] : string -->_str : "my-fake-sym" -->"ok" : "ok" --} --const inst = new F(); ++>F.prototype = { [_sym]: "ok", [_str]: "ok"} : { [_sym]: string; [_str]: string; } ++>F.prototype : { [_sym]: string; [_str]: string; } ++>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } ++>prototype : { [_sym]: string; [_str]: string; } ++>{ [_sym]: "ok", [_str]: "ok"} : { [_sym]: string; [_str]: string; } + + [_sym]: "ok", + >[_sym] : string +@@= skipped -20, +20 lines =@@ + >"ok" : "ok" + } + const inst = new F(); ->inst : F ->new F() : F ->F : typeof F -- --const _y = inst[_str]; -->_y : any -->inst[_str] : any ++>inst : any ++>new F() : any ++>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } + + const _y = inst[_str]; + >_y : any + >inst[_str] : any ->inst : F -->_str : "my-fake-sym" -- --const _z = inst[_sym]; -->_z : any -->inst[_sym] : any ++>inst : any + >_str : "my-fake-sym" + + const _z = inst[_sym]; + >_z : any + >inst[_sym] : any ->inst : F -->_sym : unique symbol -- --module.exports.F = F; ++>inst : any + >_sym : unique symbol + + module.exports.F = F; ->module.exports.F = F : typeof F ->module.exports.F : typeof F ->module.exports : typeof module.exports @@ -98,13 +95,23 @@ ->exports : typeof module.exports ->F : typeof F ->F : typeof F -- --module.exports.S = _sym; -->module.exports.S = _sym : unique symbol -->module.exports.S : unique symbol ++>module.exports.F = F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } ++>module.exports.F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport5") ++>module : { "lateBoundAssignmentDeclarationSupport5": typeof import("lateBoundAssignmentDeclarationSupport5"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport5") ++>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } ++>F : { (): void; prototype: { [_sym]: string; [_str]: string; }; } + + module.exports.S = _sym; + >module.exports.S = _sym : unique symbol + >module.exports.S : unique symbol ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->S : unique symbol -->_sym : unique symbol -- ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport5") ++>module : { "lateBoundAssignmentDeclarationSupport5": typeof import("lateBoundAssignmentDeclarationSupport5"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport5") + >S : unique symbol + >_sym : unique symbol + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport6.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport6.errors.txt.diff index 34d79d8e9a..31c4e72b93 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport6.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport6.errors.txt.diff @@ -9,15 +9,16 @@ - Property 'my-fake-sym' does not exist on type 'F'. -usage.js(4,11): error TS7053: Element implicitly has an 'any' type because expression of type 'unique symbol' can't be used to index type 'F'. - Property '[_sym]' does not exist on type 'F'. -+usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++lateBoundAssignmentDeclarationSupport6.js(10,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. ++usage.js(2,15): error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. -==== usage.js (2 errors) ==== +==== usage.js (1 errors) ==== const x = require("./lateBoundAssignmentDeclarationSupport6.js"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. const inst = new x.F(); ++ ~~~~~~~~~ ++!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const y = inst["my-fake-sym"]; - ~~~~~~~~~~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'F'. @@ -28,13 +29,16 @@ -!!! error TS7053: Property '[_sym]' does not exist on type 'F'. -==== lateBoundAssignmentDeclarationSupport6.js (2 errors) ==== -+==== lateBoundAssignmentDeclarationSupport6.js (0 errors) ==== ++==== lateBoundAssignmentDeclarationSupport6.js (1 errors) ==== // currently unsupported const _sym = Symbol(); const _str = "my-fake-sym"; -@@= skipped -31, +20 lines =@@ +@@= skipped -30, +20 lines =@@ + Object.defineProperty(F.prototype, _str, {value: "ok"}); Object.defineProperty(F.prototype, _sym, {value: "ok"}); const inst = new F(); ++ ~~~~~~~ ++!!! error TS7009: 'new' expression, whose target lacks a construct signature, implicitly has an 'any' type. const _y = inst[_str]; - ~~~~~~~~~~ -!!! error TS7053: Element implicitly has an 'any' type because expression of type '"my-fake-sym"' can't be used to index type 'F'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport6.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport6.types.diff index 5463414438..c2bc5345ac 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport6.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport6.types.diff @@ -6,8 +6,8 @@ const x = require("./lateBoundAssignmentDeclarationSupport6.js"); ->x : typeof x ->require("./lateBoundAssignmentDeclarationSupport6.js") : typeof x -+>x : any -+>require("./lateBoundAssignmentDeclarationSupport6.js") : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport6") ++>require("./lateBoundAssignmentDeclarationSupport6.js") : typeof import("lateBoundAssignmentDeclarationSupport6") >require : any >"./lateBoundAssignmentDeclarationSupport6.js" : "./lateBoundAssignmentDeclarationSupport6.js" @@ -19,9 +19,9 @@ ->F : typeof x.F +>inst : any +>new x.F() : any -+>x.F : any -+>x : any -+>F : any ++>x.F : () => void ++>x : typeof import("lateBoundAssignmentDeclarationSupport6") ++>F : () => void const y = inst["my-fake-sym"]; >y : any @@ -34,81 +34,73 @@ >z : any >inst[x.S] : any ->inst : x.F -->x.S : unique symbol -->x : typeof x -->S : unique symbol +>inst : any -+>x.S : any -+>x : any -+>S : any + >x.S : unique symbol +->x : typeof x ++>x : typeof import("lateBoundAssignmentDeclarationSupport6") + >S : unique symbol + + === lateBoundAssignmentDeclarationSupport6.js === +@@= skipped -38, +38 lines =@@ + >"my-fake-sym" : "my-fake-sym" --=== lateBoundAssignmentDeclarationSupport6.js === --// currently unsupported --const _sym = Symbol(); -->_sym : unique symbol -->Symbol() : unique symbol -->Symbol : SymbolConstructor -- --const _str = "my-fake-sym"; -->_str : "my-fake-sym" -->"my-fake-sym" : "my-fake-sym" -- --function F() { + function F() { ->F : typeof F --} --F.prototype.defsAClass = true; -->F.prototype.defsAClass = true : true -->F.prototype.defsAClass : any -->F.prototype : any ++>F : () => void + } + F.prototype.defsAClass = true; + >F.prototype.defsAClass = true : true + >F.prototype.defsAClass : any + >F.prototype : any ->F : typeof F -->prototype : any -->defsAClass : any -->true : true -- --Object.defineProperty(F.prototype, _str, {value: "ok"}); -->Object.defineProperty(F.prototype, _str, {value: "ok"}) : any -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->F.prototype : any ++>F : () => void + >prototype : any + >defsAClass : any + >true : true +@@= skipped -17, +17 lines =@@ + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >F.prototype : any ->F : typeof F -->prototype : any -->_str : "my-fake-sym" -->{value: "ok"} : { value: string; } -->value : string -->"ok" : "ok" -- --Object.defineProperty(F.prototype, _sym, {value: "ok"}); -->Object.defineProperty(F.prototype, _sym, {value: "ok"}) : any -->Object.defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->Object : ObjectConstructor -->defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T -->F.prototype : any ++>F : () => void + >prototype : any + >_str : "my-fake-sym" + >{value: "ok"} : { value: string; } +@@= skipped -13, +13 lines =@@ + >Object : ObjectConstructor + >defineProperty : (o: T, p: PropertyKey, attributes: PropertyDescriptor & ThisType) => T + >F.prototype : any ->F : typeof F -->prototype : any -->_sym : unique symbol -->{value: "ok"} : { value: string; } -->value : string -->"ok" : "ok" -- --const inst = new F(); ++>F : () => void + >prototype : any + >_sym : unique symbol + >{value: "ok"} : { value: string; } +@@= skipped -8, +8 lines =@@ + >"ok" : "ok" + + const inst = new F(); ->inst : F ->new F() : F ->F : typeof F -- --const _y = inst[_str]; -->_y : any -->inst[_str] : any ++>inst : any ++>new F() : any ++>F : () => void + + const _y = inst[_str]; + >_y : any + >inst[_str] : any ->inst : F -->_str : "my-fake-sym" -- --const _z = inst[_sym]; -->_z : any -->inst[_sym] : any ++>inst : any + >_str : "my-fake-sym" + + const _z = inst[_sym]; + >_z : any + >inst[_sym] : any ->inst : F -->_sym : unique symbol -- --module.exports.F = F; ++>inst : any + >_sym : unique symbol + + module.exports.F = F; ->module.exports.F = F : typeof F ->module.exports.F : typeof F ->module.exports : typeof module.exports @@ -116,13 +108,23 @@ ->exports : typeof module.exports ->F : typeof F ->F : typeof F -- --module.exports.S = _sym; -->module.exports.S = _sym : unique symbol -->module.exports.S : unique symbol ++>module.exports.F = F : () => void ++>module.exports.F : () => void ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport6") ++>module : { "lateBoundAssignmentDeclarationSupport6": typeof import("lateBoundAssignmentDeclarationSupport6"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport6") ++>F : () => void ++>F : () => void + + module.exports.S = _sym; + >module.exports.S = _sym : unique symbol + >module.exports.S : unique symbol ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->S : unique symbol -->_sym : unique symbol -- ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport6") ++>module : { "lateBoundAssignmentDeclarationSupport6": typeof import("lateBoundAssignmentDeclarationSupport6"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport6") + >S : unique symbol + >_sym : unique symbol + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport7.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport7.errors.txt.diff deleted file mode 100644 index f0bdd63b7c..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport7.errors.txt.diff +++ /dev/null @@ -1,25 +0,0 @@ ---- old.lateBoundAssignmentDeclarationSupport7.errors.txt -+++ new.lateBoundAssignmentDeclarationSupport7.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+usage.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== usage.js (1 errors) ==== -+ const x = require("./lateBoundAssignmentDeclarationSupport7.js"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ const y = x.F["my-fake-sym"]; -+ const z = x.F[x.S]; -+ -+==== lateBoundAssignmentDeclarationSupport7.js (0 errors) ==== -+ const _sym = Symbol(); -+ const _str = "my-fake-sym"; -+ -+ function F() { -+ } -+ F[_sym] = "ok"; -+ F[_str] = "ok"; -+ module.exports.F = F; -+ module.exports.S = _sym; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport7.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport7.types.diff index c00ff38d0c..ffde40971f 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport7.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/lateBoundAssignmentDeclarationSupport7.types.diff @@ -6,70 +6,61 @@ const x = require("./lateBoundAssignmentDeclarationSupport7.js"); ->x : typeof x ->require("./lateBoundAssignmentDeclarationSupport7.js") : typeof x -+>x : any -+>require("./lateBoundAssignmentDeclarationSupport7.js") : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport7") ++>require("./lateBoundAssignmentDeclarationSupport7.js") : typeof import("lateBoundAssignmentDeclarationSupport7") >require : any >"./lateBoundAssignmentDeclarationSupport7.js" : "./lateBoundAssignmentDeclarationSupport7.js" const y = x.F["my-fake-sym"]; -->y : string -->x.F["my-fake-sym"] : string + >y : string + >x.F["my-fake-sym"] : string ->x.F : typeof x.F ->x : typeof x ->F : typeof x.F -+>y : any -+>x.F["my-fake-sym"] : any -+>x.F : any -+>x : any -+>F : any ++>x.F : { (): void; F[_sym]: string; F[_str]: string; } ++>x : typeof import("lateBoundAssignmentDeclarationSupport7") ++>F : { (): void; F[_sym]: string; F[_str]: string; } >"my-fake-sym" : "my-fake-sym" const z = x.F[x.S]; -->z : string -->x.F[x.S] : string + >z : string + >x.F[x.S] : string ->x.F : typeof x.F ->x : typeof x ->F : typeof x.F -->x.S : unique symbol ++>x.F : { (): void; F[_sym]: string; F[_str]: string; } ++>x : typeof import("lateBoundAssignmentDeclarationSupport7") ++>F : { (): void; F[_sym]: string; F[_str]: string; } + >x.S : unique symbol ->x : typeof x -->S : unique symbol -+>z : any -+>x.F[x.S] : any -+>x.F : any -+>x : any -+>F : any -+>x.S : any -+>x : any -+>S : any ++>x : typeof import("lateBoundAssignmentDeclarationSupport7") + >S : unique symbol --=== lateBoundAssignmentDeclarationSupport7.js === --const _sym = Symbol(); -->_sym : unique symbol -->Symbol() : unique symbol -->Symbol : SymbolConstructor -- --const _str = "my-fake-sym"; -->_str : "my-fake-sym" -->"my-fake-sym" : "my-fake-sym" -- --function F() { + === lateBoundAssignmentDeclarationSupport7.js === +@@= skipped -34, +34 lines =@@ + >"my-fake-sym" : "my-fake-sym" + + function F() { ->F : typeof F --} --F[_sym] = "ok"; -->F[_sym] = "ok" : "ok" -->F[_sym] : string ++>F : { (): void; F[_sym]: string; F[_str]: string; } + } + F[_sym] = "ok"; + >F[_sym] = "ok" : "ok" + >F[_sym] : string ->F : typeof F -->_sym : unique symbol -->"ok" : "ok" -- --F[_str] = "ok"; -->F[_str] = "ok" : "ok" -->F[_str] : string ++>F : { (): void; F[_sym]: string; F[_str]: string; } + >_sym : unique symbol + >"ok" : "ok" + + F[_str] = "ok"; + >F[_str] = "ok" : "ok" + >F[_str] : string ->F : typeof F -->_str : "my-fake-sym" -->"ok" : "ok" -- --module.exports.F = F; ++>F : { (): void; F[_sym]: string; F[_str]: string; } + >_str : "my-fake-sym" + >"ok" : "ok" + + module.exports.F = F; ->module.exports.F = F : typeof F ->module.exports.F : typeof F ->module.exports : typeof module.exports @@ -77,13 +68,23 @@ ->exports : typeof module.exports ->F : typeof F ->F : typeof F -- --module.exports.S = _sym; -->module.exports.S = _sym : unique symbol -->module.exports.S : unique symbol ++>module.exports.F = F : { (): void; F[_sym]: string; F[_str]: string; } ++>module.exports.F : { (): void; F[_sym]: string; F[_str]: string; } ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport7") ++>module : { "lateBoundAssignmentDeclarationSupport7": typeof import("lateBoundAssignmentDeclarationSupport7"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport7") ++>F : { (): void; F[_sym]: string; F[_str]: string; } ++>F : { (): void; F[_sym]: string; F[_str]: string; } + + module.exports.S = _sym; + >module.exports.S = _sym : unique symbol + >module.exports.S : unique symbol ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->S : unique symbol -->_sym : unique symbol -- ++>module.exports : typeof import("lateBoundAssignmentDeclarationSupport7") ++>module : { "lateBoundAssignmentDeclarationSupport7": typeof import("lateBoundAssignmentDeclarationSupport7"); } ++>exports : typeof import("lateBoundAssignmentDeclarationSupport7") + >S : unique symbol + >_sym : unique symbol + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias.errors.txt.diff index 6247e8b814..ba2c18326c 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias.errors.txt.diff @@ -3,202 +3,241 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+a.ts(1,20): error TS2306: File 'b.js' is not a module. -+b.js(1,20): error TS2304: Cannot find name 'exports'. -+b.js(3,1): error TS2304: Cannot find name 'exports'. -+b.js(5,26): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(7,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(9,33): error TS2304: Cannot find name 'exports'. -+b.js(9,43): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(12,33): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(12,50): error TS2304: Cannot find name 'exports'. -+b.js(16,53): error TS2304: Cannot find name 'exports'. -+b.js(19,53): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(22,33): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(22,50): error TS2304: Cannot find name 'exports'. ++a.ts(2,3): error TS2339: Property 'func1' does not exist on type '{}'. ++a.ts(3,3): error TS2339: Property 'func2' does not exist on type '{}'. ++a.ts(4,3): error TS2339: Property 'func3' does not exist on type '{}'. ++a.ts(5,3): error TS2339: Property 'func4' does not exist on type '{}'. ++a.ts(6,3): error TS2339: Property 'func5' does not exist on type '{}'. ++a.ts(7,3): error TS2339: Property 'func6' does not exist on type '{}'. ++a.ts(8,3): error TS2339: Property 'func7' does not exist on type '{}'. ++a.ts(9,3): error TS2339: Property 'func8' does not exist on type '{}'. ++a.ts(10,3): error TS2339: Property 'func9' does not exist on type '{}'. ++a.ts(11,3): error TS2339: Property 'func10' does not exist on type '{}'. ++a.ts(12,3): error TS2339: Property 'func11' does not exist on type '{}'. ++a.ts(13,3): error TS2339: Property 'func12' does not exist on type '{}'. ++a.ts(14,3): error TS2339: Property 'func13' does not exist on type '{}'. ++a.ts(15,3): error TS2339: Property 'func14' does not exist on type '{}'. ++a.ts(16,3): error TS2339: Property 'func15' does not exist on type '{}'. ++a.ts(17,3): error TS2339: Property 'func16' does not exist on type '{}'. ++a.ts(18,3): error TS2339: Property 'func17' does not exist on type '{}'. ++a.ts(19,3): error TS2339: Property 'func18' does not exist on type '{}'. ++a.ts(20,3): error TS2339: Property 'func19' does not exist on type '{}'. ++a.ts(21,3): error TS2339: Property 'func20' does not exist on type '{}'. ++b.js(2,14): error TS2339: Property 'func1' does not exist on type 'typeof import("b")'. ++b.js(3,9): error TS2339: Property 'func2' does not exist on type 'typeof import("b")'. ++b.js(6,20): error TS2339: Property 'func3' does not exist on type '{}'. ++b.js(7,16): error TS2339: Property 'func4' does not exist on type '{}'. ++b.js(9,33): error TS2631: Cannot assign to '"b"' because it is a namespace. ++b.js(10,27): error TS2339: Property 'func5' does not exist on type '{}'. ++b.js(13,27): error TS2339: Property 'func6' does not exist on type 'typeof import("b")'. ++b.js(17,27): error TS2339: Property 'func7' does not exist on type 'typeof import("b")'. ++b.js(20,27): error TS2339: Property 'func8' does not exist on type '{}'. ++b.js(22,50): error TS2631: Cannot assign to '"b"' because it is a namespace. +b.js(23,27): error TS2339: Property 'func9' does not exist on type '{}'. -+b.js(25,33): error TS2304: Cannot find name 'exports'. -+b.js(25,43): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++b.js(25,33): error TS2631: Cannot assign to '"b"' because it is a namespace. +b.js(26,27): error TS2339: Property 'func10' does not exist on type '{}'. -+b.js(28,1): error TS2304: Cannot find name 'exports'. -+b.js(28,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(29,1): error TS2304: Cannot find name 'exports'. -+b.js(30,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(32,1): error TS2304: Cannot find name 'exports'. -+b.js(32,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(33,1): error TS2304: Cannot find name 'exports'. -+b.js(34,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(36,1): error TS2304: Cannot find name 'exports'. -+b.js(36,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(37,1): error TS2304: Cannot find name 'exports'. -+b.js(38,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(40,1): error TS2304: Cannot find name 'exports'. -+b.js(40,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(41,1): error TS2304: Cannot find name 'exports'. -+b.js(42,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(44,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(44,18): error TS2304: Cannot find name 'exports'. -+b.js(45,1): error TS2304: Cannot find name 'exports'. -+b.js(46,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(48,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+b.js(49,1): error TS2304: Cannot find name 'exports'. -+b.js(50,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++b.js(28,1): error TS2631: Cannot assign to '"b"' because it is a namespace. ++b.js(29,9): error TS2339: Property 'func11' does not exist on type 'typeof import("b")'. ++b.js(30,16): error TS2339: Property 'func12' does not exist on type '{}'. ++b.js(32,1): error TS2631: Cannot assign to '"b"' because it is a namespace. ++b.js(33,9): error TS2339: Property 'func11' does not exist on type 'typeof import("b")'. ++b.js(34,16): error TS2339: Property 'func12' does not exist on type '{}'. ++b.js(36,1): error TS2631: Cannot assign to '"b"' because it is a namespace. ++b.js(37,9): error TS2339: Property 'func13' does not exist on type 'typeof import("b")'. ++b.js(38,16): error TS2339: Property 'func14' does not exist on type '{}'. ++b.js(40,1): error TS2631: Cannot assign to '"b"' because it is a namespace. ++b.js(41,9): error TS2339: Property 'func15' does not exist on type 'typeof import("b")'. ++b.js(42,16): error TS2339: Property 'func16' does not exist on type '{}'. ++b.js(44,1): error TS2300: Duplicate identifier 'export='. ++b.js(44,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++b.js(44,18): error TS2631: Cannot assign to '"b"' because it is a namespace. ++b.js(45,9): error TS2339: Property 'func17' does not exist on type 'typeof import("b")'. ++b.js(46,16): error TS2339: Property 'func18' does not exist on type '{}'. ++b.js(48,1): error TS2300: Duplicate identifier 'export='. ++b.js(49,9): error TS2339: Property 'func19' does not exist on type 'typeof import("b")'. ++b.js(50,16): error TS2339: Property 'func20' does not exist on type '{}'. + + -+==== a.ts (1 errors) ==== ++==== a.ts (20 errors) ==== + import b = require("./b.js"); -+ ~~~~~~~~ -+!!! error TS2306: File 'b.js' is not a module. + b.func1; ++ ~~~~~ ++!!! error TS2339: Property 'func1' does not exist on type '{}'. + b.func2; ++ ~~~~~ ++!!! error TS2339: Property 'func2' does not exist on type '{}'. + b.func3; ++ ~~~~~ ++!!! error TS2339: Property 'func3' does not exist on type '{}'. + b.func4; ++ ~~~~~ ++!!! error TS2339: Property 'func4' does not exist on type '{}'. + b.func5; ++ ~~~~~ ++!!! error TS2339: Property 'func5' does not exist on type '{}'. + b.func6; ++ ~~~~~ ++!!! error TS2339: Property 'func6' does not exist on type '{}'. + b.func7; ++ ~~~~~ ++!!! error TS2339: Property 'func7' does not exist on type '{}'. + b.func8; ++ ~~~~~ ++!!! error TS2339: Property 'func8' does not exist on type '{}'. + b.func9; ++ ~~~~~ ++!!! error TS2339: Property 'func9' does not exist on type '{}'. + b.func10; ++ ~~~~~~ ++!!! error TS2339: Property 'func10' does not exist on type '{}'. + b.func11; ++ ~~~~~~ ++!!! error TS2339: Property 'func11' does not exist on type '{}'. + b.func12; ++ ~~~~~~ ++!!! error TS2339: Property 'func12' does not exist on type '{}'. + b.func13; ++ ~~~~~~ ++!!! error TS2339: Property 'func13' does not exist on type '{}'. + b.func14; ++ ~~~~~~ ++!!! error TS2339: Property 'func14' does not exist on type '{}'. + b.func15; ++ ~~~~~~ ++!!! error TS2339: Property 'func15' does not exist on type '{}'. + b.func16; ++ ~~~~~~ ++!!! error TS2339: Property 'func16' does not exist on type '{}'. + b.func17; ++ ~~~~~~ ++!!! error TS2339: Property 'func17' does not exist on type '{}'. + b.func18; ++ ~~~~~~ ++!!! error TS2339: Property 'func18' does not exist on type '{}'. + b.func19; ++ ~~~~~~ ++!!! error TS2339: Property 'func19' does not exist on type '{}'. + b.func20; ++ ~~~~~~ ++!!! error TS2339: Property 'func20' does not exist on type '{}'. + + -+==== b.js (39 errors) ==== ++==== b.js (33 errors) ==== + var exportsAlias = exports; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + exportsAlias.func1 = function () { }; ++ ~~~~~ ++!!! error TS2339: Property 'func1' does not exist on type 'typeof import("b")'. + exports.func2 = function () { }; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~ ++!!! error TS2339: Property 'func2' does not exist on type 'typeof import("b")'. + + var moduleExportsAlias = module.exports; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + moduleExportsAlias.func3 = function () { }; ++ ~~~~~ ++!!! error TS2339: Property 'func3' does not exist on type '{}'. + module.exports.func4 = function () { }; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~ ++!!! error TS2339: Property 'func4' does not exist on type '{}'. + + var multipleDeclarationAlias1 = exports = module.exports; + ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2631: Cannot assign to '"b"' because it is a namespace. + multipleDeclarationAlias1.func5 = function () { }; ++ ~~~~~ ++!!! error TS2339: Property 'func5' does not exist on type '{}'. + + var multipleDeclarationAlias2 = module.exports = exports; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + multipleDeclarationAlias2.func6 = function () { }; ++ ~~~~~ ++!!! error TS2339: Property 'func6' does not exist on type 'typeof import("b")'. + + var someOtherVariable; + var multipleDeclarationAlias3 = someOtherVariable = exports; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + multipleDeclarationAlias3.func7 = function () { }; ++ ~~~~~ ++!!! error TS2339: Property 'func7' does not exist on type 'typeof import("b")'. + + var multipleDeclarationAlias4 = someOtherVariable = module.exports; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + multipleDeclarationAlias4.func8 = function () { }; ++ ~~~~~ ++!!! error TS2339: Property 'func8' does not exist on type '{}'. + + var multipleDeclarationAlias5 = module.exports = exports = {}; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++!!! error TS2631: Cannot assign to '"b"' because it is a namespace. + multipleDeclarationAlias5.func9 = function () { }; + ~~~~~ +!!! error TS2339: Property 'func9' does not exist on type '{}'. + + var multipleDeclarationAlias6 = exports = module.exports = {}; + ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2631: Cannot assign to '"b"' because it is a namespace. + multipleDeclarationAlias6.func10 = function () { }; + ~~~~~~ +!!! error TS2339: Property 'func10' does not exist on type '{}'. + + exports = module.exports = someOtherVariable = {}; + ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2631: Cannot assign to '"b"' because it is a namespace. + exports.func11 = function () { }; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~ ++!!! error TS2339: Property 'func11' does not exist on type 'typeof import("b")'. + module.exports.func12 = function () { }; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~ ++!!! error TS2339: Property 'func12' does not exist on type '{}'. + + exports = module.exports = someOtherVariable = {}; + ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2631: Cannot assign to '"b"' because it is a namespace. + exports.func11 = function () { }; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~ ++!!! error TS2339: Property 'func11' does not exist on type 'typeof import("b")'. + module.exports.func12 = function () { }; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~ ++!!! error TS2339: Property 'func12' does not exist on type '{}'. + + exports = module.exports = {}; + ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2631: Cannot assign to '"b"' because it is a namespace. + exports.func13 = function () { }; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~ ++!!! error TS2339: Property 'func13' does not exist on type 'typeof import("b")'. + module.exports.func14 = function () { }; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~ ++!!! error TS2339: Property 'func14' does not exist on type '{}'. + + exports = module.exports = {}; + ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2631: Cannot assign to '"b"' because it is a namespace. + exports.func15 = function () { }; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~ ++!!! error TS2339: Property 'func15' does not exist on type 'typeof import("b")'. + module.exports.func16 = function () { }; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~ ++!!! error TS2339: Property 'func16' does not exist on type '{}'. + + module.exports = exports = {}; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2300: Duplicate identifier 'export='. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++!!! error TS2631: Cannot assign to '"b"' because it is a namespace. + exports.func17 = function () { }; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~ ++!!! error TS2339: Property 'func17' does not exist on type 'typeof import("b")'. + module.exports.func18 = function () { }; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~ ++!!! error TS2339: Property 'func18' does not exist on type '{}'. + + module.exports = {}; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~ ++!!! error TS2300: Duplicate identifier 'export='. + exports.func19 = function () { }; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~ ++!!! error TS2339: Property 'func19' does not exist on type 'typeof import("b")'. + module.exports.func20 = function () { }; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~ ++!!! error TS2339: Property 'func20' does not exist on type '{}'. + + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias.types.diff index fb179732e5..7c2ab801a8 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias.types.diff @@ -5,14 +5,14 @@ === a.ts === import b = require("./b.js"); ->b : typeof b -+>b : any ++>b : {} b.func1; ->b.func1 : () => void ->b : typeof b ->func1 : () => void +>b.func1 : any -+>b : any ++>b : {} +>func1 : any b.func2; @@ -20,7 +20,7 @@ ->b : typeof b ->func2 : () => void +>b.func2 : any -+>b : any ++>b : {} +>func2 : any b.func3; @@ -28,7 +28,7 @@ ->b : typeof b ->func3 : () => void +>b.func3 : any -+>b : any ++>b : {} +>func3 : any b.func4; @@ -36,7 +36,7 @@ ->b : typeof b ->func4 : () => void +>b.func4 : any -+>b : any ++>b : {} +>func4 : any b.func5; @@ -44,7 +44,7 @@ ->b : typeof b ->func5 : () => void +>b.func5 : any -+>b : any ++>b : {} +>func5 : any b.func6; @@ -52,7 +52,7 @@ ->b : typeof b ->func6 : () => void +>b.func6 : any -+>b : any ++>b : {} +>func6 : any b.func7; @@ -60,7 +60,7 @@ ->b : typeof b ->func7 : () => void +>b.func7 : any -+>b : any ++>b : {} +>func7 : any b.func8; @@ -68,7 +68,7 @@ ->b : typeof b ->func8 : () => void +>b.func8 : any -+>b : any ++>b : {} +>func8 : any b.func9; @@ -76,7 +76,7 @@ ->b : typeof b ->func9 : () => void +>b.func9 : any -+>b : any ++>b : {} +>func9 : any b.func10; @@ -84,7 +84,7 @@ ->b : typeof b ->func10 : () => void +>b.func10 : any -+>b : any ++>b : {} +>func10 : any b.func11; @@ -92,7 +92,7 @@ ->b : typeof b ->func11 : () => void +>b.func11 : any -+>b : any ++>b : {} +>func11 : any b.func12; @@ -100,7 +100,7 @@ ->b : typeof b ->func12 : () => void +>b.func12 : any -+>b : any ++>b : {} +>func12 : any b.func13; @@ -108,7 +108,7 @@ ->b : typeof b ->func13 : () => void +>b.func13 : any -+>b : any ++>b : {} +>func13 : any b.func14; @@ -116,7 +116,7 @@ ->b : typeof b ->func14 : () => void +>b.func14 : any -+>b : any ++>b : {} +>func14 : any b.func15; @@ -124,7 +124,7 @@ ->b : typeof b ->func15 : () => void +>b.func15 : any -+>b : any ++>b : {} +>func15 : any b.func16; @@ -132,7 +132,7 @@ ->b : typeof b ->func16 : () => void +>b.func16 : any -+>b : any ++>b : {} +>func16 : any b.func17; @@ -140,7 +140,7 @@ ->b : typeof b ->func17 : () => void +>b.func17 : any -+>b : any ++>b : {} +>func17 : any b.func18; @@ -148,7 +148,7 @@ ->b : typeof b ->func18 : () => void +>b.func18 : any -+>b : any ++>b : {} +>func18 : any b.func19; @@ -156,7 +156,7 @@ ->b : typeof b ->func19 : () => void +>b.func19 : any -+>b : any ++>b : {} +>func19 : any b.func20; @@ -164,34 +164,28 @@ ->b : typeof b ->func20 : () => void +>b.func20 : any -+>b : any ++>b : {} +>func20 : any === b.js === - var exportsAlias = exports; -->exportsAlias : typeof import("b") -->exports : typeof import("b") -+>exportsAlias : any -+>exports : any +@@= skipped -110, +110 lines =@@ exportsAlias.func1 = function () { }; >exportsAlias.func1 = function () { } : () => void ->exportsAlias.func1 : () => void -->exportsAlias : typeof import("b") -->func1 : () => void +>exportsAlias.func1 : any -+>exportsAlias : any + >exportsAlias : typeof import("b") +->func1 : () => void +>func1 : any >function () { } : () => void exports.func2 = function () { }; >exports.func2 = function () { } : () => void ->exports.func2 : () => void -->exports : typeof import("b") -->func2 : () => void +>exports.func2 : any -+>exports : any + >exports : typeof import("b") +->func2 : () => void +>func2 : any >function () { } : () => void @@ -200,10 +194,10 @@ ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -+>moduleExportsAlias : any -+>module.exports : any -+>module : any -+>exports : any ++>moduleExportsAlias : {} ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} moduleExportsAlias.func3 = function () { }; >moduleExportsAlias.func3 = function () { } : () => void @@ -211,7 +205,7 @@ ->moduleExportsAlias : typeof module.exports ->func3 : () => void +>moduleExportsAlias.func3 : any -+>moduleExportsAlias : any ++>moduleExportsAlias : {} +>func3 : any >function () { } : () => void @@ -223,9 +217,9 @@ ->exports : typeof module.exports ->func4 : () => void +>module.exports.func4 : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} +>func4 : any >function () { } : () => void @@ -236,12 +230,12 @@ ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -+>multipleDeclarationAlias1 : any -+>exports = module.exports : any -+>exports : any -+>module.exports : any -+>module : any ++>multipleDeclarationAlias1 : {} ++>exports = module.exports : {} +>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} multipleDeclarationAlias1.func5 = function () { }; >multipleDeclarationAlias1.func5 = function () { } : () => void @@ -249,7 +243,7 @@ ->multipleDeclarationAlias1 : typeof module.exports ->func5 : () => void +>multipleDeclarationAlias1.func5 : any -+>multipleDeclarationAlias1 : any ++>multipleDeclarationAlias1 : {} +>func5 : any >function () { } : () => void @@ -259,13 +253,12 @@ ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->exports : typeof import("b") -+>multipleDeclarationAlias2 : any -+>module.exports = exports : any -+>module.exports : any -+>module : any -+>exports : any -+>exports : any ++>multipleDeclarationAlias2 : typeof import("b") ++>module.exports = exports : typeof import("b") ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} + >exports : typeof import("b") multipleDeclarationAlias2.func6 = function () { }; >multipleDeclarationAlias2.func6 = function () { } : () => void @@ -273,44 +266,34 @@ ->multipleDeclarationAlias2 : typeof module.exports ->func6 : () => void +>multipleDeclarationAlias2.func6 : any -+>multipleDeclarationAlias2 : any ++>multipleDeclarationAlias2 : typeof import("b") +>func6 : any >function () { } : () => void var someOtherVariable; - >someOtherVariable : any - - var multipleDeclarationAlias3 = someOtherVariable = exports; -->multipleDeclarationAlias3 : typeof import("b") -->someOtherVariable = exports : typeof import("b") -+>multipleDeclarationAlias3 : any -+>someOtherVariable = exports : any - >someOtherVariable : any -->exports : typeof import("b") -+>exports : any +@@= skipped -75, +75 lines =@@ multipleDeclarationAlias3.func7 = function () { }; >multipleDeclarationAlias3.func7 = function () { } : () => void ->multipleDeclarationAlias3.func7 : () => void -->multipleDeclarationAlias3 : typeof import("b") -->func7 : () => void +>multipleDeclarationAlias3.func7 : any -+>multipleDeclarationAlias3 : any + >multipleDeclarationAlias3 : typeof import("b") +->func7 : () => void +>func7 : any >function () { } : () => void var multipleDeclarationAlias4 = someOtherVariable = module.exports; ->multipleDeclarationAlias4 : typeof module.exports ->someOtherVariable = module.exports : typeof module.exports -+>multipleDeclarationAlias4 : any -+>someOtherVariable = module.exports : any ++>multipleDeclarationAlias4 : {} ++>someOtherVariable = module.exports : {} >someOtherVariable : any ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} multipleDeclarationAlias4.func8 = function () { }; >multipleDeclarationAlias4.func8 = function () { } : () => void @@ -318,7 +301,7 @@ ->multipleDeclarationAlias4 : typeof module.exports ->func8 : () => void +>multipleDeclarationAlias4.func8 : any -+>multipleDeclarationAlias4 : any ++>multipleDeclarationAlias4 : {} +>func8 : any >function () { } : () => void @@ -330,9 +313,9 @@ ->exports : typeof module.exports +>multipleDeclarationAlias5 : {} +>module.exports = exports = {} : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} >exports = {} : {} ->exports : typeof import("b") +>exports : any @@ -360,9 +343,9 @@ +>exports = module.exports = {} : {} +>exports : any +>module.exports = {} : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} >{} : {} multipleDeclarationAlias6.func10 = function () { }; @@ -385,9 +368,9 @@ +>exports = module.exports = someOtherVariable = {} : {} +>exports : any +>module.exports = someOtherVariable = {} : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} >someOtherVariable = {} : {} >someOtherVariable : any >{} : {} @@ -395,10 +378,9 @@ exports.func11 = function () { }; >exports.func11 = function () { } : () => void ->exports.func11 : () => void -->exports : typeof import("b") -->func11 : () => void +>exports.func11 : any -+>exports : any + >exports : typeof import("b") +->func11 : () => void +>func11 : any >function () { } : () => void @@ -410,9 +392,9 @@ ->exports : typeof module.exports ->func12 : () => void +>module.exports.func12 : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} +>func12 : any >function () { } : () => void @@ -426,9 +408,9 @@ +>exports = module.exports = someOtherVariable = {} : {} +>exports : any +>module.exports = someOtherVariable = {} : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} >someOtherVariable = {} : {} >someOtherVariable : any >{} : {} @@ -436,10 +418,9 @@ exports.func11 = function () { }; >exports.func11 = function () { } : () => void ->exports.func11 : () => void -->exports : typeof import("b") -->func11 : () => void +>exports.func11 : any -+>exports : any + >exports : typeof import("b") +->func11 : () => void +>func11 : any >function () { } : () => void @@ -451,9 +432,9 @@ ->exports : typeof module.exports ->func12 : () => void +>module.exports.func12 : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} +>func12 : any >function () { } : () => void @@ -467,18 +448,17 @@ +>exports = module.exports = {} : {} +>exports : any +>module.exports = {} : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} >{} : {} exports.func13 = function () { }; >exports.func13 = function () { } : () => void ->exports.func13 : () => void -->exports : typeof import("b") -->func13 : () => void +>exports.func13 : any -+>exports : any + >exports : typeof import("b") +->func13 : () => void +>func13 : any >function () { } : () => void @@ -490,9 +470,9 @@ ->exports : typeof module.exports ->func14 : () => void +>module.exports.func14 : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} +>func14 : any >function () { } : () => void @@ -506,18 +486,17 @@ +>exports = module.exports = {} : {} +>exports : any +>module.exports = {} : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} >{} : {} exports.func15 = function () { }; >exports.func15 = function () { } : () => void ->exports.func15 : () => void -->exports : typeof import("b") -->func15 : () => void +>exports.func15 : any -+>exports : any + >exports : typeof import("b") +->func15 : () => void +>func15 : any >function () { } : () => void @@ -529,9 +508,9 @@ ->exports : typeof module.exports ->func16 : () => void +>module.exports.func16 : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} +>func16 : any >function () { } : () => void @@ -541,9 +520,9 @@ ->module : { exports: typeof module.exports; } ->exports : typeof module.exports +>module.exports = exports = {} : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} >exports = {} : {} ->exports : typeof import("b") +>exports : any @@ -552,10 +531,9 @@ exports.func17 = function () { }; >exports.func17 = function () { } : () => void ->exports.func17 : () => void -->exports : typeof import("b") -->func17 : () => void +>exports.func17 : any -+>exports : any + >exports : typeof import("b") +->func17 : () => void +>func17 : any >function () { } : () => void @@ -567,9 +545,9 @@ ->exports : typeof module.exports ->func18 : () => void +>module.exports.func18 : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} +>func18 : any >function () { } : () => void @@ -579,18 +557,17 @@ ->module : { exports: typeof module.exports; } ->exports : typeof module.exports +>module.exports = {} : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} >{} : {} exports.func19 = function () { }; >exports.func19 = function () { } : () => void ->exports.func19 : () => void -->exports : typeof import("b") -->func19 : () => void +>exports.func19 : any -+>exports : any + >exports : typeof import("b") +->func19 : () => void +>func19 : any >function () { } : () => void @@ -602,9 +579,9 @@ ->exports : typeof module.exports ->func20 : () => void +>module.exports.func20 : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} +>func20 : any >function () { } : () => void diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias2.errors.txt.diff new file mode 100644 index 0000000000..7cf48462e5 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias2.errors.txt.diff @@ -0,0 +1,35 @@ +--- old.moduleExportAlias2.errors.txt ++++ new.moduleExportAlias2.errors.txt +@@= skipped -0, +-1 lines =@@ +- +@@= skipped --1, +1 lines =@@ ++index.js(4,13): error TS2351: This expression is not constructable. ++ Type 'typeof import("semver")' has no construct signatures. ++semver.js(2,1): error TS2631: Cannot assign to '"semver"' because it is a namespace. ++semver.js(2,11): error TS2322: Type '() => void' is not assignable to type 'typeof import("semver")'. ++ ++ ++==== index.js (1 errors) ==== ++ /// ++ const C = require("./semver") ++ var two = C.f(1) ++ var c = new C ++ ~ ++!!! error TS2351: This expression is not constructable. ++!!! error TS2351: Type 'typeof import("semver")' has no construct signatures. ++ ++==== node.d.ts (0 errors) ==== ++ declare function require(name: string): any; ++ declare var exports: any; ++ declare var module: { exports: any }; ++==== semver.js (2 errors) ==== ++ /// ++ exports = module.exports = C ++ ~~~~~~~ ++!!! error TS2631: Cannot assign to '"semver"' because it is a namespace. ++ ~~~~~~~~~~~~~~ ++!!! error TS2322: Type '() => void' is not assignable to type 'typeof import("semver")'. ++ exports.f = n => n + 1 ++ function C() { ++ this.p = 1 ++ } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias2.types.diff index 996af6cf91..e07d289a6e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias2.types.diff @@ -6,8 +6,8 @@ const C = require("./semver") ->C : typeof C ->require("./semver") : typeof C -+>C : any -+>require("./semver") : any ++>C : typeof import("semver") ++>require("./semver") : typeof import("semver") >require : (name: string) => any >"./semver" : "./semver" @@ -18,7 +18,7 @@ ->C : typeof C ->f : (n: any) => any +>C.f : any -+>C : any ++>C : typeof import("semver") +>f : any >1 : 1 @@ -28,17 +28,14 @@ ->C : typeof C +>c : any +>new C : any -+>C : any ++>C : typeof import("semver") === node.d.ts === declare function require(name: string): any; -@@= skipped -30, +30 lines =@@ - >module : { exports: any; } - >exports : any - --=== semver.js === --/// --exports = module.exports = C +@@= skipped -33, +33 lines =@@ + === semver.js === + /// + exports = module.exports = C ->exports = module.exports = C : typeof C ->exports : typeof C ->module.exports = C : typeof C @@ -46,25 +43,37 @@ ->module : { exports: typeof C; } ->exports : typeof C ->C : typeof C -- --exports.f = n => n + 1 -->exports.f = n => n + 1 : (n: any) => any ++>exports = module.exports = C : () => void ++>exports : any ++>module.exports = C : () => void ++>module.exports : typeof import("semver") ++>module : { "semver": typeof import("semver"); } ++>exports : typeof import("semver") ++>C : () => void + + exports.f = n => n + 1 + >exports.f = n => n + 1 : (n: any) => any ->exports.f : (n: any) => any ->exports : typeof C ->f : (n: any) => any -->n => n + 1 : (n: any) => any -->n : any -->n + 1 : any -->n : any -->1 : 1 -- --function C() { ++>exports.f : any ++>exports : typeof import("semver") ++>f : any + >n => n + 1 : (n: any) => any + >n : any + >n + 1 : any +@@= skipped -20, +20 lines =@@ + >1 : 1 + + function C() { ->C : typeof C -- -- this.p = 1 -->this.p = 1 : 1 -->this.p : any ++>C : () => void + + this.p = 1 + >this.p = 1 : 1 + >this.p : any ->this : this -->p : any -->1 : 1 --} ++>this : any + >p : any + >1 : 1 + } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias3.errors.txt.diff deleted file mode 100644 index 4b41da4d5c..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias3.errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.moduleExportAlias3.errors.txt -+++ new.moduleExportAlias3.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+bug24062.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== bug24062.js (1 errors) ==== -+ // #24062 -+ class C { -+ } -+ module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ C -+ }; -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias3.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias3.types.diff index 3162433ec0..a7964416fc 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias3.types.diff @@ -9,9 +9,9 @@ ->module : { exports: typeof module.exports; } ->exports : typeof module.exports +>module.exports = { C} : { C: typeof C; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { C: typeof C; } ++>module : { export=: { C: typeof C; }; } ++>exports : { C: typeof C; } >{ C} : { C: typeof C; } C diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias4.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias4.errors.txt.diff index 8303ba3275..09aaefcabc 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias4.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias4.errors.txt.diff @@ -3,20 +3,17 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+bug24024.js(2,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+bug24024.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+bug24024.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++bug24024.js(3,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++bug24024.js(4,16): error TS2339: Property 'D' does not exist on type 'typeof C'. + + -+==== bug24024.js (3 errors) ==== ++==== bug24024.js (2 errors) ==== + // #24024 + var wat = require('./bug24024') -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + module.exports = class C {} -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.D = class D { } -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~ ++!!! error TS2339: Property 'D' does not exist on type 'typeof C'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias4.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias4.types.diff index 1afde4e0f9..63ebfde3ce 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias4.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias4.types.diff @@ -6,8 +6,8 @@ var wat = require('./bug24024') ->wat : typeof wat ->require('./bug24024') : typeof wat -+>wat : any -+>require('./bug24024') : any ++>wat : typeof C ++>require('./bug24024') : typeof C >require : any >'./bug24024' : "./bug24024" @@ -19,9 +19,9 @@ ->class C {} : typeof wat ->C : typeof wat +>module.exports = class C {} : typeof C -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof C ++>module : { C: typeof C; } ++>exports : typeof C +>class C {} : typeof C +>C : typeof C @@ -36,9 +36,9 @@ ->D : typeof wat.D +>module.exports.D = class D { } : typeof D +>module.exports.D : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof C ++>module : { C: typeof C; } ++>exports : typeof C +>D : any +>class D { } : typeof D +>D : typeof D diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias5.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias5.errors.txt.diff index d06378e5f3..863eb1b417 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias5.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias5.errors.txt.diff @@ -3,23 +3,21 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+bug24754.js(4,1): error TS2304: Cannot find name 'exports'. -+bug24754.js(4,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+bug24754.js(5,1): error TS2304: Cannot find name 'exports'. ++bug24754.js(4,1): error TS2631: Cannot assign to '"bug24754"' because it is a namespace. ++bug24754.js(4,11): error TS2741: Property 'version' is missing in type '{ (): void; WebpackOptionsDefaulter: number; }' but required in type 'typeof import("bug24754")'. + + -+==== bug24754.js (3 errors) ==== ++==== bug24754.js (2 errors) ==== + // #24754 + const webpack = function (){ + } + exports = module.exports = webpack; + ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++!!! error TS2631: Cannot assign to '"bug24754"' because it is a namespace. ++ ~~~~~~~~~~~~~~ ++!!! error TS2741: Property 'version' is missing in type '{ (): void; WebpackOptionsDefaulter: number; }' but required in type 'typeof import("bug24754")'. ++!!! related TS2728 bug24754.js:5:1: 'version' is declared here. + exports.version = 1001; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + + webpack.WebpackOptionsDefaulter = 1111; + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias5.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias5.types.diff index 5a93faf6c8..c7012d8b52 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias5.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAlias5.types.diff @@ -13,19 +13,16 @@ +>exports = module.exports = webpack : { (): void; WebpackOptionsDefaulter: number; } +>exports : any +>module.exports = webpack : { (): void; WebpackOptionsDefaulter: number; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("bug24754") ++>module : { "bug24754": typeof import("bug24754"); } ++>exports : typeof import("bug24754") >webpack : { (): void; WebpackOptionsDefaulter: number; } exports.version = 1001; >exports.version = 1001 : 1001 -->exports.version : 1001 + >exports.version : 1001 ->exports : { (): void; version: 1001; WebpackOptionsDefaulter: number; } -->version : 1001 -+>exports.version : any -+>exports : any -+>version : any ++>exports : typeof import("bug24754") + >version : 1001 >1001 : 1001 - webpack.WebpackOptionsDefaulter = 1111; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasElementAccessExpression.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasElementAccessExpression.errors.txt.diff deleted file mode 100644 index e552513e4d..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasElementAccessExpression.errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.moduleExportAliasElementAccessExpression.errors.txt -+++ new.moduleExportAliasElementAccessExpression.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+moduleExportAliasElementAccessExpression.js(2,1): error TS2304: Cannot find name 'exports'. -+moduleExportAliasElementAccessExpression.js(4,1): error TS2304: Cannot find name 'exports'. -+ -+ -+==== moduleExportAliasElementAccessExpression.js (2 errors) ==== -+ function D () { } -+ exports["D"] = D; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ // (the only package I could find that uses spaces in identifiers is webidl-conversions) -+ exports["Does not work yet"] = D; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasElementAccessExpression.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasElementAccessExpression.types.diff deleted file mode 100644 index 83c21239fa..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasElementAccessExpression.types.diff +++ /dev/null @@ -1,23 +0,0 @@ ---- old.moduleExportAliasElementAccessExpression.types -+++ new.moduleExportAliasElementAccessExpression.types -@@= skipped -5, +5 lines =@@ - - exports["D"] = D; - >exports["D"] = D : () => void -->exports["D"] : () => void -->exports : typeof import("moduleExportAliasElementAccessExpression") -+>exports["D"] : any -+>exports : any - >"D" : "D" - >D : () => void - - // (the only package I could find that uses spaces in identifiers is webidl-conversions) - exports["Does not work yet"] = D; - >exports["Does not work yet"] = D : () => void -->exports["Does not work yet"] : () => void -->exports : typeof import("moduleExportAliasElementAccessExpression") -+>exports["Does not work yet"] : any -+>exports : any - >"Does not work yet" : "Does not work yet" - >D : () => void - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasExports.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasExports.errors.txt.diff index 3f51505bec..ae5c12ff25 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasExports.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasExports.errors.txt.diff @@ -3,25 +3,19 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+Eloquent.js(3,1): error TS2304: Cannot find name 'exports'. -+Eloquent.js(4,1): error TS2304: Cannot find name 'exports'. -+Eloquent.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+Eloquent.js(5,18): error TS2304: Cannot find name 'exports'. ++Eloquent.js(5,1): error TS1231: An export assignment must be at the top level of a file or module declaration. ++Eloquent.js(5,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + -+==== Eloquent.js (4 errors) ==== ++==== Eloquent.js (2 errors) ==== + // bug #27365, crashes from github.com/marijnh/Eloquent-JavaScript + (function() { + exports.bigOak = 1 -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + exports.everywhere = 2 -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + module.exports = exports + ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++!!! error TS1231: An export assignment must be at the top level of a file or module declaration. ++ ~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + })() + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasExports.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasExports.types.diff index 5b3acb3c58..c4a00470eb 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasExports.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasExports.types.diff @@ -1,38 +1,11 @@ --- old.moduleExportAliasExports.types +++ new.moduleExportAliasExports.types -@@= skipped -8, +8 lines =@@ - - exports.bigOak = 1 - >exports.bigOak = 1 : 1 -->exports.bigOak : 1 -->exports : typeof import("Eloquent") -->bigOak : 1 -+>exports.bigOak : any -+>exports : any -+>bigOak : any - >1 : 1 - - exports.everywhere = 2 - >exports.everywhere = 2 : 2 -->exports.everywhere : 2 -->exports : typeof import("Eloquent") -->everywhere : 2 -+>exports.everywhere : any -+>exports : any -+>everywhere : any - >2 : 2 - +@@= skipped -23, +23 lines =@@ module.exports = exports -->module.exports = exports : typeof import("Eloquent") -->module.exports : typeof import("Eloquent") + >module.exports = exports : typeof import("Eloquent") + >module.exports : typeof import("Eloquent") ->module : { exports: typeof import("Eloquent"); } -->exports : typeof import("Eloquent") -->exports : typeof import("Eloquent") -+>module.exports = exports : any -+>module.exports : any -+>module : any -+>exports : any -+>exports : any - - })() ++>module : { "Eloquent": typeof import("Eloquent"); } + >exports : typeof import("Eloquent") + >exports : typeof import("Eloquent") diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasImported.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasImported.errors.txt.diff index 043a1a3af3..a70a1cd90d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasImported.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasImported.errors.txt.diff @@ -3,22 +3,22 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+bug28014.js(1,1): error TS2304: Cannot find name 'exports'. -+bug28014.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+importer.js(1,8): error TS2306: File 'bug28014.js' is not a module. ++bug28014.js(1,9): error TS2339: Property 'version' does not exist on type 'typeof import("bug28014")'. ++bug28014.js(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. ++bug28014.js(3,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + -+==== bug28014.js (2 errors) ==== ++==== bug28014.js (3 errors) ==== + exports.version = 1 -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~~ ++!!! error TS2339: Property 'version' does not exist on type 'typeof import("bug28014")'. + function alias() { } + module.exports = alias -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. ++ ~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + -+==== importer.js (1 errors) ==== ++==== importer.js (0 errors) ==== + import('./bug28014') -+ ~~~~~~~~~~~~ -+!!! error TS2306: File 'bug28014.js' is not a module. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasImported.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasImported.types.diff index 900c0c12e3..296dd3626d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasImported.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasImported.types.diff @@ -8,7 +8,7 @@ ->exports : typeof alias ->version : 1 +>exports.version : any -+>exports : any ++>exports : typeof import("bug28014") +>version : any >1 : 1 @@ -23,14 +23,14 @@ ->exports : typeof alias ->alias : typeof alias +>module.exports = alias : () => void -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : () => void ++>module : { alias: () => void; } ++>exports : () => void +>alias : () => void === importer.js === import('./bug28014') ->import('./bug28014') : Promise<{ (): void; version: 1; }> -+>import('./bug28014') : Promise ++>import('./bug28014') : Promise<() => void> >'./bug28014' : "./bug28014" diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasUnknown.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasUnknown.errors.txt.diff index fd2dce18fe..7124ec6374 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasUnknown.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasUnknown.errors.txt.diff @@ -1,22 +1,22 @@ --- old.moduleExportAliasUnknown.errors.txt +++ new.moduleExportAliasUnknown.errors.txt @@= skipped -0, +0 lines =@@ -+bug27025.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++bug27025.js(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements. bug27025.js(1,25): error TS2339: Property 'nonprop' does not exist on type 'Window & typeof globalThis'. -+bug27025.js(2,1): error TS2304: Cannot find name 'exports'. ++bug27025.js(2,9): error TS2339: Property 'foo' does not exist on type 'typeof import("bug27025")'. bug27025.js(2,15): error TS2304: Cannot find name 'bar'. -==== bug27025.js (2 errors) ==== +==== bug27025.js (4 errors) ==== module.exports = window.nonprop; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. ~~~~~~~ !!! error TS2339: Property 'nonprop' does not exist on type 'Window & typeof globalThis'. exports.foo = bar; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~ ++!!! error TS2339: Property 'foo' does not exist on type 'typeof import("bug27025")'. ~~~ !!! error TS2304: Cannot find name 'bar'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasUnknown.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasUnknown.types.diff index 2cceb03b06..96040c1236 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasUnknown.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAliasUnknown.types.diff @@ -5,7 +5,16 @@ >module.exports = window.nonprop : any >module.exports : any ->module : { exports: any; } -+>module : any ++>module : { unknown: any; } >exports : any >window.nonprop : any >window : Window & typeof globalThis +@@= skipped -9, +9 lines =@@ + exports.foo = bar; + >exports.foo = bar : any + >exports.foo : any +->exports : any ++>exports : typeof import("bug27025") + >foo : any + >bar : any + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment.errors.txt.diff index 489f90f6a9..496c46382c 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment.errors.txt.diff @@ -3,28 +3,47 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+use.js(1,14): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++npmlog.js(5,14): error TS2741: Property 'y' is missing in type 'EE' but required in type 'typeof import("npmlog")'. ++npmlog.js(8,16): error TS2339: Property 'on' does not exist on type 'typeof import("npmlog")'. ++npmlog.js(10,8): error TS2339: Property 'x' does not exist on type 'EE'. ++npmlog.js(12,8): error TS2339: Property 'y' does not exist on type 'EE'. ++npmlog.js(13,16): error TS2339: Property 'x' does not exist on type 'typeof import("npmlog")'. ++use.js(2,8): error TS2339: Property 'x' does not exist on type 'typeof import("npmlog")'. ++use.js(3,8): error TS2339: Property 'on' does not exist on type 'typeof import("npmlog")'. + + -+==== use.js (1 errors) ==== ++==== use.js (2 errors) ==== + var npmlog = require('./npmlog') -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + npmlog.x ++ ~ ++!!! error TS2339: Property 'x' does not exist on type 'typeof import("npmlog")'. + npmlog.on ++ ~~ ++!!! error TS2339: Property 'on' does not exist on type 'typeof import("npmlog")'. + -+==== npmlog.js (0 errors) ==== ++==== npmlog.js (5 errors) ==== + class EE { + /** @param {string} s */ + on(s) { } + } + var npmlog = module.exports = new EE() ++ ~~~~~~~~~~~~~~ ++!!! error TS2741: Property 'y' is missing in type 'EE' but required in type 'typeof import("npmlog")'. ++!!! related TS2728 npmlog.js:11:1: 'y' is declared here. + + npmlog.on('hi') // both references should see EE.on + module.exports.on('hi') // here too ++ ~~ ++!!! error TS2339: Property 'on' does not exist on type 'typeof import("npmlog")'. + + npmlog.x = 1 ++ ~ ++!!! error TS2339: Property 'x' does not exist on type 'EE'. + module.exports.y = 2 + npmlog.y ++ ~ ++!!! error TS2339: Property 'y' does not exist on type 'EE'. + module.exports.x ++ ~ ++!!! error TS2339: Property 'x' does not exist on type 'typeof import("npmlog")'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment.types.diff index 605457d9c2..9cf4124f8e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment.types.diff @@ -6,8 +6,8 @@ var npmlog = require('./npmlog') ->npmlog : { on(s: string): void; x: number; y: 2; } ->require('./npmlog') : { on(s: string): void; x: number; y: 2; } -+>npmlog : any -+>require('./npmlog') : any ++>npmlog : typeof import("npmlog") ++>require('./npmlog') : typeof import("npmlog") >require : any >'./npmlog' : "./npmlog" @@ -16,7 +16,7 @@ ->npmlog : { on(s: string): void; x: number; y: 2; } ->x : number +>npmlog.x : any -+>npmlog : any ++>npmlog : typeof import("npmlog") +>x : any npmlog.on @@ -24,68 +24,90 @@ ->npmlog : { on(s: string): void; x: number; y: 2; } ->on : (s: string) => void +>npmlog.on : any -+>npmlog : any ++>npmlog : typeof import("npmlog") +>on : any --=== npmlog.js === --class EE { -->EE : EE -- -- /** @param {string} s */ -- on(s) { } -->on : (s: string) => void -->s : string --} --var npmlog = module.exports = new EE() + === npmlog.js === + class EE { +@@= skipped -25, +25 lines =@@ + >s : string + } + var npmlog = module.exports = new EE() ->npmlog : { on(s: string): void; x: number; y: 2; } ->module.exports = new EE() : { on(s: string): void; x: number; y: 2; } ->module.exports : { on(s: string): void; x: number; y: 2; } ->module : { exports: { on(s: string): void; x: number; y: 2; }; } ->exports : { on(s: string): void; x: number; y: 2; } -->new EE() : EE -->EE : typeof EE -- --npmlog.on('hi') // both references should see EE.on -->npmlog.on('hi') : void -->npmlog.on : (s: string) => void ++>npmlog : EE ++>module.exports = new EE() : EE ++>module.exports : typeof import("npmlog") ++>module : { "npmlog": typeof import("npmlog"); } ++>exports : typeof import("npmlog") + >new EE() : EE + >EE : typeof EE + + npmlog.on('hi') // both references should see EE.on + >npmlog.on('hi') : void + >npmlog.on : (s: string) => void ->npmlog : { on(s: string): void; x: number; y: 2; } -->on : (s: string) => void -->'hi' : "hi" -- --module.exports.on('hi') // here too ++>npmlog : EE + >on : (s: string) => void + >'hi' : "hi" + + module.exports.on('hi') // here too ->module.exports.on('hi') : void ->module.exports.on : (s: string) => void ->module.exports : { on(s: string): void; x: number; y: 2; } ->module : { exports: { on(s: string): void; x: number; y: 2; }; } ->exports : { on(s: string): void; x: number; y: 2; } ->on : (s: string) => void -->'hi' : "hi" -- --npmlog.x = 1 -->npmlog.x = 1 : 1 ++>module.exports.on('hi') : any ++>module.exports.on : any ++>module.exports : typeof import("npmlog") ++>module : { "npmlog": typeof import("npmlog"); } ++>exports : typeof import("npmlog") ++>on : any + >'hi' : "hi" + + npmlog.x = 1 + >npmlog.x = 1 : 1 ->npmlog.x : number ->npmlog : { on(s: string): void; x: number; y: 2; } ->x : number -->1 : 1 -- --module.exports.y = 2 -->module.exports.y = 2 : 2 -->module.exports.y : 2 ++>npmlog.x : any ++>npmlog : EE ++>x : any + >1 : 1 + + module.exports.y = 2 + >module.exports.y = 2 : 2 + >module.exports.y : 2 ->module.exports : { on(s: string): void; x: number; y: 2; } ->module : { exports: { on(s: string): void; x: number; y: 2; }; } ->exports : { on(s: string): void; x: number; y: 2; } -->y : 2 -->2 : 2 -- --npmlog.y ++>module.exports : typeof import("npmlog") ++>module : { "npmlog": typeof import("npmlog"); } ++>exports : typeof import("npmlog") + >y : 2 + >2 : 2 + + npmlog.y ->npmlog.y : 2 ->npmlog : { on(s: string): void; x: number; y: 2; } ->y : 2 -- --module.exports.x ++>npmlog.y : any ++>npmlog : EE ++>y : any + + module.exports.x ->module.exports.x : number ->module.exports : { on(s: string): void; x: number; y: 2; } ->module : { exports: { on(s: string): void; x: number; y: 2; }; } ->exports : { on(s: string): void; x: number; y: 2; } ->x : number -- ++>module.exports.x : any ++>module.exports : typeof import("npmlog") ++>module : { "npmlog": typeof import("npmlog"); } ++>exports : typeof import("npmlog") ++>x : any + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment2.errors.txt.diff index 526432265f..9dc73eb43e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment2.errors.txt.diff @@ -3,22 +3,21 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+npm.js(1,11): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+npm.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+npm.js(5,5): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++npm.js(1,11): error TS2322: Type '(tree: any) => void' is not assignable to type 'typeof import("npm")'. ++npm.js(5,12): error TS2349: This expression is not callable. ++ Type 'typeof import("npm")' has no call signatures. + + -+==== npm.js (3 errors) ==== ++==== npm.js (2 errors) ==== + var npm = module.exports = function (tree) { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~ ++!!! error TS2322: Type '(tree: any) => void' is not assignable to type 'typeof import("npm")'. + } + module.exports.asReadInstalled = function (tree) { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + npm(tree) // both references should be callable + module.exports(tree) -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~ ++!!! error TS2349: This expression is not callable. ++!!! error TS2349: Type 'typeof import("npm")' has no call signatures. + } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment2.types.diff index 338900bf5a..d2eddb9555 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment2.types.diff @@ -11,9 +11,9 @@ ->exports : { (tree: any): void; asReadInstalled: (tree: any) => void; } +>npm : (tree: any) => void +>module.exports = function (tree) {} : (tree: any) => void -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("npm") ++>module : { "npm": typeof import("npm"); } ++>exports : typeof import("npm") >function (tree) {} : (tree: any) => void >tree : any } @@ -25,9 +25,9 @@ ->exports : { (tree: any): void; asReadInstalled: (tree: any) => void; } ->asReadInstalled : (tree: any) => void +>module.exports.asReadInstalled : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("npm") ++>module : { "npm": typeof import("npm"); } ++>exports : typeof import("npm") +>asReadInstalled : any >function (tree) { npm(tree) // both references should be callable module.exports(tree)} : (tree: any) => void >tree : any @@ -44,9 +44,9 @@ ->module : { exports: { (tree: any): void; asReadInstalled: (tree: any) => void; }; } ->exports : { (tree: any): void; asReadInstalled: (tree: any) => void; } +>module.exports(tree) : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("npm") ++>module : { "npm": typeof import("npm"); } ++>exports : typeof import("npm") >tree : any } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment3.errors.txt.diff deleted file mode 100644 index 6e8b775678..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment3.errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.moduleExportAssignment3.errors.txt -+++ new.moduleExportAssignment3.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+npm.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== npm.js (1 errors) ==== -+ var mod = require('./mod') -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ mod() // should be callable from here too -+ -+==== mod.js (0 errors) ==== -+ module.exports = function x() { } -+ module.exports() // should be callable -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment3.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment3.types.diff index 2fbfac6977..41ec501b11 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment3.types.diff @@ -1,34 +1,19 @@ --- old.moduleExportAssignment3.types +++ new.moduleExportAssignment3.types -@@= skipped -1, +1 lines =@@ - - === npm.js === - var mod = require('./mod') -->mod : () => void -->require('./mod') : () => void -+>mod : any -+>require('./mod') : any - >require : any - >'./mod' : "./mod" - - mod() // should be callable from here too -->mod() : void -->mod : () => void -+>mod() : any -+>mod : any - --=== mod.js === --module.exports = function x() { } -->module.exports = function x() { } : () => void -->module.exports : () => void +@@= skipped -14, +14 lines =@@ + module.exports = function x() { } + >module.exports = function x() { } : () => void + >module.exports : () => void ->module : { exports: () => void; } -->exports : () => void -->function x() { } : () => void -->x : () => void -- --module.exports() // should be callable -->module.exports() : void -->module.exports : () => void ++>module : { export=: () => void; } + >exports : () => void + >function x() { } : () => void + >x : () => void +@@= skipped -8, +8 lines =@@ + module.exports() // should be callable + >module.exports() : void + >module.exports : () => void ->module : { exports: () => void; } -->exports : () => void -- ++>module : { export=: () => void; } + >exports : () => void + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment4.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment4.errors.txt.diff index f63390409d..1f958bb8f1 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment4.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment4.errors.txt.diff @@ -3,18 +3,15 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+async.js(1,1): error TS2304: Cannot find name 'exports'. -+async.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+async.js(2,18): error TS2304: Cannot find name 'exports'. ++async.js(1,9): error TS2339: Property 'default' does not exist on type 'typeof import("async")'. ++async.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + -+==== async.js (3 errors) ==== ++==== async.js (2 errors) ==== + exports.default = { m: 1, a: 1 } -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~~ ++!!! error TS2339: Property 'default' does not exist on type 'typeof import("async")'. + module.exports = exports['default']; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment4.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment4.types.diff index 34b44df68a..a9648f0e9f 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment4.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment4.types.diff @@ -1,6 +1,15 @@ --- old.moduleExportAssignment4.types +++ new.moduleExportAssignment4.types -@@= skipped -12, +12 lines =@@ +@@= skipped -3, +3 lines =@@ + exports.default = { m: 1, a: 1 } + >exports.default = { m: 1, a: 1 } : { m: number; a: number; } + >exports.default : any +->exports : any ++>exports : typeof import("async") + >default : any + >{ m: 1, a: 1 } : { m: number; a: number; } + >m : number +@@= skipped -9, +9 lines =@@ >1 : 1 module.exports = exports['default']; @@ -9,7 +18,10 @@ ->module : { exports: any; } +>module.exports = exports['default'] : any +>module.exports : any -+>module : any ++>module : { export=: any; } >exports : any >exports['default'] : any - >exports : any +->exports : any ++>exports : typeof import("async") + >'default' : "default" + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment5.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment5.errors.txt.diff index c27d180f7f..6df2407fde 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment5.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment5.errors.txt.diff @@ -3,8 +3,8 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+axios.js(9,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+axios.js(10,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++axios.js(9,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++axios.js(10,16): error TS2339: Property 'default' does not exist on type 'Axios'. + + +==== axios.js (2 errors) ==== @@ -17,9 +17,9 @@ + // none of the 3 references should have a use-before-def error + axios.m() + module.exports = axios; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.default = axios; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~ ++!!! error TS2339: Property 'default' does not exist on type 'Axios'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment5.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment5.types.diff index f4c5c17df1..d01eaabcb1 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment5.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment5.types.diff @@ -9,9 +9,9 @@ ->module : { exports: { m(): void; default: Axios; }; } ->exports : { m(): void; default: Axios; } +>module.exports = axios : Axios -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : Axios ++>module : { axios: Axios; } ++>exports : Axios >axios : Axios module.exports.default = axios; @@ -22,9 +22,9 @@ ->exports : { m(): void; default: Axios; } ->default : Axios +>module.exports.default : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : Axios ++>module : { axios: Axios; } ++>exports : Axios +>default : any >axios : Axios diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment7.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment7.errors.txt.diff index 05bc56ce6a..cd97073159 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment7.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment7.errors.txt.diff @@ -1,41 +1,21 @@ --- old.moduleExportAssignment7.errors.txt +++ new.moduleExportAssignment7.errors.txt -@@= skipped -0, +0 lines =@@ --index.ts(2,24): error TS2694: Namespace '"mod".export=' has no exported member 'Thing'. --index.ts(3,24): error TS2694: Namespace '"mod".export=' has no exported member 'AnotherThing'. --index.ts(4,24): error TS2694: Namespace '"mod".export=' has no exported member 'foo'. --index.ts(5,24): error TS2694: Namespace '"mod".export=' has no exported member 'qux'. --index.ts(6,24): error TS2694: Namespace '"mod".export=' has no exported member 'baz'. --index.ts(8,24): error TS2694: Namespace '"mod".export=' has no exported member 'literal'. --index.ts(19,31): error TS2694: Namespace '"mod".export=' has no exported member 'buz'. --main.js(20,35): error TS2694: Namespace '"mod".export=' has no exported member 'buz'. -+index.ts(2,24): error TS2694: Namespace '"mod"' has no exported member 'Thing'. -+index.ts(3,24): error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. -+index.ts(4,24): error TS2694: Namespace '"mod"' has no exported member 'foo'. -+index.ts(5,24): error TS2694: Namespace '"mod"' has no exported member 'qux'. -+index.ts(6,24): error TS2694: Namespace '"mod"' has no exported member 'baz'. -+index.ts(8,24): error TS2694: Namespace '"mod"' has no exported member 'literal'. -+index.ts(14,31): error TS2694: Namespace '"mod"' has no exported member 'Thing'. -+index.ts(15,31): error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. -+index.ts(16,31): error TS2694: Namespace '"mod"' has no exported member 'foo'. -+index.ts(17,31): error TS2694: Namespace '"mod"' has no exported member 'qux'. -+index.ts(18,31): error TS2694: Namespace '"mod"' has no exported member 'baz'. -+index.ts(19,31): error TS2694: Namespace '"mod"' has no exported member 'buz'. -+index.ts(20,31): error TS2694: Namespace '"mod"' has no exported member 'literal'. -+main.js(2,28): error TS2694: Namespace '"mod"' has no exported member 'Thing'. -+main.js(3,28): error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. -+main.js(4,28): error TS2694: Namespace '"mod"' has no exported member 'foo'. -+main.js(5,28): error TS2694: Namespace '"mod"' has no exported member 'qux'. -+main.js(6,28): error TS2694: Namespace '"mod"' has no exported member 'baz'. -+main.js(8,28): error TS2694: Namespace '"mod"' has no exported member 'literal'. -+main.js(15,35): error TS2694: Namespace '"mod"' has no exported member 'Thing'. -+main.js(16,35): error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. -+main.js(17,35): error TS2694: Namespace '"mod"' has no exported member 'foo'. -+main.js(18,35): error TS2694: Namespace '"mod"' has no exported member 'qux'. -+main.js(19,35): error TS2694: Namespace '"mod"' has no exported member 'baz'. -+main.js(20,35): error TS2694: Namespace '"mod"' has no exported member 'buz'. -+main.js(21,35): error TS2694: Namespace '"mod"' has no exported member 'literal'. -+mod.js(6,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +@@= skipped -2, +2 lines =@@ + index.ts(4,24): error TS2694: Namespace '"mod".export=' has no exported member 'foo'. + index.ts(5,24): error TS2694: Namespace '"mod".export=' has no exported member 'qux'. + index.ts(6,24): error TS2694: Namespace '"mod".export=' has no exported member 'baz'. ++index.ts(7,24): error TS2694: Namespace '"mod".export=' has no exported member 'buz'. + index.ts(8,24): error TS2694: Namespace '"mod".export=' has no exported member 'literal'. + index.ts(19,31): error TS2694: Namespace '"mod".export=' has no exported member 'buz'. ++main.js(2,28): error TS2694: Namespace '"mod".export=' has no exported member 'Thing'. ++main.js(3,28): error TS2694: Namespace '"mod".export=' has no exported member 'AnotherThing'. ++main.js(4,28): error TS2694: Namespace '"mod".export=' has no exported member 'foo'. ++main.js(5,28): error TS2694: Namespace '"mod".export=' has no exported member 'qux'. ++main.js(6,28): error TS2694: Namespace '"mod".export=' has no exported member 'baz'. ++main.js(7,28): error TS2694: Namespace '"mod".export=' has no exported member 'buz'. ++main.js(8,28): error TS2694: Namespace '"mod".export=' has no exported member 'literal'. + main.js(20,35): error TS2694: Namespace '"mod".export=' has no exported member 'buz'. ++mod.js(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== mod.js (0 errors) ==== @@ -46,125 +26,64 @@ function bar() { return 4 } /** @typedef {() => number} buz */ module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~ Thing, ++ ~~~~~~~~~~ AnotherThing, ++ ~~~~~~~~~~~~~~~~~ foo, -@@= skipped -21, +42 lines =@@ ++ ~~~~~~~~ + qux: bar, ++ ~~~~~~~~~~~~~ baz() { return 5 }, ++ ~~~~~~~~~~~~~~~~~~~~~~~ literal: "", ++ ~~~~~~~~~~~~~~~~ } -==== main.js (1 errors) ==== -+==== main.js (13 errors) ==== ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. ++==== main.js (8 errors) ==== /** * @param {import("./mod").Thing} a + ~~~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'Thing'. ++!!! error TS2694: Namespace '"mod".export=' has no exported member 'Thing'. * @param {import("./mod").AnotherThing} b + ~~~~~~~~~~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. ++!!! error TS2694: Namespace '"mod".export=' has no exported member 'AnotherThing'. * @param {import("./mod").foo} c + ~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'foo'. ++!!! error TS2694: Namespace '"mod".export=' has no exported member 'foo'. * @param {import("./mod").qux} d + ~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'qux'. ++!!! error TS2694: Namespace '"mod".export=' has no exported member 'qux'. * @param {import("./mod").baz} e + ~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'baz'. ++!!! error TS2694: Namespace '"mod".export=' has no exported member 'baz'. * @param {import("./mod").buz} f ++ ~~~ ++!!! error TS2694: Namespace '"mod".export=' has no exported member 'buz'. * @param {import("./mod").literal} g + ~~~~~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'literal'. ++!!! error TS2694: Namespace '"mod".export=' has no exported member 'literal'. */ function jstypes(a, b, c, d, e, f, g) { return a.x + b.y + c() + d() + e() + f() + g.length -@@= skipped -16, +28 lines =@@ - - /** - * @param {typeof import("./mod").Thing} a -+ ~~~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'Thing'. - * @param {typeof import("./mod").AnotherThing} b -+ ~~~~~~~~~~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. - * @param {typeof import("./mod").foo} c -+ ~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'foo'. - * @param {typeof import("./mod").qux} d -+ ~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'qux'. - * @param {typeof import("./mod").baz} e -+ ~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'baz'. - * @param {typeof import("./mod").buz} f - ~~~ --!!! error TS2694: Namespace '"mod".export=' has no exported member 'buz'. -+!!! error TS2694: Namespace '"mod"' has no exported member 'buz'. - * @param {typeof import("./mod").literal} g -+ ~~~~~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'literal'. - */ - function jsvalues(a, b, c, d, e, f, g) { +@@= skipped -48, +80 lines =@@ return a.length + b.length + c() + d() + e() + f() + g.length } -==== index.ts (7 errors) ==== -+==== index.ts (13 errors) ==== ++==== index.ts (8 errors) ==== function types( a: import('./mod').Thing, ~~~~~ --!!! error TS2694: Namespace '"mod".export=' has no exported member 'Thing'. -+!!! error TS2694: Namespace '"mod"' has no exported member 'Thing'. - b: import('./mod').AnotherThing, - ~~~~~~~~~~~~ --!!! error TS2694: Namespace '"mod".export=' has no exported member 'AnotherThing'. -+!!! error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. - c: import('./mod').foo, - ~~~ --!!! error TS2694: Namespace '"mod".export=' has no exported member 'foo'. -+!!! error TS2694: Namespace '"mod"' has no exported member 'foo'. - d: import('./mod').qux, - ~~~ --!!! error TS2694: Namespace '"mod".export=' has no exported member 'qux'. -+!!! error TS2694: Namespace '"mod"' has no exported member 'qux'. - e: import('./mod').baz, +@@= skipped -18, +18 lines =@@ ~~~ --!!! error TS2694: Namespace '"mod".export=' has no exported member 'baz'. -+!!! error TS2694: Namespace '"mod"' has no exported member 'baz'. + !!! error TS2694: Namespace '"mod".export=' has no exported member 'baz'. f: import('./mod').buz, ++ ~~~ ++!!! error TS2694: Namespace '"mod".export=' has no exported member 'buz'. g: import('./mod').literal, ~~~~~~~ --!!! error TS2694: Namespace '"mod".export=' has no exported member 'literal'. -+!!! error TS2694: Namespace '"mod"' has no exported member 'literal'. - ) { - return a.x + b.y + c() + d() + e() + f() + g.length - } - - function values( - a: typeof import('./mod').Thing, -+ ~~~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'Thing'. - b: typeof import('./mod').AnotherThing, -+ ~~~~~~~~~~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'AnotherThing'. - c: typeof import('./mod').foo, -+ ~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'foo'. - d: typeof import('./mod').qux, -+ ~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'qux'. - e: typeof import('./mod').baz, -+ ~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'baz'. - f: typeof import('./mod').buz, - ~~~ --!!! error TS2694: Namespace '"mod".export=' has no exported member 'buz'. -+!!! error TS2694: Namespace '"mod"' has no exported member 'buz'. - g: typeof import('./mod').literal, -+ ~~~~~~~ -+!!! error TS2694: Namespace '"mod"' has no exported member 'literal'. - ) { - return a.length + b.length + c() + d() + e() + f() + g.length - } + !!! error TS2694: Namespace '"mod".export=' has no exported member 'literal'. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment7.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment7.types.diff index 29518b6bea..0065273908 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment7.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportAssignment7.types.diff @@ -10,9 +10,9 @@ ->exports : { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz(): number; literal: string; } ->{ Thing, AnotherThing, foo, qux: bar, baz() { return 5 }, literal: "",} : { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz(): number; literal: string; } +>module.exports = { Thing, AnotherThing, foo, qux: bar, baz() { return 5 }, literal: "",} : { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz: () => number; literal: string; } -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz: () => number; literal: string; } ++>module : { export=: { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz: () => number; literal: string; }; } ++>exports : { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz: () => number; literal: string; } +>{ Thing, AnotherThing, foo, qux: bar, baz() { return 5 }, literal: "",} : { Thing: typeof Thing; AnotherThing: typeof AnotherThing; foo: () => number; qux: () => number; baz: () => number; literal: string; } Thing, @@ -29,13 +29,13 @@ ->e : () => number ->f : import("mod").buz ->g : string -+>jstypes : (a: any, b: any, c: any, d: any, e: any, f: () => number, g: any) => any ++>jstypes : (a: any, b: any, c: any, d: any, e: any, f: any, g: any) => any +>a : any +>b : any +>c : any +>d : any +>e : any -+>f : () => number ++>f : any +>g : any return a.x + b.y + c() + d() + e() + f() + g.length @@ -57,6 +57,11 @@ ->d : () => number ->e() : number ->e : () => number +->f() : number +->f : import("mod").buz +->g.length : number +->g : string +->length : number +>a.x + b.y + c() + d() + e() + f() + g.length : any +>a.x + b.y + c() + d() + e() + f() : any +>a.x + b.y + c() + d() + e() : any @@ -75,12 +80,8 @@ +>d : any +>e() : any +>e : any - >f() : number -->f : import("mod").buz -->g.length : number -->g : string -->length : number -+>f : () => number ++>f() : any ++>f : any +>g.length : any +>g : any +>length : any @@ -92,88 +93,36 @@ */ function jsvalues(a, b, c, d, e, f, g) { ->jsvalues : (a: typeof import("./mod").Thing, b: typeof import("./mod").AnotherThing, c: typeof import("./mod").foo, d: typeof import("./mod").qux, e: typeof import("./mod").baz, f: typeof import("./mod").buz, g: typeof import("./mod").literal) => any -->a : typeof Thing -->b : typeof AnotherThing -->c : () => number -->d : () => number -->e : () => number -+>jsvalues : (a: any, b: any, c: any, d: any, e: any, f: any, g: any) => any -+>a : any -+>b : any -+>c : any -+>d : any -+>e : any - >f : any -->g : string -+>g : any - - return a.length + b.length + c() + d() + e() + f() + g.length - >a.length + b.length + c() + d() + e() + f() + g.length : any - >a.length + b.length + c() + d() + e() + f() : any -->a.length + b.length + c() + d() + e() : number -->a.length + b.length + c() + d() : number -->a.length + b.length + c() : number -->a.length + b.length : number -->a.length : number -->a : typeof Thing -->length : number -->b.length : number -->b : typeof AnotherThing -->length : number -->c() : number -->c : () => number -->d() : number -->d : () => number -->e() : number -->e : () => number -+>a.length + b.length + c() + d() + e() : any -+>a.length + b.length + c() + d() : any -+>a.length + b.length + c() : any -+>a.length + b.length : any -+>a.length : any -+>a : any -+>length : any -+>b.length : any -+>b : any -+>length : any -+>c() : any -+>c : any -+>d() : any -+>d : any -+>e() : any -+>e : any - >f() : any - >f : any -->g.length : number -->g : string -->length : number -+>g.length : any -+>g : any -+>length : any - } ++>jsvalues : (a: typeof Thing, b: typeof AnotherThing, c: () => number, d: () => number, e: () => number, f: any, g: string) => any + >a : typeof Thing + >b : typeof AnotherThing + >c : () => number +@@= skipped -37, +37 lines =@@ === index.ts === function types( ->types : (a: import("./mod").Thing, b: import("./mod").AnotherThing, c: import("./mod").foo, d: import("./mod").qux, e: import("./mod").baz, f: import("./mod").buz, g: import("./mod").literal) => any -+>types : (a: any, b: any, c: any, d: any, e: any, f: () => number, g: any) => any ++>types : (a: any, b: any, c: any, d: any, e: any, f: any, g: any) => any a: import('./mod').Thing, >a : any -@@= skipped -55, +55 lines =@@ +@@= skipped -18, +18 lines =@@ >e : any f: import('./mod').buz, ->f : import("mod").buz -+>f : () => number ++>f : any g: import('./mod').literal, >g : any -@@= skipped -26, +26 lines =@@ +@@= skipped -25, +25 lines =@@ + >d : any >e() : any >e : any - >f() : number +->f() : number ->f : import("mod").buz -+>f : () => number ++>f() : any ++>f : any >g.length : any >g : any >length : any @@ -181,85 +130,7 @@ function values( ->values : (a: typeof import("./mod").Thing, b: typeof import("./mod").AnotherThing, c: typeof import("./mod").foo, d: typeof import("./mod").qux, e: typeof import("./mod").baz, f: typeof import("./mod").buz, g: typeof import("./mod").literal) => any -+>values : (a: any, b: any, c: any, d: any, e: any, f: any, g: any) => any ++>values : (a: typeof Thing, b: typeof AnotherThing, c: () => number, d: () => number, e: () => number, f: any, g: string) => any a: typeof import('./mod').Thing, -->a : typeof Thing -+>a : any - >Thing : any - - b: typeof import('./mod').AnotherThing, -->b : typeof AnotherThing -+>b : any - >AnotherThing : any - - c: typeof import('./mod').foo, -->c : () => number -+>c : any - >foo : any - - d: typeof import('./mod').qux, -->d : () => number -+>d : any - >qux : any - - e: typeof import('./mod').baz, -->e : () => number -+>e : any - >baz : any - - f: typeof import('./mod').buz, -@@= skipped -34, +34 lines =@@ - >buz : any - - g: typeof import('./mod').literal, -->g : string -+>g : any - >literal : any - - ) { - return a.length + b.length + c() + d() + e() + f() + g.length - >a.length + b.length + c() + d() + e() + f() + g.length : any - >a.length + b.length + c() + d() + e() + f() : any -->a.length + b.length + c() + d() + e() : number -->a.length + b.length + c() + d() : number -->a.length + b.length + c() : number -->a.length + b.length : number -->a.length : number -->a : typeof Thing -->length : number -->b.length : number -->b : typeof AnotherThing -->length : number -->c() : number -->c : () => number -->d() : number -->d : () => number -->e() : number -->e : () => number -+>a.length + b.length + c() + d() + e() : any -+>a.length + b.length + c() + d() : any -+>a.length + b.length + c() : any -+>a.length + b.length : any -+>a.length : any -+>a : any -+>length : any -+>b.length : any -+>b : any -+>length : any -+>c() : any -+>c : any -+>d() : any -+>d : any -+>e() : any -+>e : any - >f() : any - >f : any -->g.length : number -->g : string -->length : number -+>g.length : any -+>g : any -+>length : any - } - + >a : typeof Thing diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias.errors.txt.diff index 0df0d5bd90..cdd343ee9d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias.errors.txt.diff @@ -2,14 +2,14 @@ +++ new.moduleExportDuplicateAlias.errors.txt @@= skipped -0, +0 lines =@@ -moduleExportAliasDuplicateAlias.js(3,1): error TS2722: Cannot invoke an object which is possibly 'undefined'. -+test.js(1,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++test.js(1,27): error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. -==== test.js (0 errors) ==== +==== test.js (1 errors) ==== const { apply } = require('./moduleExportAliasDuplicateAlias') -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. apply() -==== moduleExportAliasDuplicateAlias.js (1 errors) ==== diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias2.errors.txt.diff index 0cdcce1ae1..5d387a8539 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias2.errors.txt.diff @@ -3,13 +3,13 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+test.js(1,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++test.js(1,27): error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. + + +==== test.js (1 errors) ==== + const { apply } = require('./moduleExportAliasDuplicateAlias') -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. + apply() + +==== moduleExportAliasDuplicateAlias.js (0 errors) ==== diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias3.errors.txt.diff index 455d78d879..32939ea6dc 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias3.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportDuplicateAlias3.errors.txt.diff @@ -3,13 +3,13 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+test.js(1,19): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++test.js(1,27): error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. + + +==== test.js (1 errors) ==== + const { apply } = require('./moduleExportAliasDuplicateAlias') -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2307: Cannot find module './moduleExportAliasDuplicateAlias' or its corresponding type declarations. + const result = apply.toFixed() + +==== moduleExportAliasDuplicateAlias.js (0 errors) ==== diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportNestedNamespaces.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportNestedNamespaces.errors.txt.diff index 8a0908e82d..4edb069e91 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportNestedNamespaces.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportNestedNamespaces.errors.txt.diff @@ -3,25 +3,17 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+mod.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+mod.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+mod.js(5,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +mod.js(7,14): error TS2339: Property 'p' does not exist on type 'Classic'. -+use.js(1,20): error TS2306: File 'mod.js' is not a module. ++use.js(8,15): error TS2694: Namespace '"mod"' has no exported member 'n'. ++use.js(9,13): error TS2749: 's.Classic' refers to a value, but is being used as a type here. Did you mean 'typeof s.Classic'? + + -+==== mod.js (4 errors) ==== ++==== mod.js (1 errors) ==== + module.exports.n = {}; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + module.exports.n.K = function C() { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + this.x = 10; + } + module.exports.Classic = class { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + constructor() { + this.p = 1 + ~ @@ -29,10 +21,8 @@ + } + } + -+==== use.js (1 errors) ==== ++==== use.js (2 errors) ==== + import * as s from './mod' -+ ~~~~~~~ -+!!! error TS2306: File 'mod.js' is not a module. + + var k = new s.n.K() + k.x @@ -40,7 +30,11 @@ + + + /** @param {s.n.K} c ++ ~ ++!!! error TS2694: Namespace '"mod"' has no exported member 'n'. + @param {s.Classic} classic */ ++ ~~~~~~~~~ ++!!! error TS2749: 's.Classic' refers to a value, but is being used as a type here. Did you mean 'typeof s.Classic'? + function f(c, classic) { + c.x + classic.p diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportNestedNamespaces.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportNestedNamespaces.types.diff index 60b579adb4..33414ef0ff 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportNestedNamespaces.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportNestedNamespaces.types.diff @@ -12,9 +12,9 @@ ->n : typeof n +>module.exports.n = {} : {} +>module.exports.n : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("mod") ++>module : { "mod": typeof import("mod"); } ++>exports : typeof import("mod") +>n : any >{} : {} @@ -32,9 +32,9 @@ +>module.exports.n.K = function C() { this.x = 10;} : () => void +>module.exports.n.K : any +>module.exports.n : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : typeof import("mod") ++>module : { "mod": typeof import("mod"); } ++>exports : typeof import("mod") +>n : any +>K : any +>function C() { this.x = 10;} : () => void @@ -50,25 +50,22 @@ } module.exports.Classic = class { >module.exports.Classic = class { constructor() { this.p = 1 }} : typeof Classic -->module.exports.Classic : typeof Classic + >module.exports.Classic : typeof Classic ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->Classic : typeof Classic -+>module.exports.Classic : any -+>module.exports : any -+>module : any -+>exports : any -+>Classic : any ++>module.exports : typeof import("mod") ++>module : { "mod": typeof import("mod"); } ++>exports : typeof import("mod") + >Classic : typeof Classic >class { constructor() { this.p = 1 }} : typeof Classic - constructor() { @@= skipped -48, +48 lines =@@ === use.js === import * as s from './mod' ->s : typeof s -+>s : any ++>s : typeof import("mod") var k = new s.n.K() ->k : C @@ -82,7 +79,7 @@ +>new s.n.K() : any +>s.n.K : any +>s.n : any -+>s : any ++>s : typeof import("mod") +>n : any +>K : any @@ -100,11 +97,11 @@ ->s.Classic : typeof s.Classic ->s : typeof s ->Classic : typeof s.Classic -+>classic : any -+>new s.Classic() : any -+>s.Classic : any -+>s : any -+>Classic : any ++>classic : Classic ++>new s.Classic() : Classic ++>s.Classic : typeof Classic ++>s : typeof import("mod") ++>Classic : typeof Classic /** @param {s.n.K} c diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportPropertyAssignmentDefault.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportPropertyAssignmentDefault.errors.txt.diff index 494105cad6..7792808c23 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportPropertyAssignmentDefault.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportPropertyAssignmentDefault.errors.txt.diff @@ -3,16 +3,16 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+axios.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+axios.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++axios.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++axios.js(3,16): error TS2339: Property 'default' does not exist on type '{}'. + + +==== axios.js (2 errors) ==== + var axios = {} + module.exports = axios // both assignments should be ok -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.default = axios -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~ ++!!! error TS2339: Property 'default' does not exist on type '{}'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportPropertyAssignmentDefault.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportPropertyAssignmentDefault.types.diff index 08262b1278..d9bbf26cbb 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportPropertyAssignmentDefault.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportPropertyAssignmentDefault.types.diff @@ -15,9 +15,9 @@ ->exports : typeof axios ->axios : typeof axios +>module.exports = axios : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { axios: {}; } ++>exports : {} +>axios : {} module.exports.default = axios @@ -30,9 +30,9 @@ ->axios : typeof axios +>module.exports.default = axios : {} +>module.exports.default : any -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { axios: {}; } ++>exports : {} +>default : any +>axios : {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment.errors.txt.diff index 5b365edab8..38361412bb 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment.errors.txt.diff @@ -1,26 +1,32 @@ --- old.moduleExportWithExportPropertyAssignment.errors.txt +++ new.moduleExportWithExportPropertyAssignment.errors.txt -@@= skipped -0, +-1 lines =@@ +@@= skipped -0, +0 lines =@@ -a.js(4,6): error TS2554: Expected 1 arguments, but got 0. -- -- --==== a.js (1 errors) ==== -- /// -- var mod1 = require('./mod1') -- mod1() -- mod1.f() // error, not enough arguments -- ~ ++a.js(4,6): error TS2339: Property 'f' does not exist on type '() => void'. ++mod1.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++mod1.js(4,16): error TS2339: Property 'f' does not exist on type '() => void'. + + + ==== a.js (1 errors) ==== +@@= skipped -6, +8 lines =@@ + mod1() + mod1.f() // error, not enough arguments + ~ -!!! error TS2554: Expected 1 arguments, but got 0. -!!! related TS6210 mod1.js:4:30: An argument for 'a' was not provided. -- --==== requires.d.ts (0 errors) ==== -- declare var module: { exports: any }; -- declare function require(name: string): any; ++!!! error TS2339: Property 'f' does not exist on type '() => void'. + + ==== requires.d.ts (0 errors) ==== + declare var module: { exports: any }; + declare function require(name: string): any; -==== mod1.js (0 errors) ==== -- /// -- module.exports = function () { } -- /** @param {number} a */ -- module.exports.f = function (a) { } -- -@@= skipped --1, +1 lines =@@ -+ ++==== mod1.js (2 errors) ==== + /// + module.exports = function () { } ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + /** @param {number} a */ + module.exports.f = function (a) { } ++ ~ ++!!! error TS2339: Property 'f' does not exist on type '() => void'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment.types.diff index d66b6e556b..c93de1e1cd 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment.types.diff @@ -6,16 +6,15 @@ var mod1 = require('./mod1') ->mod1 : { (): void; f: (a: number) => void; } ->require('./mod1') : { (): void; f: (a: number) => void; } -+>mod1 : any -+>require('./mod1') : any ++>mod1 : () => void ++>require('./mod1') : () => void >require : (name: string) => any >'./mod1' : "./mod1" mod1() -->mod1() : void + >mod1() : void ->mod1 : { (): void; f: (a: number) => void; } -+>mod1() : any -+>mod1 : any ++>mod1 : () => void mod1.f() // error, not enough arguments ->mod1.f() : void @@ -24,26 +23,27 @@ ->f : (a: number) => void +>mod1.f() : any +>mod1.f : any -+>mod1 : any ++>mod1 : () => void +>f : any === requires.d.ts === declare var module: { exports: any }; -@@= skipped -24, +24 lines =@@ - >require : (name: string) => any - >name : string - --=== mod1.js === --/// --module.exports = function () { } +@@= skipped -27, +27 lines =@@ + === mod1.js === + /// + module.exports = function () { } ->module.exports = function () { } : { (): void; f: (a: number) => void; } ->module.exports : { (): void; f: (a: number) => void; } ->module : { exports: { (): void; f: (a: number) => void; }; } ->exports : { (): void; f: (a: number) => void; } -->function () { } : () => void -- --/** @param {number} a */ --module.exports.f = function (a) { } ++>module.exports = function () { } : () => void ++>module.exports : () => void ++>module : { export=: () => void; } ++>exports : () => void + >function () { } : () => void + + /** @param {number} a */ + module.exports.f = function (a) { } ->module.exports.f = function (a) { } : (a: number) => void ->module.exports.f : (a: number) => void ->module.exports : { (): void; f: (a: number) => void; } @@ -52,4 +52,12 @@ ->f : (a: number) => void ->function (a) { } : (a: number) => void ->a : number -- ++>module.exports.f = function (a) { } : (a: any) => void ++>module.exports.f : any ++>module.exports : () => void ++>module : { export=: () => void; } ++>exports : () => void ++>f : any ++>function (a) { } : (a: any) => void ++>a : any + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment2.errors.txt.diff index a7fa4ec209..7ab9791378 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment2.errors.txt.diff @@ -1,27 +1,32 @@ --- old.moduleExportWithExportPropertyAssignment2.errors.txt +++ new.moduleExportWithExportPropertyAssignment2.errors.txt -@@= skipped -0, +-1 lines =@@ +@@= skipped -0, +0 lines =@@ -a.js(4,6): error TS2339: Property 'f' does not exist on type 'number'. -mod1.js(3,16): error TS2339: Property 'f' does not exist on type 'number'. -- -- --==== a.js (1 errors) ==== -- /// -- var mod1 = require('./mod1') -- mod1.toFixed(12) -- mod1.f() // error, 'f' is not a property on 'number' -- ~ ++a.js(4,6): error TS2339: Property 'f' does not exist on type '1'. ++mod1.js(2,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++mod1.js(3,16): error TS2339: Property 'f' does not exist on type '1'. + + + ==== a.js (1 errors) ==== +@@= skipped -7, +8 lines =@@ + mod1.toFixed(12) + mod1.f() // error, 'f' is not a property on 'number' + ~ -!!! error TS2339: Property 'f' does not exist on type 'number'. -- --==== requires.d.ts (0 errors) ==== -- declare var module: { exports: any }; -- declare function require(name: string): any; ++!!! error TS2339: Property 'f' does not exist on type '1'. + + ==== requires.d.ts (0 errors) ==== + declare var module: { exports: any }; + declare function require(name: string): any; -==== mod1.js (1 errors) ==== -- /// -- module.exports = 1 -- module.exports.f = function () { } -- ~ ++==== mod1.js (2 errors) ==== + /// + module.exports = 1 ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.f = function () { } + ~ -!!! error TS2339: Property 'f' does not exist on type 'number'. -- -@@= skipped --1, +1 lines =@@ -+ ++!!! error TS2339: Property 'f' does not exist on type '1'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment2.types.diff index 21afa020e8..9eb67df190 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment2.types.diff @@ -6,49 +6,50 @@ var mod1 = require('./mod1') ->mod1 : number ->require('./mod1') : number -+>mod1 : any -+>require('./mod1') : any ++>mod1 : 1 ++>require('./mod1') : 1 >require : (name: string) => any >'./mod1' : "./mod1" mod1.toFixed(12) -->mod1.toFixed(12) : string -->mod1.toFixed : (fractionDigits?: number) => string + >mod1.toFixed(12) : string + >mod1.toFixed : (fractionDigits?: number) => string ->mod1 : number -->toFixed : (fractionDigits?: number) => string -+>mod1.toFixed(12) : any -+>mod1.toFixed : any -+>mod1 : any -+>toFixed : any ++>mod1 : 1 + >toFixed : (fractionDigits?: number) => string >12 : 12 mod1.f() // error, 'f' is not a property on 'number' >mod1.f() : any >mod1.f : any ->mod1 : number -+>mod1 : any ++>mod1 : 1 >f : any === requires.d.ts === -@@= skipped -27, +27 lines =@@ - >require : (name: string) => any - >name : string - --=== mod1.js === --/// --module.exports = 1 +@@= skipped -30, +30 lines =@@ + === mod1.js === + /// + module.exports = 1 ->module.exports = 1 : number ->module.exports : number ->module : { exports: number; } ->exports : number -->1 : 1 -- --module.exports.f = function () { } -->module.exports.f = function () { } : () => void -->module.exports.f : any ++>module.exports = 1 : 1 ++>module.exports : 1 ++>module : { export=: 1; } ++>exports : 1 + >1 : 1 + + module.exports.f = function () { } + >module.exports.f = function () { } : () => void + >module.exports.f : any ->module.exports : number ->module : { exports: number; } ->exports : number -->f : any -->function () { } : () => void -- ++>module.exports : 1 ++>module : { export=: 1; } ++>exports : 1 + >f : any + >function () { } : () => void + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment3.errors.txt.diff index f5de502328..d7dd97252e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment3.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment3.errors.txt.diff @@ -1,39 +1,58 @@ --- old.moduleExportWithExportPropertyAssignment3.errors.txt +++ new.moduleExportWithExportPropertyAssignment3.errors.txt -@@= skipped -0, +-1 lines =@@ +@@= skipped -0, +0 lines =@@ -a.js(4,17): error TS2339: Property 'toFixed' does not exist on type 'number | "string"'. - Property 'toFixed' does not exist on type '"string"'. -a.js(5,16): error TS2339: Property 'toFixed' does not exist on type 'number | "string"'. - Property 'toFixed' does not exist on type '"string"'. -- -- ++a.js(6,6): error TS2339: Property 'justProperty' does not exist on type '{ justExport: number; bothBefore: number; bothAfter: number; }'. ++mod1.js(2,1): error TS2322: Type 'string' is not assignable to type 'number'. ++mod1.js(3,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++mod1.js(8,1): error TS2322: Type 'string' is not assignable to type 'number'. ++mod1.js(9,16): error TS2339: Property 'justProperty' does not exist on type '{ justExport: number; bothBefore: number; bothAfter: number; }'. + + -==== a.js (2 errors) ==== -- /// -- var mod1 = require('./mod1') -- mod1.justExport.toFixed() -- mod1.bothBefore.toFixed() // error, 'toFixed' not on 'string | number' ++==== a.js (1 errors) ==== + /// + var mod1 = require('./mod1') + mod1.justExport.toFixed() + mod1.bothBefore.toFixed() // error, 'toFixed' not on 'string | number' - ~~~~~~~ -!!! error TS2339: Property 'toFixed' does not exist on type 'number | "string"'. -!!! error TS2339: Property 'toFixed' does not exist on type '"string"'. -- mod1.bothAfter.toFixed() // error, 'toFixed' not on 'string | number' + mod1.bothAfter.toFixed() // error, 'toFixed' not on 'string | number' - ~~~~~~~ -!!! error TS2339: Property 'toFixed' does not exist on type 'number | "string"'. -!!! error TS2339: Property 'toFixed' does not exist on type '"string"'. -- mod1.justProperty.length -- --==== requires.d.ts (0 errors) ==== -- declare var module: { exports: any }; -- declare function require(name: string): any; + mod1.justProperty.length ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'justProperty' does not exist on type '{ justExport: number; bothBefore: number; bothAfter: number; }'. + + ==== requires.d.ts (0 errors) ==== + declare var module: { exports: any }; + declare function require(name: string): any; -==== mod1.js (0 errors) ==== -- /// -- module.exports.bothBefore = 'string' -- module.exports = { -- justExport: 1, -- bothBefore: 2, -- bothAfter: 3, -- } -- module.exports.bothAfter = 'string' -- module.exports.justProperty = 'string' -- -@@= skipped --1, +1 lines =@@ -+ ++==== mod1.js (4 errors) ==== + /// + module.exports.bothBefore = 'string' ++ ~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2322: Type 'string' is not assignable to type 'number'. + module.exports = { ++ ~~~~~~~~~~~~~~~~~~ + justExport: 1, ++ ~~~~~~~~~~~~~~~~~~ + bothBefore: 2, ++ ~~~~~~~~~~~~~~~~~~ + bothAfter: 3, ++ ~~~~~~~~~~~~~~~~~ + } ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + module.exports.bothAfter = 'string' ++ ~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2322: Type 'string' is not assignable to type 'number'. + module.exports.justProperty = 'string' ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'justProperty' does not exist on type '{ justExport: number; bothBefore: number; bothAfter: number; }'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment3.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment3.types.diff index 8397883071..1d4fd87c5a 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment3.types.diff @@ -6,46 +6,47 @@ var mod1 = require('./mod1') ->mod1 : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } ->require('./mod1') : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } -+>mod1 : any -+>require('./mod1') : any ++>mod1 : { justExport: number; bothBefore: number; bothAfter: number; } ++>require('./mod1') : { justExport: number; bothBefore: number; bothAfter: number; } >require : (name: string) => any >'./mod1' : "./mod1" - mod1.justExport.toFixed() -->mod1.justExport.toFixed() : string -->mod1.justExport.toFixed : (fractionDigits?: number) => string -->mod1.justExport : number +@@= skipped -9, +9 lines =@@ + >mod1.justExport.toFixed() : string + >mod1.justExport.toFixed : (fractionDigits?: number) => string + >mod1.justExport : number ->mod1 : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } -->justExport : number -->toFixed : (fractionDigits?: number) => string -+>mod1.justExport.toFixed() : any -+>mod1.justExport.toFixed : any -+>mod1.justExport : any -+>mod1 : any -+>justExport : any -+>toFixed : any ++>mod1 : { justExport: number; bothBefore: number; bothAfter: number; } + >justExport : number + >toFixed : (fractionDigits?: number) => string mod1.bothBefore.toFixed() // error, 'toFixed' not on 'string | number' - >mod1.bothBefore.toFixed() : any - >mod1.bothBefore.toFixed : any +->mod1.bothBefore.toFixed() : any +->mod1.bothBefore.toFixed : any ->mod1.bothBefore : number | "string" ->mod1 : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } ->bothBefore : number | "string" -+>mod1.bothBefore : any -+>mod1 : any -+>bothBefore : any - >toFixed : any +->toFixed : any ++>mod1.bothBefore.toFixed() : string ++>mod1.bothBefore.toFixed : (fractionDigits?: number) => string ++>mod1.bothBefore : number ++>mod1 : { justExport: number; bothBefore: number; bothAfter: number; } ++>bothBefore : number ++>toFixed : (fractionDigits?: number) => string mod1.bothAfter.toFixed() // error, 'toFixed' not on 'string | number' - >mod1.bothAfter.toFixed() : any - >mod1.bothAfter.toFixed : any +->mod1.bothAfter.toFixed() : any +->mod1.bothAfter.toFixed : any ->mod1.bothAfter : number | "string" ->mod1 : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } ->bothAfter : number | "string" -+>mod1.bothAfter : any -+>mod1 : any -+>bothAfter : any - >toFixed : any +->toFixed : any ++>mod1.bothAfter.toFixed() : string ++>mod1.bothAfter.toFixed : (fractionDigits?: number) => string ++>mod1.bothAfter : number ++>mod1 : { justExport: number; bothBefore: number; bothAfter: number; } ++>bothAfter : number ++>toFixed : (fractionDigits?: number) => string mod1.justProperty.length ->mod1.justProperty.length : number @@ -55,61 +56,67 @@ ->length : number +>mod1.justProperty.length : any +>mod1.justProperty : any -+>mod1 : any ++>mod1 : { justExport: number; bothBefore: number; bothAfter: number; } +>justProperty : any +>length : any === requires.d.ts === declare var module: { exports: any }; -@@= skipped -45, +45 lines =@@ - >require : (name: string) => any - >name : string - --=== mod1.js === --/// --module.exports.bothBefore = 'string' -->module.exports.bothBefore = 'string' : "string" +@@= skipped -40, +40 lines =@@ + /// + module.exports.bothBefore = 'string' + >module.exports.bothBefore = 'string' : "string" ->module.exports.bothBefore : number | "string" ->module.exports : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } ->module : { exports: { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; }; } ->exports : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } ->bothBefore : number | "string" -->'string' : "string" -- --module.exports = { ++>module.exports.bothBefore : number ++>module.exports : { justExport: number; bothBefore: number; bothAfter: number; } ++>module : { export=: { justExport: number; bothBefore: number; bothAfter: number; }; } ++>exports : { justExport: number; bothBefore: number; bothAfter: number; } ++>bothBefore : number + >'string' : "string" + + module.exports = { ->module.exports = { justExport: 1, bothBefore: 2, bothAfter: 3,} : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } ->module.exports : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } ->module : { exports: { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; }; } ->exports : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } -->{ justExport: 1, bothBefore: 2, bothAfter: 3,} : { justExport: number; bothBefore: number; bothAfter: number; } -- -- justExport: 1, -->justExport : number -->1 : 1 -- -- bothBefore: 2, -->bothBefore : number -->2 : 2 -- -- bothAfter: 3, -->bothAfter : number -->3 : 3 --} --module.exports.bothAfter = 'string' -->module.exports.bothAfter = 'string' : "string" ++>module.exports = { justExport: 1, bothBefore: 2, bothAfter: 3,} : { justExport: number; bothBefore: number; bothAfter: number; } ++>module.exports : { justExport: number; bothBefore: number; bothAfter: number; } ++>module : { export=: { justExport: number; bothBefore: number; bothAfter: number; }; } ++>exports : { justExport: number; bothBefore: number; bothAfter: number; } + >{ justExport: 1, bothBefore: 2, bothAfter: 3,} : { justExport: number; bothBefore: number; bothAfter: number; } + + justExport: 1, +@@= skipped -28, +28 lines =@@ + } + module.exports.bothAfter = 'string' + >module.exports.bothAfter = 'string' : "string" ->module.exports.bothAfter : number | "string" ->module.exports : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } ->module : { exports: { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; }; } ->exports : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } ->bothAfter : number | "string" -->'string' : "string" -- --module.exports.justProperty = 'string' -->module.exports.justProperty = 'string' : "string" ++>module.exports.bothAfter : number ++>module.exports : { justExport: number; bothBefore: number; bothAfter: number; } ++>module : { export=: { justExport: number; bothBefore: number; bothAfter: number; }; } ++>exports : { justExport: number; bothBefore: number; bothAfter: number; } ++>bothAfter : number + >'string' : "string" + + module.exports.justProperty = 'string' + >module.exports.justProperty = 'string' : "string" ->module.exports.justProperty : "string" ->module.exports : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } ->module : { exports: { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; }; } ->exports : { justExport: number; bothBefore: number | "string"; bothAfter: number | "string"; justProperty: "string"; } ->justProperty : "string" -->'string' : "string" -- ++>module.exports.justProperty : any ++>module.exports : { justExport: number; bothBefore: number; bothAfter: number; } ++>module : { export=: { justExport: number; bothBefore: number; bothAfter: number; }; } ++>exports : { justExport: number; bothBefore: number; bothAfter: number; } ++>justProperty : any + >'string' : "string" + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment4.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment4.errors.txt.diff index cd37bd9dfe..45be2a7d6b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment4.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment4.errors.txt.diff @@ -1,6 +1,6 @@ --- old.moduleExportWithExportPropertyAssignment4.errors.txt +++ new.moduleExportWithExportPropertyAssignment4.errors.txt -@@= skipped -0, +-1 lines =@@ +@@= skipped -0, +0 lines =@@ -a.js(4,17): error TS2339: Property 'toFixed' does not exist on type 'number | "string"'. - Property 'toFixed' does not exist on type '"string"'. -a.js(5,16): error TS2339: Property 'toFixed' does not exist on type 'number | "string"'. @@ -9,45 +9,56 @@ -mod1.js(4,1): error TS2323: Cannot redeclare exported variable 'bothBefore'. -mod1.js(5,1): error TS2323: Cannot redeclare exported variable 'bothAfter'. -mod1.js(10,1): error TS2323: Cannot redeclare exported variable 'bothAfter'. -- -- ++a.js(6,6): error TS2339: Property 'justProperty' does not exist on type '{ (): void; justExport: number; bothBefore: number; bothAfter: number; }'. ++mod1.js(2,1): error TS2322: Type 'string' is not assignable to type 'number'. ++mod1.js(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++mod1.js(10,1): error TS2322: Type 'string' is not assignable to type 'number'. ++mod1.js(11,16): error TS2339: Property 'justProperty' does not exist on type '{ (): void; justExport: number; bothBefore: number; bothAfter: number; }'. + + -==== a.js (2 errors) ==== -- /// -- var mod1 = require('./mod1') -- mod1.justExport.toFixed() -- mod1.bothBefore.toFixed() // error ++==== a.js (1 errors) ==== + /// + var mod1 = require('./mod1') + mod1.justExport.toFixed() + mod1.bothBefore.toFixed() // error - ~~~~~~~ -!!! error TS2339: Property 'toFixed' does not exist on type 'number | "string"'. -!!! error TS2339: Property 'toFixed' does not exist on type '"string"'. -- mod1.bothAfter.toFixed() + mod1.bothAfter.toFixed() - ~~~~~~~ -!!! error TS2339: Property 'toFixed' does not exist on type 'number | "string"'. -!!! error TS2339: Property 'toFixed' does not exist on type '"string"'. -- mod1.justProperty.length -- --==== requires.d.ts (0 errors) ==== -- declare var module: { exports: any }; -- declare function require(name: string): any; --==== mod1.js (4 errors) ==== -- /// -- module.exports.bothBefore = 'string' -- ~~~~~~~~~~~~~~~~~~~~~~~~~ + mod1.justProperty.length ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'justProperty' does not exist on type '{ (): void; justExport: number; bothBefore: number; bothAfter: number; }'. + + ==== requires.d.ts (0 errors) ==== + declare var module: { exports: any }; +@@= skipped -28, +21 lines =@@ + /// + module.exports.bothBefore = 'string' + ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Cannot redeclare exported variable 'bothBefore'. -- A.justExport = 4 -- A.bothBefore = 2 ++!!! error TS2322: Type 'string' is not assignable to type 'number'. + A.justExport = 4 + A.bothBefore = 2 - ~~~~~~~~~~~~ -!!! error TS2323: Cannot redeclare exported variable 'bothBefore'. -- A.bothAfter = 3 + A.bothAfter = 3 - ~~~~~~~~~~~ -!!! error TS2323: Cannot redeclare exported variable 'bothAfter'. -- module.exports = A -- function A() { -- this.p = 1 -- } -- module.exports.bothAfter = 'string' -- ~~~~~~~~~~~~~~~~~~~~~~~~ + module.exports = A ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + function A() { + this.p = 1 + } + module.exports.bothAfter = 'string' + ~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS2323: Cannot redeclare exported variable 'bothAfter'. -- module.exports.justProperty = 'string' -- -@@= skipped --1, +1 lines =@@ -+ ++!!! error TS2322: Type 'string' is not assignable to type 'number'. + module.exports.justProperty = 'string' ++ ~~~~~~~~~~~~ ++!!! error TS2339: Property 'justProperty' does not exist on type '{ (): void; justExport: number; bothBefore: number; bothAfter: number; }'. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment4.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment4.types.diff index 316b56ab11..23d0e8f7a9 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment4.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportWithExportPropertyAssignment4.types.diff @@ -6,46 +6,47 @@ var mod1 = require('./mod1') ->mod1 : typeof mod1 ->require('./mod1') : typeof mod1 -+>mod1 : any -+>require('./mod1') : any ++>mod1 : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>require('./mod1') : { (): void; justExport: number; bothBefore: number; bothAfter: number; } >require : (name: string) => any >'./mod1' : "./mod1" - mod1.justExport.toFixed() -->mod1.justExport.toFixed() : string -->mod1.justExport.toFixed : (fractionDigits?: number) => string -->mod1.justExport : number +@@= skipped -9, +9 lines =@@ + >mod1.justExport.toFixed() : string + >mod1.justExport.toFixed : (fractionDigits?: number) => string + >mod1.justExport : number ->mod1 : typeof mod1 -->justExport : number -->toFixed : (fractionDigits?: number) => string -+>mod1.justExport.toFixed() : any -+>mod1.justExport.toFixed : any -+>mod1.justExport : any -+>mod1 : any -+>justExport : any -+>toFixed : any ++>mod1 : { (): void; justExport: number; bothBefore: number; bothAfter: number; } + >justExport : number + >toFixed : (fractionDigits?: number) => string mod1.bothBefore.toFixed() // error - >mod1.bothBefore.toFixed() : any - >mod1.bothBefore.toFixed : any +->mod1.bothBefore.toFixed() : any +->mod1.bothBefore.toFixed : any ->mod1.bothBefore : number | "string" ->mod1 : typeof mod1 ->bothBefore : number | "string" -+>mod1.bothBefore : any -+>mod1 : any -+>bothBefore : any - >toFixed : any +->toFixed : any ++>mod1.bothBefore.toFixed() : string ++>mod1.bothBefore.toFixed : (fractionDigits?: number) => string ++>mod1.bothBefore : number ++>mod1 : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>bothBefore : number ++>toFixed : (fractionDigits?: number) => string mod1.bothAfter.toFixed() - >mod1.bothAfter.toFixed() : any - >mod1.bothAfter.toFixed : any +->mod1.bothAfter.toFixed() : any +->mod1.bothAfter.toFixed : any ->mod1.bothAfter : number | "string" ->mod1 : typeof mod1 ->bothAfter : number | "string" -+>mod1.bothAfter : any -+>mod1 : any -+>bothAfter : any - >toFixed : any +->toFixed : any ++>mod1.bothAfter.toFixed() : string ++>mod1.bothAfter.toFixed : (fractionDigits?: number) => string ++>mod1.bothAfter : number ++>mod1 : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>bothAfter : number ++>toFixed : (fractionDigits?: number) => string mod1.justProperty.length ->mod1.justProperty.length : number @@ -55,80 +56,105 @@ ->length : number +>mod1.justProperty.length : any +>mod1.justProperty : any -+>mod1 : any ++>mod1 : { (): void; justExport: number; bothBefore: number; bothAfter: number; } +>justProperty : any +>length : any === requires.d.ts === declare var module: { exports: any }; -@@= skipped -45, +45 lines =@@ - >require : (name: string) => any - >name : string - --=== mod1.js === --/// --module.exports.bothBefore = 'string' -->module.exports.bothBefore = 'string' : "string" +@@= skipped -40, +40 lines =@@ + /// + module.exports.bothBefore = 'string' + >module.exports.bothBefore = 'string' : "string" ->module.exports.bothBefore : number | "string" ->module.exports : typeof A ->module : { exports: typeof A; } ->exports : typeof A ->bothBefore : number | "string" -->'string' : "string" -- --A.justExport = 4 -->A.justExport = 4 : 4 -->A.justExport : number ++>module.exports.bothBefore : number ++>module.exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>module : { A: { (): void; justExport: number; bothBefore: number; bothAfter: number; }; } ++>exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>bothBefore : number + >'string' : "string" + + A.justExport = 4 + >A.justExport = 4 : 4 + >A.justExport : number ->A : typeof A -->justExport : number -->4 : 4 -- --A.bothBefore = 2 -->A.bothBefore = 2 : 2 ++>A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } + >justExport : number + >4 : 4 + + A.bothBefore = 2 + >A.bothBefore = 2 : 2 ->A.bothBefore : number | "string" ->A : typeof A ->bothBefore : number | "string" -->2 : 2 -- --A.bothAfter = 3 -->A.bothAfter = 3 : 3 ++>A.bothBefore : number ++>A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>bothBefore : number + >2 : 2 + + A.bothAfter = 3 + >A.bothAfter = 3 : 3 ->A.bothAfter : number | "string" ->A : typeof A ->bothAfter : number | "string" -->3 : 3 -- --module.exports = A ++>A.bothAfter : number ++>A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>bothAfter : number + >3 : 3 + + module.exports = A ->module.exports = A : typeof A ->module.exports : typeof A ->module : { exports: typeof A; } ->exports : typeof A ->A : typeof A -- --function A() { ++>module.exports = A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>module.exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>module : { A: { (): void; justExport: number; bothBefore: number; bothAfter: number; }; } ++>exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } + + function A() { ->A : typeof A -- -- this.p = 1 -->this.p = 1 : 1 -->this.p : any ++>A : { (): void; justExport: number; bothBefore: number; bothAfter: number; } + + this.p = 1 + >this.p = 1 : 1 + >this.p : any ->this : this -->p : any -->1 : 1 --} --module.exports.bothAfter = 'string' -->module.exports.bothAfter = 'string' : "string" ++>this : any + >p : any + >1 : 1 + } + module.exports.bothAfter = 'string' + >module.exports.bothAfter = 'string' : "string" ->module.exports.bothAfter : number | "string" ->module.exports : typeof A ->module : { exports: typeof A; } ->exports : typeof A ->bothAfter : number | "string" -->'string' : "string" -- --module.exports.justProperty = 'string' -->module.exports.justProperty = 'string' : "string" ++>module.exports.bothAfter : number ++>module.exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>module : { A: { (): void; justExport: number; bothBefore: number; bothAfter: number; }; } ++>exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>bothAfter : number + >'string' : "string" + + module.exports.justProperty = 'string' + >module.exports.justProperty = 'string' : "string" ->module.exports.justProperty : "string" ->module.exports : typeof A ->module : { exports: typeof A; } ->exports : typeof A ->justProperty : "string" -->'string' : "string" -- ++>module.exports.justProperty : any ++>module.exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>module : { A: { (): void; justExport: number; bothBefore: number; bothAfter: number; }; } ++>exports : { (): void; justExport: number; bothBefore: number; bothAfter: number; } ++>justProperty : any + >'string' : "string" + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop1.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop1.errors.txt.diff deleted file mode 100644 index 49bb1d6358..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop1.errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.moduleExportsAliasLoop1.errors.txt -+++ new.moduleExportsAliasLoop1.errors.txt -@@= skipped -0, +0 lines =@@ --x.js(1,9): error TS2339: Property 'fn1' does not exist on type 'typeof import("x")'. -+x.js(1,1): error TS2304: Cannot find name 'exports'. -+x.js(2,1): error TS2304: Cannot find name 'exports'. - - --==== x.js (1 errors) ==== -+==== x.js (2 errors) ==== - exports.fn1(); -- ~~~ --!!! error TS2339: Property 'fn1' does not exist on type 'typeof import("x")'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. - exports.fn2 = Math.min; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop1.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop1.types.diff deleted file mode 100644 index d6d40210ea..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop1.types.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.moduleExportsAliasLoop1.types -+++ new.moduleExportsAliasLoop1.types -@@= skipped -3, +3 lines =@@ - exports.fn1(); - >exports.fn1() : any - >exports.fn1 : any -->exports : typeof import("x") -+>exports : any - >fn1 : any - - exports.fn2 = Math.min; - >exports.fn2 = Math.min : (...values: number[]) => number -->exports.fn2 : (...values: number[]) => number -->exports : typeof import("x") -->fn2 : (...values: number[]) => number -+>exports.fn2 : any -+>exports : any -+>fn2 : any - >Math.min : (...values: number[]) => number - >Math : Math - >min : (...values: number[]) => number diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop2.errors.txt.diff deleted file mode 100644 index f4755834df..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop2.errors.txt.diff +++ /dev/null @@ -1,20 +0,0 @@ ---- old.moduleExportsAliasLoop2.errors.txt -+++ new.moduleExportsAliasLoop2.errors.txt -@@= skipped -0, +0 lines =@@ --x.js(2,9): error TS2339: Property 'fn1' does not exist on type 'typeof import("x")'. -+x.js(2,1): error TS2304: Cannot find name 'exports'. -+x.js(3,1): error TS2304: Cannot find name 'exports'. - - --==== x.js (1 errors) ==== -+==== x.js (2 errors) ==== - const Foo = { min: 3 }; - exports.fn1(); -- ~~~ --!!! error TS2339: Property 'fn1' does not exist on type 'typeof import("x")'. -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. - exports.fn2 = Foo.min; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop2.types.diff deleted file mode 100644 index cb85190c78..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsAliasLoop2.types.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.moduleExportsAliasLoop2.types -+++ new.moduleExportsAliasLoop2.types -@@= skipped -9, +9 lines =@@ - exports.fn1(); - >exports.fn1() : any - >exports.fn1 : any -->exports : typeof import("x") -+>exports : any - >fn1 : any - - exports.fn2 = Foo.min; - >exports.fn2 = Foo.min : number -->exports.fn2 : number -->exports : typeof import("x") -->fn2 : number -+>exports.fn2 : any -+>exports : any -+>fn2 : any - >Foo.min : number - >Foo : { min: number; } - >min : number diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsElementAccessAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsElementAccessAssignment.errors.txt.diff index 19fb23bf40..5166c78330 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsElementAccessAssignment.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsElementAccessAssignment.errors.txt.diff @@ -3,24 +3,36 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+mod2.js(1,14): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod1.js(1,1): error TS7022: 'a' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. ++mod1.js(2,1): error TS7022: 'b' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. ++mod1.js(3,1): error TS7022: 'default' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. ++mod1.js(4,1): error TS7022: 'c' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. ++mod1.js(5,1): error TS7022: 'd' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. + + -+==== mod2.js (1 errors) ==== ++==== mod2.js (0 errors) ==== + const mod1 = require("./mod1"); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + mod1.a; + mod1.b; + mod1.c; + mod1.d; + mod1.d.e; + mod1.default; -+==== mod1.js (0 errors) ==== ++==== mod1.js (5 errors) ==== + exports.a = { x: "x" }; ++ ~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS7022: 'a' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. + exports["b"] = { x: "x" }; ++ ~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS7022: 'b' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. + exports["default"] = { x: "x" }; ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS7022: 'default' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. + module.exports["c"] = { x: "x" }; ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS7022: 'c' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. + module["exports"]["d"] = {}; ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS7022: 'd' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. + module["exports"]["d"].e = 0; + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsElementAccessAssignment.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsElementAccessAssignment.types.diff index dc951858e6..32fa1b0bef 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsElementAccessAssignment.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/moduleExportsElementAccessAssignment.types.diff @@ -6,8 +6,8 @@ const mod1 = require("./mod1"); ->mod1 : typeof mod1 ->require("./mod1") : typeof mod1 -+>mod1 : any -+>require("./mod1") : any ++>mod1 : typeof import("mod1") ++>require("./mod1") : typeof import("mod1") >require : any >"./mod1" : "./mod1" @@ -16,7 +16,7 @@ ->mod1 : typeof mod1 ->a : { x: string; } +>mod1.a : any -+>mod1 : any ++>mod1 : typeof import("mod1") +>a : any mod1.b; @@ -24,7 +24,7 @@ ->mod1 : typeof mod1 ->b : { x: string; } +>mod1.b : any -+>mod1 : any ++>mod1 : typeof import("mod1") +>b : any mod1.c; @@ -32,7 +32,7 @@ ->mod1 : typeof mod1 ->c : { x: string; } +>mod1.c : any -+>mod1 : any ++>mod1 : typeof import("mod1") +>c : any mod1.d; @@ -40,7 +40,7 @@ ->mod1 : typeof mod1 ->d : typeof mod1."d" +>mod1.d : any -+>mod1 : any ++>mod1 : typeof import("mod1") +>d : any mod1.d.e; @@ -51,7 +51,7 @@ ->e : number +>mod1.d.e : any +>mod1.d : any -+>mod1 : any ++>mod1 : typeof import("mod1") +>d : any +>e : any @@ -60,65 +60,80 @@ ->mod1 : typeof mod1 ->default : { x: string; } +>mod1.default : any -+>mod1 : any ++>mod1 : typeof import("mod1") +>default : any --=== mod1.js === --exports.a = { x: "x" }; -->exports.a = { x: "x" } : { x: string; } + === mod1.js === + exports.a = { x: "x" }; + >exports.a = { x: "x" } : { x: string; } ->exports.a : { x: string; } -->exports : typeof import("mod1") ++>exports.a : any + >exports : typeof import("mod1") ->a : { x: string; } -->{ x: "x" } : { x: string; } -->x : string -->"x" : "x" -- --exports["b"] = { x: "x" }; -->exports["b"] = { x: "x" } : { x: string; } ++>a : any + >{ x: "x" } : { x: string; } + >x : string + >"x" : "x" + + exports["b"] = { x: "x" }; + >exports["b"] = { x: "x" } : { x: string; } ->exports["b"] : { x: string; } -->exports : typeof import("mod1") -->"b" : "b" -->{ x: "x" } : { x: string; } -->x : string -->"x" : "x" -- --exports["default"] = { x: "x" }; -->exports["default"] = { x: "x" } : { x: string; } ++>exports["b"] : any + >exports : typeof import("mod1") + >"b" : "b" + >{ x: "x" } : { x: string; } +@@= skipped -58, +58 lines =@@ + + exports["default"] = { x: "x" }; + >exports["default"] = { x: "x" } : { x: string; } ->exports["default"] : { x: string; } -->exports : typeof import("mod1") -->"default" : "default" -->{ x: "x" } : { x: string; } -->x : string -->"x" : "x" -- --module.exports["c"] = { x: "x" }; -->module.exports["c"] = { x: "x" } : { x: string; } ++>exports["default"] : any + >exports : typeof import("mod1") + >"default" : "default" + >{ x: "x" } : { x: string; } +@@= skipped -9, +9 lines =@@ + + module.exports["c"] = { x: "x" }; + >module.exports["c"] = { x: "x" } : { x: string; } ->module.exports["c"] : { x: string; } ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->"c" : "c" -->{ x: "x" } : { x: string; } -->x : string -->"x" : "x" -- --module["exports"]["d"] = {}; ++>module.exports["c"] : any ++>module.exports : typeof import("mod1") ++>module : { "mod1": typeof import("mod1"); } ++>exports : typeof import("mod1") + >"c" : "c" + >{ x: "x" } : { x: string; } + >x : string + >"x" : "x" + + module["exports"]["d"] = {}; ->module["exports"]["d"] = {} : typeof "d" ->module["exports"]["d"] : typeof "d" ->module["exports"] : typeof module.exports ->module : { exports: typeof module.exports; } -->"exports" : "exports" -->"d" : "d" -->{} : {} -- --module["exports"]["d"].e = 0; -->module["exports"]["d"].e = 0 : 0 ++>module["exports"]["d"] = {} : {} ++>module["exports"]["d"] : any ++>module["exports"] : typeof import("mod1") ++>module : { "mod1": typeof import("mod1"); } + >"exports" : "exports" + >"d" : "d" + >{} : {} + + module["exports"]["d"].e = 0; + >module["exports"]["d"].e = 0 : 0 ->module["exports"]["d"].e : number ->module["exports"]["d"] : typeof "d" ->module["exports"] : typeof module.exports ->module : { exports: typeof module.exports; } -->"exports" : "exports" -->"d" : "d" ++>module["exports"]["d"].e : any ++>module["exports"]["d"] : any ++>module["exports"] : typeof import("mod1") ++>module : { "mod1": typeof import("mod1"); } + >"exports" : "exports" + >"d" : "d" ->e : number -->0 : 0 -- ++>e : any + >0 : 0 + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/namespaceAssignmentToRequireAlias.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/namespaceAssignmentToRequireAlias.errors.txt.diff index 6ecc9f18af..e5573c1702 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/namespaceAssignmentToRequireAlias.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/namespaceAssignmentToRequireAlias.errors.txt.diff @@ -2,15 +2,21 @@ +++ new.namespaceAssignmentToRequireAlias.errors.txt @@= skipped -0, +0 lines =@@ -bug40140.js(1,19): error TS7016: Could not find a declaration file for module 'untyped'. 'node_modules/untyped/index.js' implicitly has an 'any' type. -+bug40140.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++bug40140.js(2,3): error TS2339: Property 'assignment' does not exist on type '{}'. ++bug40140.js(3,3): error TS2339: Property 'noError' does not exist on type '{}'. - ==== bug40140.js (1 errors) ==== +-==== bug40140.js (1 errors) ==== ++==== bug40140.js (2 errors) ==== const u = require('untyped'); - ~~~~~~~~~ -!!! error TS7016: Could not find a declaration file for module 'untyped'. 'node_modules/untyped/index.js' implicitly has an 'any' type. -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. u.assignment.nested = true ++ ~~~~~~~~~~ ++!!! error TS2339: Property 'assignment' does not exist on type '{}'. u.noError() ++ ~~~~~~~ ++!!! error TS2339: Property 'noError' does not exist on type '{}'. + + ==== node_modules/untyped/index.js (0 errors) ==== diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/namespaceAssignmentToRequireAlias.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/namespaceAssignmentToRequireAlias.types.diff new file mode 100644 index 0000000000..3317d54709 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/namespaceAssignmentToRequireAlias.types.diff @@ -0,0 +1,39 @@ +--- old.namespaceAssignmentToRequireAlias.types ++++ new.namespaceAssignmentToRequireAlias.types +@@= skipped -1, +1 lines =@@ + + === bug40140.js === + const u = require('untyped'); +->u : any +->require('untyped') : any ++>u : {} ++>require('untyped') : {} + >require : any + >'untyped' : "untyped" + +@@= skipped -9, +9 lines =@@ + >u.assignment.nested = true : true + >u.assignment.nested : any + >u.assignment : any +->u : any ++>u : {} + >assignment : any + >nested : any + >true : true +@@= skipped -8, +8 lines =@@ + u.noError() + >u.noError() : any + >u.noError : any +->u : any ++>u : {} + >noError : any + + ++=== node_modules/untyped/index.js === ++module.exports = {} ++>module.exports = {} : {} ++>module.exports : {} ++>module : { export=: {}; } ++>exports : {} ++>{} : {} ++ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nestedDestructuringOfRequire.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nestedDestructuringOfRequire.errors.txt.diff deleted file mode 100644 index 18a3a3496f..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nestedDestructuringOfRequire.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.nestedDestructuringOfRequire.errors.txt -+++ new.nestedDestructuringOfRequire.errors.txt -@@= skipped -0, +0 lines =@@ -+main.js(3,5): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - main.js(5,1): error TS2304: Cannot find name 'chalk'. - - --==== main.js (1 errors) ==== -+==== main.js (2 errors) ==== - const { - chalk: { grey } - } = require('./mod1'); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - grey - chalk - ~~~~~ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nestedDestructuringOfRequire.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nestedDestructuringOfRequire.types.diff index 4c76b4f096..dd2ae6cf67 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nestedDestructuringOfRequire.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/nestedDestructuringOfRequire.types.diff @@ -1,41 +1,15 @@ --- old.nestedDestructuringOfRequire.types +++ new.nestedDestructuringOfRequire.types -@@= skipped -3, +3 lines =@@ - const { - chalk: { grey } - >chalk : any -->grey : {} -+>grey : any - - } = require('./mod1'); -->require('./mod1') : typeof import("mod1") -+>require('./mod1') : any - >require : any - >'./mod1' : "./mod1" - - grey -->grey : {} -+>grey : any - - chalk - >chalk : any - --=== mod1.js === --const chalk = { -->chalk : { grey: {}; } -->{ grey: {}} : { grey: {}; } -- -- grey: {} -->grey : {} -->{} : {} -- --}; --module.exports.chalk = chalk -->module.exports.chalk = chalk : { grey: {}; } -->module.exports.chalk : { grey: {}; } +@@= skipped -29, +29 lines =@@ + module.exports.chalk = chalk + >module.exports.chalk = chalk : { grey: {}; } + >module.exports.chalk : { grey: {}; } ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->chalk : { grey: {}; } -->chalk : { grey: {}; } -- ++>module.exports : typeof import("mod1") ++>module : { "mod1": typeof import("mod1"); } ++>exports : typeof import("mod1") + >chalk : { grey: {}; } + >chalk : { grey: {}; } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=node16).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=node16).errors.txt.diff index 476adbfa62..bb398e8506 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=node16).errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=node16).errors.txt.diff @@ -3,16 +3,13 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+bar.ts(1,17): error TS2306: File 'foo.cjs' is not a module. -+foo.cjs(1,1): error TS2304: Cannot find name 'exports'. ++bar.ts(1,8): error TS2613: Module '"foo"' has no default export. Did you mean to use 'import { foo } from "foo"' instead? + + -+==== foo.cjs (1 errors) ==== ++==== foo.cjs (0 errors) ==== + exports.foo = "foo" -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. +==== bar.ts (1 errors) ==== + import foo from "./foo.cjs" -+ ~~~~~~~~~~~ -+!!! error TS2306: File 'foo.cjs' is not a module. ++ ~~~ ++!!! error TS2613: Module '"foo"' has no default export. Did you mean to use 'import { foo } from "foo"' instead? + foo.foo; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=node16).types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=node16).types.diff index 052c74bf00..de183089db 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=node16).types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=node16).types.diff @@ -1,16 +1,6 @@ --- old.nodeModulesAllowJsCjsFromJs(module=node16).types +++ new.nodeModulesAllowJsCjsFromJs(module=node16).types -@@= skipped -2, +2 lines =@@ - === foo.cjs === - exports.foo = "foo" - >exports.foo = "foo" : "foo" -->exports.foo : "foo" -->exports : typeof import("foo") -->foo : "foo" -+>exports.foo : any -+>exports : any -+>foo : any - >"foo" : "foo" +@@= skipped -9, +9 lines =@@ === bar.ts === import foo from "./foo.cjs" diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).errors.txt.diff index 342d2257db..7b84b22c6d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).errors.txt.diff @@ -3,16 +3,13 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+bar.ts(1,17): error TS2306: File 'foo.cjs' is not a module. -+foo.cjs(1,1): error TS2304: Cannot find name 'exports'. ++bar.ts(1,8): error TS2613: Module '"foo"' has no default export. Did you mean to use 'import { foo } from "foo"' instead? + + -+==== foo.cjs (1 errors) ==== ++==== foo.cjs (0 errors) ==== + exports.foo = "foo" -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. +==== bar.ts (1 errors) ==== + import foo from "./foo.cjs" -+ ~~~~~~~~~~~ -+!!! error TS2306: File 'foo.cjs' is not a module. ++ ~~~ ++!!! error TS2613: Module '"foo"' has no default export. Did you mean to use 'import { foo } from "foo"' instead? + foo.foo; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).types.diff index ddd51fd013..01573ba640 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsCjsFromJs(module=nodenext).types.diff @@ -1,16 +1,6 @@ --- old.nodeModulesAllowJsCjsFromJs(module=nodenext).types +++ new.nodeModulesAllowJsCjsFromJs(module=nodenext).types -@@= skipped -2, +2 lines =@@ - === foo.cjs === - exports.foo = "foo" - >exports.foo = "foo" : "foo" -->exports.foo : "foo" -->exports : typeof import("foo") -->foo : "foo" -+>exports.foo : any -+>exports : any -+>foo : any - >"foo" : "foo" +@@= skipped -9, +9 lines =@@ === bar.ts === import foo from "./foo.cjs" diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=node16).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=node16).errors.txt.diff index f8742c3560..2dac119c36 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=node16).errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=node16).errors.txt.diff @@ -1,11 +1,11 @@ --- old.nodeModulesAllowJsExportAssignment(module=node16).errors.txt +++ new.nodeModulesAllowJsExportAssignment(module=node16).errors.txt @@= skipped -0, +0 lines =@@ - file.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-file.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++file.js(4,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. index.js(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. -index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. -subfolder/index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. -+subfolder/file.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== subfolder/index.js (1 errors) ==== @@ -15,14 +15,11 @@ export = a; - ~~~~~~~~~~~ -!!! error TS8003: 'export =' can only be used in TypeScript files. --==== subfolder/file.js (0 errors) ==== -+==== subfolder/file.js (1 errors) ==== + ==== subfolder/file.js (0 errors) ==== // cjs format file const a = {}; module.exports = a; -==== index.js (2 errors) ==== -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +==== index.js (1 errors) ==== // esm format file const a = {}; @@ -34,3 +31,12 @@ ==== file.js (1 errors) ==== // esm format file import "fs"; + const a = {}; + module.exports = a; +- ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + ==== package.json (0 errors) ==== + { + "name": "package", diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=node16).types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=node16).types.diff index 0e8d2d52dd..e2f961ea64 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=node16).types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=node16).types.diff @@ -1,24 +1,25 @@ --- old.nodeModulesAllowJsExportAssignment(module=node16).types +++ new.nodeModulesAllowJsExportAssignment(module=node16).types -@@= skipped -16, +16 lines =@@ - +@@= skipped -17, +17 lines =@@ module.exports = a; >module.exports = a : {} -->module.exports : {} + >module.exports : {} ->module : { exports: {}; } -->exports : {} -+>module.exports : any -+>module : any -+>exports : any ++>module : { readonly a: {}; } + >exports : {} >a : {} - === index.js === -@@= skipped -22, +22 lines =@@ +@@= skipped -21, +21 lines =@@ >{} : {} module.exports = a; ->module.exports = a : any +->module.exports : any +->module : any +->exports : any +>module.exports = a : {} - >module.exports : any - >module : any - >exports : any ++>module.exports : {} ++>module : { readonly a: {}; } ++>exports : {} + >a : {} + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt.diff index be2cd40e6d..a3ea3773fb 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt.diff @@ -1,11 +1,11 @@ --- old.nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt +++ new.nodeModulesAllowJsExportAssignment(module=nodenext).errors.txt @@= skipped -0, +0 lines =@@ - file.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +-file.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++file.js(4,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. index.js(3,1): error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. -index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. -subfolder/index.js(3,1): error TS8003: 'export =' can only be used in TypeScript files. -+subfolder/file.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -==== subfolder/index.js (1 errors) ==== @@ -15,14 +15,11 @@ export = a; - ~~~~~~~~~~~ -!!! error TS8003: 'export =' can only be used in TypeScript files. --==== subfolder/file.js (0 errors) ==== -+==== subfolder/file.js (1 errors) ==== + ==== subfolder/file.js (0 errors) ==== // cjs format file const a = {}; module.exports = a; -==== index.js (2 errors) ==== -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. +==== index.js (1 errors) ==== // esm format file const a = {}; @@ -34,3 +31,12 @@ ==== file.js (1 errors) ==== // esm format file import "fs"; + const a = {}; + module.exports = a; +- ~~~~~~ +-!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS1203: Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead. + ==== package.json (0 errors) ==== + { + "name": "package", diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).types.diff index 1941209495..542c8c9c7b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesAllowJsExportAssignment(module=nodenext).types.diff @@ -1,24 +1,25 @@ --- old.nodeModulesAllowJsExportAssignment(module=nodenext).types +++ new.nodeModulesAllowJsExportAssignment(module=nodenext).types -@@= skipped -16, +16 lines =@@ - +@@= skipped -17, +17 lines =@@ module.exports = a; >module.exports = a : {} -->module.exports : {} + >module.exports : {} ->module : { exports: {}; } -->exports : {} -+>module.exports : any -+>module : any -+>exports : any ++>module : { readonly a: {}; } + >exports : {} >a : {} - === index.js === -@@= skipped -22, +22 lines =@@ +@@= skipped -21, +21 lines =@@ >{} : {} module.exports = a; ->module.exports = a : any +->module.exports : any +->module : any +->exports : any +>module.exports = a : {} - >module.exports : any - >module : any - >exports : any ++>module.exports : {} ++>module : { readonly a: {}; } ++>exports : {} + >a : {} + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesCJSEmit1.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesCJSEmit1.errors.txt.diff index e90ead308e..8bfdf797ea 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesCJSEmit1.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/nodeModulesCJSEmit1.errors.txt.diff @@ -1,36 +1,30 @@ --- old.nodeModulesCJSEmit1.errors.txt +++ new.nodeModulesCJSEmit1.errors.txt @@= skipped -0, +0 lines =@@ -+/1.cjs(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+/2.cjs(1,1): error TS2304: Cannot find name 'exports'. - /3.cjs(2,1): error TS2304: Cannot find name 'exports'. -+/5.cjs(1,17): error TS2306: File '/2.cjs' is not a module. +-/3.cjs(2,1): error TS2304: Cannot find name 'exports'. ++/5.cjs(1,8): error TS1192: Module '"/2"' has no default export. /5.cjs(2,8): error TS1192: Module '"/3"' has no default export. --==== /1.cjs (0 errors) ==== -+==== /1.cjs (1 errors) ==== - module.exports = {}; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - --==== /2.cjs (0 errors) ==== -+==== /2.cjs (1 errors) ==== +@@= skipped -7, +7 lines =@@ + ==== /2.cjs (0 errors) ==== exports.foo = 0; -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. - ==== /3.cjs (1 errors) ==== +-==== /3.cjs (1 errors) ==== ++==== /3.cjs (0 errors) ==== import "foo"; -@@= skipped -16, +23 lines =@@ + exports.foo = {}; +- ~~~~~~~ +-!!! error TS2304: Cannot find name 'exports'. + ==== /4.cjs (0 errors) ==== ; -==== /5.cjs (1 errors) ==== +==== /5.cjs (2 errors) ==== import two from "./2.cjs"; // ok -+ ~~~~~~~~~ -+!!! error TS2306: File '/2.cjs' is not a module. ++ ~~~ ++!!! error TS1192: Module '"/2"' has no default export. import three from "./3.cjs"; // error ~~~~~ !!! error TS1192: Module '"/3"' has no default export. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/paramTagOnCallExpression.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/paramTagOnCallExpression.errors.txt.diff deleted file mode 100644 index 3e78010df1..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/paramTagOnCallExpression.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.paramTagOnCallExpression.errors.txt -+++ new.paramTagOnCallExpression.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+a.js(3,1): error TS2304: Cannot find name 'exports'. -+ -+ -+==== decls.d.ts (0 errors) ==== -+ declare function factory(type: string): {}; -+==== a.js (1 errors) ==== -+ // from util -+ /** @param {function} ctor - A big long explanation follows */ -+ exports.inherits = factory('inherits') -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/paramTagOnCallExpression.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/paramTagOnCallExpression.types.diff deleted file mode 100644 index c0a3eba6cb..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/paramTagOnCallExpression.types.diff +++ /dev/null @@ -1,15 +0,0 @@ ---- old.paramTagOnCallExpression.types -+++ new.paramTagOnCallExpression.types -@@= skipped -9, +9 lines =@@ - /** @param {function} ctor - A big long explanation follows */ - exports.inherits = factory('inherits') - >exports.inherits = factory('inherits') : {} -->exports.inherits : {} -->exports : typeof import("a") -->inherits : {} -+>exports.inherits : any -+>exports : any -+>inherits : any - >factory('inherits') : {} - >factory : (type: string) => {} - >'inherits' : "inherits" diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/paramTagTypeResolution.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/paramTagTypeResolution.errors.txt.diff deleted file mode 100644 index 3c3e409fd5..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/paramTagTypeResolution.errors.txt.diff +++ /dev/null @@ -1,21 +0,0 @@ ---- old.paramTagTypeResolution.errors.txt -+++ new.paramTagTypeResolution.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+main.js(1,9): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== main.js (1 errors) ==== -+ var f = require('./first'); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ f(1, n => { }) -+ -+==== first.js (0 errors) ==== -+ /** @template T -+ * @param {T} x -+ * @param {(t: T) => void} k -+ */ -+ module.exports = function (x, k) { return k(x) } -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/paramTagTypeResolution.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/paramTagTypeResolution.types.diff index bdf2a34b53..8f9c4d672c 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/paramTagTypeResolution.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/paramTagTypeResolution.types.diff @@ -6,8 +6,8 @@ var f = require('./first'); ->f : (x: T, k: (t: T) => void) => void ->require('./first') : (x: T, k: (t: T) => void) => void -+>f : any -+>require('./first') : any ++>f : (x: any, k: any) => any ++>require('./first') : (x: any, k: any) => any >require : any >'./first' : "./first" @@ -15,19 +15,19 @@ ->f(1, n => { }) : void ->f : (x: T, k: (t: T) => void) => void +>f(1, n => { }) : any -+>f : any ++>f : (x: any, k: any) => any >1 : 1 ->n => { } : (n: number) => void ->n : number +>n => { } : (n: any) => void +>n : any --=== first.js === --/** @template T -- * @param {T} x -- * @param {(t: T) => void} k -- */ --module.exports = function (x, k) { return k(x) } + === first.js === + /** @template T +@@= skipped -18, +18 lines =@@ + * @param {(t: T) => void} k + */ + module.exports = function (x, k) { return k(x) } ->module.exports = function (x, k) { return k(x) } : (x: T, k: (t: T) => void) => void ->module.exports : (x: T, k: (t: T) => void) => void ->module : { exports: (x: T, k: (t: T) => void) => void; } @@ -38,4 +38,14 @@ ->k(x) : void ->k : (t: T) => void ->x : T -- ++>module.exports = function (x, k) { return k(x) } : (x: any, k: any) => any ++>module.exports : (x: any, k: any) => any ++>module : { export=: (x: any, k: any) => any; } ++>exports : (x: any, k: any) => any ++>function (x, k) { return k(x) } : (x: any, k: any) => any ++>x : any ++>k : any ++>k(x) : any ++>k : any ++>x : any + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/reExportJsFromTs.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/reExportJsFromTs.errors.txt.diff index ada0d06bd4..266c0de416 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/reExportJsFromTs.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/reExportJsFromTs.errors.txt.diff @@ -3,19 +3,16 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+/lib/constants.js(1,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+/src/constants.ts(1,30): error TS2306: File '/lib/constants.js' is not a module. ++/src/constants.ts(1,30): error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. + + -+==== /lib/constants.js (1 errors) ==== ++==== /lib/constants.js (0 errors) ==== + module.exports = { -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + str: 'x', + }; + +==== /src/constants.ts (1 errors) ==== + import * as tsConstants from "../lib/constants"; + ~~~~~~~~~~~~~~~~~~ -+!!! error TS2306: File '/lib/constants.js' is not a module. ++!!! error TS2497: This module can only be referenced with ECMAScript imports/exports by turning on the 'esModuleInterop' flag and referencing its default export. + export { tsConstants }; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/reExportJsFromTs.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/reExportJsFromTs.types.diff index f4fd4279b6..6c33e6393a 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/reExportJsFromTs.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/reExportJsFromTs.types.diff @@ -1,26 +1,11 @@ --- old.reExportJsFromTs.types +++ new.reExportJsFromTs.types -@@= skipped -2, +2 lines =@@ - === /lib/constants.js === +@@= skipped -3, +3 lines =@@ module.exports = { >module.exports = { str: 'x',} : { str: string; } -->module.exports : { str: string; } + >module.exports : { str: string; } ->module : { exports: { str: string; }; } -->exports : { str: string; } -+>module.exports : any -+>module : any -+>exports : any ++>module : { export=: { str: string; }; } + >exports : { str: string; } >{ str: 'x',} : { str: string; } - str: 'x', -@@= skipped -13, +13 lines =@@ - - === /src/constants.ts === - import * as tsConstants from "../lib/constants"; -->tsConstants : { str: string; } -+>tsConstants : any - - export { tsConstants }; -->tsConstants : { str: string; } -+>tsConstants : any - diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/requireAssertsFromTypescript.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/requireAssertsFromTypescript.errors.txt.diff deleted file mode 100644 index 3ec8f6e992..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/requireAssertsFromTypescript.errors.txt.diff +++ /dev/null @@ -1,27 +0,0 @@ ---- old.requireAssertsFromTypescript.errors.txt -+++ new.requireAssertsFromTypescript.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+38379.js(1,17): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+38379.js(2,15): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ -+==== 38379.js (2 errors) ==== -+ const { art } = require('./ex') -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ const artoo = require('./ex2') -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ let x = 1 -+ art(x) -+ let y = 1 -+ artoo(y) -+ -+==== ex.d.ts (0 errors) ==== -+ // based on assert in @types/node -+ export function art(value: any, message?: string | Error): asserts value; -+==== ex2.d.ts (0 errors) ==== -+ declare function art(value: any, message?: string | Error): asserts value; -+ export = art; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/requireAssertsFromTypescript.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/requireAssertsFromTypescript.types.diff deleted file mode 100644 index 15384d5672..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/requireAssertsFromTypescript.types.diff +++ /dev/null @@ -1,43 +0,0 @@ ---- old.requireAssertsFromTypescript.types -+++ new.requireAssertsFromTypescript.types -@@= skipped -1, +1 lines =@@ - - === 38379.js === - const { art } = require('./ex') -->art : (value: any, message?: string | Error) => asserts value -->require('./ex') : typeof import("ex") -+>art : any -+>require('./ex') : any - >require : any - >'./ex' : "./ex" - - const artoo = require('./ex2') -->artoo : (value: any, message?: string | Error) => asserts value -->require('./ex2') : (value: any, message?: string | Error) => asserts value -+>artoo : any -+>require('./ex2') : any - >require : any - >'./ex2' : "./ex2" - -@@= skipped -16, +16 lines =@@ - >1 : 1 - - art(x) -->art(x) : void -->art : (value: any, message?: string | Error) => asserts value -+>art(x) : any -+>art : any - >x : number - - let y = 1 -@@= skipped -9, +9 lines =@@ - >1 : 1 - - artoo(y) -->artoo(y) : void -->artoo : (value: any, message?: string | Error) => asserts value -+>artoo(y) : any -+>artoo : any - >y : number - - === ex.d.ts === diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/requireTwoPropertyAccesses.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/requireTwoPropertyAccesses.types.diff index 0065ccbcbc..9b38f292af 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/requireTwoPropertyAccesses.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/requireTwoPropertyAccesses.types.diff @@ -27,20 +27,12 @@ ->value : error +>value : any --=== mod.js === --module.exports = { -->module.exports = { x: { y: "value" }} : { x: { y: string; }; } -->module.exports : { x: { y: string; }; } + === mod.js === + module.exports = { + >module.exports = { x: { y: "value" }} : { x: { y: string; }; } + >module.exports : { x: { y: string; }; } ->module : { exports: { x: { y: string; }; }; } -->exports : { x: { y: string; }; } -->{ x: { y: "value" }} : { x: { y: string; }; } -- -- x: { -->x : { y: string; } -->{ y: "value" } : { y: string; } -- -- y: "value" -->y : string -->"value" : "value" -- } --} ++>module : { export=: { x: { y: string; }; }; } + >exports : { x: { y: string; }; } + >{ x: { y: "value" }} : { x: { y: string; }; } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromParamTagForFunction.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromParamTagForFunction.errors.txt.diff index 1f35e42090..a117e7e07e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromParamTagForFunction.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromParamTagForFunction.errors.txt.diff @@ -9,7 +9,7 @@ +c.js(3,13): error TS2749: 'C' refers to a value, but is being used as a type here. Did you mean 'typeof C'? +d.js(3,13): error TS2749: 'D' refers to a value, but is being used as a type here. Did you mean 'typeof D'? +e-ext.js(3,14): error TS2339: Property 'x' does not exist on type 'E'. -+e.js(3,13): error TS2749: 'E' refers to a value, but is being used as a type here. Did you mean 'typeof E'? ++e.js(4,19): error TS2339: Property 'x' does not exist on type 'E'. +f.js(5,13): error TS2749: 'F' refers to a value, but is being used as a type here. Did you mean 'typeof F'? +g.js(5,13): error TS2749: 'G' refers to a value, but is being used as a type here. Did you mean 'typeof G'? +h.js(3,14): error TS2339: Property 'x' does not exist on type 'H'. @@ -89,9 +89,9 @@ + const { E } = require("./e-ext"); + + /** @param {E} p */ -+ ~ -+!!! error TS2749: 'E' refers to a value, but is being used as a type here. Did you mean 'typeof E'? + function e(p) { p.x; } ++ ~ ++!!! error TS2339: Property 'x' does not exist on type 'E'. + +==== f.js (1 errors) ==== + var F = function () { diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromParamTagForFunction.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromParamTagForFunction.types.diff index 70f281743d..73a750af67 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromParamTagForFunction.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromParamTagForFunction.types.diff @@ -6,12 +6,11 @@ exports.A = function () { ->exports.A = function () { this.x = 1;} : typeof A ->exports.A : typeof A -->exports : typeof import("a-ext") -->A : typeof A -->function () { this.x = 1;} : typeof A +>exports.A = function () { this.x = 1;} : () => void +>exports.A : any -+>exports : any + >exports : typeof import("a-ext") +->A : typeof A +->function () { this.x = 1;} : typeof A +>A : any +>function () { this.x = 1;} : () => void @@ -28,12 +27,10 @@ === a.js === const { A } = require("./a-ext"); ->A : typeof A -->require("./a-ext") : typeof import("a-ext") +>A : any -+>require("./a-ext") : any + >require("./a-ext") : typeof import("a-ext") >require : (id: string) => any >"./a-ext" : "./a-ext" - @@= skipped -9, +9 lines =@@ function a(p) { p.x; } >a : (p: A) => void @@ -46,28 +43,7 @@ === b-ext.js === exports.B = class { - >exports.B = class { constructor() { this.x = 1; }} : typeof B -->exports.B : typeof B -->exports : typeof import("b-ext") -->B : typeof B -+>exports.B : any -+>exports : any -+>B : any - >class { constructor() { this.x = 1; }} : typeof B - - constructor() { -@@= skipped -24, +24 lines =@@ - - === b.js === - const { B } = require("./b-ext"); -->B : typeof B -->require("./b-ext") : typeof import("b-ext") -+>B : any -+>require("./b-ext") : any - >require : (id: string) => any - >"./b-ext" : "./b-ext" - -@@= skipped -9, +9 lines =@@ +@@= skipped -33, +33 lines =@@ function b(p) { p.x; } >b : (p: B) => void >p : B @@ -94,12 +70,10 @@ === c.js === const { C } = require("./c-ext"); ->C : typeof C -->require("./c-ext") : typeof import("c-ext") -+>C : any -+>require("./c-ext") : any ++>C : () => void + >require("./c-ext") : typeof import("c-ext") >require : (id: string) => any >"./c-ext" : "./c-ext" - @@= skipped -27, +27 lines =@@ function c(p) { p.x; } >c : (p: C) => void @@ -130,12 +104,10 @@ === d.js === const { D } = require("./d-ext"); ->D : typeof D -->require("./d-ext") : typeof import("d-ext") -+>D : any -+>require("./d-ext") : any ++>D : () => void + >require("./d-ext") : typeof import("d-ext") >require : (id: string) => any >"./d-ext" : "./d-ext" - @@= skipped -9, +9 lines =@@ function d(p) { p.x; } >d : (p: D) => void @@ -148,18 +120,7 @@ === e-ext.js === export class E { -@@= skipped -20, +20 lines =@@ - - === e.js === - const { E } = require("./e-ext"); -->E : typeof E -->require("./e-ext") : typeof import("e-ext") -+>E : any -+>require("./e-ext") : any - >require : (id: string) => any - >"./e-ext" : "./e-ext" - -@@= skipped -9, +9 lines =@@ +@@= skipped -29, +29 lines =@@ function e(p) { p.x; } >e : (p: E) => void >p : E diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment17.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment17.errors.txt.diff new file mode 100644 index 0000000000..304c73c481 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment17.errors.txt.diff @@ -0,0 +1,40 @@ +--- old.typeFromPropertyAssignment17.errors.txt ++++ new.typeFromPropertyAssignment17.errors.txt +@@= skipped -0, +-1 lines =@@ +- +@@= skipped --1, +1 lines =@@ ++use.js(3,8): error TS2554: Expected 1 arguments, but got 0. ++ ++ ++==== use.js (1 errors) ==== ++ /// ++ var mini = require('./minimatch') ++ mini.M.defaults() ++ ~~~~~~~~ ++!!! error TS2554: Expected 1 arguments, but got 0. ++!!! related TS6210 minimatch.js:10:24: An argument for 'def' was not provided. ++ var m = new mini.M() ++ m.m() ++ mini.filter() ++ ++==== types.d.ts (0 errors) ==== ++ declare var require: any; ++ declare var module: any; ++==== minimatch.js (0 errors) ==== ++ /// ++ module.exports = minimatch ++ minimatch.M = M ++ minimatch.filter = filter ++ function filter() { ++ return minimatch() ++ } ++ function minimatch() { ++ } ++ M.defaults = function (def) { ++ return def ++ } ++ M.prototype.m = function () { ++ } ++ function M() { ++ } ++ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment17.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment17.types.diff index 938ca071d3..07106b9f41 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment17.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment17.types.diff @@ -6,23 +6,21 @@ var mini = require('./minimatch') ->mini : typeof mini ->require('./minimatch') : typeof mini -+>mini : any -+>require('./minimatch') : any ++>mini : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } ++>require('./minimatch') : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } >require : any >'./minimatch' : "./minimatch" mini.M.defaults() >mini.M.defaults() : any -->mini.M.defaults : (def: any) => any + >mini.M.defaults : (def: any) => any ->mini.M : typeof M ->mini : typeof mini ->M : typeof M -->defaults : (def: any) => any -+>mini.M.defaults : any -+>mini.M : any -+>mini : any -+>M : any -+>defaults : any ++>mini.M : { (): void; defaults: (def: any) => any; } ++>mini : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } ++>M : { (): void; defaults: (def: any) => any; } + >defaults : (def: any) => any var m = new mini.M() ->m : M @@ -32,9 +30,9 @@ ->M : typeof M +>m : any +>new mini.M() : any -+>mini.M : any -+>mini : any -+>M : any ++>mini.M : { (): void; defaults: (def: any) => any; } ++>mini : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } ++>M : { (): void; defaults: (def: any) => any; } m.m() ->m.m() : void @@ -47,75 +45,79 @@ +>m : any mini.filter() -->mini.filter() : void -->mini.filter : () => void + >mini.filter() : void + >mini.filter : () => void ->mini : typeof mini -->filter : () => void -+>mini.filter() : any -+>mini.filter : any -+>mini : any -+>filter : any ++>mini : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } + >filter : () => void === types.d.ts === - declare var require: any; -@@= skipped -39, +39 lines =@@ - declare var module: any; - >module : any - --=== minimatch.js === --/// --module.exports = minimatch +@@= skipped -42, +42 lines =@@ + === minimatch.js === + /// + module.exports = minimatch ->module.exports = minimatch : typeof minimatch ->module.exports : typeof minimatch ->module : { exports: typeof minimatch; } ->exports : typeof minimatch ->minimatch : typeof minimatch -- --minimatch.M = M ++>module.exports = minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } ++>module.exports : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } ++>module : { minimatch: { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; }; } ++>exports : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } ++>minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } + + minimatch.M = M ->minimatch.M = M : typeof M ->minimatch.M : typeof M ->minimatch : typeof minimatch ->M : typeof M ->M : typeof M -- --minimatch.filter = filter -->minimatch.filter = filter : () => void -->minimatch.filter : () => void ++>minimatch.M = M : { (): void; defaults: (def: any) => any; } ++>minimatch.M : { (): void; defaults: (def: any) => any; } ++>minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } ++>M : { (): void; defaults: (def: any) => any; } ++>M : { (): void; defaults: (def: any) => any; } + + minimatch.filter = filter + >minimatch.filter = filter : () => void + >minimatch.filter : () => void ->minimatch : typeof minimatch -->filter : () => void -->filter : () => void -- --function filter() { -->filter : () => void -- -- return minimatch() -->minimatch() : void ++>minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } + >filter : () => void + >filter : () => void + +@@= skipped -25, +25 lines =@@ + + return minimatch() + >minimatch() : void ->minimatch : typeof minimatch --} --function minimatch() { ++>minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } + } + function minimatch() { ->minimatch : typeof minimatch --} --M.defaults = function (def) { -->M.defaults = function (def) { return def} : (def: any) => any -->M.defaults : (def: any) => any ++>minimatch : { (): void; M: { (): void; defaults: (def: any) => any; }; filter: () => void; } + } + M.defaults = function (def) { + >M.defaults = function (def) { return def} : (def: any) => any + >M.defaults : (def: any) => any ->M : typeof M -->defaults : (def: any) => any -->function (def) { return def} : (def: any) => any -->def : any -- -- return def -->def : any --} --M.prototype.m = function () { -->M.prototype.m = function () {} : () => void -->M.prototype.m : any -->M.prototype : any ++>M : { (): void; defaults: (def: any) => any; } + >defaults : (def: any) => any + >function (def) { return def} : (def: any) => any + >def : any +@@= skipped -20, +20 lines =@@ + >M.prototype.m = function () {} : () => void + >M.prototype.m : any + >M.prototype : any ->M : typeof M -->prototype : any -->m : any -->function () {} : () => void --} --function M() { ++>M : { (): void; defaults: (def: any) => any; } + >prototype : any + >m : any + >function () {} : () => void + } + function M() { ->M : typeof M --} -- ++>M : { (): void; defaults: (def: any) => any; } + } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment19.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment19.errors.txt.diff new file mode 100644 index 0000000000..b722733093 --- /dev/null +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment19.errors.txt.diff @@ -0,0 +1,28 @@ +--- old.typeFromPropertyAssignment19.errors.txt ++++ new.typeFromPropertyAssignment19.errors.txt +@@= skipped -0, +-1 lines =@@ +- +@@= skipped --1, +1 lines =@@ ++index.js(2,19): error TS2306: File 'semver.js' is not a module. ++semver.js(2,1): error TS2304: Cannot find name 'exports'. ++ ++ ++==== index.js (1 errors) ==== ++ /// ++ const C = require("./semver") ++ ~~~~~~~~~~ ++!!! error TS2306: File 'semver.js' is not a module. ++ var two = C.f(1) ++ ++==== types.d.ts (0 errors) ==== ++ declare var require: any; ++ declare var module: any; ++==== semver.js (1 errors) ==== ++ /// ++ exports = module.exports = C ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. ++ C.f = n => n + 1 ++ function C() { ++ this.p = 1 ++ } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment19.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment19.types.diff index 1ad4b05c58..6a7084129d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment19.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment19.types.diff @@ -23,13 +23,10 @@ >1 : 1 === types.d.ts === -@@= skipped -20, +20 lines =@@ - declare var module: any; - >module : any - --=== semver.js === --/// --exports = module.exports = C +@@= skipped -23, +23 lines =@@ + === semver.js === + /// + exports = module.exports = C ->exports = module.exports = C : typeof C ->exports : typeof C ->module.exports = C : typeof C @@ -37,25 +34,34 @@ ->module : { exports: typeof C; } ->exports : typeof C ->C : typeof C -- --C.f = n => n + 1 -->C.f = n => n + 1 : (n: any) => any -->C.f : (n: any) => any ++>exports = module.exports = C : { (): void; f: (n: any) => any; } ++>exports : any ++>module.exports = C : { (): void; f: (n: any) => any; } ++>module.exports : any ++>module : any ++>exports : any ++>C : { (): void; f: (n: any) => any; } + + C.f = n => n + 1 + >C.f = n => n + 1 : (n: any) => any + >C.f : (n: any) => any ->C : typeof C -->f : (n: any) => any -->n => n + 1 : (n: any) => any -->n : any -->n + 1 : any -->n : any -->1 : 1 -- --function C() { ++>C : { (): void; f: (n: any) => any; } + >f : (n: any) => any + >n => n + 1 : (n: any) => any + >n : any +@@= skipped -20, +20 lines =@@ + >1 : 1 + + function C() { ->C : typeof C -- -- this.p = 1 -->this.p = 1 : 1 -->this.p : any ++>C : { (): void; f: (n: any) => any; } + + this.p = 1 + >this.p = 1 : 1 + >this.p : any ->this : this -->p : any -->1 : 1 --} ++>this : any + >p : any + >1 : 1 + } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment37.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment37.errors.txt.diff index 5cee1c2556..00b6865f9b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment37.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment37.errors.txt.diff @@ -3,21 +3,30 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+use.js(1,14): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod.js(1,14): error TS2304: Cannot find name 'exports'. ++mod.js(1,24): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod.js(3,10): error TS2339: Property 'existy' does not exist on type '{}'. ++use.js(1,22): error TS2306: File 'mod.js' is not a module. + + +==== use.js (1 errors) ==== + const util = require('./mod') -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~ ++!!! error TS2306: File 'mod.js' is not a module. + function n() { + util.existy // no error + } + util.existy // no error + -+==== mod.js (0 errors) ==== ++==== mod.js (3 errors) ==== + const util = exports = module.exports = {} ++ ~~~~~~~ ++!!! error TS2304: Cannot find name 'exports'. ++ ~~~~~~ ++!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + if (!!false) { + util.existy = function () { } ++ ~~~~~~ ++!!! error TS2339: Property 'existy' does not exist on type '{}'. + } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment37.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment37.types.diff index d706f0db9d..d7f880e72f 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment37.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeFromPropertyAssignment37.types.diff @@ -30,8 +30,8 @@ +>util : any +>existy : any --=== mod.js === --const util = exports = module.exports = {} + === mod.js === + const util = exports = module.exports = {} ->util : typeof module.exports ->exports = module.exports = {} : typeof module.exports ->exports : typeof import("mod") @@ -39,18 +39,26 @@ ->module.exports : typeof module.exports ->module : { exports: typeof module.exports; } ->exports : typeof module.exports -->{} : {} -- --if (!!false) { -->!!false : boolean -->!false : true -->false : false -- -- util.existy = function () { } -->util.existy = function () { } : () => void ++>util : {} ++>exports = module.exports = {} : {} ++>exports : any ++>module.exports = {} : {} ++>module.exports : any ++>module : any ++>exports : any + >{} : {} + + if (!!false) { +@@= skipped -27, +27 lines =@@ + + util.existy = function () { } + >util.existy = function () { } : () => void ->util.existy : () => void ->util : typeof module.exports ->existy : () => void -->function () { } : () => void --} -- ++>util.existy : any ++>util : {} ++>existy : any + >function () { } : () => void + } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeTagModuleExports.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeTagModuleExports.errors.txt.diff index 11f5442caa..32e45e553e 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeTagModuleExports.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeTagModuleExports.errors.txt.diff @@ -1,15 +1,14 @@ --- old.typeTagModuleExports.errors.txt +++ new.typeTagModuleExports.errors.txt -@@= skipped -0, +0 lines =@@ +@@= skipped -0, +-1 lines =@@ -bug27327.js(2,1): error TS2322: Type 'number' is not assignable to type 'string'. -+bug27327.js(2,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - - - ==== bug27327.js (1 errors) ==== - /** @type {string} */ - module.exports = 0; +- +- +-==== bug27327.js (1 errors) ==== +- /** @type {string} */ +- module.exports = 0; - ~~~~~~~~~~~~~~ -!!! error TS2322: Type 'number' is not assignable to type 'string'. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. - +- +@@= skipped --1, +1 lines =@@ ++ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typeTagModuleExports.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typeTagModuleExports.types.diff index 0f8e5dcb6f..01893d8233 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typeTagModuleExports.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typeTagModuleExports.types.diff @@ -9,8 +9,8 @@ ->module : { exports: string; } ->exports : string +>module.exports = 0 : 0 -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : 0 ++>module : { export=: 0; } ++>exports : 0 >0 : 0 diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule.errors.txt.diff index 47b8f2f3bc..38256774be 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule.errors.txt.diff @@ -3,17 +3,20 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+mod3.js(6,1): error TS2304: Cannot find name 'exports'. ++mod1.js(5,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++use.js(1,29): error TS2694: Namespace 'C' has no exported member 'Both'. + + +==== commonjs.d.ts (0 errors) ==== + declare var module: { exports: any}; -+==== mod1.js (0 errors) ==== ++==== mod1.js (1 errors) ==== + /// + /** @typedef {{ type: "a", x: 1 }} A */ + /** @typedef {{ type: "b", y: 1 }} B */ + /** @typedef {A | B} Both */ + module.exports = C ++ ~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. + function C() { + this.p = 1 + } @@ -28,20 +31,20 @@ + this.p = 1 + } + -+==== mod3.js (1 errors) ==== ++==== mod3.js (0 errors) ==== + /// + /** @typedef {{ type: "a", x: 1 }} A */ + /** @typedef {{ type: "b", y: 1 }} B */ + /** @typedef {A | B} Both */ + + exports.C = function() { -+ ~~~~~~~ -+!!! error TS2304: Cannot find name 'exports'. + this.p = 1 + } + -+==== use.js (0 errors) ==== ++==== use.js (1 errors) ==== + /** @type {import('./mod1').Both} */ ++ ~~~~ ++!!! error TS2694: Namespace 'C' has no exported member 'Both'. + var both1 = { type: 'a', x: 1 }; + /** @type {import('./mod2').Both} */ + var both2 = both1; diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule.types.diff index ea3fe19b73..6aa012e05b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule.types.diff @@ -10,9 +10,9 @@ ->exports : typeof C ->C : typeof C +>module.exports = C : () => void -+>module.exports : any -+>module : { exports: any; } -+>exports : any ++>module.exports : () => void ++>module : { C: () => void; } ++>exports : () => void +>C : () => void function C() { @@ -48,12 +48,11 @@ exports.C = function() { ->exports.C = function() { this.p = 1} : typeof C ->exports.C : typeof C -->exports : typeof import("mod3") -->C : typeof C -->function() { this.p = 1} : typeof C +>exports.C = function() { this.p = 1} : () => void +>exports.C : any -+>exports : any + >exports : typeof import("mod3") +->C : typeof C +->function() { this.p = 1} : typeof C +>C : any +>function() { this.p = 1} : () => void @@ -70,25 +69,29 @@ /** @type {import('./mod1').Both} */ var both1 = { type: 'a', x: 1 }; ->both1 : import("mod1").Both -+>both1 : { type: "a"; x: 1; } | { type: "b"; y: 1; } - >{ type: 'a', x: 1 } : { type: "a"; x: 1; } - >type : "a" +->{ type: 'a', x: 1 } : { type: "a"; x: 1; } +->type : "a" ++>both1 : any ++>{ type: 'a', x: 1 } : { type: string; x: number; } ++>type : string >'a' : "a" -@@= skipped -9, +9 lines =@@ +->x : 1 ++>x : number + >1 : 1 /** @type {import('./mod2').Both} */ var both2 = both1; ->both2 : import("mod2").Both ->both1 : import("mod1").A +>both2 : Both -+>both1 : { type: "a"; x: 1; } ++>both1 : any /** @type {import('./mod3').Both} */ var both3 = both2; ->both3 : import("mod3").Both ->both2 : import("mod2").A +>both3 : { type: "a"; x: 1; } | { type: "b"; y: 1; } -+>both2 : A ++>both2 : Both diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule2.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule2.errors.txt.diff index 5b880ebdd3..1921a5962d 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule2.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule2.errors.txt.diff @@ -5,19 +5,24 @@ -mod1.js(4,7): error TS2300: Duplicate identifier 'Foo'. -mod1.js(9,23): error TS2300: Duplicate identifier 'Baz'. -mod1.js(11,5): error TS2300: Duplicate identifier 'Baz'. -+use.js(1,11): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+use.js(2,19): error TS2307: Cannot find module './mod1.js' or its corresponding type declarations. ++mod1.js(3,23): error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local. ++mod1.js(4,7): error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local. ++mod1.js(7,9): error TS2339: Property 'Bar' does not exist on type 'typeof import("mod1")'. ++mod1.js(10,1): error TS2300: Duplicate identifier 'export='. ++mod1.js(10,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ++mod1.js(20,9): error TS2339: Property 'Quid' does not exist on type 'typeof import("mod1")'. ++mod1.js(23,1): error TS2300: Duplicate identifier 'export='. ++mod1.js(24,5): error TS2353: Object literal may only specify known properties, and 'Quack' does not exist in type '{ Baz: typeof Baz; }'. ++use.js(2,32): error TS2694: Namespace '"mod1".export=' has no exported member 'Baz'. +use.js(4,12): error TS2503: Cannot find namespace 'mod'. -==== use.js (0 errors) ==== -+==== use.js (3 errors) ==== ++==== use.js (2 errors) ==== var mod = require('./mod1.js'); -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. /** @type {import("./mod1.js").Baz} */ -+ ~~~~~~~~~~~ -+!!! error TS2307: Cannot find module './mod1.js' or its corresponding type declarations. ++ ~~~ ++!!! error TS2694: Namespace '"mod1".export=' has no exported member 'Baz'. var b; /** @type {mod.Baz} */ + ~~~ @@ -26,28 +31,59 @@ var bbb = new mod.Baz(); -==== mod1.js (4 errors) ==== -+==== mod1.js (0 errors) ==== ++==== mod1.js (8 errors) ==== // error /** @typedef {number} Foo */ -- ~~~ + ~~~ -!!! error TS2300: Duplicate identifier 'Foo'. ++!!! error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local. class Foo { } // should error -- ~~~ + ~~~ -!!! error TS2300: Duplicate identifier 'Foo'. ++!!! error TS2395: Individual declarations in merged declaration 'Foo' must be all exported or all local. /** @typedef {number} Bar */ exports.Bar = class { } ++ ~~~ ++!!! error TS2339: Property 'Bar' does not exist on type 'typeof import("mod1")'. /** @typedef {number} Baz */ - ~~~ -!!! error TS2300: Duplicate identifier 'Baz'. -!!! related TS6203 mod1.js:11:5: 'Baz' was also declared here. module.exports = { ++ ~~~~~~~~~~~~~~~~~~ ++ ~~~~~~~~~~~~~~~~~~ Baz: class { } - ~~~ -!!! error TS2300: Duplicate identifier 'Baz'. -!!! related TS6203 mod1.js:9:23: 'Baz' was also declared here. ++ ~~~~~~~~~~~~~~~~~~ ++ ~~~~~~~~~~~~~~~~~~ } ++ ~ ++!!! error TS2300: Duplicate identifier 'export='. ++ ~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. // ok + +@@= skipped -42, +56 lines =@@ + + /** @typedef {number} Quid */ + exports.Quid = 2; ++ ~~~~ ++!!! error TS2339: Property 'Quid' does not exist on type 'typeof import("mod1")'. + + /** @typedef {number} Quack */ + module.exports = { ++ ~~~~~~~~~~~~~~~~~~ + Quack: 2 ++ ~~~~~~~~~~~~ ++ ~~~~~ ++!!! error TS2353: Object literal may only specify known properties, and 'Quack' does not exist in type '{ Baz: typeof Baz; }'. + } ++ ~ ++!!! error TS2300: Duplicate identifier 'export='. + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule2.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule2.types.diff index bb6453bd98..97373e3d4c 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule2.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule2.types.diff @@ -6,8 +6,8 @@ var mod = require('./mod1.js'); ->mod : { Bar: typeof mod.Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof mod.Bar; Baz?: undefined; Quid: 2; Quack: number; } ->require('./mod1.js') : { Bar: typeof mod.Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof mod.Bar; Baz?: undefined; Quid: 2; Quack: number; } -+>mod : any -+>require('./mod1.js') : any ++>mod : { Baz: typeof Baz; } ++>require('./mod1.js') : { Baz: typeof Baz; } >require : any >'./mod1.js' : "./mod1.js" @@ -22,70 +22,61 @@ +>bb : Baz var bbb = new mod.Baz(); -->bbb : Baz -->new mod.Baz() : Baz -->mod.Baz : typeof Baz + >bbb : Baz + >new mod.Baz() : Baz + >mod.Baz : typeof Baz ->mod : { Bar: typeof mod.Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof mod.Bar; Baz?: undefined; Quid: 2; Quack: number; } -->Baz : typeof Baz -+>bbb : any -+>new mod.Baz() : any -+>mod.Baz : any -+>mod : any -+>Baz : any ++>mod : { Baz: typeof Baz; } + >Baz : typeof Baz --=== mod1.js === --// error -- --/** @typedef {number} Foo */ --class Foo { } // should error -->Foo : Foo -- --/** @typedef {number} Bar */ --exports.Bar = class { } -->exports.Bar = class { } : typeof Bar + === mod1.js === +@@= skipped -30, +30 lines =@@ + /** @typedef {number} Bar */ + exports.Bar = class { } + >exports.Bar = class { } : typeof Bar ->exports.Bar : typeof Bar ->exports : { Bar: typeof Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof Bar; Baz?: undefined; Quid: 2; Quack: number; } ->Bar : typeof Bar -->class { } : typeof Bar -- --/** @typedef {number} Baz */ --module.exports = { ++>exports.Bar : any ++>exports : typeof import("mod1") ++>Bar : any + >class { } : typeof Bar + + /** @typedef {number} Baz */ + module.exports = { ->module.exports = { Baz: class { }} : { Bar: typeof Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof Bar; Baz?: undefined; Quid: 2; Quack: number; } ->module.exports : { Bar: typeof Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof Bar; Baz?: undefined; Quid: 2; Quack: number; } ->module : { exports: { Bar: typeof Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof Bar; Baz?: undefined; Quid: 2; Quack: number; }; } ->exports : { Bar: typeof Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof Bar; Baz?: undefined; Quid: 2; Quack: number; } -->{ Baz: class { }} : { Baz: typeof Baz; } -- -- Baz: class { } -->Baz : typeof Baz -->class { } : typeof Baz --} -- --// ok -- --/** @typedef {number} Qux */ --var Qux = 2; -->Qux : number -->2 : 2 -- --/** @typedef {number} Quid */ --exports.Quid = 2; -->exports.Quid = 2 : 2 ++>module.exports = { Baz: class { }} : { Baz: typeof Baz; } ++>module.exports : { Baz: typeof Baz; } ++>module : { export=: { Baz: typeof Baz; }; } ++>exports : { Baz: typeof Baz; } + >{ Baz: class { }} : { Baz: typeof Baz; } + + Baz: class { } +@@= skipped -28, +28 lines =@@ + /** @typedef {number} Quid */ + exports.Quid = 2; + >exports.Quid = 2 : 2 ->exports.Quid : 2 ->exports : { Bar: typeof Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof Bar; Baz?: undefined; Quid: 2; Quack: number; } ->Quid : 2 -->2 : 2 -- --/** @typedef {number} Quack */ --module.exports = { ++>exports.Quid : any ++>exports : typeof import("mod1") ++>Quid : any + >2 : 2 + + /** @typedef {number} Quack */ + module.exports = { ->module.exports = { Quack: 2} : { Bar: typeof Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof Bar; Baz?: undefined; Quid: 2; Quack: number; } ->module.exports : { Bar: typeof Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof Bar; Baz?: undefined; Quid: 2; Quack: number; } ->module : { exports: { Bar: typeof Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof Bar; Baz?: undefined; Quid: 2; Quack: number; }; } ->exports : { Bar: typeof Bar; Baz: typeof Baz; Quid: 2; Quack?: undefined; } | { Bar: typeof Bar; Baz?: undefined; Quid: 2; Quack: number; } -->{ Quack: 2} : { Quack: number; } -- -- Quack: 2 -->Quack : number -->2 : 2 --} -- ++>module.exports = { Quack: 2} : { Quack: number; } ++>module.exports : { Baz: typeof Baz; } ++>module : { export=: { Baz: typeof Baz; }; } ++>exports : { Baz: typeof Baz; } + >{ Quack: 2} : { Quack: number; } + + Quack: 2 diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.errors.txt.diff index 0472321455..ff156cd3b8 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.errors.txt.diff @@ -4,7 +4,7 @@ -mod2.js(1,23): error TS2300: Duplicate identifier 'Foo'. -mod2.js(3,4): error TS2300: Duplicate identifier 'Foo'. +mod2.js(3,4): error TS2339: Property 'Foo' does not exist on type '{}'. -+mod2.js(4,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod2.js(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements. ==== mod2.js (2 errors) ==== @@ -19,7 +19,7 @@ -!!! related TS6203 mod2.js:1:23: 'Foo' was also declared here. +!!! error TS2339: Property 'Foo' does not exist on type '{}'. module.exports = ns; -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.types.diff index aa5c941749..968f4002a1 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule3.types.diff @@ -25,9 +25,9 @@ ->exports : typeof ns ->ns : typeof ns +>module.exports = ns : {} -+>module.exports : any -+>module : any -+>exports : any ++>module.exports : {} ++>module : { readonly ns: {}; } ++>exports : {} +>ns : {} diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule4.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule4.errors.txt.diff index 9b7e69a330..f3615f3918 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule4.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule4.errors.txt.diff @@ -3,7 +3,7 @@ @@= skipped -0, +0 lines =@@ -mod3.js(1,23): error TS2300: Duplicate identifier 'Foo'. -mod3.js(3,20): error TS2300: Duplicate identifier 'Foo'. -+mod3.js(3,1): error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++mod3.js(3,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== mod3.js (2 errors) ==== @@ -17,7 +17,7 @@ - ~~~ -!!! error TS2300: Duplicate identifier 'Foo'. -!!! related TS6203 mod3.js:1:23: 'Foo' was also declared here. -+ ~~~~~~ -+!!! error TS2580: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. ++ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ++!!! error TS2309: An export assignment cannot be used in a module with other exported elements. diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule4.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule4.types.diff index ab8b6a5e92..bdab2bbc97 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule4.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/typedefCrossModule4.types.diff @@ -1,15 +1,11 @@ --- old.typedefCrossModule4.types +++ new.typedefCrossModule4.types -@@= skipped -6, +6 lines =@@ - +@@= skipped -7, +7 lines =@@ module.exports = { Foo: Bar }; >module.exports = { Foo: Bar } : { Foo: typeof Bar; } -->module.exports : { Foo: typeof Bar; } + >module.exports : { Foo: typeof Bar; } ->module : { exports: { Foo: typeof Bar; }; } -->exports : { Foo: typeof Bar; } -+>module.exports : any -+>module : any -+>exports : any ++>module : { export=: { Foo: typeof Bar; }; } + >exports : { Foo: typeof Bar; } >{ Foo: Bar } : { Foo: typeof Bar; } >Foo : typeof Bar - >Bar : typeof Bar diff --git a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/untypedModuleImport_allowJs.types.diff similarity index 62% rename from testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.types.diff rename to testdata/baselines/reference/submoduleAccepted/conformance/untypedModuleImport_allowJs.types.diff index 1467185c72..15add56e3b 100644 --- a/testdata/baselines/reference/submodule/conformance/untypedModuleImport_allowJs.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/untypedModuleImport_allowJs.types.diff @@ -17,13 +17,17 @@ +>foo : any +>bar : any --=== /node_modules/foo/index.js === --exports.default = { bar() { return 0; } } + === /node_modules/foo/index.js === + exports.default = { bar() { return 0; } } ->exports.default = { bar() { return 0; } } : { bar(): number; } ->exports.default : { bar(): number; } -->exports : typeof import("/node_modules/foo/index") ++>exports.default = { bar() { return 0; } } : { bar: () => number; } ++>exports.default : any + >exports : typeof import("/node_modules/foo/index") ->default : { bar(): number; } ->{ bar() { return 0; } } : { bar(): number; } -->bar : () => number -->0 : 0 -- ++>default : any ++>{ bar() { return 0; } } : { bar: () => number; } + >bar : () => number + >0 : 0 + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromJavascript.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromJavascript.errors.txt.diff index 69e845ec0f..a5f749f185 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromJavascript.errors.txt.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromJavascript.errors.txt.diff @@ -3,38 +3,44 @@ @@= skipped -0, +-1 lines =@@ - @@= skipped --1, +1 lines =@@ -+use.js(1,10): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+use.js(10,12): error TS2503: Cannot find namespace 'ex'. ++ex.js(4,14): error TS2339: Property 'n' does not exist on type 'Crunch'. ++ex.js(7,21): error TS2339: Property 'n' does not exist on type 'Crunch'. ++use.js(5,8): error TS2339: Property 'n' does not exist on type 'Crunch'. ++use.js(13,10): error TS2339: Property 'n' does not exist on type 'Crunch'. + + +==== use.js (2 errors) ==== + var ex = require('./ex') -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. + + // values work + var crunch = new ex.Crunch(1); + crunch.n ++ ~ ++!!! error TS2339: Property 'n' does not exist on type 'Crunch'. + + + // types work + /** + * @param {ex.Crunch} wrap -+ ~~ -+!!! error TS2503: Cannot find namespace 'ex'. + */ + function f(wrap) { + wrap.n ++ ~ ++!!! error TS2339: Property 'n' does not exist on type 'Crunch'. + } + -+==== ex.js (0 errors) ==== ++==== ex.js (2 errors) ==== + export class Crunch { + /** @param {number} n */ + constructor(n) { + this.n = n ++ ~ ++!!! error TS2339: Property 'n' does not exist on type 'Crunch'. + } + m() { + return this.n ++ ~ ++!!! error TS2339: Property 'n' does not exist on type 'Crunch'. + } + } + diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromJavascript.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromJavascript.types.diff index b723fd3e3d..de2e7124d9 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromJavascript.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromJavascript.types.diff @@ -6,8 +6,8 @@ var ex = require('./ex') ->ex : typeof ex ->require('./ex') : typeof ex -+>ex : any -+>require('./ex') : any ++>ex : typeof import("ex") ++>require('./ex') : typeof import("ex") >require : any >'./ex' : "./ex" @@ -18,11 +18,11 @@ ->ex.Crunch : typeof ex.Crunch ->ex : typeof ex ->Crunch : typeof ex.Crunch -+>crunch : any -+>new ex.Crunch(1) : any -+>ex.Crunch : any -+>ex : any -+>Crunch : any ++>crunch : Crunch ++>new ex.Crunch(1) : Crunch ++>ex.Crunch : typeof Crunch ++>ex : typeof import("ex") ++>Crunch : typeof Crunch >1 : 1 crunch.n @@ -30,7 +30,7 @@ ->crunch : ex.Crunch ->n : number +>crunch.n : any -+>crunch : any ++>crunch : Crunch +>n : any @@ -48,32 +48,25 @@ ->wrap.n : number ->wrap : ex.Crunch ->n : number --} -- --=== ex.js === --export class Crunch { -->Crunch : Crunch -- -- /** @param {number} n */ -- constructor(n) { -->n : number -- -- this.n = n -->this.n = n : number -->this.n : any -->this : this +>wrap.n : any +>wrap : Crunch - >n : any -->n : number -- } -- m() { ++>n : any + } + + === ex.js === +@@= skipped -25, +25 lines =@@ + >n : number + } + m() { ->m : () => number -- -- return this.n ++>m : () => any + + return this.n ->this.n : number -->this : this ++>this.n : any + >this : this ->n : number -- } ++>n : any + } } diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromTypescript.errors.txt.diff b/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromTypescript.errors.txt.diff deleted file mode 100644 index 26a8cc3d72..0000000000 --- a/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromTypescript.errors.txt.diff +++ /dev/null @@ -1,42 +0,0 @@ ---- old.varRequireFromTypescript.errors.txt -+++ new.varRequireFromTypescript.errors.txt -@@= skipped -0, +-1 lines =@@ -- -@@= skipped --1, +1 lines =@@ -+use.js(1,10): error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+use.js(10,12): error TS2503: Cannot find namespace 'ex'. -+use.js(11,12): error TS2503: Cannot find namespace 'ex'. -+ -+ -+==== use.js (3 errors) ==== -+ var ex = require('./ex') -+ ~~~~~~~ -+!!! error TS2580: Cannot find name 'require'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node`. -+ -+ // values work -+ var crunch = new ex.Crunch(1); -+ crunch.n -+ -+ -+ // types work -+ /** -+ * @param {ex.Greatest} greatest -+ ~~ -+!!! error TS2503: Cannot find namespace 'ex'. -+ * @param {ex.Crunch} wrap -+ ~~ -+!!! error TS2503: Cannot find namespace 'ex'. -+ */ -+ function f(greatest, wrap) { -+ greatest.day -+ wrap.n -+ } -+ -+==== ex.d.ts (0 errors) ==== -+ export type Greatest = { day: 1 } -+ export class Crunch { -+ n: number -+ m(): number -+ constructor(n: number) -+ } -+ diff --git a/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromTypescript.types.diff b/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromTypescript.types.diff index 93df86ffc7..2cfe18f13b 100644 --- a/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromTypescript.types.diff +++ b/testdata/baselines/reference/submoduleAccepted/conformance/varRequireFromTypescript.types.diff @@ -6,8 +6,8 @@ var ex = require('./ex') ->ex : typeof ex ->require('./ex') : typeof ex -+>ex : any -+>require('./ex') : any ++>ex : typeof import("ex") ++>require('./ex') : typeof import("ex") >require : any >'./ex' : "./ex" @@ -18,23 +18,20 @@ ->ex.Crunch : typeof ex.Crunch ->ex : typeof ex ->Crunch : typeof ex.Crunch -+>crunch : any -+>new ex.Crunch(1) : any -+>ex.Crunch : any -+>ex : any -+>Crunch : any ++>crunch : Crunch ++>new ex.Crunch(1) : Crunch ++>ex.Crunch : typeof Crunch ++>ex : typeof import("ex") ++>Crunch : typeof Crunch >1 : 1 crunch.n -->crunch.n : number + >crunch.n : number ->crunch : ex.Crunch -->n : number -+>crunch.n : any -+>crunch : any -+>n : any ++>crunch : Crunch + >n : number - // types work @@= skipped -26, +26 lines =@@ * @param {ex.Crunch} wrap */ @@ -47,20 +44,15 @@ +>wrap : Crunch greatest.day -->greatest.day : 1 + >greatest.day : 1 ->greatest : ex.Greatest -->day : 1 -+>greatest.day : any +>greatest : Greatest -+>day : any + >day : 1 wrap.n -->wrap.n : number + >wrap.n : number ->wrap : ex.Crunch -->n : number -+>wrap.n : any +>wrap : Crunch -+>n : any + >n : number } - === ex.d.ts ===