diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index 1b96ef48991..dc68cccaddb 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -2910,15 +2910,13 @@ namespace ts { // util.property = function ... bindExportsPropertyAssignment(node as BindableStaticPropertyAssignmentExpression); } + else if (hasDynamicName(node)) { + bindAnonymousDeclaration(node, SymbolFlags.Property | SymbolFlags.Assignment, InternalSymbolName.Computed); + const sym = bindPotentiallyMissingNamespaces(parentSymbol, node.left.expression, isTopLevelNamespaceAssignment(node.left), /*isPrototype*/ false, /*containerIsClass*/ false); + addLateBoundAssignmentDeclarationToSymbol(node, sym); + } else { - if (hasDynamicName(node)) { - bindAnonymousDeclaration(node, SymbolFlags.Property | SymbolFlags.Assignment, InternalSymbolName.Computed); - const sym = bindPotentiallyMissingNamespaces(parentSymbol, node.left.expression, isTopLevelNamespaceAssignment(node.left), /*isPrototype*/ false, /*containerIsClass*/ false); - addLateBoundAssignmentDeclarationToSymbol(node, sym); - } - else { - bindStaticPropertyAssignment(cast(node.left, isBindableStaticAccessExpression)); - } + bindStaticPropertyAssignment(cast(node.left, isBindableStaticNameExpression)); } } @@ -2926,7 +2924,8 @@ namespace ts { * For nodes like `x.y = z`, declare a member 'y' on 'x' if x is a function (or IIFE) or class or {}, or not declared. * Also works for expression statements preceded by JSDoc, like / ** @type number * / x.y; */ - function bindStaticPropertyAssignment(node: BindableStaticAccessExpression) { + function bindStaticPropertyAssignment(node: BindableStaticNameExpression) { + Debug.assert(!isIdentifier(node)); setParent(node.expression, node); bindPropertyAssignment(node.expression, node, /*isPrototypeProperty*/ false, /*containerIsClass*/ false); } diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index c989a0cc0df..9947538f89c 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -5574,6 +5574,10 @@ namespace ts { return symbol.declarations && find(symbol.declarations, s => !!getEffectiveTypeAnnotationNode(s) && (!enclosingDeclaration || !!findAncestor(s, n => n === enclosingDeclaration))); } + function existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing: TypeNode, type: Type) { + return !(getObjectFlags(type) & ObjectFlags.Reference) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount((type as TypeReference).target.typeParameters); + } + /** * Unlike `typeToTypeNodeHelper`, this handles setting up the `AllowUniqueESSymbolType` flag * so a `unique symbol` is returned when appropriate for the input symbol, rather than `typeof sym` @@ -5584,7 +5588,7 @@ namespace ts { if (declWithExistingAnnotation && !isFunctionLikeDeclaration(declWithExistingAnnotation)) { // try to reuse the existing annotation const existing = getEffectiveTypeAnnotationNode(declWithExistingAnnotation)!; - if (getTypeFromTypeNode(existing) === type) { + if (getTypeFromTypeNode(existing) === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type)) { const result = serializeExistingTypeNode(context, existing, includePrivateSymbol, bundled); if (result) { return result; @@ -5605,7 +5609,7 @@ namespace ts { function serializeReturnTypeForSignature(context: NodeBuilderContext, type: Type, signature: Signature, includePrivateSymbol?: (s: Symbol) => void, bundled?: boolean) { if (type !== errorType && context.enclosingDeclaration) { const annotation = signature.declaration && getEffectiveReturnTypeNode(signature.declaration); - if (!!findAncestor(annotation, n => n === context.enclosingDeclaration) && annotation && instantiateType(getTypeFromTypeNode(annotation), signature.mapper) === type) { + if (!!findAncestor(annotation, n => n === context.enclosingDeclaration) && annotation && instantiateType(getTypeFromTypeNode(annotation), signature.mapper) === type && existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(annotation, type)) { const result = serializeExistingTypeNode(context, annotation, includePrivateSymbol, bundled); if (result) { return result; @@ -5646,6 +5650,20 @@ namespace ts { if (isJSDocVariadicType(node)) { return factory.createArrayTypeNode(visitNode((node as JSDocVariadicType).type, visitExistingNodeTreeSymbols)); } + if (isJSDocTypeLiteral(node)) { + return factory.createTypeLiteralNode(map(node.jsDocPropertyTags, t => { + const name = isIdentifier(t.name) ? t.name : t.name.right; + const typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode(node), name.escapedText); + const overrideTypeNode = typeViaParent && t.typeExpression && getTypeFromTypeNode(t.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context) : undefined; + + return factory.createPropertySignature( + /*modifiers*/ undefined, + name, + t.typeExpression && isJSDocOptionalType(t.typeExpression.type) ? factory.createToken(SyntaxKind.QuestionToken) : undefined, + overrideTypeNode || (t.typeExpression && visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols)) || factory.createKeywordTypeNode(SyntaxKind.AnyKeyword) + ); + })); + } if (isTypeReferenceNode(node) && isIdentifier(node.typeName) && node.typeName.escapedText === "") { return setOriginalNode(factory.createKeywordTypeNode(SyntaxKind.AnyKeyword), node); } @@ -5697,6 +5715,9 @@ namespace ts { ); } } + if (isTypeReferenceNode(node) && isInJSDoc(node) && (getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName(getTypeReferenceName(node), SymbolFlags.Type, /*ignoreErrors*/ true))) { + return setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node); + } if (isLiteralImportTypeNode(node)) { return factory.updateImportTypeNode( node, @@ -6023,6 +6044,7 @@ namespace ts { } } + // Synthesize declarations for a symbol - might be an Interface, a Class, a Namespace, a Type, a Variable (const, let, or var), an Alias // or a merge of some number of those. // An interesting challenge is ensuring that when classes merge with namespaces and interfaces, is keeping @@ -6398,7 +6420,10 @@ namespace ts { const baseTypes = getBaseTypes(classType); const implementsTypes = getImplementsTypes(classType); const staticType = getTypeOfSymbol(symbol); - const staticBaseType = getBaseConstructorTypeOfClass(staticType as InterfaceType); + const isClass = !!staticType.symbol?.valueDeclaration && isClassLike(staticType.symbol.valueDeclaration); + const staticBaseType = isClass + ? getBaseConstructorTypeOfClass(staticType as InterfaceType) + : anyType; const heritageClauses = [ ...!length(baseTypes) ? [] : [factory.createHeritageClause(SyntaxKind.ExtendsKeyword, map(baseTypes, b => serializeBaseType(b, staticBaseType, localName)))], ...!length(implementsTypes) ? [] : [factory.createHeritageClause(SyntaxKind.ImplementsKeyword, map(implementsTypes, b => serializeBaseType(b, staticBaseType, localName)))] @@ -6434,7 +6459,17 @@ namespace ts { const staticMembers = flatMap( filter(getPropertiesOfType(staticType), p => !(p.flags & SymbolFlags.Prototype) && p.escapedName !== "prototype" && !isNamespaceMember(p)), p => serializePropertySymbolForClass(p, /*isStatic*/ true, staticBaseType)); - const constructors = serializeSignatures(SignatureKind.Construct, staticType, baseTypes[0], SyntaxKind.Constructor) as ConstructorDeclaration[]; + // When we encounter an `X.prototype.y` assignment in a JS file, we bind `X` as a class regardless as to whether + // the value is ever initialized with a class or function-like value. For cases where `X` could never be + // created via `new`, we will inject a `private constructor()` declaration to indicate it is not createable. + const isNonConstructableClassLikeInJsFile = + !isClass && + !!symbol.valueDeclaration && + isInJSFile(symbol.valueDeclaration) && + !some(getSignaturesOfType(staticType, SignatureKind.Construct)); + const constructors = isNonConstructableClassLikeInJsFile ? + [factory.createConstructorDeclaration(/*decorators*/ undefined, factory.createModifiersFromModifierFlags(ModifierFlags.Private), [], /*body*/ undefined)] : + serializeSignatures(SignatureKind.Construct, staticType, baseTypes[0], SyntaxKind.Constructor) as ConstructorDeclaration[]; const indexSignatures = serializeIndexSignatures(classType, baseTypes[0]); addResult(setTextRange(factory.createClassDeclaration( /*decorators*/ undefined, @@ -7673,7 +7708,7 @@ namespace ts { if (isPropertyDeclaration(declaration) && (noImplicitAny || isInJSFile(declaration))) { // We have a property declaration with no type annotation or initializer, in noImplicitAny mode or a .js file. - // Use control flow analysis of this.xxx assignments the constructor to determine the type of the property. + // Use control flow analysis of this.xxx assignments in the constructor to determine the type of the property. const constructor = findConstructorDeclaration(declaration.parent); const type = constructor ? getFlowTypeInConstructor(declaration.symbol, constructor) : getEffectiveModifierFlags(declaration) & ModifierFlags.Ambient ? getTypeOfPropertyInBaseClass(declaration.symbol) : @@ -7698,7 +7733,7 @@ namespace ts { } function isConstructorDeclaredProperty(symbol: Symbol) { - // A propery is considered a constructor declared property when all declaration sites are this.xxx assignments, + // A property is considered a constructor declared property when all declaration sites are this.xxx assignments, // when no declaration sites have JSDoc type annotations, and when at least one declaration site is in the body of // a class constructor. if (symbol.valueDeclaration && isBinaryExpression(symbol.valueDeclaration)) { @@ -10280,7 +10315,7 @@ namespace ts { } function getPropertiesOfType(type: Type): Symbol[] { - type = getApparentType(getReducedType(type)); + type = getReducedApparentType(type); return type.flags & TypeFlags.UnionOrIntersection ? getPropertiesOfUnionOrIntersectionType(type) : getPropertiesOfObjectType(type); @@ -10636,6 +10671,14 @@ namespace ts { t; } + function getReducedApparentType(type: Type): Type { + // Since getApparentType may return a non-reduced union or intersection type, we need to perform + // type reduction both before and after obtaining the apparent type. For example, given a type parameter + // 'T extends A | B', the type 'T & X' becomes 'A & X | B & X' after obtaining the apparent type, and + // that type may need further reduction to remove empty intersections. + return getReducedType(getApparentType(getReducedType(type))); + } + function createUnionOrIntersectionProperty(containingType: UnionOrIntersectionType, name: __String): Symbol | undefined { let singleProp: Symbol | undefined; let propSet: Map | undefined; @@ -10857,7 +10900,7 @@ namespace ts { * @param name a name of property to look up in a given type */ function getPropertyOfType(type: Type, name: __String): Symbol | undefined { - type = getApparentType(getReducedType(type)); + type = getReducedApparentType(type); if (type.flags & TypeFlags.Object) { const resolved = resolveStructuredTypeMembers(type); const symbol = resolved.members.get(name); @@ -10895,7 +10938,7 @@ namespace ts { * maps primitive types and type parameters are to their apparent types. */ function getSignaturesOfType(type: Type, kind: SignatureKind): readonly Signature[] { - return getSignaturesOfStructuredType(getApparentType(getReducedType(type)), kind); + return getSignaturesOfStructuredType(getReducedApparentType(type), kind); } function getIndexInfoOfStructuredType(type: Type, kind: IndexKind): IndexInfo | undefined { @@ -10913,13 +10956,13 @@ namespace ts { // Return the indexing info of the given kind in the given type. Creates synthetic union index types when necessary and // maps primitive types and type parameters are to their apparent types. function getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined { - return getIndexInfoOfStructuredType(getApparentType(getReducedType(type)), kind); + return getIndexInfoOfStructuredType(getReducedApparentType(type), kind); } // Return the index type of the given kind in the given type. Creates synthetic union index types when necessary and // maps primitive types and type parameters are to their apparent types. function getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined { - return getIndexTypeOfStructuredType(getApparentType(getReducedType(type)), kind); + return getIndexTypeOfStructuredType(getReducedApparentType(type), kind); } function getImplicitIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined { @@ -13293,7 +13336,7 @@ namespace ts { // In the following we resolve T[K] to the type of the property in T selected by K. // We treat boolean as different from other unions to improve errors; // skipping straight to getPropertyTypeForIndexType gives errors with 'boolean' instead of 'true'. - const apparentObjectType = getApparentType(getReducedType(objectType)); + const apparentObjectType = getReducedApparentType(objectType); if (indexType.flags & TypeFlags.Union && !(indexType.flags & TypeFlags.Boolean)) { const propTypes: Type[] = []; let wasMissingProp = false; @@ -23668,7 +23711,7 @@ namespace ts { for (const right of getPropertiesOfType(type)) { const left = props.get(right.escapedName); const rightType = getTypeOfSymbol(right); - if (left && !maybeTypeOfKind(rightType, TypeFlags.Nullable) && !(maybeTypeOfKind(rightType, TypeFlags.Any) && right.flags & SymbolFlags.Optional)) { + if (left && !maybeTypeOfKind(rightType, TypeFlags.Nullable) && !(maybeTypeOfKind(rightType, TypeFlags.AnyOrUnknown) && right.flags & SymbolFlags.Optional)) { const diagnostic = error(left.valueDeclaration, Diagnostics._0_is_specified_more_than_once_so_this_usage_will_be_overwritten, unescapeLeadingUnderscores(left.escapedName)); addRelatedInfo(diagnostic, createDiagnosticForNode(spread, Diagnostics.This_spread_always_overwrites_this_property)); } @@ -34455,7 +34498,7 @@ namespace ts { // If we hit an import declaration in an illegal context, just bail out to avoid cascading errors. return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasSyntacticModifiers(node)) { + if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_import_declaration_cannot_have_modifiers); } if (checkExternalImportOrExportDeclaration(node)) { @@ -34521,7 +34564,7 @@ namespace ts { return; } - if (!checkGrammarDecoratorsAndModifiers(node) && hasSyntacticModifiers(node)) { + if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_declaration_cannot_have_modifiers); } @@ -34644,7 +34687,7 @@ namespace ts { return; } // Grammar checking - if (!checkGrammarDecoratorsAndModifiers(node) && hasSyntacticModifiers(node)) { + if (!checkGrammarDecoratorsAndModifiers(node) && hasEffectiveModifiers(node)) { grammarErrorOnFirstToken(node, Diagnostics.An_export_assignment_cannot_have_modifiers); } if (node.expression.kind === SyntaxKind.Identifier) { @@ -37223,7 +37266,7 @@ namespace ts { if (parameter.dotDotDotToken) { return grammarErrorOnNode(parameter.dotDotDotToken, Diagnostics.An_index_signature_cannot_have_a_rest_parameter); } - if (hasSyntacticModifiers(parameter)) { + if (hasEffectiveModifiers(parameter)) { return grammarErrorOnNode(parameter.name, Diagnostics.An_index_signature_parameter_cannot_have_an_accessibility_modifier); } if (parameter.questionToken) { diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 2841b80aedf..63e293f2e8f 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -129,6 +129,22 @@ namespace ts { return map; } + /** + * Creates a new array with `element` interspersed in between each element of `input` + * if there is more than 1 value in `input`. Otherwise, returns the existing array. + */ + export function intersperse(input: T[], element: T): T[] { + if (input.length <= 1) { + return input; + } + const result: T[] = []; + for (let i = 0, n = input.length; i < n; i++) { + if (i) result.push(element); + result.push(input[i]); + } + return result; + } + /** * Iterates through `array` by index and performs the callback on each element of array until the callback * returns a falsey value, then returns false. diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 78c047a5e4a..2dfabe540ad 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -4911,6 +4911,14 @@ "category": "Error", "code": 8032 }, + "A JSDoc '@typedef' comment may not contain multiple '@type' tags.": { + "category": "Error", + "code": 8033 + }, + "The tag was first specified here.": { + "category": "Error", + "code": 8034 + }, "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clause.": { "category": "Error", "code": 9002 @@ -5649,7 +5657,7 @@ "category": "Message", "code": 95111 }, - "Remove block body braces": { + "Remove braces from arrow function body": { "category": "Message", "code": 95112 }, @@ -5661,7 +5669,7 @@ "category": "Message", "code": 95114 }, - "Remove all incorrect body block braces": { + "Remove braces from all arrow function bodies with relevant issues": { "category": "Message", "code": 95115 }, @@ -5669,7 +5677,7 @@ "category": "Message", "code": 95116 }, - + "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer.": { "category": "Error", "code": 18004 diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index d8bd85c10f5..63e26f2b274 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -7566,6 +7566,14 @@ namespace ts { hasChildren = true; if (child.kind === SyntaxKind.JSDocTypeTag) { if (childTypeTag) { + parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags); + const lastError = lastOrUndefined(parseDiagnostics); + if (lastError) { + addRelatedInfo( + lastError, + createDetachedDiagnostic(fileName, 0, 0, Diagnostics.The_tag_was_first_specified_here) + ); + } break; } else { diff --git a/src/compiler/transformers/module/module.ts b/src/compiler/transformers/module/module.ts index 6071b2a78cf..83522c44a38 100644 --- a/src/compiler/transformers/module/module.ts +++ b/src/compiler/transformers/module/module.ts @@ -1867,7 +1867,7 @@ namespace ts { text: ` var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); - }` + };` }; function createExportStarHelper(context: TransformationContext, module: Expression) { diff --git a/src/compiler/transformers/taggedTemplate.ts b/src/compiler/transformers/taggedTemplate.ts index 5ab91a8e76b..b06b12f33b2 100644 --- a/src/compiler/transformers/taggedTemplate.ts +++ b/src/compiler/transformers/taggedTemplate.ts @@ -65,7 +65,7 @@ namespace ts { } function createTemplateCooked(template: TemplateHead | TemplateMiddle | TemplateTail | NoSubstitutionTemplateLiteral) { - return template.templateFlags ? factory.createIdentifier("undefined") : factory.createStringLiteral(template.text); + return template.templateFlags ? factory.createVoidZero() : factory.createStringLiteral(template.text); } /** diff --git a/src/harness/vfsUtil.ts b/src/harness/vfsUtil.ts index bfc29d2d4e9..88fc73ebca9 100644 --- a/src/harness/vfsUtil.ts +++ b/src/harness/vfsUtil.ts @@ -649,15 +649,14 @@ namespace vfs { * * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module. */ - public readFileSync(path: string, encoding: string): string; + public readFileSync(path: string, encoding: BufferEncoding): string; /** * Read from a file. * * NOTE: do not rename this method as it is intended to align with the same named export of the "fs" module. */ - public readFileSync(path: string, encoding?: string | null): string | Buffer; - public readFileSync(path: string, encoding: string | null = null) { // eslint-disable-line no-null/no-null - ts.Debug.assert(encoding === null || Buffer.isEncoding(encoding)); // eslint-disable-line no-null/no-null + public readFileSync(path: string, encoding?: BufferEncoding | null): string | Buffer; + public readFileSync(path: string, encoding: BufferEncoding | null = null) { // eslint-disable-line no-null/no-null const { node } = this._walk(this._resolve(path)); if (!node) throw createIOError("ENOENT"); if (isDirectory(node)) throw createIOError("EISDIR"); diff --git a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl index affaf8077f6..92422802668 100644 --- a/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/fra/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3729,6 +3729,12 @@ + + + + + + @@ -4713,6 +4719,15 @@ + + + + + + + + + @@ -5163,6 +5178,15 @@ + + + + + + + + + @@ -8733,6 +8757,15 @@ + + + ']]> + + ']]> + + + + @@ -10299,11 +10332,11 @@ - + - type.]]> + type. Did you mean to write 'Promise<{0}>'?]]> - global.]]> + . Vouliez-vous vraiment écrire 'Promise<{0}>' ?]]> diff --git a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl index 88268cdbb56..d78cb7db9af 100644 --- a/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ita/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3717,6 +3717,12 @@ + + + + + + @@ -4701,6 +4707,15 @@ + + + + + + + + + @@ -5151,6 +5166,15 @@ + + + + + + + + + @@ -8721,6 +8745,15 @@ + + + ']]> + + ']]> + + + + @@ -10287,11 +10320,11 @@ - + - type.]]> + type. Did you mean to write 'Promise<{0}>'?]]> - .]]> + . Si intendeva scrivere 'Promise<{0}>'?]]> diff --git a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl index f4286521ef6..12e2189024d 100644 --- a/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/jpn/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3717,6 +3717,12 @@ + + + + + + @@ -4701,6 +4707,15 @@ + + + + + + + + + @@ -5151,6 +5166,15 @@ + + + + + + + + + @@ -8721,6 +8745,15 @@ + + + ']]> + + ' に置き換える]]> + + + + @@ -10287,11 +10320,11 @@ - + - type.]]> + type. Did you mean to write 'Promise<{0}>'?]]> - 型である必要があります。]]> + 型である必要があります。'Promise<{0}>' と書き込むつもりでしたか?]]> diff --git a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl index 1965a850988..3909794c3f6 100644 --- a/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/plk/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3710,6 +3710,9 @@ + + + diff --git a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl index aa1a21e275f..14887d133d9 100644 --- a/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/ptb/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -3710,6 +3710,15 @@ + + + + + + + + + diff --git a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl index 49bad292a5a..e62a54ac190 100644 --- a/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl +++ b/src/loc/lcl/rus/diagnosticMessages/diagnosticMessages.generated.json.lcl @@ -5168,6 +5168,9 @@ + + + diff --git a/src/server/editorServices.ts b/src/server/editorServices.ts index d314a80e508..d89cfcb1d40 100644 --- a/src/server/editorServices.ts +++ b/src/server/editorServices.ts @@ -1743,7 +1743,9 @@ namespace ts.server { return project?.isSolution() ? project.getDefaultChildProjectFromSolution(info) : - project; + project && projectContainsInfoDirectly(project, info) ? + project : + undefined; } /** diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index 0a7a339e5f4..335e283276c 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -270,7 +270,6 @@ namespace ts.server { } } - /*@internal*/ export function isDynamicFileName(fileName: NormalizedPath) { return fileName[0] === "^" || ((stringContains(fileName, "walkThroughSnippet:/") || stringContains(fileName, "untitled:/")) && diff --git a/src/services/codefixes/returnValueCorrect.ts b/src/services/codefixes/returnValueCorrect.ts index a4cb05b8ff1..39bcbe35a71 100644 --- a/src/services/codefixes/returnValueCorrect.ts +++ b/src/services/codefixes/returnValueCorrect.ts @@ -2,7 +2,7 @@ namespace ts.codefix { const fixId = "returnValueCorrect"; const fixIdAddReturnStatement = "fixAddReturnStatement"; - const fixIdRemoveBlockBodyBrace = "fixRemoveBlockBodyBrace"; + const fixRemoveBracesFromArrowFunctionBody = "fixRemoveBracesFromArrowFunctionBody"; const fixIdWrapTheBlockWithParen = "fixWrapTheBlockWithParen"; const errorCodes = [ Diagnostics.A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value.code, @@ -35,7 +35,7 @@ namespace ts.codefix { registerCodeFix({ errorCodes, - fixIds: [fixIdAddReturnStatement, fixIdRemoveBlockBodyBrace, fixIdWrapTheBlockWithParen], + fixIds: [fixIdAddReturnStatement, fixRemoveBracesFromArrowFunctionBody, fixIdWrapTheBlockWithParen], getCodeActions: context => { const { program, sourceFile, span: { start }, errorCode } = context; const info = getInfo(program.getTypeChecker(), sourceFile, start, errorCode); @@ -44,7 +44,7 @@ namespace ts.codefix { if (info.kind === ProblemKind.MissingReturnStatement) { return append( [getActionForfixAddReturnStatement(context, info.expression, info.statement)], - isArrowFunction(info.declaration) ? getActionForfixRemoveBlockBodyBrace(context, info.declaration, info.expression, info.commentSource): undefined); + isArrowFunction(info.declaration) ? getActionForFixRemoveBracesFromArrowFunctionBody(context, info.declaration, info.expression, info.commentSource): undefined); } else { return [getActionForfixWrapTheBlockWithParen(context, info.declaration, info.expression)]; @@ -58,7 +58,7 @@ namespace ts.codefix { case fixIdAddReturnStatement: addReturnStatement(changes, diag.file, info.expression, info.statement); break; - case fixIdRemoveBlockBodyBrace: + case fixRemoveBracesFromArrowFunctionBody: if (!isArrowFunction(info.declaration)) return undefined; removeBlockBodyBrace(changes, diag.file, info.declaration, info.expression, info.commentSource, /* withParen */ false); break; @@ -232,9 +232,9 @@ namespace ts.codefix { return createCodeFixAction(fixId, changes, Diagnostics.Add_a_return_statement, fixIdAddReturnStatement, Diagnostics.Add_all_missing_return_statement); } - function getActionForfixRemoveBlockBodyBrace(context: CodeFixContext, declaration: ArrowFunction, expression: Expression, commentSource: Node) { + function getActionForFixRemoveBracesFromArrowFunctionBody(context: CodeFixContext, declaration: ArrowFunction, expression: Expression, commentSource: Node) { const changes = textChanges.ChangeTracker.with(context, t => removeBlockBodyBrace(t, context.sourceFile, declaration, expression, commentSource, /* withParen */ false)); - return createCodeFixAction(fixId, changes, Diagnostics.Remove_block_body_braces, fixIdRemoveBlockBodyBrace, Diagnostics.Remove_all_incorrect_body_block_braces); + return createCodeFixAction(fixId, changes, Diagnostics.Remove_braces_from_arrow_function_body, fixRemoveBracesFromArrowFunctionBody, Diagnostics.Remove_braces_from_all_arrow_function_bodies_with_relevant_issues); } function getActionForfixWrapTheBlockWithParen(context: CodeFixContext, declaration: ArrowFunction, expression: Expression) { diff --git a/src/services/completions.ts b/src/services/completions.ts index 0a436e41154..8b9228d3441 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -875,7 +875,7 @@ namespace ts.Completions { // * |c| // */ const lineStart = getLineStartPositionForPosition(position, sourceFile); - if (!(sourceFile.text.substring(lineStart, position).match(/[^\*|\s|(/\*\*)]/))) { + if (!/[^\*|\s(/)]/.test(sourceFile.text.substring(lineStart, position))) { return { kind: CompletionDataKind.JsDocTag }; } } @@ -2414,7 +2414,7 @@ namespace ts.Completions { } // do not filter it out if the static presence doesnt match - if (hasSyntacticModifier(m, ModifierFlags.Static) !== !!(currentClassElementModifierFlags & ModifierFlags.Static)) { + if (hasEffectiveModifier(m, ModifierFlags.Static) !== !!(currentClassElementModifierFlags & ModifierFlags.Static)) { continue; } diff --git a/src/services/jsDoc.ts b/src/services/jsDoc.ts index 63297c7868d..3115109572a 100644 --- a/src/services/jsDoc.ts +++ b/src/services/jsDoc.ts @@ -89,17 +89,14 @@ namespace ts.JsDoc { // Eg. const a: Array | Array; a.length // The property length will have two declarations of property length coming // from Array - Array and Array - const documentationComment: SymbolDisplayPart[] = []; + const documentationComment: string[] = []; forEachUnique(declarations, declaration => { for (const { comment } of getCommentHavingNodes(declaration)) { if (comment === undefined) continue; - if (documentationComment.length) { - documentationComment.push(lineBreakPart()); - } - documentationComment.push(textPart(comment)); + pushIfUnique(documentationComment, comment); } }); - return documentationComment; + return intersperse(map(documentationComment, textPart), lineBreakPart()); } function getCommentHavingNodes(declaration: Declaration): readonly (JSDoc | JSDocTag)[] { diff --git a/src/services/navigationBar.ts b/src/services/navigationBar.ts index 55c2d41728a..2f0e5f92c15 100644 --- a/src/services/navigationBar.ts +++ b/src/services/navigationBar.ts @@ -307,7 +307,18 @@ namespace ts.NavigationBar { addNodeWithRecursiveChild(node, getInteriorModule(node).body); break; - case SyntaxKind.ExportAssignment: + case SyntaxKind.ExportAssignment: { + const expression = (node).expression; + if (isObjectLiteralExpression(expression)) { + startNode(node); + addChildrenRecursively(expression); + endNode(); + } + else { + addLeafNode(node); + } + break; + } case SyntaxKind.ExportSpecifier: case SyntaxKind.ImportEqualsDeclaration: case SyntaxKind.IndexSignature: diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index 568d75e542d..7f3028c2c6f 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -200,6 +200,7 @@ namespace ts.OutliningElementsCollector { case SyntaxKind.EnumDeclaration: case SyntaxKind.CaseBlock: case SyntaxKind.TypeLiteral: + case SyntaxKind.ObjectBindingPattern: return spanForNode(n); case SyntaxKind.TupleType: return spanForNode(n, /*autoCollapse*/ false, /*useFullStart*/ !isTupleTypeNode(n.parent), SyntaxKind.OpenBracketToken); diff --git a/src/services/refactors/extractSymbol.ts b/src/services/refactors/extractSymbol.ts index b88189046f0..dad4884847c 100644 --- a/src/services/refactors/extractSymbol.ts +++ b/src/services/refactors/extractSymbol.ts @@ -405,24 +405,24 @@ namespace ts.refactor.extractSymbol { rangeFacts |= RangeFacts.UsesThis; } break; + case SyntaxKind.ClassDeclaration: + case SyntaxKind.FunctionDeclaration: + if (isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { + // You cannot extract global declarations + (errors || (errors = [] as Diagnostic[])).push(createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); + } + // falls through + case SyntaxKind.ClassExpression: + case SyntaxKind.FunctionExpression: + case SyntaxKind.MethodDeclaration: + case SyntaxKind.Constructor: + case SyntaxKind.GetAccessor: + case SyntaxKind.SetAccessor: + // do not dive into functions (except arrow functions) or classes + return false; } - if (isFunctionLikeDeclaration(node) || isClassLike(node)) { - switch (node.kind) { - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.ClassDeclaration: - if (isSourceFile(node.parent) && node.parent.externalModuleIndicator === undefined) { - // You cannot extract global declarations - (errors || (errors = [] as Diagnostic[])).push(createDiagnosticForNode(node, Messages.functionWillNotBeVisibleInTheNewScope)); - } - break; - } - - // do not dive into functions or classes - return false; - } const savedPermittedJumps = permittedJumps; - switch (node.kind) { case SyntaxKind.IfStatement: permittedJumps = PermittedJumps.None; diff --git a/src/services/refactors/generateGetAccessorAndSetAccessor.ts b/src/services/refactors/generateGetAccessorAndSetAccessor.ts index 66c592d46e5..02ee8aeba48 100644 --- a/src/services/refactors/generateGetAccessorAndSetAccessor.ts +++ b/src/services/refactors/generateGetAccessorAndSetAccessor.ts @@ -41,7 +41,6 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor { const fieldInfo = getConvertibleFieldAtPosition(context); if (!fieldInfo) return undefined; - const isJS = isSourceFileJS(file); const changeTracker = textChanges.ChangeTracker.fromContext(context); const { isStatic, isReadonly, fieldName, accessorName, originalName, type, container, declaration, renameAccessor } = fieldInfo; @@ -50,15 +49,20 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor { suppressLeadingAndTrailingTrivia(declaration); suppressLeadingAndTrailingTrivia(container); - const isInClassLike = isClassLike(container); - // avoid Readonly modifier because it will convert to get accessor - const modifierFlags = getEffectiveModifierFlags(declaration) & ~ModifierFlags.Readonly; - const accessorModifiers = isInClassLike - ? !modifierFlags || modifierFlags & ModifierFlags.Private - ? getModifiers(isJS, isStatic, SyntaxKind.PublicKeyword) - : factory.createNodeArray(factory.createModifiersFromModifierFlags(modifierFlags)) - : undefined; - const fieldModifiers = isInClassLike ? getModifiers(isJS, isStatic, SyntaxKind.PrivateKeyword) : undefined; + let accessorModifiers: ModifiersArray | undefined; + let fieldModifiers: ModifiersArray | undefined; + if (isClassLike(container)) { + const modifierFlags = getEffectiveModifierFlags(declaration); + if (isSourceFileJS(file)) { + const modifiers = createModifiers(modifierFlags); + accessorModifiers = modifiers; + fieldModifiers = modifiers; + } + else { + accessorModifiers = createModifiers(prepareModifierFlagsForAccessor(modifierFlags)); + fieldModifiers = createModifiers(prepareModifierFlagsForField(modifierFlags)); + } + } updateFieldDeclaration(changeTracker, file, declaration, fieldName, fieldModifiers); @@ -105,12 +109,26 @@ namespace ts.refactor.generateGetAccessorAndSetAccessor { return isIdentifier(fieldName) ? factory.createPropertyAccess(leftHead, fieldName) : factory.createElementAccess(leftHead, factory.createStringLiteralFromNode(fieldName)); } - function getModifiers(isJS: boolean, isStatic: boolean, accessModifier: SyntaxKind.PublicKeyword | SyntaxKind.PrivateKeyword): NodeArray | undefined { - const modifiers = append( - !isJS ? [factory.createModifier(accessModifier) as Token | Token] : undefined, - isStatic ? factory.createModifier(SyntaxKind.StaticKeyword) : undefined - ); - return modifiers && factory.createNodeArray(modifiers); + function createModifiers(modifierFlags: ModifierFlags): ModifiersArray | undefined { + return modifierFlags ? factory.createNodeArray(factory.createModifiersFromModifierFlags(modifierFlags)) : undefined; + } + + function prepareModifierFlagsForAccessor(modifierFlags: ModifierFlags): ModifierFlags { + modifierFlags &= ~ModifierFlags.Readonly; // avoid Readonly modifier because it will convert to get accessor + modifierFlags &= ~ModifierFlags.Private; + + if (!(modifierFlags & ModifierFlags.Protected)) { + modifierFlags |= ModifierFlags.Public; + } + + return modifierFlags; + } + + function prepareModifierFlagsForField(modifierFlags: ModifierFlags): ModifierFlags { + modifierFlags &= ~ModifierFlags.Public; + modifierFlags &= ~ModifierFlags.Protected; + modifierFlags |= ModifierFlags.Private; + return modifierFlags; } function getConvertibleFieldAtPosition(context: RefactorContext): Info | undefined { diff --git a/src/testRunner/unittests/tsbuild/watchMode.ts b/src/testRunner/unittests/tsbuild/watchMode.ts index 308c229776d..69faba35c31 100644 --- a/src/testRunner/unittests/tsbuild/watchMode.ts +++ b/src/testRunner/unittests/tsbuild/watchMode.ts @@ -15,6 +15,13 @@ namespace ts.tscWatch { return ts.createSolutionBuilder(host, rootNames, defaultOptions || {}); } + export function ensureErrorFreeBuild(host: WatchedSystem, rootNames: readonly string[]) { + // ts build should succeed + const solutionBuilder = createSolutionBuilder(host, rootNames, {}); + solutionBuilder.build(); + assert.equal(host.getOutput().length, 0, JSON.stringify(host.getOutput(), /*replacer*/ undefined, " ")); + } + type OutputFileStamp = [string, Date | undefined, boolean]; function transformOutputToOutputFileStamp(f: string, host: TsBuildWatchSystem): OutputFileStamp { return [f, host.getModifiedTime(f), host.writtenFiles.has(host.toFullPath(f))] as OutputFileStamp; diff --git a/src/testRunner/unittests/tsserver/configuredProjects.ts b/src/testRunner/unittests/tsserver/configuredProjects.ts index 4c61106a1d6..b8ec47946a3 100644 --- a/src/testRunner/unittests/tsserver/configuredProjects.ts +++ b/src/testRunner/unittests/tsserver/configuredProjects.ts @@ -1050,6 +1050,64 @@ declare var console: { }); }); }); + + it("when default configured project does not contain the file", () => { + const barConfig: File = { + path: `${tscWatch.projectRoot}/bar/tsconfig.json`, + content: "{}" + }; + const barIndex: File = { + path: `${tscWatch.projectRoot}/bar/index.ts`, + content: `import {foo} from "../foo/lib"; +foo();` + }; + const fooBarConfig: File = { + path: `${tscWatch.projectRoot}/foobar/tsconfig.json`, + content: barConfig.path + }; + const fooBarIndex: File = { + path: `${tscWatch.projectRoot}/foobar/index.ts`, + content: barIndex.content + }; + const fooConfig: File = { + path: `${tscWatch.projectRoot}/foo/tsconfig.json`, + content: JSON.stringify({ + include: ["index.ts"], + compilerOptions: { + declaration: true, + outDir: "lib" + } + }) + }; + const fooIndex: File = { + path: `${tscWatch.projectRoot}/foo/index.ts`, + content: `export function foo() {}` + }; + const host = createServerHost([barConfig, barIndex, fooBarConfig, fooBarIndex, fooConfig, fooIndex, libFile]); + tscWatch.ensureErrorFreeBuild(host, [fooConfig.path]); + const fooDts = `${tscWatch.projectRoot}/foo/lib/index.d.ts`; + assert.isTrue(host.fileExists(fooDts)); + const session = createSession(host); + const service = session.getProjectService(); + service.openClientFile(barIndex.path); + checkProjectActualFiles(service.configuredProjects.get(barConfig.path)!, [barIndex.path, fooDts, libFile.path, barConfig.path]); + service.openClientFile(fooBarIndex.path); + checkProjectActualFiles(service.configuredProjects.get(fooBarConfig.path)!, [fooBarIndex.path, fooDts, libFile.path, fooBarConfig.path]); + service.openClientFile(fooIndex.path); + checkProjectActualFiles(service.configuredProjects.get(fooConfig.path)!, [fooIndex.path, libFile.path, fooConfig.path]); + service.openClientFile(fooDts); + session.executeCommandSeq({ + command: protocol.CommandTypes.GetApplicableRefactors, + arguments: { + file: fooDts, + startLine: 1, + startOffset: 1, + endLine: 1, + endOffset: 1 + } + }); + assert.equal(service.tryGetDefaultProjectForFile(server.toNormalizedPath(fooDts)), service.configuredProjects.get(barConfig.path)); + }); }); describe("unittests:: tsserver:: ConfiguredProjects:: non-existing directories listed in config file input array", () => { diff --git a/src/testRunner/unittests/tsserver/projectReferenceCompileOnSave.ts b/src/testRunner/unittests/tsserver/projectReferenceCompileOnSave.ts index e8442e07e69..e4301b3c271 100644 --- a/src/testRunner/unittests/tsserver/projectReferenceCompileOnSave.ts +++ b/src/testRunner/unittests/tsserver/projectReferenceCompileOnSave.ts @@ -469,9 +469,7 @@ ${appendDts}` const host = createServerHost([libFile, tsbaseJson, buttonConfig, buttonSource, siblingConfig, siblingSource], { useCaseSensitiveFileNames: true }); // ts build should succeed - const solutionBuilder = tscWatch.createSolutionBuilder(host, [siblingConfig.path], {}); - solutionBuilder.build(); - assert.equal(host.getOutput().length, 0, JSON.stringify(host.getOutput(), /*replacer*/ undefined, " ")); + tscWatch.ensureErrorFreeBuild(host, [siblingConfig.path]); const sourceJs = changeExtension(siblingSource.path, ".js"); const expectedSiblingJs = host.readFile(sourceJs); diff --git a/src/testRunner/unittests/tsserver/projectReferences.ts b/src/testRunner/unittests/tsserver/projectReferences.ts index 2eb7d7710ce..8da081d82c1 100644 --- a/src/testRunner/unittests/tsserver/projectReferences.ts +++ b/src/testRunner/unittests/tsserver/projectReferences.ts @@ -2,12 +2,8 @@ namespace ts.projectSystem { describe("unittests:: tsserver:: with project references and tsbuild", () => { function createHost(files: readonly TestFSWithWatch.FileOrFolderOrSymLink[], rootNames: readonly string[]) { const host = createServerHost(files); - // ts build should succeed - const solutionBuilder = tscWatch.createSolutionBuilder(host, rootNames, {}); - solutionBuilder.build(); - assert.equal(host.getOutput().length, 0, JSON.stringify(host.getOutput(), /*replacer*/ undefined, " ")); - + tscWatch.ensureErrorFreeBuild(host, rootNames); return host; } diff --git a/tests/baselines/reference/ambientShorthand_reExport.js b/tests/baselines/reference/ambientShorthand_reExport.js index 56a8cbaa427..5d8b1ff9dfd 100644 --- a/tests/baselines/reference/ambientShorthand_reExport.js +++ b/tests/baselines/reference/ambientShorthand_reExport.js @@ -39,7 +39,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("jquery"), exports); //// [reExportUser.js] diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 095d043a7dc..49b2921255a 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -8906,6 +8906,7 @@ declare namespace ts.server { svc: number; text: number; } + function isDynamicFileName(fileName: NormalizedPath): boolean; class ScriptInfo { private readonly host; readonly fileName: NormalizedPath; diff --git a/tests/baselines/reference/declarationEmitAliasExportStar.js b/tests/baselines/reference/declarationEmitAliasExportStar.js index e4dc99a7074..8cd03b75e7c 100644 --- a/tests/baselines/reference/declarationEmitAliasExportStar.js +++ b/tests/baselines/reference/declarationEmitAliasExportStar.js @@ -23,7 +23,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./thingB"), exports); //// [index.js] diff --git a/tests/baselines/reference/declarationEmitExportAssignedNamespaceNoTripleSlashTypesReference.js b/tests/baselines/reference/declarationEmitExportAssignedNamespaceNoTripleSlashTypesReference.js index 8f147063de0..1e6e0c58f64 100644 --- a/tests/baselines/reference/declarationEmitExportAssignedNamespaceNoTripleSlashTypesReference.js +++ b/tests/baselines/reference/declarationEmitExportAssignedNamespaceNoTripleSlashTypesReference.js @@ -66,7 +66,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("@emotion/core"), exports); diff --git a/tests/baselines/reference/declarationEmitReexportedSymlinkReference.js b/tests/baselines/reference/declarationEmitReexportedSymlinkReference.js index 930ab97bfec..99ad86960e2 100644 --- a/tests/baselines/reference/declarationEmitReexportedSymlinkReference.js +++ b/tests/baselines/reference/declarationEmitReexportedSymlinkReference.js @@ -60,7 +60,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./keys"), exports); diff --git a/tests/baselines/reference/declarationEmitReexportedSymlinkReference2.js b/tests/baselines/reference/declarationEmitReexportedSymlinkReference2.js index ccda718f60c..50c0ddb6f96 100644 --- a/tests/baselines/reference/declarationEmitReexportedSymlinkReference2.js +++ b/tests/baselines/reference/declarationEmitReexportedSymlinkReference2.js @@ -63,7 +63,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./keys"), exports); diff --git a/tests/baselines/reference/declarationEmitReexportedSymlinkReference3.js b/tests/baselines/reference/declarationEmitReexportedSymlinkReference3.js index 3f27689c985..f83c0e0daf3 100644 --- a/tests/baselines/reference/declarationEmitReexportedSymlinkReference3.js +++ b/tests/baselines/reference/declarationEmitReexportedSymlinkReference3.js @@ -60,7 +60,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./keys"), exports); diff --git a/tests/baselines/reference/docker/office-ui-fabric.log b/tests/baselines/reference/docker/office-ui-fabric.log index a130c29396c..3a8ae0d4b9b 100644 --- a/tests/baselines/reference/docker/office-ui-fabric.log +++ b/tests/baselines/reference/docker/office-ui-fabric.log @@ -1,5 +1,13 @@ Exit Code: 1 Standard output: +@uifabric/tslint-rules: yarn run vX.X.X +@uifabric/tslint-rules: $ just-scripts build +@uifabric/tslint-rules: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts] +@uifabric/tslint-rules: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/tslint-rules/tsconfig.json +@uifabric/tslint-rules: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib --module esnext --project "/office-ui-fabric-react/packages/tslint-rules/tsconfig.json" +@uifabric/tslint-rules: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/tslint-rules/tsconfig.json +@uifabric/tslint-rules: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/tslint-rules/tsconfig.json" +@uifabric/tslint-rules: Done in ?s. @fluentui/ability-attributes: yarn run vX.X.X @fluentui/ability-attributes: $ npm run schema && gulp bundle:package:no-umd @fluentui/ability-attributes: > @fluentui/ability-attributes@X.X.X schema /office-ui-fabric-react/packages/fluentui/ability-attributes @@ -11,6 +19,37 @@ Standard output: Standard error: info cli using local version of lerna +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'cat' of module exports inside circular dependency +@uifabric/tslint-rules: (Use `node --trace-warnings ...` to show where the warning was created) +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'cd' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'chmod' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'cp' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'dirs' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'pushd' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'popd' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'echo' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'tempdir' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'pwd' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'exec' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'ls' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'find' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'grep' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'head' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'ln' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'mkdir' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'rm' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'mv' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'sed' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'set' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'sort' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'tail' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'test' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'to' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'toEnd' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'touch' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'uniq' of module exports inside circular dependency +@uifabric/tslint-rules: (node:28) Warning: Accessing non-existent property 'which' of module exports inside circular dependency +@uifabric/tslint-rules: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect @fluentui/ability-attributes: npm WARN lifecycle The node binary used for scripts is but npm is using /usr/local/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with. @fluentui/ability-attributes: internal/modules/cjs/loader.js:491 @fluentui/ability-attributes: throw new ERR_PACKAGE_PATH_NOT_EXPORTED(basePath, mappingKey); diff --git a/tests/baselines/reference/docker/vue-next.log b/tests/baselines/reference/docker/vue-next.log index 96c3e8730f4..9187c7c5d17 100644 --- a/tests/baselines/reference/docker/vue-next.log +++ b/tests/baselines/reference/docker/vue-next.log @@ -1,7 +1,7 @@ Exit Code: 0 Standard output: -> @X.X.X-beta.10 build /vue-next +> @X.X.X-beta.12 build /vue-next > node scripts/build.js "--types" Rolling up type definitions for compiler-core... Writing: /vue-next/temp/compiler-core.api.json @@ -106,16 +106,16 @@ created packages/reactivity/dist/reactivity.global.prod.js in ?s packages/runtime-core/src/apiInject.ts Error: /vue-next/packages/runtime-core/src/apiInject.ts(40,9): semantic error TS2360: The left-hand side of an 'in' expression must be of type 'any', 'string', 'number', or 'symbol'. at error (/vue-next/node_modules/rollup/dist/shared/rollup.js:161:30) - at throwPluginError (/vue-next/node_modules/rollup/dist/shared/rollup.js:16925:12) - at Object.error (/vue-next/node_modules/rollup/dist/shared/rollup.js:17944:24) - at Object.error (/vue-next/node_modules/rollup/dist/shared/rollup.js:17098:38) + at throwPluginError (/vue-next/node_modules/rollup/dist/shared/rollup.js:16989:12) + at Object.error (/vue-next/node_modules/rollup/dist/shared/rollup.js:18021:24) + at Object.error (/vue-next/node_modules/rollup/dist/shared/rollup.js:17162:38) at RollupContext.error (/vue-next/node_modules/rollup-plugin-typescript2/src/rollupcontext.ts:37:18) at /vue-next/node_modules/rollup-plugin-typescript2/src/print-diagnostics.ts:41:11 at arrayEach (/vue-next/node_modules/rollup-plugin-typescript2/node_modules/lodash/lodash.js:516:11) at forEach (/vue-next/node_modules/rollup-plugin-typescript2/node_modules/lodash/lodash.js:9342:14) at _.each (/vue-next/node_modules/rollup-plugin-typescript2/src/print-diagnostics.ts:9:2) at Object.transform (/vue-next/node_modules/rollup-plugin-typescript2/src/index.ts:242:5) -(node:17) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 1 (EPERM): rollup -c --environment COMMIT:b725b63,NODE_ENV:production,TARGET:runtime-core,TYPES:true +(node:18) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 1 (EPERM): rollup -c --environment COMMIT:74ed7d1,NODE_ENV:production,TARGET:runtime-core,TYPES:true at makeError (/vue-next/node_modules/execa/lib/error.js:59:11) at handlePromise (/vue-next/node_modules/execa/index.js:112:26) at processTicksAndRejections (internal/process/task_queues.js:97:5) @@ -123,5 +123,5 @@ Error: /vue-next/packages/runtime-core/src/apiInject.ts(40,9): semantic error TS at async buildAll (/vue-next/scripts/build.js:50:5) at async run (/vue-next/scripts/build.js:40:5) (Use `node --trace-warnings ...` to show where the warning was created) -(node:17) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) -(node:17) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. +(node:18) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) +(node:18) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. diff --git a/tests/baselines/reference/doubleUnderscoreExportStarConflict.js b/tests/baselines/reference/doubleUnderscoreExportStarConflict.js index a5d60f02159..3497051eb15 100644 --- a/tests/baselines/reference/doubleUnderscoreExportStarConflict.js +++ b/tests/baselines/reference/doubleUnderscoreExportStarConflict.js @@ -34,7 +34,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./b"), exports); __exportStar(require("./c"), exports); diff --git a/tests/baselines/reference/es6ExportAllInEs5.js b/tests/baselines/reference/es6ExportAllInEs5.js index 72ec47714d8..aaf14965eca 100644 --- a/tests/baselines/reference/es6ExportAllInEs5.js +++ b/tests/baselines/reference/es6ExportAllInEs5.js @@ -41,7 +41,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./server"), exports); diff --git a/tests/baselines/reference/es6ExportEqualsInterop.js b/tests/baselines/reference/es6ExportEqualsInterop.js index 6f24e91d8fd..9e0caded280 100644 --- a/tests/baselines/reference/es6ExportEqualsInterop.js +++ b/tests/baselines/reference/es6ExportEqualsInterop.js @@ -218,7 +218,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; var z2 = require("variable"); var z3 = require("interface-variable"); diff --git a/tests/baselines/reference/esModuleInteropWithExportStar(target=es3).js b/tests/baselines/reference/esModuleInteropWithExportStar(target=es3).js index 3db289c7f1a..de77e148cdf 100644 --- a/tests/baselines/reference/esModuleInteropWithExportStar(target=es3).js +++ b/tests/baselines/reference/esModuleInteropWithExportStar(target=es3).js @@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; var fs = __importStar(require("./fs")); fs; diff --git a/tests/baselines/reference/esModuleInteropWithExportStar(target=es5).js b/tests/baselines/reference/esModuleInteropWithExportStar(target=es5).js index 1ebde18e428..133a175e1ad 100644 --- a/tests/baselines/reference/esModuleInteropWithExportStar(target=es5).js +++ b/tests/baselines/reference/esModuleInteropWithExportStar(target=es5).js @@ -35,7 +35,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); var fs = __importStar(require("./fs")); fs; diff --git a/tests/baselines/reference/exportNamespace1.js b/tests/baselines/reference/exportNamespace1.js index ff02a98707e..5631e6d8194 100644 --- a/tests/baselines/reference/exportNamespace1.js +++ b/tests/baselines/reference/exportNamespace1.js @@ -38,7 +38,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./b"), exports); //// [d.js] diff --git a/tests/baselines/reference/exportNestedNamespaces.types b/tests/baselines/reference/exportNestedNamespaces.types index 4bc7568885e..aae9e30a535 100644 --- a/tests/baselines/reference/exportNestedNamespaces.types +++ b/tests/baselines/reference/exportNestedNamespaces.types @@ -68,7 +68,7 @@ var classic = new s.Classic() /** @param {s.n.K} c @param {s.Classic} classic */ function f(c, classic) { ->f : (c: s.n.K, classic: s.Classic) => void +>f : (c: K, classic: s.Classic) => void >c : K >classic : Classic diff --git a/tests/baselines/reference/exportStar-amd.js b/tests/baselines/reference/exportStar-amd.js index a2a062a7501..3292a18294d 100644 --- a/tests/baselines/reference/exportStar-amd.js +++ b/tests/baselines/reference/exportStar-amd.js @@ -67,7 +67,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "./t1", "./t2", "./t3"], function (require, exports, t1_1, t2_1, t3_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tests/baselines/reference/exportStar.js b/tests/baselines/reference/exportStar.js index bf65527a104..7d2cb9e1fe8 100644 --- a/tests/baselines/reference/exportStar.js +++ b/tests/baselines/reference/exportStar.js @@ -62,7 +62,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./t1"), exports); __exportStar(require("./t2"), exports); diff --git a/tests/baselines/reference/exportStarForValues.js b/tests/baselines/reference/exportStarForValues.js index 277b953d353..fad8c19a1c7 100644 --- a/tests/baselines/reference/exportStarForValues.js +++ b/tests/baselines/reference/exportStarForValues.js @@ -22,7 +22,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file1"], function (require, exports, file1_1) { "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/exportStarForValues2.js b/tests/baselines/reference/exportStarForValues2.js index 01ded620485..19c55f2ff84 100644 --- a/tests/baselines/reference/exportStarForValues2.js +++ b/tests/baselines/reference/exportStarForValues2.js @@ -26,7 +26,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file1"], function (require, exports, file1_1) { "use strict"; exports.__esModule = true; @@ -43,7 +43,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file2"], function (require, exports, file2_1) { "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/exportStarForValues3.js b/tests/baselines/reference/exportStarForValues3.js index e31102f3f7f..a0ea7d524ee 100644 --- a/tests/baselines/reference/exportStarForValues3.js +++ b/tests/baselines/reference/exportStarForValues3.js @@ -38,7 +38,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file1"], function (require, exports, file1_1) { "use strict"; exports.__esModule = true; @@ -55,7 +55,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file1"], function (require, exports, file1_1) { "use strict"; exports.__esModule = true; @@ -72,7 +72,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file2", "file3"], function (require, exports, file2_1, file3_1) { "use strict"; exports.__esModule = true; @@ -90,7 +90,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file4"], function (require, exports, file4_1) { "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/exportStarForValues4.js b/tests/baselines/reference/exportStarForValues4.js index 527df22d292..13a6dfae6cc 100644 --- a/tests/baselines/reference/exportStarForValues4.js +++ b/tests/baselines/reference/exportStarForValues4.js @@ -30,7 +30,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file2"], function (require, exports, file2_1) { "use strict"; exports.__esModule = true; @@ -47,7 +47,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file1", "file3"], function (require, exports, file1_1, file3_1) { "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/exportStarForValues5.js b/tests/baselines/reference/exportStarForValues5.js index 6a5c2e6755f..d3ecb850f86 100644 --- a/tests/baselines/reference/exportStarForValues5.js +++ b/tests/baselines/reference/exportStarForValues5.js @@ -22,7 +22,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file1"], function (require, exports, file1_1) { "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/exportStarForValues7.js b/tests/baselines/reference/exportStarForValues7.js index 3fe3020756c..5d9e534333e 100644 --- a/tests/baselines/reference/exportStarForValues7.js +++ b/tests/baselines/reference/exportStarForValues7.js @@ -26,7 +26,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file1"], function (require, exports, file1_1) { "use strict"; exports.__esModule = true; @@ -44,7 +44,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file2"], function (require, exports, file2_1) { "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/exportStarForValues8.js b/tests/baselines/reference/exportStarForValues8.js index 3458e5f6a38..66111015e70 100644 --- a/tests/baselines/reference/exportStarForValues8.js +++ b/tests/baselines/reference/exportStarForValues8.js @@ -38,7 +38,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file1"], function (require, exports, file1_1) { "use strict"; exports.__esModule = true; @@ -56,7 +56,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file1"], function (require, exports, file1_1) { "use strict"; exports.__esModule = true; @@ -74,7 +74,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file2", "file3"], function (require, exports, file2_1, file3_1) { "use strict"; exports.__esModule = true; @@ -93,7 +93,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file4"], function (require, exports, file4_1) { "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/exportStarForValues9.js b/tests/baselines/reference/exportStarForValues9.js index 70ab46eafeb..c328f25910b 100644 --- a/tests/baselines/reference/exportStarForValues9.js +++ b/tests/baselines/reference/exportStarForValues9.js @@ -30,7 +30,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file2"], function (require, exports, file2_1) { "use strict"; exports.__esModule = true; @@ -48,7 +48,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; define(["require", "exports", "file1", "file3"], function (require, exports, file1_1, file3_1) { "use strict"; exports.__esModule = true; diff --git a/tests/baselines/reference/exportStarFromEmptyModule.js b/tests/baselines/reference/exportStarFromEmptyModule.js index 450bbafe424..9864a341f7e 100644 --- a/tests/baselines/reference/exportStarFromEmptyModule.js +++ b/tests/baselines/reference/exportStarFromEmptyModule.js @@ -45,7 +45,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.A = void 0; __exportStar(require("./exportStarFromEmptyModule_module2"), exports); diff --git a/tests/baselines/reference/exportStarNotElided.js b/tests/baselines/reference/exportStarNotElided.js index 41d2b55483b..27a8616b32f 100644 --- a/tests/baselines/reference/exportStarNotElided.js +++ b/tests/baselines/reference/exportStarNotElided.js @@ -33,7 +33,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./register"), exports); __exportStar(require("./data1"), exports); diff --git a/tests/baselines/reference/inlineJsxFactoryDeclarations.js b/tests/baselines/reference/inlineJsxFactoryDeclarations.js index c4909439e54..e799b950b6a 100644 --- a/tests/baselines/reference/inlineJsxFactoryDeclarations.js +++ b/tests/baselines/reference/inlineJsxFactoryDeclarations.js @@ -74,7 +74,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; /** @jsx dom */ var renderer_1 = require("./renderer"); diff --git a/tests/baselines/reference/intersectionReduction.errors.txt b/tests/baselines/reference/intersectionReduction.errors.txt index 7026fcda0a9..82911aca009 100644 --- a/tests/baselines/reference/intersectionReduction.errors.txt +++ b/tests/baselines/reference/intersectionReduction.errors.txt @@ -120,4 +120,36 @@ tests/cases/conformance/types/intersection/intersectionReduction.ts(81,1): error const f2 = (t: Container<"a"> | (Container<"b"> & Container<"c">)): Container<"a"> => t; const f3 = (t: Container<"a"> | (Container<"b"> & { dataB: boolean } & Container<"a">)): Container<"a"> => t; const f4 = (t: number | (Container<"b"> & { dataB: boolean } & Container<"a">)): number => t; + + // Repro from #38549 + + interface A2 { + kind: "A"; + a: number; + } + + interface B2 { + kind: "B"; + b: number; + } + + declare const shouldBeB: (A2 | B2) & B2; + const b: B2 = shouldBeB; // works + + function inGeneric(alsoShouldBeB: T & B2) { + const b: B2 = alsoShouldBeB; + } + + // Repro from #38542 + + interface ABI { + kind: 'a' | 'b'; + } + + declare class CA { kind: 'a'; a: string; x: number }; + declare class CB { kind: 'b'; b: string; y: number }; + + function bar(x: T & CA) { + let ab: ABI = x; + } \ No newline at end of file diff --git a/tests/baselines/reference/intersectionReduction.js b/tests/baselines/reference/intersectionReduction.js index c04ce9973bc..64b1757b09d 100644 --- a/tests/baselines/reference/intersectionReduction.js +++ b/tests/baselines/reference/intersectionReduction.js @@ -107,6 +107,38 @@ type Container = { const f2 = (t: Container<"a"> | (Container<"b"> & Container<"c">)): Container<"a"> => t; const f3 = (t: Container<"a"> | (Container<"b"> & { dataB: boolean } & Container<"a">)): Container<"a"> => t; const f4 = (t: number | (Container<"b"> & { dataB: boolean } & Container<"a">)): number => t; + +// Repro from #38549 + +interface A2 { + kind: "A"; + a: number; +} + +interface B2 { + kind: "B"; + b: number; +} + +declare const shouldBeB: (A2 | B2) & B2; +const b: B2 = shouldBeB; // works + +function inGeneric(alsoShouldBeB: T & B2) { + const b: B2 = alsoShouldBeB; +} + +// Repro from #38542 + +interface ABI { + kind: 'a' | 'b'; +} + +declare class CA { kind: 'a'; a: string; x: number }; +declare class CB { kind: 'b'; b: string; y: number }; + +function bar(x: T & CA) { + let ab: ABI = x; +} //// [intersectionReduction.js] @@ -128,3 +160,12 @@ var f1 = function (t) { return t; }; var f2 = function (t) { return t; }; var f3 = function (t) { return t; }; var f4 = function (t) { return t; }; +var b = shouldBeB; // works +function inGeneric(alsoShouldBeB) { + var b = alsoShouldBeB; +} +; +; +function bar(x) { + var ab = x; +} diff --git a/tests/baselines/reference/intersectionReduction.symbols b/tests/baselines/reference/intersectionReduction.symbols index 2949e87b2c7..02cc8c9ff2f 100644 --- a/tests/baselines/reference/intersectionReduction.symbols +++ b/tests/baselines/reference/intersectionReduction.symbols @@ -373,3 +373,87 @@ const f4 = (t: number | (Container<"b"> & { dataB: boolean } & Container<"a">)): >Container : Symbol(Container, Decl(intersectionReduction.ts, 99, 44)) >t : Symbol(t, Decl(intersectionReduction.ts, 107, 12)) +// Repro from #38549 + +interface A2 { +>A2 : Symbol(A2, Decl(intersectionReduction.ts, 107, 93)) + + kind: "A"; +>kind : Symbol(A2.kind, Decl(intersectionReduction.ts, 111, 14)) + + a: number; +>a : Symbol(A2.a, Decl(intersectionReduction.ts, 112, 14)) +} + +interface B2 { +>B2 : Symbol(B2, Decl(intersectionReduction.ts, 114, 1)) + + kind: "B"; +>kind : Symbol(B2.kind, Decl(intersectionReduction.ts, 116, 14)) + + b: number; +>b : Symbol(B2.b, Decl(intersectionReduction.ts, 117, 14)) +} + +declare const shouldBeB: (A2 | B2) & B2; +>shouldBeB : Symbol(shouldBeB, Decl(intersectionReduction.ts, 121, 13)) +>A2 : Symbol(A2, Decl(intersectionReduction.ts, 107, 93)) +>B2 : Symbol(B2, Decl(intersectionReduction.ts, 114, 1)) +>B2 : Symbol(B2, Decl(intersectionReduction.ts, 114, 1)) + +const b: B2 = shouldBeB; // works +>b : Symbol(b, Decl(intersectionReduction.ts, 122, 5)) +>B2 : Symbol(B2, Decl(intersectionReduction.ts, 114, 1)) +>shouldBeB : Symbol(shouldBeB, Decl(intersectionReduction.ts, 121, 13)) + +function inGeneric(alsoShouldBeB: T & B2) { +>inGeneric : Symbol(inGeneric, Decl(intersectionReduction.ts, 122, 24)) +>T : Symbol(T, Decl(intersectionReduction.ts, 124, 19)) +>A2 : Symbol(A2, Decl(intersectionReduction.ts, 107, 93)) +>B2 : Symbol(B2, Decl(intersectionReduction.ts, 114, 1)) +>alsoShouldBeB : Symbol(alsoShouldBeB, Decl(intersectionReduction.ts, 124, 38)) +>T : Symbol(T, Decl(intersectionReduction.ts, 124, 19)) +>B2 : Symbol(B2, Decl(intersectionReduction.ts, 114, 1)) + + const b: B2 = alsoShouldBeB; +>b : Symbol(b, Decl(intersectionReduction.ts, 125, 9)) +>B2 : Symbol(B2, Decl(intersectionReduction.ts, 114, 1)) +>alsoShouldBeB : Symbol(alsoShouldBeB, Decl(intersectionReduction.ts, 124, 38)) +} + +// Repro from #38542 + +interface ABI { +>ABI : Symbol(ABI, Decl(intersectionReduction.ts, 126, 1)) + + kind: 'a' | 'b'; +>kind : Symbol(ABI.kind, Decl(intersectionReduction.ts, 130, 15)) +} + +declare class CA { kind: 'a'; a: string; x: number }; +>CA : Symbol(CA, Decl(intersectionReduction.ts, 132, 1)) +>kind : Symbol(CA.kind, Decl(intersectionReduction.ts, 134, 18)) +>a : Symbol(CA.a, Decl(intersectionReduction.ts, 134, 29)) +>x : Symbol(CA.x, Decl(intersectionReduction.ts, 134, 40)) + +declare class CB { kind: 'b'; b: string; y: number }; +>CB : Symbol(CB, Decl(intersectionReduction.ts, 134, 53)) +>kind : Symbol(CB.kind, Decl(intersectionReduction.ts, 135, 18)) +>b : Symbol(CB.b, Decl(intersectionReduction.ts, 135, 29)) +>y : Symbol(CB.y, Decl(intersectionReduction.ts, 135, 40)) + +function bar(x: T & CA) { +>bar : Symbol(bar, Decl(intersectionReduction.ts, 135, 53)) +>T : Symbol(T, Decl(intersectionReduction.ts, 137, 13)) +>CA : Symbol(CA, Decl(intersectionReduction.ts, 132, 1)) +>CB : Symbol(CB, Decl(intersectionReduction.ts, 134, 53)) +>x : Symbol(x, Decl(intersectionReduction.ts, 137, 32)) +>T : Symbol(T, Decl(intersectionReduction.ts, 137, 13)) +>CA : Symbol(CA, Decl(intersectionReduction.ts, 132, 1)) + + let ab: ABI = x; +>ab : Symbol(ab, Decl(intersectionReduction.ts, 138, 7)) +>ABI : Symbol(ABI, Decl(intersectionReduction.ts, 126, 1)) +>x : Symbol(x, Decl(intersectionReduction.ts, 137, 32)) +} + diff --git a/tests/baselines/reference/intersectionReduction.types b/tests/baselines/reference/intersectionReduction.types index 8c4ee05051b..c1ae0685836 100644 --- a/tests/baselines/reference/intersectionReduction.types +++ b/tests/baselines/reference/intersectionReduction.types @@ -315,3 +315,65 @@ const f4 = (t: number | (Container<"b"> & { dataB: boolean } & Container<"a">)): >dataB : boolean >t : number +// Repro from #38549 + +interface A2 { + kind: "A"; +>kind : "A" + + a: number; +>a : number +} + +interface B2 { + kind: "B"; +>kind : "B" + + b: number; +>b : number +} + +declare const shouldBeB: (A2 | B2) & B2; +>shouldBeB : B2 + +const b: B2 = shouldBeB; // works +>b : B2 +>shouldBeB : B2 + +function inGeneric(alsoShouldBeB: T & B2) { +>inGeneric : (alsoShouldBeB: T & B2) => void +>alsoShouldBeB : T & B2 + + const b: B2 = alsoShouldBeB; +>b : B2 +>alsoShouldBeB : T & B2 +} + +// Repro from #38542 + +interface ABI { + kind: 'a' | 'b'; +>kind : "a" | "b" +} + +declare class CA { kind: 'a'; a: string; x: number }; +>CA : CA +>kind : "a" +>a : string +>x : number + +declare class CB { kind: 'b'; b: string; y: number }; +>CB : CB +>kind : "b" +>b : string +>y : number + +function bar(x: T & CA) { +>bar : (x: T & CA) => void +>x : T & CA + + let ab: ABI = x; +>ab : ABI +>x : T & CA +} + diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).js b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).js index 1ad643d360d..bed4ca912d8 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).js +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es2015).js @@ -35,20 +35,20 @@ function tag(str, ...args) { } const a = tag `123`; const b = tag `123 ${100}`; -const x = tag(__makeTemplateObject([undefined, undefined, " wonderful ", undefined], ["\\u{hello} ", " \\xtraordinary ", " wonderful ", " \\uworld"]), 100, 200, 300); +const x = tag(__makeTemplateObject([void 0, void 0, " wonderful ", void 0], ["\\u{hello} ", " \\xtraordinary ", " wonderful ", " \\uworld"]), 100, 200, 300); const y = `\u{hello} ${100} \xtraordinary ${200} wonderful ${300} \uworld`; // should error with NoSubstitutionTemplate -const z = tag(__makeTemplateObject([undefined], ["\\u{hello} \\xtraordinary wonderful \\uworld"])); // should work with Tagged NoSubstitutionTemplate +const z = tag(__makeTemplateObject([void 0], ["\\u{hello} \\xtraordinary wonderful \\uworld"])); // should work with Tagged NoSubstitutionTemplate const a1 = tag `${100}\0`; // \0 -const a2 = tag(__makeTemplateObject(["", undefined], ["", "\\00"]), 100); // \\00 -const a3 = tag(__makeTemplateObject(["", undefined], ["", "\\u"]), 100); // \\u -const a4 = tag(__makeTemplateObject(["", undefined], ["", "\\u0"]), 100); // \\u0 -const a5 = tag(__makeTemplateObject(["", undefined], ["", "\\u00"]), 100); // \\u00 -const a6 = tag(__makeTemplateObject(["", undefined], ["", "\\u000"]), 100); // \\u000 +const a2 = tag(__makeTemplateObject(["", void 0], ["", "\\00"]), 100); // \\00 +const a3 = tag(__makeTemplateObject(["", void 0], ["", "\\u"]), 100); // \\u +const a4 = tag(__makeTemplateObject(["", void 0], ["", "\\u0"]), 100); // \\u0 +const a5 = tag(__makeTemplateObject(["", void 0], ["", "\\u00"]), 100); // \\u00 +const a6 = tag(__makeTemplateObject(["", void 0], ["", "\\u000"]), 100); // \\u000 const a7 = tag `${100}\u0000`; // \u0000 -const a8 = tag(__makeTemplateObject(["", undefined], ["", "\\u{"]), 100); // \\u{ +const a8 = tag(__makeTemplateObject(["", void 0], ["", "\\u{"]), 100); // \\u{ const a9 = tag `${100}\u{10FFFF}`; // \\u{10FFFF -const a10 = tag(__makeTemplateObject(["", undefined], ["", "\\u{1f622"]), 100); // \\u{1f622 +const a10 = tag(__makeTemplateObject(["", void 0], ["", "\\u{1f622"]), 100); // \\u{1f622 const a11 = tag `${100}\u{1f622}`; // \u{1f622} -const a12 = tag(__makeTemplateObject(["", undefined], ["", "\\x"]), 100); // \\x -const a13 = tag(__makeTemplateObject(["", undefined], ["", "\\x0"]), 100); // \\x0 +const a12 = tag(__makeTemplateObject(["", void 0], ["", "\\x"]), 100); // \\x +const a13 = tag(__makeTemplateObject(["", void 0], ["", "\\x0"]), 100); // \\x0 const a14 = tag `${100}\x00`; // \x00 diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js index 362e2cf175c..6e0c375edb2 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences(target=es5).js @@ -39,20 +39,20 @@ function tag(str) { } var a = tag(__makeTemplateObject(["123"], ["123"])); var b = tag(__makeTemplateObject(["123 ", ""], ["123 ", ""]), 100); -var x = tag(__makeTemplateObject([undefined, undefined, " wonderful ", undefined], ["\\u{hello} ", " \\xtraordinary ", " wonderful ", " \\uworld"]), 100, 200, 300); +var x = tag(__makeTemplateObject([void 0, void 0, " wonderful ", void 0], ["\\u{hello} ", " \\xtraordinary ", " wonderful ", " \\uworld"]), 100, 200, 300); var y = "hello} " + 100 + " traordinary " + 200 + " wonderful " + 300 + " world"; // should error with NoSubstitutionTemplate -var z = tag(__makeTemplateObject([undefined], ["\\u{hello} \\xtraordinary wonderful \\uworld"])); // should work with Tagged NoSubstitutionTemplate +var z = tag(__makeTemplateObject([void 0], ["\\u{hello} \\xtraordinary wonderful \\uworld"])); // should work with Tagged NoSubstitutionTemplate var a1 = tag(__makeTemplateObject(["", "\0"], ["", "\\0"]), 100); // \0 -var a2 = tag(__makeTemplateObject(["", undefined], ["", "\\00"]), 100); // \\00 -var a3 = tag(__makeTemplateObject(["", undefined], ["", "\\u"]), 100); // \\u -var a4 = tag(__makeTemplateObject(["", undefined], ["", "\\u0"]), 100); // \\u0 -var a5 = tag(__makeTemplateObject(["", undefined], ["", "\\u00"]), 100); // \\u00 -var a6 = tag(__makeTemplateObject(["", undefined], ["", "\\u000"]), 100); // \\u000 +var a2 = tag(__makeTemplateObject(["", void 0], ["", "\\00"]), 100); // \\00 +var a3 = tag(__makeTemplateObject(["", void 0], ["", "\\u"]), 100); // \\u +var a4 = tag(__makeTemplateObject(["", void 0], ["", "\\u0"]), 100); // \\u0 +var a5 = tag(__makeTemplateObject(["", void 0], ["", "\\u00"]), 100); // \\u00 +var a6 = tag(__makeTemplateObject(["", void 0], ["", "\\u000"]), 100); // \\u000 var a7 = tag(__makeTemplateObject(["", "\0"], ["", "\\u0000"]), 100); // \u0000 -var a8 = tag(__makeTemplateObject(["", undefined], ["", "\\u{"]), 100); // \\u{ +var a8 = tag(__makeTemplateObject(["", void 0], ["", "\\u{"]), 100); // \\u{ var a9 = tag(__makeTemplateObject(["", "\uDBFF\uDFFF"], ["", "\\u{10FFFF}"]), 100); // \\u{10FFFF -var a10 = tag(__makeTemplateObject(["", undefined], ["", "\\u{1f622"]), 100); // \\u{1f622 +var a10 = tag(__makeTemplateObject(["", void 0], ["", "\\u{1f622"]), 100); // \\u{1f622 var a11 = tag(__makeTemplateObject(["", "\uD83D\uDE22"], ["", "\\u{1f622}"]), 100); // \u{1f622} -var a12 = tag(__makeTemplateObject(["", undefined], ["", "\\x"]), 100); // \\x -var a13 = tag(__makeTemplateObject(["", undefined], ["", "\\x0"]), 100); // \\x0 +var a12 = tag(__makeTemplateObject(["", void 0], ["", "\\x"]), 100); // \\x +var a13 = tag(__makeTemplateObject(["", void 0], ["", "\\x0"]), 100); // \\x0 var a14 = tag(__makeTemplateObject(["", "\0"], ["", "\\x00"]), 100); // \x00 diff --git a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences.js b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences.js index 362e2cf175c..58984b3018c 100644 --- a/tests/baselines/reference/invalidTaggedTemplateEscapeSequences.js +++ b/tests/baselines/reference/invalidTaggedTemplateEscapeSequences.js @@ -1,28 +1,28 @@ //// [invalidTaggedTemplateEscapeSequences.ts] -function tag (str: any, ...args: any[]): any { - return str -} - -const a = tag`123` -const b = tag`123 ${100}` -const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; -const y = `\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; // should error with NoSubstitutionTemplate -const z = tag`\u{hello} \xtraordinary wonderful \uworld` // should work with Tagged NoSubstitutionTemplate - -const a1 = tag`${ 100 }\0` // \0 -const a2 = tag`${ 100 }\00` // \\00 -const a3 = tag`${ 100 }\u` // \\u -const a4 = tag`${ 100 }\u0` // \\u0 -const a5 = tag`${ 100 }\u00` // \\u00 -const a6 = tag`${ 100 }\u000` // \\u000 -const a7 = tag`${ 100 }\u0000` // \u0000 -const a8 = tag`${ 100 }\u{` // \\u{ -const a9 = tag`${ 100 }\u{10FFFF}` // \\u{10FFFF -const a10 = tag`${ 100 }\u{1f622` // \\u{1f622 -const a11 = tag`${ 100 }\u{1f622}` // \u{1f622} -const a12 = tag`${ 100 }\x` // \\x -const a13 = tag`${ 100 }\x0` // \\x0 -const a14 = tag`${ 100 }\x00` // \x00 +function tag (str: any, ...args: any[]): any { + return str +} + +const a = tag`123` +const b = tag`123 ${100}` +const x = tag`\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; +const y = `\u{hello} ${ 100 } \xtraordinary ${ 200 } wonderful ${ 300 } \uworld`; // should error with NoSubstitutionTemplate +const z = tag`\u{hello} \xtraordinary wonderful \uworld` // should work with Tagged NoSubstitutionTemplate + +const a1 = tag`${ 100 }\0` // \0 +const a2 = tag`${ 100 }\00` // \\00 +const a3 = tag`${ 100 }\u` // \\u +const a4 = tag`${ 100 }\u0` // \\u0 +const a5 = tag`${ 100 }\u00` // \\u00 +const a6 = tag`${ 100 }\u000` // \\u000 +const a7 = tag`${ 100 }\u0000` // \u0000 +const a8 = tag`${ 100 }\u{` // \\u{ +const a9 = tag`${ 100 }\u{10FFFF}` // \\u{10FFFF +const a10 = tag`${ 100 }\u{1f622` // \\u{1f622 +const a11 = tag`${ 100 }\u{1f622}` // \u{1f622} +const a12 = tag`${ 100 }\x` // \\x +const a13 = tag`${ 100 }\x0` // \\x0 +const a14 = tag`${ 100 }\x00` // \x00 //// [invalidTaggedTemplateEscapeSequences.js] @@ -39,20 +39,20 @@ function tag(str) { } var a = tag(__makeTemplateObject(["123"], ["123"])); var b = tag(__makeTemplateObject(["123 ", ""], ["123 ", ""]), 100); -var x = tag(__makeTemplateObject([undefined, undefined, " wonderful ", undefined], ["\\u{hello} ", " \\xtraordinary ", " wonderful ", " \\uworld"]), 100, 200, 300); +var x = tag(__makeTemplateObject([void 0, void 0, " wonderful ", void 0], ["\\u{hello} ", " \\xtraordinary ", " wonderful ", " \\uworld"]), 100, 200, 300); var y = "hello} " + 100 + " traordinary " + 200 + " wonderful " + 300 + " world"; // should error with NoSubstitutionTemplate -var z = tag(__makeTemplateObject([undefined], ["\\u{hello} \\xtraordinary wonderful \\uworld"])); // should work with Tagged NoSubstitutionTemplate +var z = tag(__makeTemplateObject([void 0], ["\\u{hello} \\xtraordinary wonderful \\uworld"])); // should work with Tagged NoSubstitutionTemplate var a1 = tag(__makeTemplateObject(["", "\0"], ["", "\\0"]), 100); // \0 -var a2 = tag(__makeTemplateObject(["", undefined], ["", "\\00"]), 100); // \\00 -var a3 = tag(__makeTemplateObject(["", undefined], ["", "\\u"]), 100); // \\u -var a4 = tag(__makeTemplateObject(["", undefined], ["", "\\u0"]), 100); // \\u0 -var a5 = tag(__makeTemplateObject(["", undefined], ["", "\\u00"]), 100); // \\u00 -var a6 = tag(__makeTemplateObject(["", undefined], ["", "\\u000"]), 100); // \\u000 +var a2 = tag(__makeTemplateObject(["", void 0], ["", "\\00"]), 100); // \\00 +var a3 = tag(__makeTemplateObject(["", void 0], ["", "\\u"]), 100); // \\u +var a4 = tag(__makeTemplateObject(["", void 0], ["", "\\u0"]), 100); // \\u0 +var a5 = tag(__makeTemplateObject(["", void 0], ["", "\\u00"]), 100); // \\u00 +var a6 = tag(__makeTemplateObject(["", void 0], ["", "\\u000"]), 100); // \\u000 var a7 = tag(__makeTemplateObject(["", "\0"], ["", "\\u0000"]), 100); // \u0000 -var a8 = tag(__makeTemplateObject(["", undefined], ["", "\\u{"]), 100); // \\u{ +var a8 = tag(__makeTemplateObject(["", void 0], ["", "\\u{"]), 100); // \\u{ var a9 = tag(__makeTemplateObject(["", "\uDBFF\uDFFF"], ["", "\\u{10FFFF}"]), 100); // \\u{10FFFF -var a10 = tag(__makeTemplateObject(["", undefined], ["", "\\u{1f622"]), 100); // \\u{1f622 +var a10 = tag(__makeTemplateObject(["", void 0], ["", "\\u{1f622"]), 100); // \\u{1f622 var a11 = tag(__makeTemplateObject(["", "\uD83D\uDE22"], ["", "\\u{1f622}"]), 100); // \u{1f622} -var a12 = tag(__makeTemplateObject(["", undefined], ["", "\\x"]), 100); // \\x -var a13 = tag(__makeTemplateObject(["", undefined], ["", "\\x0"]), 100); // \\x0 +var a12 = tag(__makeTemplateObject(["", void 0], ["", "\\x"]), 100); // \\x +var a13 = tag(__makeTemplateObject(["", void 0], ["", "\\x0"]), 100); // \\x0 var a14 = tag(__makeTemplateObject(["", "\0"], ["", "\\x00"]), 100); // \x00 diff --git a/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.errors.txt b/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.errors.txt new file mode 100644 index 00000000000..d57fb401814 --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.errors.txt @@ -0,0 +1,10 @@ +tests/cases/conformance/jsdoc/declarations/index.js(4,3): error TS2339: Property 'prototype' does not exist on type '{}'. + + +==== tests/cases/conformance/jsdoc/declarations/index.js (1 errors) ==== + // https://github.com/microsoft/TypeScript/issues/35801 + let A; + A = {}; + A.prototype.b = {}; + ~~~~~~~~~ +!!! error TS2339: Property 'prototype' does not exist on type '{}'. \ No newline at end of file diff --git a/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.js b/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.js new file mode 100644 index 00000000000..084e6f18b91 --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.js @@ -0,0 +1,18 @@ +//// [index.js] +// https://github.com/microsoft/TypeScript/issues/35801 +let A; +A = {}; +A.prototype.b = {}; + +//// [index.js] +// https://github.com/microsoft/TypeScript/issues/35801 +var A; +A = {}; +A.prototype.b = {}; + + +//// [index.d.ts] +declare class A { + private constructor(); + b: {}; +} diff --git a/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.symbols b/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.symbols new file mode 100644 index 00000000000..6b1aa5b1fda --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.symbols @@ -0,0 +1,13 @@ +=== tests/cases/conformance/jsdoc/declarations/index.js === +// https://github.com/microsoft/TypeScript/issues/35801 +let A; +>A : Symbol(A, Decl(index.js, 1, 3)) + +A = {}; +>A : Symbol(A, Decl(index.js, 1, 3)) + +A.prototype.b = {}; +>A.prototype : Symbol(A.b, Decl(index.js, 2, 7)) +>A : Symbol(A, Decl(index.js, 1, 3)) +>b : Symbol(A.b, Decl(index.js, 2, 7)) + diff --git a/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.types b/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.types new file mode 100644 index 00000000000..ecd9ac99954 --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsClassLikeHeuristic.types @@ -0,0 +1,19 @@ +=== tests/cases/conformance/jsdoc/declarations/index.js === +// https://github.com/microsoft/TypeScript/issues/35801 +let A; +>A : any + +A = {}; +>A = {} : {} +>A : any +>{} : {} + +A.prototype.b = {}; +>A.prototype.b = {} : {} +>A.prototype.b : any +>A.prototype : any +>A : {} +>prototype : any +>b : any +>{} : {} + diff --git a/tests/baselines/reference/jsDeclarationsClassStatic.js b/tests/baselines/reference/jsDeclarationsClassStatic.js index 1498b8bd6bd..4af5f3fd83e 100644 --- a/tests/baselines/reference/jsDeclarationsClassStatic.js +++ b/tests/baselines/reference/jsDeclarationsClassStatic.js @@ -70,5 +70,5 @@ type HandlerOptions = { /** * Should be able to export a type alias at the same time. */ - name: String; + name: string; }; diff --git a/tests/baselines/reference/jsDeclarationsExportForms.js b/tests/baselines/reference/jsDeclarationsExportForms.js index 2ff100c4eda..8134e557a11 100644 --- a/tests/baselines/reference/jsDeclarationsExportForms.js +++ b/tests/baselines/reference/jsDeclarationsExportForms.js @@ -85,7 +85,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./cls"), exports); //// [bar2.js] @@ -99,7 +99,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./func"), exports); __exportStar(require("./cls"), exports); diff --git a/tests/baselines/reference/jsDeclarationsExportFormsErr.js b/tests/baselines/reference/jsDeclarationsExportFormsErr.js index f30b0a90ab0..6f777832804 100644 --- a/tests/baselines/reference/jsDeclarationsExportFormsErr.js +++ b/tests/baselines/reference/jsDeclarationsExportFormsErr.js @@ -51,7 +51,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./cls"), exports); //// [includeAll.js] diff --git a/tests/baselines/reference/jsDeclarationsJSDocRedirectedLookups.js b/tests/baselines/reference/jsDeclarationsJSDocRedirectedLookups.js new file mode 100644 index 00000000000..294407154c3 --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsJSDocRedirectedLookups.js @@ -0,0 +1,82 @@ +//// [index.js] +// these are recognized as TS concepts by the checker +/** @type {String} */const a = ""; +/** @type {Number} */const b = 0; +/** @type {Boolean} */const c = true; +/** @type {Void} */const d = undefined; +/** @type {Undefined} */const e = undefined; +/** @type {Null} */const f = null; + +/** @type {Function} */const g = () => void 0; +/** @type {function} */const h = () => void 0; +/** @type {array} */const i = []; +/** @type {promise} */const j = Promise.resolve(0); +/** @type {Object} */const k = {x: "x"}; + + +// these are not recognized as anything and should just be lookup failures +// ignore the errors to try to ensure they're emitted as `any` in declaration emit +// @ts-ignore +/** @type {class} */const l = true; +// @ts-ignore +/** @type {bool} */const m = true; +// @ts-ignore +/** @type {int} */const n = true; +// @ts-ignore +/** @type {float} */const o = true; +// @ts-ignore +/** @type {integer} */const p = true; + +// or, in the case of `event` likely erroneously refers to the type of the global Event object +/** @type {event} */const q = undefined; + +//// [index.js] +"use strict"; +// these are recognized as TS concepts by the checker +/** @type {String} */ const a = ""; +/** @type {Number} */ const b = 0; +/** @type {Boolean} */ const c = true; +/** @type {Void} */ const d = undefined; +/** @type {Undefined} */ const e = undefined; +/** @type {Null} */ const f = null; +/** @type {Function} */ const g = () => void 0; +/** @type {function} */ const h = () => void 0; +/** @type {array} */ const i = []; +/** @type {promise} */ const j = Promise.resolve(0); +/** @type {Object} */ const k = { x: "x" }; +// these are not recognized as anything and should just be lookup failures +// ignore the errors to try to ensure they're emitted as `any` in declaration emit +// @ts-ignore +/** @type {class} */ const l = true; +// @ts-ignore +/** @type {bool} */ const m = true; +// @ts-ignore +/** @type {int} */ const n = true; +// @ts-ignore +/** @type {float} */ const o = true; +// @ts-ignore +/** @type {integer} */ const p = true; +// or, in the case of `event` likely erroneously refers to the type of the global Event object +/** @type {event} */ const q = undefined; + + +//// [index.d.ts] +/** @type {String} */ declare const a: string; +/** @type {Number} */ declare const b: number; +/** @type {Boolean} */ declare const c: boolean; +/** @type {Void} */ declare const d: void; +/** @type {Undefined} */ declare const e: undefined; +/** @type {Null} */ declare const f: null; +/** @type {Function} */ declare const g: Function; +/** @type {function} */ declare const h: Function; +/** @type {array} */ declare const i: any[]; +/** @type {promise} */ declare const j: Promise; +/** @type {Object} */ declare const k: { + [x: string]: string; +}; +/** @type {class} */ declare const l: any; +/** @type {bool} */ declare const m: any; +/** @type {int} */ declare const n: any; +/** @type {float} */ declare const o: any; +/** @type {integer} */ declare const p: any; +/** @type {event} */ declare const q: Event | undefined; diff --git a/tests/baselines/reference/jsDeclarationsJSDocRedirectedLookups.symbols b/tests/baselines/reference/jsDeclarationsJSDocRedirectedLookups.symbols new file mode 100644 index 00000000000..b24b2964a49 --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsJSDocRedirectedLookups.symbols @@ -0,0 +1,69 @@ +=== tests/cases/conformance/jsdoc/declarations/index.js === +// these are recognized as TS concepts by the checker +/** @type {String} */const a = ""; +>a : Symbol(a, Decl(index.js, 1, 26)) + +/** @type {Number} */const b = 0; +>b : Symbol(b, Decl(index.js, 2, 26)) + +/** @type {Boolean} */const c = true; +>c : Symbol(c, Decl(index.js, 3, 27)) + +/** @type {Void} */const d = undefined; +>d : Symbol(d, Decl(index.js, 4, 24)) +>undefined : Symbol(undefined) + +/** @type {Undefined} */const e = undefined; +>e : Symbol(e, Decl(index.js, 5, 29)) +>undefined : Symbol(undefined) + +/** @type {Null} */const f = null; +>f : Symbol(f, Decl(index.js, 6, 24)) + +/** @type {Function} */const g = () => void 0; +>g : Symbol(g, Decl(index.js, 8, 28)) + +/** @type {function} */const h = () => void 0; +>h : Symbol(h, Decl(index.js, 9, 28)) + +/** @type {array} */const i = []; +>i : Symbol(i, Decl(index.js, 10, 25)) + +/** @type {promise} */const j = Promise.resolve(0); +>j : Symbol(j, Decl(index.js, 11, 27)) +>Promise.resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) +>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.iterable.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --)) +>resolve : Symbol(PromiseConstructor.resolve, Decl(lib.es2015.promise.d.ts, --, --), Decl(lib.es2015.promise.d.ts, --, --)) + +/** @type {Object} */const k = {x: "x"}; +>k : Symbol(k, Decl(index.js, 12, 42)) +>x : Symbol(x, Decl(index.js, 12, 48)) + + +// these are not recognized as anything and should just be lookup failures +// ignore the errors to try to ensure they're emitted as `any` in declaration emit +// @ts-ignore +/** @type {class} */const l = true; +>l : Symbol(l, Decl(index.js, 18, 25)) + +// @ts-ignore +/** @type {bool} */const m = true; +>m : Symbol(m, Decl(index.js, 20, 24)) + +// @ts-ignore +/** @type {int} */const n = true; +>n : Symbol(n, Decl(index.js, 22, 23)) + +// @ts-ignore +/** @type {float} */const o = true; +>o : Symbol(o, Decl(index.js, 24, 25)) + +// @ts-ignore +/** @type {integer} */const p = true; +>p : Symbol(p, Decl(index.js, 26, 27)) + +// or, in the case of `event` likely erroneously refers to the type of the global Event object +/** @type {event} */const q = undefined; +>q : Symbol(q, Decl(index.js, 29, 25)) +>undefined : Symbol(undefined) + diff --git a/tests/baselines/reference/jsDeclarationsJSDocRedirectedLookups.types b/tests/baselines/reference/jsDeclarationsJSDocRedirectedLookups.types new file mode 100644 index 00000000000..43281db54a3 --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsJSDocRedirectedLookups.types @@ -0,0 +1,89 @@ +=== tests/cases/conformance/jsdoc/declarations/index.js === +// these are recognized as TS concepts by the checker +/** @type {String} */const a = ""; +>a : string +>"" : "" + +/** @type {Number} */const b = 0; +>b : number +>0 : 0 + +/** @type {Boolean} */const c = true; +>c : boolean +>true : true + +/** @type {Void} */const d = undefined; +>d : void +>undefined : undefined + +/** @type {Undefined} */const e = undefined; +>e : undefined +>undefined : undefined + +/** @type {Null} */const f = null; +>f : null +>null : null + +/** @type {Function} */const g = () => void 0; +>g : Function +>() => void 0 : () => undefined +>void 0 : undefined +>0 : 0 + +/** @type {function} */const h = () => void 0; +>h : Function +>() => void 0 : () => undefined +>void 0 : undefined +>0 : 0 + +/** @type {array} */const i = []; +>i : any[] +>[] : never[] + +/** @type {promise} */const j = Promise.resolve(0); +>j : Promise +>Promise.resolve(0) : Promise +>Promise.resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>Promise : PromiseConstructor +>resolve : { (value: T | PromiseLike): Promise; (): Promise; } +>0 : 0 + +/** @type {Object} */const k = {x: "x"}; +>k : { [x: string]: string; } +>{x: "x"} : { x: string; } +>x : string +>"x" : "x" + + +// these are not recognized as anything and should just be lookup failures +// ignore the errors to try to ensure they're emitted as `any` in declaration emit +// @ts-ignore +/** @type {class} */const l = true; +>l : error +>true : true + +// @ts-ignore +/** @type {bool} */const m = true; +>m : error +>true : true + +// @ts-ignore +/** @type {int} */const n = true; +>n : error +>true : true + +// @ts-ignore +/** @type {float} */const o = true; +>o : error +>true : true + +// @ts-ignore +/** @type {integer} */const p = true; +>p : error +>true : true + +// or, in the case of `event` likely erroneously refers to the type of the global Event object +/** @type {event} */const q = undefined; +>q : Event | undefined +>undefined : undefined + diff --git a/tests/baselines/reference/jsDeclarationsMissingGenerics.js b/tests/baselines/reference/jsDeclarationsMissingGenerics.js new file mode 100644 index 00000000000..50d260f785a --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsMissingGenerics.js @@ -0,0 +1,30 @@ +//// [file.js] +/** + * @param {Array} x + */ +function x(x) {} +/** + * @param {Promise} x + */ +function y(x) {} + +//// [file.js] +/** + * @param {Array} x + */ +function x(x) { } +/** + * @param {Promise} x + */ +function y(x) { } + + +//// [file.d.ts] +/** + * @param {Array} x + */ +declare function x(x: any[]): void; +/** + * @param {Promise} x + */ +declare function y(x: Promise): void; diff --git a/tests/baselines/reference/jsDeclarationsMissingGenerics.symbols b/tests/baselines/reference/jsDeclarationsMissingGenerics.symbols new file mode 100644 index 00000000000..a28d52c3dc5 --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsMissingGenerics.symbols @@ -0,0 +1,15 @@ +=== tests/cases/conformance/jsdoc/declarations/file.js === +/** + * @param {Array} x + */ +function x(x) {} +>x : Symbol(x, Decl(file.js, 0, 0)) +>x : Symbol(x, Decl(file.js, 3, 11)) + +/** + * @param {Promise} x + */ +function y(x) {} +>y : Symbol(y, Decl(file.js, 3, 16)) +>x : Symbol(x, Decl(file.js, 7, 11)) + diff --git a/tests/baselines/reference/jsDeclarationsMissingGenerics.types b/tests/baselines/reference/jsDeclarationsMissingGenerics.types new file mode 100644 index 00000000000..55045a38844 --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsMissingGenerics.types @@ -0,0 +1,15 @@ +=== tests/cases/conformance/jsdoc/declarations/file.js === +/** + * @param {Array} x + */ +function x(x) {} +>x : (x: any[]) => void +>x : any[] + +/** + * @param {Promise} x + */ +function y(x) {} +>y : (x: Promise) => void +>x : Promise + diff --git a/tests/baselines/reference/jsDeclarationsNestedParams.js b/tests/baselines/reference/jsDeclarationsNestedParams.js new file mode 100644 index 00000000000..f2ced1ba7cf --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsNestedParams.js @@ -0,0 +1,96 @@ +//// [file.js] +class X { + /** + * Cancels the request, sending a cancellation to the other party + * @param {Object} error __auto_generated__ + * @param {string?} error.reason the error reason to send the cancellation with + * @param {string?} error.code the error code to send the cancellation with + * @returns {Promise.<*>} resolves when the event has been sent. + */ + async cancel({reason, code}) {} +} + +class Y { + /** + * Cancels the request, sending a cancellation to the other party + * @param {Object} error __auto_generated__ + * @param {string?} error.reason the error reason to send the cancellation with + * @param {Object} error.suberr + * @param {string?} error.suberr.reason the error reason to send the cancellation with + * @param {string?} error.suberr.code the error code to send the cancellation with + * @returns {Promise.<*>} resolves when the event has been sent. + */ + async cancel({reason, suberr}) {} +} + + +//// [file.js] +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +class X { + /** + * Cancels the request, sending a cancellation to the other party + * @param {Object} error __auto_generated__ + * @param {string?} error.reason the error reason to send the cancellation with + * @param {string?} error.code the error code to send the cancellation with + * @returns {Promise.<*>} resolves when the event has been sent. + */ + cancel({ reason, code }) { + return __awaiter(this, void 0, void 0, function* () { }); + } +} +class Y { + /** + * Cancels the request, sending a cancellation to the other party + * @param {Object} error __auto_generated__ + * @param {string?} error.reason the error reason to send the cancellation with + * @param {Object} error.suberr + * @param {string?} error.suberr.reason the error reason to send the cancellation with + * @param {string?} error.suberr.code the error code to send the cancellation with + * @returns {Promise.<*>} resolves when the event has been sent. + */ + cancel({ reason, suberr }) { + return __awaiter(this, void 0, void 0, function* () { }); + } +} + + +//// [file.d.ts] +declare class X { + /** + * Cancels the request, sending a cancellation to the other party + * @param {Object} error __auto_generated__ + * @param {string?} error.reason the error reason to send the cancellation with + * @param {string?} error.code the error code to send the cancellation with + * @returns {Promise.<*>} resolves when the event has been sent. + */ + cancel({ reason, code }: { + reason: string | null; + code: string | null; + }): Promise; +} +declare class Y { + /** + * Cancels the request, sending a cancellation to the other party + * @param {Object} error __auto_generated__ + * @param {string?} error.reason the error reason to send the cancellation with + * @param {Object} error.suberr + * @param {string?} error.suberr.reason the error reason to send the cancellation with + * @param {string?} error.suberr.code the error code to send the cancellation with + * @returns {Promise.<*>} resolves when the event has been sent. + */ + cancel({ reason, suberr }: { + reason: string | null; + suberr: { + reason: string | null; + code: string | null; + }; + }): Promise; +} diff --git a/tests/baselines/reference/jsDeclarationsNestedParams.symbols b/tests/baselines/reference/jsDeclarationsNestedParams.symbols new file mode 100644 index 00000000000..3b567a5952c --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsNestedParams.symbols @@ -0,0 +1,35 @@ +=== tests/cases/conformance/jsdoc/declarations/file.js === +class X { +>X : Symbol(X, Decl(file.js, 0, 0)) + + /** + * Cancels the request, sending a cancellation to the other party + * @param {Object} error __auto_generated__ + * @param {string?} error.reason the error reason to send the cancellation with + * @param {string?} error.code the error code to send the cancellation with + * @returns {Promise.<*>} resolves when the event has been sent. + */ + async cancel({reason, code}) {} +>cancel : Symbol(X.cancel, Decl(file.js, 0, 9)) +>reason : Symbol(reason, Decl(file.js, 8, 18)) +>code : Symbol(code, Decl(file.js, 8, 25)) +} + +class Y { +>Y : Symbol(Y, Decl(file.js, 9, 1)) + + /** + * Cancels the request, sending a cancellation to the other party + * @param {Object} error __auto_generated__ + * @param {string?} error.reason the error reason to send the cancellation with + * @param {Object} error.suberr + * @param {string?} error.suberr.reason the error reason to send the cancellation with + * @param {string?} error.suberr.code the error code to send the cancellation with + * @returns {Promise.<*>} resolves when the event has been sent. + */ + async cancel({reason, suberr}) {} +>cancel : Symbol(Y.cancel, Decl(file.js, 11, 9)) +>reason : Symbol(reason, Decl(file.js, 21, 18)) +>suberr : Symbol(suberr, Decl(file.js, 21, 25)) +} + diff --git a/tests/baselines/reference/jsDeclarationsNestedParams.types b/tests/baselines/reference/jsDeclarationsNestedParams.types new file mode 100644 index 00000000000..483a707a089 --- /dev/null +++ b/tests/baselines/reference/jsDeclarationsNestedParams.types @@ -0,0 +1,35 @@ +=== tests/cases/conformance/jsdoc/declarations/file.js === +class X { +>X : X + + /** + * Cancels the request, sending a cancellation to the other party + * @param {Object} error __auto_generated__ + * @param {string?} error.reason the error reason to send the cancellation with + * @param {string?} error.code the error code to send the cancellation with + * @returns {Promise.<*>} resolves when the event has been sent. + */ + async cancel({reason, code}) {} +>cancel : ({ reason, code }: { reason: string | null; code: string | null;}) => Promise +>reason : string +>code : string +} + +class Y { +>Y : Y + + /** + * Cancels the request, sending a cancellation to the other party + * @param {Object} error __auto_generated__ + * @param {string?} error.reason the error reason to send the cancellation with + * @param {Object} error.suberr + * @param {string?} error.suberr.reason the error reason to send the cancellation with + * @param {string?} error.suberr.code the error code to send the cancellation with + * @returns {Promise.<*>} resolves when the event has been sent. + */ + async cancel({reason, suberr}) {} +>cancel : ({ reason, suberr }: { reason: string | null; suberr: { reason: string | null; code: string | null; };}) => Promise +>reason : string +>suberr : { reason: string; code: string; } +} + diff --git a/tests/baselines/reference/jsdocArrayObjectPromiseImplicitAny.types b/tests/baselines/reference/jsdocArrayObjectPromiseImplicitAny.types index 7ea21afe4c8..3fab5033c23 100644 --- a/tests/baselines/reference/jsdocArrayObjectPromiseImplicitAny.types +++ b/tests/baselines/reference/jsdocArrayObjectPromiseImplicitAny.types @@ -16,7 +16,7 @@ var numberArray = [5]; * @return {Array} */ function returnAnyArray(arr) { ->returnAnyArray : (arr: Array) => Array +>returnAnyArray : (arr: any[]) => any[] >arr : any[] return arr; @@ -46,7 +46,7 @@ var numberPromise = Promise.resolve(5); * @return {Promise} */ function returnAnyPromise(pr) { ->returnAnyPromise : (pr: Promise) => Promise +>returnAnyPromise : (pr: Promise) => Promise >pr : Promise return pr; @@ -72,7 +72,7 @@ var paramedObject = {valueOf: 1}; * @return {Object} */ function returnAnyObject(obj) { ->returnAnyObject : (obj: Object) => Object +>returnAnyObject : (obj: any) => any >obj : any return obj; diff --git a/tests/baselines/reference/jsdocArrayObjectPromiseNoImplicitAny.types b/tests/baselines/reference/jsdocArrayObjectPromiseNoImplicitAny.types index e5dba449a09..82ff886f1ec 100644 --- a/tests/baselines/reference/jsdocArrayObjectPromiseNoImplicitAny.types +++ b/tests/baselines/reference/jsdocArrayObjectPromiseNoImplicitAny.types @@ -16,7 +16,7 @@ var numberArray = [5]; * @return {Array} */ function returnNotAnyArray(arr) { ->returnNotAnyArray : (arr: Array) => Array +>returnNotAnyArray : (arr: any[]) => any[] >arr : any[] return arr; @@ -46,7 +46,7 @@ var numberPromise = Promise.resolve(5); * @return {Promise} */ function returnNotAnyPromise(pr) { ->returnNotAnyPromise : (pr: Promise) => Promise +>returnNotAnyPromise : (pr: Promise) => Promise >pr : Promise return pr; diff --git a/tests/baselines/reference/jsdocClassMissingTypeArguments.types b/tests/baselines/reference/jsdocClassMissingTypeArguments.types index 8be84d6df5d..0c64fd3c5a7 100644 --- a/tests/baselines/reference/jsdocClassMissingTypeArguments.types +++ b/tests/baselines/reference/jsdocClassMissingTypeArguments.types @@ -5,6 +5,6 @@ class C {} /** @param {C} p */ function f(p) {} ->f : (p: C) => void +>f : (p: C) => void >p : C diff --git a/tests/baselines/reference/jsdocParamTag2.types b/tests/baselines/reference/jsdocParamTag2.types index bc4d0f3b10a..e81155ccb3c 100644 --- a/tests/baselines/reference/jsdocParamTag2.types +++ b/tests/baselines/reference/jsdocParamTag2.types @@ -49,7 +49,7 @@ function good4({a, b}) {} * @param {string} x */ function good5({a, b}, x) {} ->good5 : ({ a, b }: * @param {string} obj.a - this is like the saddest way to specify a type * @param {string} obj.b - but it sure does allow a lot of documentation, x: string) => void +>good5 : ({ a, b }: { a: string; b: string;}, x: string) => void >a : string >b : string >x : string @@ -63,7 +63,7 @@ function good5({a, b}, x) {} * @param {string} OBJECTION.d - meh */ function good6({a, b}, {c, d}) {} ->good6 : ({ a, b }: * @param {string} obj.a * @param {string} obj.b - but it sure does allow a lot of documentation, { c, d }: * @param {string} OBJECTION.c * @param {string} OBJECTION.d - meh) => void +>good6 : ({ a, b }: { a: string; b: string;}, { c, d }: { c: string; d: string;}) => void >a : string >b : string >c : string @@ -77,7 +77,7 @@ function good6({a, b}, {c, d}) {} * @param {string} y */ function good7(x, {a, b}, y) {} ->good7 : (x: number, { a, b }: * @param {string} obj.a * @param {string} obj.b, y: string) => void +>good7 : (x: number, { a, b }: { a: string; b: string;}, y: string) => void >x : number >a : string >b : string @@ -89,7 +89,7 @@ function good7(x, {a, b}, y) {} * @param {string} obj.b */ function good8({a, b}) {} ->good8 : ({ a, b }: * @param {string} obj.a * @param {string} obj.b) => void +>good8 : ({ a, b }: { a: string; b: string;}) => void >a : string >b : string diff --git a/tests/baselines/reference/jsdocParamTagTypeLiteral.types b/tests/baselines/reference/jsdocParamTagTypeLiteral.types index a27d8b4d50c..6a51e49ee6c 100644 --- a/tests/baselines/reference/jsdocParamTagTypeLiteral.types +++ b/tests/baselines/reference/jsdocParamTagTypeLiteral.types @@ -23,7 +23,7 @@ normal(12); * @param {string} [opts1.w="hi"] doc5 */ function foo1(opts1) { ->foo1 : (opts1: * @param {string} opts1.x doc2 * @param {string=} opts1.y doc3 * @param {string} [opts1.z] doc4 * @param {string} [opts1.w] doc5) => void +>foo1 : (opts1: { x: string; y?: string | undefined; z: string; w: string;}) => void >opts1 : { x: string; y?: string | undefined; z?: string; w?: string; } opts1.x; @@ -45,7 +45,7 @@ foo1({x: 'abc'}); * @param {string=} opts2[].anotherY */ function foo2(/** @param opts2 bad idea theatre! */opts2) { ->foo2 : (opts2: * @param {string} opts2.anotherX * @param {string=} opts2.anotherY) => void +>foo2 : (opts2: { anotherX: string; anotherY?: string | undefined;}) => void >opts2 : { anotherX: string; anotherY?: string | undefined; }[] opts2[0].anotherX; @@ -69,7 +69,7 @@ foo2([{anotherX: "world"}]); * @param {string} opts3.x */ function foo3(opts3) { ->foo3 : (opts3: * @param {string} opts3.x) => void +>foo3 : (opts3: { x: string;}) => void >opts3 : { x: string; } opts3.x; @@ -92,7 +92,7 @@ foo3({x: 'abc'}); * @param {string} [opts4[].w="hi"] */ function foo4(opts4) { ->foo4 : (opts4: * @param {string} opts4.x * @param {string=} opts4.y * @param {string} [opts4.z] * @param {string} [opts4.w]) => void +>foo4 : (opts4: { x: string; y?: string | undefined; z: string; w: string;}) => void >opts4 : { x: string; y?: string | undefined; z?: string; w?: string; }[] opts4[0].x; @@ -122,7 +122,7 @@ foo4([{ x: 'hi' }]); * @param {number} opts5[].unnest - Here we are almost all the way back at the beginning. */ function foo5(opts5) { ->foo5 : (opts5: * @param {string} opts5.help - (This one is just normal) * @param { * @param {string} opts5.what.a - (Another normal one) * @param { * @param {string} opts5.what.bad.idea - I don't think you can get back out of this level... * @param {boolean} opts5.what.bad.oh - Oh ... that's how you do it.} opts5.what.bad - Now we're nesting inside a nested type} opts5.what - Look at us go! Here's the first nest! * @param {number} opts5.unnest - Here we are almost all the way back at the beginning.) => void +>foo5 : (opts5: { help: string; what: { a: string; bad: { idea: string; oh: boolean; }; }; unnest: number;}) => void >opts5 : { help: string; what: { a: string; bad: { idea: string; oh: boolean; }[]; }; unnest: number; }[] opts5[0].what.bad[0].idea; diff --git a/tests/baselines/reference/jsdocTemplateConstructorFunction2.types b/tests/baselines/reference/jsdocTemplateConstructorFunction2.types index 19270bb4b67..dc70e5282c3 100644 --- a/tests/baselines/reference/jsdocTemplateConstructorFunction2.types +++ b/tests/baselines/reference/jsdocTemplateConstructorFunction2.types @@ -26,13 +26,13 @@ function Zet(t) { * @param {T} o.nested */ Zet.prototype.add = function(v, o) { ->Zet.prototype.add = function(v, o) { this.u = v || o.nested return this.u} : (v: T, o: * @param {T} o.nested) => T +>Zet.prototype.add = function(v, o) { this.u = v || o.nested return this.u} : (v: T, o: { nested: T; }) => T >Zet.prototype.add : any >Zet.prototype : any >Zet : typeof Zet >prototype : any >add : any ->function(v, o) { this.u = v || o.nested return this.u} : (v: T, o: * @param {T} o.nested) => T +>function(v, o) { this.u = v || o.nested return this.u} : (v: T, o: { nested: T; }) => T >v : T >o : { nested: T; } diff --git a/tests/baselines/reference/jsdocTemplateTag.types b/tests/baselines/reference/jsdocTemplateTag.types index 860244c6315..7b5a2f5da71 100644 --- a/tests/baselines/reference/jsdocTemplateTag.types +++ b/tests/baselines/reference/jsdocTemplateTag.types @@ -42,12 +42,12 @@ let s = g('hi')() * @param {Array.} keyframes - Can't look up types on Element since it's a global in another file. (But it shouldn't crash). */ Element.prototype.animate = function(keyframes) {}; ->Element.prototype.animate = function(keyframes) {} : (keyframes: Array) => void +>Element.prototype.animate = function(keyframes) {} : (keyframes: Array) => void >Element.prototype.animate : (keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions) => Animation >Element.prototype : Element >Element : { new (): Element; prototype: Element; } >prototype : Element >animate : (keyframes: Keyframe[] | PropertyIndexedKeyframes, options?: number | KeyframeAnimationOptions) => Animation ->function(keyframes) {} : (keyframes: Array) => void +>function(keyframes) {} : (keyframes: Array) => void >keyframes : any[] diff --git a/tests/baselines/reference/jsdocTypeNongenericInstantiationAttempt.types b/tests/baselines/reference/jsdocTypeNongenericInstantiationAttempt.types index 1549c560583..21dc8d546ce 100644 --- a/tests/baselines/reference/jsdocTypeNongenericInstantiationAttempt.types +++ b/tests/baselines/reference/jsdocTypeNongenericInstantiationAttempt.types @@ -109,6 +109,6 @@ function fn() {} * @param {fn} somebody */ function sayHello8(somebody) { } ->sayHello8 : (somebody: fn) => void +>sayHello8 : (somebody: () => void) => void >somebody : () => void diff --git a/tests/baselines/reference/jsdocTypeReferenceToValue.types b/tests/baselines/reference/jsdocTypeReferenceToValue.types index 4db6664b84d..91f8e26d35d 100644 --- a/tests/baselines/reference/jsdocTypeReferenceToValue.types +++ b/tests/baselines/reference/jsdocTypeReferenceToValue.types @@ -1,7 +1,7 @@ === tests/cases/conformance/jsdoc/foo.js === /** @param {Image} image */ function process(image) { ->process : (image: Image) => HTMLImageElement +>process : (image: new (width?: number, height?: number) => HTMLImageElement) => HTMLImageElement >image : new (width?: number, height?: number) => HTMLImageElement return new image(1, 1) diff --git a/tests/baselines/reference/jsxPartialSpread.js b/tests/baselines/reference/jsxPartialSpread.js new file mode 100644 index 00000000000..e37b12f7d7a --- /dev/null +++ b/tests/baselines/reference/jsxPartialSpread.js @@ -0,0 +1,26 @@ +//// [jsxPartialSpread.tsx] +/// +const Select = (p: {value?: unknown}) =>

; +import React from 'react'; + +export function Repro({ SelectProps = {} }: { SelectProps?: Partial[0]> }) { + return ( + ); +} +exports.Repro = Repro; diff --git a/tests/baselines/reference/jsxPartialSpread.symbols b/tests/baselines/reference/jsxPartialSpread.symbols new file mode 100644 index 00000000000..7b0a1710649 --- /dev/null +++ b/tests/baselines/reference/jsxPartialSpread.symbols @@ -0,0 +1,28 @@ +=== tests/cases/compiler/jsxPartialSpread.tsx === +/// +const Select = (p: {value?: unknown}) =>

; +>Select : Symbol(Select, Decl(jsxPartialSpread.tsx, 1, 5)) +>p : Symbol(p, Decl(jsxPartialSpread.tsx, 1, 16)) +>value : Symbol(value, Decl(jsxPartialSpread.tsx, 1, 20)) +>p : Symbol(JSX.IntrinsicElements.p, Decl(react16.d.ts, 2467, 102)) +>p : Symbol(JSX.IntrinsicElements.p, Decl(react16.d.ts, 2467, 102)) + +import React from 'react'; +>React : Symbol(React, Decl(jsxPartialSpread.tsx, 2, 6)) + +export function Repro({ SelectProps = {} }: { SelectProps?: Partial[0]> }) { +>Repro : Symbol(Repro, Decl(jsxPartialSpread.tsx, 2, 26)) +>SelectProps : Symbol(SelectProps, Decl(jsxPartialSpread.tsx, 4, 23)) +>SelectProps : Symbol(SelectProps, Decl(jsxPartialSpread.tsx, 4, 45)) +>Partial : Symbol(Partial, Decl(lib.es5.d.ts, --, --)) +>Parameters : Symbol(Parameters, Decl(lib.es5.d.ts, --, --)) +>Select : Symbol(Select, Decl(jsxPartialSpread.tsx, 1, 5)) + + return ( + ) : JSX.Element + + : JSX.Element +>Select : (p: { value?: unknown; }) => JSX.Element +>value : string +>'test' : "test" +>SelectProps : Partial<{ value?: unknown; }> + + ); +} diff --git a/tests/baselines/reference/moduleAugmentationDoesInterfaceMergeOfReexport.js b/tests/baselines/reference/moduleAugmentationDoesInterfaceMergeOfReexport.js index 1366f9cb258..2d3b3b7a1b4 100644 --- a/tests/baselines/reference/moduleAugmentationDoesInterfaceMergeOfReexport.js +++ b/tests/baselines/reference/moduleAugmentationDoesInterfaceMergeOfReexport.js @@ -36,7 +36,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./file"), exports); //// [augment.js] diff --git a/tests/baselines/reference/moduleAugmentationDoesNamespaceEnumMergeOfReexport.js b/tests/baselines/reference/moduleAugmentationDoesNamespaceEnumMergeOfReexport.js index 0cf02bb0c60..38bfb39d776 100644 --- a/tests/baselines/reference/moduleAugmentationDoesNamespaceEnumMergeOfReexport.js +++ b/tests/baselines/reference/moduleAugmentationDoesNamespaceEnumMergeOfReexport.js @@ -41,7 +41,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./file"), exports); //// [augment.js] diff --git a/tests/baselines/reference/moduleAugmentationDoesNamespaceMergeOfReexport.js b/tests/baselines/reference/moduleAugmentationDoesNamespaceMergeOfReexport.js index 9ddd49666a8..8a606153bd1 100644 --- a/tests/baselines/reference/moduleAugmentationDoesNamespaceMergeOfReexport.js +++ b/tests/baselines/reference/moduleAugmentationDoesNamespaceMergeOfReexport.js @@ -40,7 +40,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./file"), exports); //// [augment.js] diff --git a/tests/baselines/reference/moduleAugmentationEnumClassMergeOfReexportIsError.js b/tests/baselines/reference/moduleAugmentationEnumClassMergeOfReexportIsError.js index 1bd7540e23f..0cb50179bfd 100644 --- a/tests/baselines/reference/moduleAugmentationEnumClassMergeOfReexportIsError.js +++ b/tests/baselines/reference/moduleAugmentationEnumClassMergeOfReexportIsError.js @@ -39,7 +39,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./file"), exports); //// [augment.js] diff --git a/tests/baselines/reference/moduleDeclarationExportStarShadowingGlobalIsNameable.js b/tests/baselines/reference/moduleDeclarationExportStarShadowingGlobalIsNameable.js index 9e49c965bfa..f243093f5be 100644 --- a/tests/baselines/reference/moduleDeclarationExportStarShadowingGlobalIsNameable.js +++ b/tests/baselines/reference/moduleDeclarationExportStarShadowingGlobalIsNameable.js @@ -39,7 +39,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./account"), exports); //// [index.js] diff --git a/tests/baselines/reference/moduleExportNestedNamespaces.types b/tests/baselines/reference/moduleExportNestedNamespaces.types index a1fc39b723c..5a266b23277 100644 --- a/tests/baselines/reference/moduleExportNestedNamespaces.types +++ b/tests/baselines/reference/moduleExportNestedNamespaces.types @@ -75,7 +75,7 @@ var classic = new s.Classic() /** @param {s.n.K} c @param {s.Classic} classic */ function f(c, classic) { ->f : (c: s.n.K, classic: s.Classic) => void +>f : (c: C, classic: s.Classic) => void >c : C >classic : Classic diff --git a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.js b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.js index ab43c82628d..4051b88b059 100644 --- a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.js +++ b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings1.js @@ -26,7 +26,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./c"), exports); //// [a.js] @@ -40,7 +40,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./b"), exports); __exportStar(require("./c"), exports); diff --git a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.js b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.js index 456cc75fe8b..1a0b21438e2 100644 --- a/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.js +++ b/tests/baselines/reference/moduleSameValueDuplicateExportedBindings2.js @@ -46,7 +46,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./b"), exports); __exportStar(require("./c"), exports); diff --git a/tests/baselines/reference/prototypePropertyAssignmentMergeWithInterfaceMethod.types b/tests/baselines/reference/prototypePropertyAssignmentMergeWithInterfaceMethod.types index b61471495b1..1a4d86e89cd 100644 --- a/tests/baselines/reference/prototypePropertyAssignmentMergeWithInterfaceMethod.types +++ b/tests/baselines/reference/prototypePropertyAssignmentMergeWithInterfaceMethod.types @@ -40,7 +40,7 @@ lf.Transaction = function() {}; * @return {!IThenable} */ lf.Transaction.prototype.begin = function(scope) {}; ->lf.Transaction.prototype.begin = function(scope) {} : (scope: Array) => any +>lf.Transaction.prototype.begin = function(scope) {} : (scope: Array) => any >lf.Transaction.prototype.begin : any >lf.Transaction.prototype : any >lf.Transaction : typeof Transaction @@ -48,6 +48,6 @@ lf.Transaction.prototype.begin = function(scope) {}; >Transaction : typeof Transaction >prototype : any >begin : any ->function(scope) {} : (scope: Array) => any +>function(scope) {} : (scope: Array) => any >scope : any[] diff --git a/tests/baselines/reference/quickInfoOnUnionPropertiesWithIdenticalJSDocComments01.baseline b/tests/baselines/reference/quickInfoOnUnionPropertiesWithIdenticalJSDocComments01.baseline new file mode 100644 index 00000000000..b03ca277801 --- /dev/null +++ b/tests/baselines/reference/quickInfoOnUnionPropertiesWithIdenticalJSDocComments01.baseline @@ -0,0 +1,60 @@ +[ + { + "marker": { + "fileName": "/tests/cases/fourslash/quickInfoOnUnionPropertiesWithIdenticalJSDocComments01.ts", + "position": 746 + }, + "quickInfo": { + "kind": "property", + "kindModifiers": "optional", + "textSpan": { + "start": 746, + "length": 8 + }, + "displayParts": [ + { + "text": "(", + "kind": "punctuation" + }, + { + "text": "property", + "kind": "text" + }, + { + "text": ")", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "language", + "kind": "propertyName" + }, + { + "text": "?", + "kind": "punctuation" + }, + { + "text": ":", + "kind": "punctuation" + }, + { + "text": " ", + "kind": "space" + }, + { + "text": "string", + "kind": "keyword" + } + ], + "documentation": [ + { + "text": "A language id, like `typescript`.", + "kind": "text" + } + ] + } + } +] \ No newline at end of file diff --git a/tests/baselines/reference/symbolLinkDeclarationEmitModuleNames.js b/tests/baselines/reference/symbolLinkDeclarationEmitModuleNames.js index a4f5f4e177c..7474849c1a8 100644 --- a/tests/baselines/reference/symbolLinkDeclarationEmitModuleNames.js +++ b/tests/baselines/reference/symbolLinkDeclarationEmitModuleNames.js @@ -51,7 +51,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./src/value-promise"), exports); __exportStar(require("./src/bindingkey"), exports); diff --git a/tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToImport.js b/tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToImport.js index 2cadc1e1ec5..7f04a9b7201 100644 --- a/tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToImport.js +++ b/tests/baselines/reference/transformApi/transformsCorrectly.transformAddCommentToImport.js @@ -8,7 +8,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); exports.Value = void 0; /*comment*/ diff --git a/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js b/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js index deeefd1ad04..6001eeaf1f7 100644 --- a/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js +++ b/tests/baselines/reference/tsbuild/watchMode/reexport/Reports-errors-correctly.js @@ -85,7 +85,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./session"), exports); diff --git a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js index 649de585df5..29eefb2d8e1 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink-moduleCaseChange.js @@ -73,7 +73,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./keys"), exports); diff --git a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js index 4a223fe9c6d..40045b6d167 100644 --- a/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js +++ b/tests/baselines/reference/tsc/declarationEmit/when-pkg-references-sibling-package-through-indirect-symlink.js @@ -73,7 +73,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; Object.defineProperty(exports, "__esModule", { value: true }); __exportStar(require("./keys"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index 9c1f665cca0..03e43850ee9 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -70,7 +70,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -86,7 +86,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -132,7 +132,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 20027ce38f1..d9199bcceef 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependencies/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -64,7 +64,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -80,7 +80,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -114,7 +114,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index e51fe281ec1..8fd7efd3250 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -76,7 +76,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -96,7 +96,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -162,7 +162,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 6c1de9a4deb..76c72db2a76 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/assumeChangesOnlyAffectDirectDependenciesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -70,7 +70,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -90,7 +90,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -135,7 +135,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index f72345ccc56..e927c312aca 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -70,7 +70,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -86,7 +86,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -132,7 +132,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 8de8338f4bb..96f39107d7d 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/default/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -64,7 +64,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -80,7 +80,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -114,7 +114,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index 071013c5e81..18c3f4e5ea1 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -76,7 +76,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -96,7 +96,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -162,7 +162,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index 547418b8fce..9f9528102ad 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/defaultAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -70,7 +70,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -90,7 +90,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -135,7 +135,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index b1eead4925a..1c96e77804b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -70,7 +70,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -86,7 +86,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -132,7 +132,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index bda31bf5c1f..950359dda9e 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModules/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -64,7 +64,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -80,7 +80,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -114,7 +114,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js index cfe43df46a1..e793fd4f72b 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-circular-import-and-exports.js @@ -76,7 +76,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -96,7 +96,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -162,7 +162,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js index c0a64ac97a5..8eed0ceda00 100644 --- a/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js +++ b/tests/baselines/reference/tscWatch/emitAndErrorUpdates/isolatedModulesAndD/updates-errors-when-file-transitively-exported-file-changes/when-there-are-no-circular-import-and-exports.js @@ -70,7 +70,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools.interface"), exports); @@ -90,7 +90,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./tools/public"), exports); @@ -135,7 +135,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./data"), exports); diff --git a/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js b/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js index 2345c69fd19..b5479b07279 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js +++ b/tests/baselines/reference/tscWatch/programUpdates/changes-in-files-are-reflected-in-project-structure.js @@ -39,7 +39,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./f2"), exports); @@ -96,7 +96,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("../c/f3"), exports); diff --git a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js index 6db5d9bcb60..0d56470f85e 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js +++ b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure-2.js @@ -39,7 +39,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("../c/f3"), exports); @@ -55,7 +55,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./f2"), exports); diff --git a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js index 75dd1b1443f..6973c5ff627 100644 --- a/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js +++ b/tests/baselines/reference/tscWatch/programUpdates/deleted-files-affect-project-structure.js @@ -39,7 +39,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("../c/f3"), exports); @@ -55,7 +55,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi })); var __exportStar = (this && this.__exportStar) || function(m, exports) { for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); -} +}; exports.__esModule = true; __exportStar(require("./f2"), exports); diff --git a/tests/baselines/reference/typeFromPropertyAssignment35.types b/tests/baselines/reference/typeFromPropertyAssignment35.types index 78f1dfd6224..df9db2d8a5e 100644 --- a/tests/baselines/reference/typeFromPropertyAssignment35.types +++ b/tests/baselines/reference/typeFromPropertyAssignment35.types @@ -1,7 +1,7 @@ === tests/cases/conformance/salsa/bug26877.js === /** @param {Emu.D} x */ function ollKorrect(x) { ->ollKorrect : (x: Emu.D) => void +>ollKorrect : (x: D) => void >x : D x._model diff --git a/tests/baselines/reference/typeFromPropertyAssignment6.types b/tests/baselines/reference/typeFromPropertyAssignment6.types index 7bcbddebe73..2649b817155 100644 --- a/tests/baselines/reference/typeFromPropertyAssignment6.types +++ b/tests/baselines/reference/typeFromPropertyAssignment6.types @@ -33,7 +33,7 @@ var msgs = Outer.i.messages() /** @param {Outer.Inner} inner */ function x(inner) { ->x : (inner: Outer.Inner) => void +>x : (inner: I) => void >inner : I } diff --git a/tests/baselines/reference/typedefDuplicateTypeDeclaration.errors.txt b/tests/baselines/reference/typedefDuplicateTypeDeclaration.errors.txt new file mode 100644 index 00000000000..70e0f941b97 --- /dev/null +++ b/tests/baselines/reference/typedefDuplicateTypeDeclaration.errors.txt @@ -0,0 +1,13 @@ +tests/cases/conformance/jsdoc/typedefDuplicateTypeDeclaration.js(4,16): error TS8033: A JSDoc '@typedef' comment may not contain multiple '@type' tags. + + +==== tests/cases/conformance/jsdoc/typedefDuplicateTypeDeclaration.js (1 errors) ==== + /** + * @typedef Name + * @type {string} + * @type {Oops} + + */ + +!!! error TS8033: A JSDoc '@typedef' comment may not contain multiple '@type' tags. +!!! related TS8034 tests/cases/conformance/jsdoc/typedefDuplicateTypeDeclaration.js:1:1: The tag was first specified here. \ No newline at end of file diff --git a/tests/baselines/reference/typedefDuplicateTypeDeclaration.symbols b/tests/baselines/reference/typedefDuplicateTypeDeclaration.symbols new file mode 100644 index 00000000000..eeafce6655c --- /dev/null +++ b/tests/baselines/reference/typedefDuplicateTypeDeclaration.symbols @@ -0,0 +1,7 @@ +=== tests/cases/conformance/jsdoc/typedefDuplicateTypeDeclaration.js === +/** +No type information for this code. * @typedef Name +No type information for this code. * @type {string} +No type information for this code. * @type {Oops} +No type information for this code. */ +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/typedefDuplicateTypeDeclaration.types b/tests/baselines/reference/typedefDuplicateTypeDeclaration.types new file mode 100644 index 00000000000..eeafce6655c --- /dev/null +++ b/tests/baselines/reference/typedefDuplicateTypeDeclaration.types @@ -0,0 +1,7 @@ +=== tests/cases/conformance/jsdoc/typedefDuplicateTypeDeclaration.js === +/** +No type information for this code. * @typedef Name +No type information for this code. * @type {string} +No type information for this code. * @type {Oops} +No type information for this code. */ +No type information for this code. \ No newline at end of file diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.js b/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.js new file mode 100644 index 00000000000..2ff4da1f22a --- /dev/null +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.js @@ -0,0 +1,76 @@ +//// [uniqueSymbolsDeclarationsInJs.js] +// classes +class C { + /** + * @readonly + */ + static readonlyStaticCall = Symbol(); + /** + * @type {unique symbol} + * @readonly + */ + static readonlyStaticType; + /** + * @type {unique symbol} + * @readonly + */ + static readonlyStaticTypeAndCall = Symbol(); + static readwriteStaticCall = Symbol(); + + /** + * @readonly + */ + readonlyCall = Symbol(); + readwriteCall = Symbol(); +} + + +//// [uniqueSymbolsDeclarationsInJs-out.js] +// classes +let C = /** @class */ (() => { + class C { + constructor() { + /** + * @readonly + */ + this.readonlyCall = Symbol(); + this.readwriteCall = Symbol(); + } + } + /** + * @readonly + */ + C.readonlyStaticCall = Symbol(); + /** + * @type {unique symbol} + * @readonly + */ + C.readonlyStaticTypeAndCall = Symbol(); + C.readwriteStaticCall = Symbol(); + return C; +})(); + + +//// [uniqueSymbolsDeclarationsInJs-out.d.ts] +declare class C { + /** + * @readonly + */ + static readonly readonlyStaticCall: unique symbol; + /** + * @type {unique symbol} + * @readonly + */ + static readonly readonlyStaticType: unique symbol; + /** + * @type {unique symbol} + * @readonly + */ + static readonly readonlyStaticTypeAndCall: unique symbol; + static readwriteStaticCall: symbol; + /** + * @readonly + */ + readonly readonlyCall: symbol; + readwriteCall: symbol; +} diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.symbols b/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.symbols new file mode 100644 index 00000000000..b48c5cc6c58 --- /dev/null +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.symbols @@ -0,0 +1,43 @@ +=== tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarationsInJs.js === +// classes +class C { +>C : Symbol(C, Decl(uniqueSymbolsDeclarationsInJs.js, 0, 0)) + + /** + * @readonly + */ + static readonlyStaticCall = Symbol(); +>readonlyStaticCall : Symbol(C.readonlyStaticCall, Decl(uniqueSymbolsDeclarationsInJs.js, 1, 9)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) + + /** + * @type {unique symbol} + * @readonly + */ + static readonlyStaticType; +>readonlyStaticType : Symbol(C.readonlyStaticType, Decl(uniqueSymbolsDeclarationsInJs.js, 5, 41)) + + /** + * @type {unique symbol} + * @readonly + */ + static readonlyStaticTypeAndCall = Symbol(); +>readonlyStaticTypeAndCall : Symbol(C.readonlyStaticTypeAndCall, Decl(uniqueSymbolsDeclarationsInJs.js, 10, 30)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) + + static readwriteStaticCall = Symbol(); +>readwriteStaticCall : Symbol(C.readwriteStaticCall, Decl(uniqueSymbolsDeclarationsInJs.js, 15, 48)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) + + /** + * @readonly + */ + readonlyCall = Symbol(); +>readonlyCall : Symbol(C.readonlyCall, Decl(uniqueSymbolsDeclarationsInJs.js, 16, 42)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) + + readwriteCall = Symbol(); +>readwriteCall : Symbol(C.readwriteCall, Decl(uniqueSymbolsDeclarationsInJs.js, 21, 28)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.es2019.symbol.d.ts, --, --)) +} + diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.types b/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.types new file mode 100644 index 00000000000..a51ba3c324d --- /dev/null +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsInJs.types @@ -0,0 +1,48 @@ +=== tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarationsInJs.js === +// classes +class C { +>C : C + + /** + * @readonly + */ + static readonlyStaticCall = Symbol(); +>readonlyStaticCall : unique symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + + /** + * @type {unique symbol} + * @readonly + */ + static readonlyStaticType; +>readonlyStaticType : symbol + + /** + * @type {unique symbol} + * @readonly + */ + static readonlyStaticTypeAndCall = Symbol(); +>readonlyStaticTypeAndCall : symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + + static readwriteStaticCall = Symbol(); +>readwriteStaticCall : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + /** + * @readonly + */ + readonlyCall = Symbol(); +>readonlyCall : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor + + readwriteCall = Symbol(); +>readwriteCall : symbol +>Symbol() : symbol +>Symbol : SymbolConstructor +} + diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.errors.txt b/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.errors.txt new file mode 100644 index 00000000000..16120be782b --- /dev/null +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.errors.txt @@ -0,0 +1,24 @@ +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarationsInJsErrors.js(5,12): error TS1331: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. +tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarationsInJsErrors.js(14,12): error TS1331: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. + + +==== tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarationsInJsErrors.js (2 errors) ==== + class C { + /** + * @type {unique symbol} + */ + static readwriteStaticType; + ~~~~~~~~~~~~~~~~~~~ +!!! error TS1331: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. + /** + * @type {unique symbol} + * @readonly + */ + static readonlyType; + /** + * @type {unique symbol} + */ + static readwriteType; + ~~~~~~~~~~~~~ +!!! error TS1331: A property of a class whose type is a 'unique symbol' type must be both 'static' and 'readonly'. + } \ No newline at end of file diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.js b/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.js new file mode 100644 index 00000000000..65019a88efd --- /dev/null +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.js @@ -0,0 +1,38 @@ +//// [uniqueSymbolsDeclarationsInJsErrors.js] +class C { + /** + * @type {unique symbol} + */ + static readwriteStaticType; + /** + * @type {unique symbol} + * @readonly + */ + static readonlyType; + /** + * @type {unique symbol} + */ + static readwriteType; +} + +//// [uniqueSymbolsDeclarationsInJsErrors-out.js] +class C { +} + + +//// [uniqueSymbolsDeclarationsInJsErrors-out.d.ts] +declare class C { + /** + * @type {unique symbol} + */ + static readwriteStaticType: unique symbol; + /** + * @type {unique symbol} + * @readonly + */ + static readonly readonlyType: unique symbol; + /** + * @type {unique symbol} + */ + static readwriteType: unique symbol; +} diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.symbols b/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.symbols new file mode 100644 index 00000000000..6ac6e495d77 --- /dev/null +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.symbols @@ -0,0 +1,23 @@ +=== tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarationsInJsErrors.js === +class C { +>C : Symbol(C, Decl(uniqueSymbolsDeclarationsInJsErrors.js, 0, 0)) + + /** + * @type {unique symbol} + */ + static readwriteStaticType; +>readwriteStaticType : Symbol(C.readwriteStaticType, Decl(uniqueSymbolsDeclarationsInJsErrors.js, 0, 9)) + + /** + * @type {unique symbol} + * @readonly + */ + static readonlyType; +>readonlyType : Symbol(C.readonlyType, Decl(uniqueSymbolsDeclarationsInJsErrors.js, 4, 31)) + + /** + * @type {unique symbol} + */ + static readwriteType; +>readwriteType : Symbol(C.readwriteType, Decl(uniqueSymbolsDeclarationsInJsErrors.js, 9, 24)) +} diff --git a/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.types b/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.types new file mode 100644 index 00000000000..4571b2c3825 --- /dev/null +++ b/tests/baselines/reference/uniqueSymbolsDeclarationsInJsErrors.types @@ -0,0 +1,23 @@ +=== tests/cases/conformance/types/uniqueSymbol/uniqueSymbolsDeclarationsInJsErrors.js === +class C { +>C : C + + /** + * @type {unique symbol} + */ + static readwriteStaticType; +>readwriteStaticType : symbol + + /** + * @type {unique symbol} + * @readonly + */ + static readonlyType; +>readonlyType : symbol + + /** + * @type {unique symbol} + */ + static readwriteType; +>readwriteType : symbol +} diff --git a/tests/baselines/reference/varRequireFromJavascript.types b/tests/baselines/reference/varRequireFromJavascript.types index f6ef20d1a15..84fef5df259 100644 --- a/tests/baselines/reference/varRequireFromJavascript.types +++ b/tests/baselines/reference/varRequireFromJavascript.types @@ -25,7 +25,7 @@ crunch.n * @param {ex.Crunch} wrap */ function f(wrap) { ->f : (wrap: ex.Crunch) => void +>f : (wrap: import("tests/cases/conformance/salsa/ex").Crunch) => void >wrap : import("tests/cases/conformance/salsa/ex").Crunch wrap.n diff --git a/tests/baselines/reference/varRequireFromTypescript.types b/tests/baselines/reference/varRequireFromTypescript.types index cb7c44cfc84..7010bfaf1a8 100644 --- a/tests/baselines/reference/varRequireFromTypescript.types +++ b/tests/baselines/reference/varRequireFromTypescript.types @@ -26,7 +26,7 @@ crunch.n * @param {ex.Crunch} wrap */ function f(greatest, wrap) { ->f : (greatest: ex.Greatest, wrap: ex.Crunch) => void +>f : (greatest: import("tests/cases/conformance/salsa/ex").Greatest, wrap: import("tests/cases/conformance/salsa/ex").Crunch) => void >greatest : import("tests/cases/conformance/salsa/ex").Greatest >wrap : import("tests/cases/conformance/salsa/ex").Crunch diff --git a/tests/cases/compiler/jsxPartialSpread.tsx b/tests/cases/compiler/jsxPartialSpread.tsx new file mode 100644 index 00000000000..b71ee00e5d9 --- /dev/null +++ b/tests/cases/compiler/jsxPartialSpread.tsx @@ -0,0 +1,12 @@ +// @jsx: preserve +// @esModuleInterop: true +// @strict: true +/// +const Select = (p: {value?: unknown}) =>

; +import React from 'react'; + +export function Repro({ SelectProps = {} }: { SelectProps?: Partial[0]> }) { + return ( +