mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into nodeFactory
# Conflicts: # src/compiler/binder.ts # src/compiler/checker.ts # src/compiler/factory.ts # src/compiler/transformers/declarations.ts # src/compiler/transformers/es2015.ts # src/compiler/transformers/module/module.ts # src/compiler/transformers/module/system.ts # src/compiler/transformers/taggedTemplate.ts # src/compiler/transformers/ts.ts # src/compiler/utilities.ts # src/compiler/visitor.ts # src/harness/vfsUtil.ts # src/services/codefixes/addMissingAsync.ts # src/services/codefixes/convertToMappedObjectType.ts # src/services/codefixes/helpers.ts # src/services/completions.ts # src/services/refactors/generateGetAccessorAndSetAccessor.ts
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
+60
-17
@@ -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(<UnionType>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<Symbol> | 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(<ObjectType>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) {
|
||||
|
||||
@@ -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<T>(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.
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -3729,6 +3729,12 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_private_method_0_90038" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare private method '{0}']]></Val>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_private_property_0_90035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare private property '{0}']]></Val>
|
||||
@@ -4713,6 +4719,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Impossible d'effectuer l'élévation à une puissance sur des valeurs 'bigint' sauf si l'option 'target' a la valeur 'es2016' ou une valeur correspondant à une version ultérieure.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.]]></Val>
|
||||
@@ -5163,6 +5178,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Fix_all_incorrect_return_type_of_an_async_functions_90037" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Fix all incorrect return type of an async functions]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Corriger tous les types de retour incorrects des fonctions asynchrone]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Found_0_errors_6217" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Found {0} errors.]]></Val>
|
||||
@@ -8733,6 +8757,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Remplacer '{0}' par 'Promise<{1}>']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_all_unused_infer_with_unknown_90031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace all unused 'infer' with 'unknown']]></Val>
|
||||
@@ -10299,11 +10332,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The return type of an async function or method must be the global Promise<T> type.]]></Val>
|
||||
<Val><![CDATA[The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<{0}>'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le type de retour d'une fonction ou d'une méthode async doit être le type Promise<T> global.]]></Val>
|
||||
<Val><![CDATA[Le type de retour d'une fonction ou d'une méthode asynchrone doit être le type global Promise<T>. Vouliez-vous vraiment écrire 'Promise<{0}>' ?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -3717,6 +3717,12 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_private_method_0_90038" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare private method '{0}']]></Val>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_private_property_0_90035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare private property '{0}']]></Val>
|
||||
@@ -4701,6 +4707,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Non è possibile usare l'elevamento a potenza su valori 'bigint' a meno che l'opzione 'target' non sia impostata su 'es2016' o versioni successive.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.]]></Val>
|
||||
@@ -5151,6 +5166,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Fix_all_incorrect_return_type_of_an_async_functions_90037" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Fix all incorrect return type of an async functions]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Correggere tutti i tipi restituiti non corretti di una funzione asincrona]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Found_0_errors_6217" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Found {0} errors.]]></Val>
|
||||
@@ -8721,6 +8745,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Sostituire '{0}' con 'Promise<{1}>']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_all_unused_infer_with_unknown_90031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace all unused 'infer' with 'unknown']]></Val>
|
||||
@@ -10287,11 +10320,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The return type of an async function or method must be the global Promise<T> type.]]></Val>
|
||||
<Val><![CDATA[The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<{0}>'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il tipo restituito di un metodo o una funzione asincrona deve essere il tipo globale Promise<T>.]]></Val>
|
||||
<Val><![CDATA[Il tipo restituito di un metodo o una funzione asincrona deve essere il tipo globale Promise<T>. Si intendeva scrivere 'Promise<{0}>'?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -3717,6 +3717,12 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_private_method_0_90038" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare private method '{0}']]></Val>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_private_property_0_90035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare private property '{0}']]></Val>
|
||||
@@ -4701,6 +4707,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Exponentiation_cannot_be_performed_on_bigint_values_unless_the_target_option_is_set_to_es2016_or_lat_2791" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Exponentiation cannot be performed on 'bigint' values unless the 'target' option is set to 'es2016' or later.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['target' オプションが 'es2016' 以降に設定されている場合を除き、'bigint' 値に対して累乗を実行することはできません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or__1203" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Export assignment cannot be used when targeting ECMAScript modules. Consider using 'export default' or another module format instead.]]></Val>
|
||||
@@ -5151,6 +5166,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Fix_all_incorrect_return_type_of_an_async_functions_90037" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Fix all incorrect return type of an async functions]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[非同期関数の無効な戻り値の型をすべて修正します]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Found_0_errors_6217" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Found {0} errors.]]></Val>
|
||||
@@ -8721,6 +8745,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_0_with_Promise_1_90036" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace '{0}' with 'Promise<{1}>']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' を 'Promise<{1}>' に置き換える]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Replace_all_unused_infer_with_unknown_90031" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Replace all unused 'infer' with 'unknown']]></Val>
|
||||
@@ -10287,11 +10320,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_1064" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_wri_1064" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The return type of an async function or method must be the global Promise<T> type.]]></Val>
|
||||
<Val><![CDATA[The return type of an async function or method must be the global Promise<T> type. Did you mean to write 'Promise<{0}>'?]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[非同期関数または非同期メソッドの戻り値の型は、グローバル Promise<T> 型である必要があります。]]></Val>
|
||||
<Val><![CDATA[非同期関数または非同期メソッドの戻り値の型は、グローバル Promise<T> 型である必要があります。'Promise<{0}>' と書き込むつもりでしたか?]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
|
||||
@@ -3710,6 +3710,9 @@
|
||||
<Item ItemId=";Declare_private_method_0_90038" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare private method '{0}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Zadeklaruj metodę prywatną „{0}”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
@@ -3710,6 +3710,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_private_method_0_90038" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare private method '{0}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Declarar método privado '{0}']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Declare_private_property_0_90035" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Declare private property '{0}']]></Val>
|
||||
|
||||
@@ -5168,6 +5168,9 @@
|
||||
<Item ItemId=";Fix_all_incorrect_return_type_of_an_async_functions_90037" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Fix all incorrect return type of an async functions]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Исправьте все неправильные возвращаемые типы асинхронных функций.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
|
||||
@@ -1743,7 +1743,9 @@ namespace ts.server {
|
||||
|
||||
return project?.isSolution() ?
|
||||
project.getDefaultChildProjectFromSolution(info) :
|
||||
project;
|
||||
project && projectContainsInfoDirectly(project, info) ?
|
||||
project :
|
||||
undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -270,7 +270,6 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
export function isDynamicFileName(fileName: NormalizedPath) {
|
||||
return fileName[0] === "^" ||
|
||||
((stringContains(fileName, "walkThroughSnippet:/") || stringContains(fileName, "untitled:/")) &&
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,17 +89,14 @@ namespace ts.JsDoc {
|
||||
// Eg. const a: Array<string> | Array<number>; a.length
|
||||
// The property length will have two declarations of property length coming
|
||||
// from Array<T> - Array<string> and Array<number>
|
||||
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)[] {
|
||||
|
||||
@@ -307,7 +307,18 @@ namespace ts.NavigationBar {
|
||||
addNodeWithRecursiveChild(node, getInteriorModule(<ModuleDeclaration>node).body);
|
||||
break;
|
||||
|
||||
case SyntaxKind.ExportAssignment:
|
||||
case SyntaxKind.ExportAssignment: {
|
||||
const expression = (<ExportAssignment>node).expression;
|
||||
if (isObjectLiteralExpression(expression)) {
|
||||
startNode(node);
|
||||
addChildrenRecursively(expression);
|
||||
endNode();
|
||||
}
|
||||
else {
|
||||
addLeafNode(node);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SyntaxKind.ExportSpecifier:
|
||||
case SyntaxKind.ImportEqualsDeclaration:
|
||||
case SyntaxKind.IndexSignature:
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<Modifier> | undefined {
|
||||
const modifiers = append<Modifier>(
|
||||
!isJS ? [factory.createModifier(accessModifier) as Token<SyntaxKind.PublicKeyword> | Token<SyntaxKind.PrivateKeyword>] : 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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<protocol.GetApplicableRefactorsRequest>({
|
||||
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", () => {
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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]
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 });
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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<T extends A2 | B2>(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<T extends CA | CB>(x: T & CA) {
|
||||
let ab: ABI = x;
|
||||
}
|
||||
|
||||
@@ -107,6 +107,38 @@ type Container<Type extends string> = {
|
||||
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<T extends A2 | B2>(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<T extends CA | CB>(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;
|
||||
}
|
||||
|
||||
@@ -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<T extends A2 | B2>(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<T extends CA | CB>(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))
|
||||
}
|
||||
|
||||
|
||||
@@ -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<T extends A2 | B2>(alsoShouldBeB: T & B2) {
|
||||
>inGeneric : <T extends A2 | B2>(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<T extends CA | CB>(x: T & CA) {
|
||||
>bar : <T extends CA | CB>(x: T & CA) => void
|
||||
>x : T & CA
|
||||
|
||||
let ab: ABI = x;
|
||||
>ab : ABI
|
||||
>x : T & CA
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 '{}'.
|
||||
@@ -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: {};
|
||||
}
|
||||
@@ -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))
|
||||
|
||||
@@ -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
|
||||
>{} : {}
|
||||
|
||||
@@ -70,5 +70,5 @@ type HandlerOptions = {
|
||||
/**
|
||||
* Should be able to export a type alias at the same time.
|
||||
*/
|
||||
name: String;
|
||||
name: string;
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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<string, string>} */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<string, string>} */ 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<any>;
|
||||
/** @type {Object<string, string>} */ 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;
|
||||
@@ -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<string, string>} */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)
|
||||
|
||||
@@ -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<any>
|
||||
>Promise.resolve(0) : Promise<number>
|
||||
>Promise.resolve : { <T>(value: T | PromiseLike<T>): Promise<T>; (): Promise<void>; }
|
||||
>Promise : PromiseConstructor
|
||||
>resolve : { <T>(value: T | PromiseLike<T>): Promise<T>; (): Promise<void>; }
|
||||
>0 : 0
|
||||
|
||||
/** @type {Object<string, string>} */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
|
||||
|
||||
@@ -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<any>): void;
|
||||
@@ -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))
|
||||
|
||||
@@ -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<any>) => void
|
||||
>x : Promise<any>
|
||||
|
||||
@@ -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<any>;
|
||||
}
|
||||
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<any>;
|
||||
}
|
||||
@@ -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))
|
||||
}
|
||||
|
||||
@@ -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<any>
|
||||
>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<any>
|
||||
>reason : string
|
||||
>suberr : { reason: string; code: string; }
|
||||
}
|
||||
|
||||
@@ -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<any>) => Promise<any>
|
||||
>pr : Promise<any>
|
||||
|
||||
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;
|
||||
|
||||
@@ -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<any>) => Promise<any>
|
||||
>pr : Promise<any>
|
||||
|
||||
return pr;
|
||||
|
||||
@@ -5,6 +5,6 @@ class C {}
|
||||
|
||||
/** @param {C} p */
|
||||
function f(p) {}
|
||||
>f : (p: C) => void
|
||||
>f : (p: C<any>) => void
|
||||
>p : C<any>
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
|
||||
@@ -42,12 +42,12 @@ let s = g('hi')()
|
||||
* @param {Array.<Object>} 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<Object>) => void
|
||||
>Element.prototype.animate = function(keyframes) {} : (keyframes: Array<any>) => 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<Object>) => void
|
||||
>function(keyframes) {} : (keyframes: Array<any>) => void
|
||||
>keyframes : any[]
|
||||
|
||||
|
||||
@@ -109,6 +109,6 @@ function fn() {}
|
||||
* @param {fn<T>} somebody
|
||||
*/
|
||||
function sayHello8(somebody) { }
|
||||
>sayHello8 : (somebody: fn<T>) => void
|
||||
>sayHello8 : (somebody: () => void) => void
|
||||
>somebody : () => void
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
//// [jsxPartialSpread.tsx]
|
||||
/// <reference path="/.lib/react16.d.ts" />
|
||||
const Select = (p: {value?: unknown}) => <p></p>;
|
||||
import React from 'react';
|
||||
|
||||
export function Repro({ SelectProps = {} }: { SelectProps?: Partial<Parameters<typeof Select>[0]> }) {
|
||||
return (
|
||||
<Select value={'test'} {...SelectProps} />
|
||||
);
|
||||
}
|
||||
|
||||
//// [jsxPartialSpread.jsx]
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
exports.__esModule = true;
|
||||
exports.Repro = void 0;
|
||||
/// <reference path="react16.d.ts" />
|
||||
var Select = function (p) { return <p></p>; };
|
||||
var react_1 = __importDefault(require("react"));
|
||||
function Repro(_a) {
|
||||
var _b = _a.SelectProps, SelectProps = _b === void 0 ? {} : _b;
|
||||
return (<Select value={'test'} {...SelectProps}/>);
|
||||
}
|
||||
exports.Repro = Repro;
|
||||
@@ -0,0 +1,28 @@
|
||||
=== tests/cases/compiler/jsxPartialSpread.tsx ===
|
||||
/// <reference path="react16.d.ts" />
|
||||
const Select = (p: {value?: unknown}) => <p></p>;
|
||||
>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<Parameters<typeof Select>[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 (
|
||||
<Select value={'test'} {...SelectProps} />
|
||||
>Select : Symbol(Select, Decl(jsxPartialSpread.tsx, 1, 5))
|
||||
>value : Symbol(value, Decl(jsxPartialSpread.tsx, 6, 15))
|
||||
>SelectProps : Symbol(SelectProps, Decl(jsxPartialSpread.tsx, 4, 23))
|
||||
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
=== tests/cases/compiler/jsxPartialSpread.tsx ===
|
||||
/// <reference path="react16.d.ts" />
|
||||
const Select = (p: {value?: unknown}) => <p></p>;
|
||||
>Select : (p: { value?: unknown;}) => JSX.Element
|
||||
>(p: {value?: unknown}) => <p></p> : (p: { value?: unknown;}) => JSX.Element
|
||||
>p : { value?: unknown; }
|
||||
>value : unknown
|
||||
><p></p> : JSX.Element
|
||||
>p : { value?: unknown; }
|
||||
>p : { value?: unknown; }
|
||||
|
||||
import React from 'react';
|
||||
>React : typeof React
|
||||
|
||||
export function Repro({ SelectProps = {} }: { SelectProps?: Partial<Parameters<typeof Select>[0]> }) {
|
||||
>Repro : ({ SelectProps }: { SelectProps?: Partial<Parameters<typeof Select>[0]>;}) => JSX.Element
|
||||
>SelectProps : Partial<{ value?: unknown; }>
|
||||
>{} : {}
|
||||
>SelectProps : Partial<{ value?: unknown; }> | undefined
|
||||
>Select : (p: { value?: unknown; }) => JSX.Element
|
||||
|
||||
return (
|
||||
>( <Select value={'test'} {...SelectProps} /> ) : JSX.Element
|
||||
|
||||
<Select value={'test'} {...SelectProps} />
|
||||
><Select value={'test'} {...SelectProps} /> : JSX.Element
|
||||
>Select : (p: { value?: unknown; }) => JSX.Element
|
||||
>value : string
|
||||
>'test' : "test"
|
||||
>SelectProps : Partial<{ value?: unknown; }>
|
||||
|
||||
);
|
||||
}
|
||||
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -40,7 +40,7 @@ lf.Transaction = function() {};
|
||||
* @return {!IThenable}
|
||||
*/
|
||||
lf.Transaction.prototype.begin = function(scope) {};
|
||||
>lf.Transaction.prototype.begin = function(scope) {} : (scope: Array<lf.schema.Table>) => any
|
||||
>lf.Transaction.prototype.begin = function(scope) {} : (scope: Array<any>) => 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<lf.schema.Table>) => any
|
||||
>function(scope) {} : (scope: Array<any>) => any
|
||||
>scope : any[]
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user