Merge branch 'master' into fixMappedTypeCombinedMappers
# Conflicts: # src/compiler/checker.ts
This commit is contained in:
commit
3bc8c7e015
23 changed files with 932 additions and 1084 deletions
|
@ -60,7 +60,7 @@
|
|||
"gulp-insert": "latest",
|
||||
"gulp-newer": "latest",
|
||||
"gulp-sourcemaps": "latest",
|
||||
"gulp-typescript": "latest",
|
||||
"gulp-typescript": "3.1.3",
|
||||
"into-stream": "latest",
|
||||
"istanbul": "latest",
|
||||
"jake": "latest",
|
||||
|
|
|
@ -4606,7 +4606,7 @@ namespace ts {
|
|||
// Create a mapper from T to the current iteration type constituent. Then, if the
|
||||
// mapped type is itself an instantiated type, combine the iteration mapper with the
|
||||
// instantiation mapper.
|
||||
const iterationMapper = createUnaryTypeMapper(typeParameter, t);
|
||||
const iterationMapper = createTypeMapper([typeParameter], [t]);
|
||||
const templateMapper = type.mapper ? combineTypeMappers(type.mapper, iterationMapper) : iterationMapper;
|
||||
const propType = instantiateType(templateType, templateMapper);
|
||||
// If the current iteration type constituent is a string literal type, create a property.
|
||||
|
@ -4666,7 +4666,7 @@ namespace ts {
|
|||
}
|
||||
|
||||
function getErasedTemplateTypeFromMappedType(type: MappedType) {
|
||||
return instantiateType(getTemplateTypeFromMappedType(type), createUnaryTypeMapper(getTypeParameterFromMappedType(type), anyType));
|
||||
return instantiateType(getTemplateTypeFromMappedType(type), createTypeEraser([getTypeParameterFromMappedType(type)]));
|
||||
}
|
||||
|
||||
function isGenericMappedType(type: Type) {
|
||||
|
@ -5058,9 +5058,10 @@ namespace ts {
|
|||
if (!links.resolvedSignature) {
|
||||
const parameters: Symbol[] = [];
|
||||
let hasLiteralTypes = false;
|
||||
let minArgumentCount = -1;
|
||||
let minArgumentCount = 0;
|
||||
let thisParameter: Symbol = undefined;
|
||||
let hasThisParameter: boolean;
|
||||
const iife = getImmediatelyInvokedFunctionExpression(declaration);
|
||||
const isJSConstructSignature = isJSDocConstructSignature(declaration);
|
||||
|
||||
// If this is a JSDoc construct signature, then skip the first parameter in the
|
||||
|
@ -5087,14 +5088,12 @@ namespace ts {
|
|||
hasLiteralTypes = true;
|
||||
}
|
||||
|
||||
if (param.initializer || param.questionToken || param.dotDotDotToken || isJSDocOptionalParameter(param)) {
|
||||
if (minArgumentCount < 0) {
|
||||
minArgumentCount = i - (hasThisParameter ? 1 : 0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If we see any required parameters, it means the prior ones were not in fact optional.
|
||||
minArgumentCount = -1;
|
||||
// Record a new minimum argument count if this is not an optional parameter
|
||||
const isOptionalParameter = param.initializer || param.questionToken || param.dotDotDotToken ||
|
||||
iife && parameters.length > iife.arguments.length && !param.type ||
|
||||
isJSDocOptionalParameter(param);
|
||||
if (!isOptionalParameter) {
|
||||
minArgumentCount = parameters.length;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5109,13 +5108,6 @@ namespace ts {
|
|||
}
|
||||
}
|
||||
|
||||
if (minArgumentCount < 0) {
|
||||
minArgumentCount = declaration.parameters.length - (hasThisParameter ? 1 : 0);
|
||||
}
|
||||
if (isJSConstructSignature) {
|
||||
minArgumentCount--;
|
||||
}
|
||||
|
||||
const classType = declaration.kind === SyntaxKind.Constructor ?
|
||||
getDeclaredTypeOfClassOrInterface(getMergedSymbol((<ClassDeclaration>declaration.parent).symbol))
|
||||
: undefined;
|
||||
|
@ -6135,7 +6127,7 @@ namespace ts {
|
|||
error(accessExpression, Diagnostics.Index_signature_in_type_0_only_permits_reading, typeToString(type));
|
||||
return unknownType;
|
||||
}
|
||||
const mapper = createUnaryTypeMapper(getTypeParameterFromMappedType(type), indexType);
|
||||
const mapper = createTypeMapper([getTypeParameterFromMappedType(type)], [indexType]);
|
||||
const templateMapper = type.mapper ? combineTypeMappers(type.mapper, mapper) : mapper;
|
||||
return instantiateType(getTemplateTypeFromMappedType(type), templateMapper);
|
||||
}
|
||||
|
@ -6241,7 +6233,7 @@ namespace ts {
|
|||
* this function should be called in a left folding style, with left = previous result of getSpreadType
|
||||
* and right = the new element to be spread.
|
||||
*/
|
||||
function getSpreadType(left: Type, right: Type, isFromObjectLiteral: boolean): Type {
|
||||
function getSpreadType(left: Type, right: Type): Type {
|
||||
if (left.flags & TypeFlags.Any || right.flags & TypeFlags.Any) {
|
||||
return anyType;
|
||||
}
|
||||
|
@ -6254,10 +6246,10 @@ namespace ts {
|
|||
return left;
|
||||
}
|
||||
if (left.flags & TypeFlags.Union) {
|
||||
return mapType(left, t => getSpreadType(t, right, isFromObjectLiteral));
|
||||
return mapType(left, t => getSpreadType(t, right));
|
||||
}
|
||||
if (right.flags & TypeFlags.Union) {
|
||||
return mapType(right, t => getSpreadType(left, t, isFromObjectLiteral));
|
||||
return mapType(right, t => getSpreadType(left, t));
|
||||
}
|
||||
|
||||
const members = createMap<Symbol>();
|
||||
|
@ -6276,18 +6268,18 @@ namespace ts {
|
|||
|
||||
for (const rightProp of getPropertiesOfType(right)) {
|
||||
// we approximate own properties as non-methods plus methods that are inside the object literal
|
||||
const isOwnProperty = !(rightProp.flags & SymbolFlags.Method) || isFromObjectLiteral;
|
||||
const isSetterWithoutGetter = rightProp.flags & SymbolFlags.SetAccessor && !(rightProp.flags & SymbolFlags.GetAccessor);
|
||||
if (getDeclarationModifierFlagsFromSymbol(rightProp) & (ModifierFlags.Private | ModifierFlags.Protected)) {
|
||||
skippedPrivateMembers[rightProp.name] = true;
|
||||
}
|
||||
else if (isOwnProperty && !isSetterWithoutGetter) {
|
||||
else if (!isClassMethod(rightProp) && !isSetterWithoutGetter) {
|
||||
members[rightProp.name] = rightProp;
|
||||
}
|
||||
}
|
||||
for (const leftProp of getPropertiesOfType(left)) {
|
||||
if (leftProp.flags & SymbolFlags.SetAccessor && !(leftProp.flags & SymbolFlags.GetAccessor)
|
||||
|| leftProp.name in skippedPrivateMembers) {
|
||||
|| leftProp.name in skippedPrivateMembers
|
||||
|| isClassMethod(leftProp)) {
|
||||
continue;
|
||||
}
|
||||
if (leftProp.name in members) {
|
||||
|
@ -6312,6 +6304,10 @@ namespace ts {
|
|||
return createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo);
|
||||
}
|
||||
|
||||
function isClassMethod(prop: Symbol) {
|
||||
return prop.flags & SymbolFlags.Method && find(prop.declarations, decl => isClassLike(decl.parent));
|
||||
}
|
||||
|
||||
function createLiteralType(flags: TypeFlags, text: string) {
|
||||
const type = <LiteralType>createType(flags);
|
||||
type.text = text;
|
||||
|
@ -6502,16 +6498,16 @@ namespace ts {
|
|||
return <T>instantiations[type.id] || (instantiations[type.id] = instantiator(type, mapper));
|
||||
}
|
||||
|
||||
function createUnaryTypeMapper(source: Type, target: Type): TypeMapper {
|
||||
return t => t === source ? target : t;
|
||||
function makeUnaryTypeMapper(source: Type, target: Type) {
|
||||
return (t: Type) => t === source ? target : t;
|
||||
}
|
||||
|
||||
function createBinaryTypeMapper(source1: Type, target1: Type, source2: Type, target2: Type): TypeMapper {
|
||||
return t => t === source1 ? target1 : t === source2 ? target2 : t;
|
||||
function makeBinaryTypeMapper(source1: Type, target1: Type, source2: Type, target2: Type) {
|
||||
return (t: Type) => t === source1 ? target1 : t === source2 ? target2 : t;
|
||||
}
|
||||
|
||||
function createArrayTypeMapper(sources: Type[], targets: Type[]): TypeMapper {
|
||||
return t => {
|
||||
function makeArrayTypeMapper(sources: Type[], targets: Type[]) {
|
||||
return (t: Type) => {
|
||||
for (let i = 0; i < sources.length; i++) {
|
||||
if (t === sources[i]) {
|
||||
return targets ? targets[i] : anyType;
|
||||
|
@ -6522,11 +6518,9 @@ namespace ts {
|
|||
}
|
||||
|
||||
function createTypeMapper(sources: Type[], targets: Type[]): TypeMapper {
|
||||
const count = sources.length;
|
||||
const mapper: TypeMapper =
|
||||
count == 1 ? createUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) :
|
||||
count == 2 ? createBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) :
|
||||
createArrayTypeMapper(sources, targets);
|
||||
const mapper: TypeMapper = sources.length === 1 ? makeUnaryTypeMapper(sources[0], targets ? targets[0] : anyType) :
|
||||
sources.length === 2 ? makeBinaryTypeMapper(sources[0], targets ? targets[0] : anyType, sources[1], targets ? targets[1] : anyType) :
|
||||
makeArrayTypeMapper(sources, targets);
|
||||
mapper.mappedTypes = sources;
|
||||
return mapper;
|
||||
}
|
||||
|
@ -6560,7 +6554,7 @@ namespace ts {
|
|||
|
||||
function combineTypeMappers(mapper1: TypeMapper, mapper2: TypeMapper): TypeMapper {
|
||||
const mapper: TypeMapper = t => instantiateType(mapper1(t), mapper2);
|
||||
mapper.mappedTypes = mapper1.mappedTypes;
|
||||
mapper.mappedTypes = concatenate(mapper1.mappedTypes, mapper2.mappedTypes);
|
||||
return mapper;
|
||||
}
|
||||
|
||||
|
@ -10936,23 +10930,23 @@ namespace ts {
|
|||
const func = parameter.parent;
|
||||
if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
|
||||
const iife = getImmediatelyInvokedFunctionExpression(func);
|
||||
if (iife) {
|
||||
if (iife && iife.arguments) {
|
||||
const indexOfParameter = indexOf(func.parameters, parameter);
|
||||
if (iife.arguments && indexOfParameter < iife.arguments.length) {
|
||||
if (parameter.dotDotDotToken) {
|
||||
const restTypes: Type[] = [];
|
||||
for (let i = indexOfParameter; i < iife.arguments.length; i++) {
|
||||
restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i])));
|
||||
}
|
||||
return createArrayType(getUnionType(restTypes));
|
||||
if (parameter.dotDotDotToken) {
|
||||
const restTypes: Type[] = [];
|
||||
for (let i = indexOfParameter; i < iife.arguments.length; i++) {
|
||||
restTypes.push(getWidenedLiteralType(checkExpression(iife.arguments[i])));
|
||||
}
|
||||
const links = getNodeLinks(iife);
|
||||
const cached = links.resolvedSignature;
|
||||
links.resolvedSignature = anySignature;
|
||||
const type = getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter]));
|
||||
links.resolvedSignature = cached;
|
||||
return type;
|
||||
return restTypes.length ? createArrayType(getUnionType(restTypes)) : undefined;
|
||||
}
|
||||
const links = getNodeLinks(iife);
|
||||
const cached = links.resolvedSignature;
|
||||
links.resolvedSignature = anySignature;
|
||||
const type = indexOfParameter < iife.arguments.length ?
|
||||
getWidenedLiteralType(checkExpression(iife.arguments[indexOfParameter])) :
|
||||
parameter.initializer ? undefined : undefinedWideningType;
|
||||
links.resolvedSignature = cached;
|
||||
return type;
|
||||
}
|
||||
const contextualSignature = getContextualSignature(func);
|
||||
if (contextualSignature) {
|
||||
|
@ -11661,7 +11655,7 @@ namespace ts {
|
|||
checkExternalEmitHelpers(memberDecl, ExternalEmitHelpers.Assign);
|
||||
}
|
||||
if (propertiesArray.length > 0) {
|
||||
spread = getSpreadType(spread, createObjectLiteralType(), /*isFromObjectLiteral*/ true);
|
||||
spread = getSpreadType(spread, createObjectLiteralType());
|
||||
propertiesArray = [];
|
||||
propertiesTable = createMap<Symbol>();
|
||||
hasComputedStringProperty = false;
|
||||
|
@ -11673,7 +11667,7 @@ namespace ts {
|
|||
error(memberDecl, Diagnostics.Spread_types_may_only_be_created_from_object_types);
|
||||
return unknownType;
|
||||
}
|
||||
spread = getSpreadType(spread, type, /*isFromObjectLiteral*/ false);
|
||||
spread = getSpreadType(spread, type);
|
||||
offset = i + 1;
|
||||
continue;
|
||||
}
|
||||
|
@ -11718,7 +11712,7 @@ namespace ts {
|
|||
|
||||
if (spread !== emptyObjectType) {
|
||||
if (propertiesArray.length > 0) {
|
||||
spread = getSpreadType(spread, createObjectLiteralType(), /*isFromObjectLiteral*/ true);
|
||||
spread = getSpreadType(spread, createObjectLiteralType());
|
||||
}
|
||||
if (spread.flags & TypeFlags.Object) {
|
||||
// only set the symbol and flags if this is a (fresh) object type
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace ts {
|
|||
}
|
||||
|
||||
/** Array that is only intended to be pushed to, never read. */
|
||||
interface Push<T> {
|
||||
export interface Push<T> {
|
||||
push(value: T): void;
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ namespace ts {
|
|||
* Then it computes the set of parent folders for 'directory' that should have the same module resolution result
|
||||
* and for every parent folder in set it adds entry: parent -> module resolution. .
|
||||
* Lets say we first directory name: /a/b/c/d/e and resolution result is: /a/b/bar.ts.
|
||||
* Set of parent folders that should have the same result will be:
|
||||
* Set of parent folders that should have the same result will be:
|
||||
* [
|
||||
* /a/b/c/d, /a/b/c, /a/b
|
||||
* ]
|
||||
|
@ -391,7 +391,7 @@ namespace ts {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function getCommonPrefix(directory: Path, resolution: string) {
|
||||
if (resolution === undefined) {
|
||||
return undefined;
|
||||
|
@ -421,7 +421,7 @@ namespace ts {
|
|||
trace(host, Diagnostics.Resolving_module_0_from_1, moduleName, containingFile);
|
||||
}
|
||||
const containingDirectory = getDirectoryPath(containingFile);
|
||||
let perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory);
|
||||
const perFolderCache = cache && cache.getOrCreateCacheForDirectory(containingDirectory);
|
||||
let result = perFolderCache && perFolderCache[moduleName];
|
||||
|
||||
if (result) {
|
||||
|
@ -1022,7 +1022,7 @@ namespace ts {
|
|||
|
||||
/**
|
||||
* Represents result of search. Normally when searching among several alternatives we treat value `undefined` as indicator
|
||||
* that search fails and we should try another option.
|
||||
* that search fails and we should try another option.
|
||||
* However this does not allow us to represent final result that should be used instead of further searching (i.e. a final result that was found in cache).
|
||||
* SearchResult is used to deal with this issue, its values represents following outcomes:
|
||||
* - undefined - not found, continue searching
|
||||
|
@ -1030,7 +1030,7 @@ namespace ts {
|
|||
* - { value: <some-value> } - found - stop searching
|
||||
*/
|
||||
type SearchResult<T> = { value: T | undefined } | undefined;
|
||||
|
||||
|
||||
/**
|
||||
* Wraps value to SearchResult.
|
||||
* @returns undefined if value is undefined or { value } otherwise
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
/// <reference path='../compiler/utilities.ts' />
|
||||
|
||||
/* @internal */
|
||||
namespace ts.Completions {
|
||||
export function getCompletionsAtPosition(host: LanguageServiceHost, typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number): CompletionInfo {
|
||||
export function getCompletionsAtPosition(host: LanguageServiceHost, typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number): CompletionInfo | undefined {
|
||||
if (isInReferenceComment(sourceFile, position)) {
|
||||
return getTripleSlashReferenceCompletion(sourceFile, position);
|
||||
}
|
||||
|
@ -134,7 +132,7 @@ namespace ts.Completions {
|
|||
return uniqueNames;
|
||||
}
|
||||
|
||||
function getStringLiteralCompletionEntries(sourceFile: SourceFile, position: number) {
|
||||
function getStringLiteralCompletionEntries(sourceFile: SourceFile, position: number): CompletionInfo | undefined {
|
||||
const node = findPrecedingToken(position, sourceFile);
|
||||
if (!node || node.kind !== SyntaxKind.StringLiteral) {
|
||||
return undefined;
|
||||
|
@ -174,7 +172,7 @@ namespace ts.Completions {
|
|||
return getStringLiteralCompletionEntriesFromModuleNames(<StringLiteral>node);
|
||||
}
|
||||
else {
|
||||
const argumentInfo = SignatureHelp.getContainingArgumentInfo(node, position, sourceFile);
|
||||
const argumentInfo = SignatureHelp.getImmediatelyContainingArgumentInfo(node, position, sourceFile);
|
||||
if (argumentInfo) {
|
||||
// Get string literal completions from specialized signatures of the target
|
||||
// i.e. declare function f(a: 'A');
|
||||
|
@ -188,7 +186,7 @@ namespace ts.Completions {
|
|||
}
|
||||
}
|
||||
|
||||
function getStringLiteralCompletionEntriesFromPropertyAssignment(element: ObjectLiteralElement) {
|
||||
function getStringLiteralCompletionEntriesFromPropertyAssignment(element: ObjectLiteralElement): CompletionInfo | undefined {
|
||||
const type = typeChecker.getContextualType((<ObjectLiteralExpression>element.parent));
|
||||
const entries: CompletionEntry[] = [];
|
||||
if (type) {
|
||||
|
@ -199,7 +197,7 @@ namespace ts.Completions {
|
|||
}
|
||||
}
|
||||
|
||||
function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo: SignatureHelp.ArgumentListInfo) {
|
||||
function getStringLiteralCompletionEntriesFromCallExpression(argumentInfo: SignatureHelp.ArgumentListInfo): CompletionInfo | undefined {
|
||||
const candidates: Signature[] = [];
|
||||
const entries: CompletionEntry[] = [];
|
||||
|
||||
|
@ -219,7 +217,7 @@ namespace ts.Completions {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
function getStringLiteralCompletionEntriesFromElementAccess(node: ElementAccessExpression) {
|
||||
function getStringLiteralCompletionEntriesFromElementAccess(node: ElementAccessExpression): CompletionInfo | undefined {
|
||||
const type = typeChecker.getTypeAtLocation(node.expression);
|
||||
const entries: CompletionEntry[] = [];
|
||||
if (type) {
|
||||
|
@ -231,7 +229,7 @@ namespace ts.Completions {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
function getStringLiteralCompletionEntriesFromContextualType(node: StringLiteral) {
|
||||
function getStringLiteralCompletionEntriesFromContextualType(node: StringLiteral): CompletionInfo | undefined {
|
||||
const type = typeChecker.getContextualType(node);
|
||||
if (type) {
|
||||
const entries: CompletionEntry[] = [];
|
||||
|
@ -243,7 +241,7 @@ namespace ts.Completions {
|
|||
return undefined;
|
||||
}
|
||||
|
||||
function addStringLiteralCompletionsFromType(type: Type, result: CompletionEntry[]): void {
|
||||
function addStringLiteralCompletionsFromType(type: Type, result: Push<CompletionEntry>): void {
|
||||
if (type && type.flags & TypeFlags.TypeParameter) {
|
||||
type = typeChecker.getApparentType(type);
|
||||
}
|
||||
|
@ -251,18 +249,18 @@ namespace ts.Completions {
|
|||
return;
|
||||
}
|
||||
if (type.flags & TypeFlags.Union) {
|
||||
forEach((<UnionType>type).types, t => addStringLiteralCompletionsFromType(t, result));
|
||||
}
|
||||
else {
|
||||
if (type.flags & TypeFlags.StringLiteral) {
|
||||
result.push({
|
||||
name: (<LiteralType>type).text,
|
||||
kindModifiers: ScriptElementKindModifier.none,
|
||||
kind: ScriptElementKind.variableElement,
|
||||
sortText: "0"
|
||||
});
|
||||
for (const t of (<UnionType>type).types) {
|
||||
addStringLiteralCompletionsFromType(t, result);
|
||||
}
|
||||
}
|
||||
else if (type.flags & TypeFlags.StringLiteral) {
|
||||
result.push({
|
||||
name: (<LiteralType>type).text,
|
||||
kindModifiers: ScriptElementKindModifier.none,
|
||||
kind: ScriptElementKind.variableElement,
|
||||
sortText: "0"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function getStringLiteralCompletionEntriesFromModuleNames(node: StringLiteral): CompletionInfo {
|
||||
|
|
|
@ -260,7 +260,7 @@ namespace ts.SignatureHelp {
|
|||
* Returns relevant information for the argument list and the current argument if we are
|
||||
* in the argument of an invocation; returns undefined otherwise.
|
||||
*/
|
||||
function getImmediatelyContainingArgumentInfo(node: Node, position: number, sourceFile: SourceFile): ArgumentListInfo {
|
||||
export function getImmediatelyContainingArgumentInfo(node: Node, position: number, sourceFile: SourceFile): ArgumentListInfo {
|
||||
if (node.parent.kind === SyntaxKind.CallExpression || node.parent.kind === SyntaxKind.NewExpression) {
|
||||
const callExpression = <CallExpression>node.parent;
|
||||
// There are 3 cases to handle:
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
// contextually typed parameters.
|
||||
let twelve = (f => f(12))(i => i);
|
||||
let eleven = (o => o.a(11))({ a: function(n) { return n; } });
|
||||
// missing arguments
|
||||
(function(x, undefined) { return x; })(42);
|
||||
((x, y, z) => 42)();
|
||||
|
||||
|
||||
//// [contextuallyTypedIife.js]
|
||||
|
@ -102,3 +105,6 @@ let eleven = (o => o.a(11))({ a: function(n) { return n; } });
|
|||
// contextually typed parameters.
|
||||
var twelve = (function (f) { return f(12); })(function (i) { return i; });
|
||||
var eleven = (function (o) { return o.a(11); })({ a: function (n) { return n; } });
|
||||
// missing arguments
|
||||
(function (x, undefined) { return x; })(42);
|
||||
(function (x, y, z) { return 42; })();
|
||||
|
|
|
@ -119,3 +119,14 @@ let eleven = (o => o.a(11))({ a: function(n) { return n; } });
|
|||
>n : Symbol(n, Decl(contextuallyTypedIife.ts, 28, 42))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIife.ts, 28, 42))
|
||||
|
||||
// missing arguments
|
||||
(function(x, undefined) { return x; })(42);
|
||||
>x : Symbol(x, Decl(contextuallyTypedIife.ts, 30, 10))
|
||||
>undefined : Symbol(undefined, Decl(contextuallyTypedIife.ts, 30, 12))
|
||||
>x : Symbol(x, Decl(contextuallyTypedIife.ts, 30, 10))
|
||||
|
||||
((x, y, z) => 42)();
|
||||
>x : Symbol(x, Decl(contextuallyTypedIife.ts, 31, 2))
|
||||
>y : Symbol(y, Decl(contextuallyTypedIife.ts, 31, 4))
|
||||
>z : Symbol(z, Decl(contextuallyTypedIife.ts, 31, 7))
|
||||
|
||||
|
|
|
@ -250,3 +250,22 @@ let eleven = (o => o.a(11))({ a: function(n) { return n; } });
|
|||
>n : any
|
||||
>n : any
|
||||
|
||||
// missing arguments
|
||||
(function(x, undefined) { return x; })(42);
|
||||
>(function(x, undefined) { return x; })(42) : number
|
||||
>(function(x, undefined) { return x; }) : (x: number, undefined: any) => number
|
||||
>function(x, undefined) { return x; } : (x: number, undefined: any) => number
|
||||
>x : number
|
||||
>undefined : any
|
||||
>x : number
|
||||
>42 : 42
|
||||
|
||||
((x, y, z) => 42)();
|
||||
>((x, y, z) => 42)() : number
|
||||
>((x, y, z) => 42) : (x: any, y: any, z: any) => number
|
||||
>(x, y, z) => 42 : (x: any, y: any, z: any) => number
|
||||
>x : any
|
||||
>y : any
|
||||
>z : any
|
||||
>42 : 42
|
||||
|
||||
|
|
110
tests/baselines/reference/contextuallyTypedIifeStrict.js
Normal file
110
tests/baselines/reference/contextuallyTypedIifeStrict.js
Normal file
|
@ -0,0 +1,110 @@
|
|||
//// [contextuallyTypedIifeStrict.ts]
|
||||
// arrow
|
||||
(jake => { })("build");
|
||||
// function expression
|
||||
(function (cats) { })("lol");
|
||||
// Lots of Irritating Superfluous Parentheses
|
||||
(function (x) { } ("!"));
|
||||
((((function (y) { }))))("-");
|
||||
// multiple arguments
|
||||
((a, b, c) => { })("foo", 101, false);
|
||||
// default parameters
|
||||
((m = 10) => m + 1)(12);
|
||||
((n = 10) => n + 1)();
|
||||
// optional parameters
|
||||
((j?) => j + 1)(12);
|
||||
((k?) => k + 1)();
|
||||
((l, o?) => l + o)(12); // o should be any
|
||||
// rest parameters
|
||||
((...numbers) => numbers.every(n => n > 0))(5,6,7);
|
||||
((...mixed) => mixed.every(n => !!n))(5,'oops','oh no');
|
||||
((...noNumbers) => noNumbers.some(n => n > 0))();
|
||||
((first, ...rest) => first ? [] : rest.map(n => n > 0))(8,9,10);
|
||||
// destructuring parameters (with defaults too!)
|
||||
(({ q }) => q)({ q : 13 });
|
||||
(({ p = 14 }) => p)({ p : 15 });
|
||||
(({ r = 17 } = { r: 18 }) => r)({r : 19});
|
||||
(({ u = 22 } = { u: 23 }) => u)();
|
||||
// contextually typed parameters.
|
||||
let twelve = (f => f(12))(i => i);
|
||||
let eleven = (o => o.a(11))({ a: function(n) { return n; } });
|
||||
// missing arguments
|
||||
(function(x, undefined) { return x; })(42);
|
||||
((x, y, z) => 42)();
|
||||
|
||||
|
||||
//// [contextuallyTypedIifeStrict.js]
|
||||
// arrow
|
||||
(function (jake) { })("build");
|
||||
// function expression
|
||||
(function (cats) { })("lol");
|
||||
// Lots of Irritating Superfluous Parentheses
|
||||
(function (x) { }("!"));
|
||||
((((function (y) { }))))("-");
|
||||
// multiple arguments
|
||||
(function (a, b, c) { })("foo", 101, false);
|
||||
// default parameters
|
||||
(function (m) {
|
||||
if (m === void 0) { m = 10; }
|
||||
return m + 1;
|
||||
})(12);
|
||||
(function (n) {
|
||||
if (n === void 0) { n = 10; }
|
||||
return n + 1;
|
||||
})();
|
||||
// optional parameters
|
||||
(function (j) { return j + 1; })(12);
|
||||
(function (k) { return k + 1; })();
|
||||
(function (l, o) { return l + o; })(12); // o should be any
|
||||
// rest parameters
|
||||
(function () {
|
||||
var numbers = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
numbers[_i] = arguments[_i];
|
||||
}
|
||||
return numbers.every(function (n) { return n > 0; });
|
||||
})(5, 6, 7);
|
||||
(function () {
|
||||
var mixed = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
mixed[_i] = arguments[_i];
|
||||
}
|
||||
return mixed.every(function (n) { return !!n; });
|
||||
})(5, 'oops', 'oh no');
|
||||
(function () {
|
||||
var noNumbers = [];
|
||||
for (var _i = 0; _i < arguments.length; _i++) {
|
||||
noNumbers[_i] = arguments[_i];
|
||||
}
|
||||
return noNumbers.some(function (n) { return n > 0; });
|
||||
})();
|
||||
(function (first) {
|
||||
var rest = [];
|
||||
for (var _i = 1; _i < arguments.length; _i++) {
|
||||
rest[_i - 1] = arguments[_i];
|
||||
}
|
||||
return first ? [] : rest.map(function (n) { return n > 0; });
|
||||
})(8, 9, 10);
|
||||
// destructuring parameters (with defaults too!)
|
||||
(function (_a) {
|
||||
var q = _a.q;
|
||||
return q;
|
||||
})({ q: 13 });
|
||||
(function (_a) {
|
||||
var _b = _a.p, p = _b === void 0 ? 14 : _b;
|
||||
return p;
|
||||
})({ p: 15 });
|
||||
(function (_a) {
|
||||
var _b = (_a === void 0 ? { r: 18 } : _a).r, r = _b === void 0 ? 17 : _b;
|
||||
return r;
|
||||
})({ r: 19 });
|
||||
(function (_a) {
|
||||
var _b = (_a === void 0 ? { u: 23 } : _a).u, u = _b === void 0 ? 22 : _b;
|
||||
return u;
|
||||
})();
|
||||
// contextually typed parameters.
|
||||
var twelve = (function (f) { return f(12); })(function (i) { return i; });
|
||||
var eleven = (function (o) { return o.a(11); })({ a: function (n) { return n; } });
|
||||
// missing arguments
|
||||
(function (x, undefined) { return x; })(42);
|
||||
(function (x, y, z) { return 42; })();
|
132
tests/baselines/reference/contextuallyTypedIifeStrict.symbols
Normal file
132
tests/baselines/reference/contextuallyTypedIifeStrict.symbols
Normal file
|
@ -0,0 +1,132 @@
|
|||
=== tests/cases/conformance/expressions/functions/contextuallyTypedIifeStrict.ts ===
|
||||
// arrow
|
||||
(jake => { })("build");
|
||||
>jake : Symbol(jake, Decl(contextuallyTypedIifeStrict.ts, 1, 1))
|
||||
|
||||
// function expression
|
||||
(function (cats) { })("lol");
|
||||
>cats : Symbol(cats, Decl(contextuallyTypedIifeStrict.ts, 3, 11))
|
||||
|
||||
// Lots of Irritating Superfluous Parentheses
|
||||
(function (x) { } ("!"));
|
||||
>x : Symbol(x, Decl(contextuallyTypedIifeStrict.ts, 5, 11))
|
||||
|
||||
((((function (y) { }))))("-");
|
||||
>y : Symbol(y, Decl(contextuallyTypedIifeStrict.ts, 6, 14))
|
||||
|
||||
// multiple arguments
|
||||
((a, b, c) => { })("foo", 101, false);
|
||||
>a : Symbol(a, Decl(contextuallyTypedIifeStrict.ts, 8, 2))
|
||||
>b : Symbol(b, Decl(contextuallyTypedIifeStrict.ts, 8, 4))
|
||||
>c : Symbol(c, Decl(contextuallyTypedIifeStrict.ts, 8, 7))
|
||||
|
||||
// default parameters
|
||||
((m = 10) => m + 1)(12);
|
||||
>m : Symbol(m, Decl(contextuallyTypedIifeStrict.ts, 10, 2))
|
||||
>m : Symbol(m, Decl(contextuallyTypedIifeStrict.ts, 10, 2))
|
||||
|
||||
((n = 10) => n + 1)();
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 11, 2))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 11, 2))
|
||||
|
||||
// optional parameters
|
||||
((j?) => j + 1)(12);
|
||||
>j : Symbol(j, Decl(contextuallyTypedIifeStrict.ts, 13, 2))
|
||||
>j : Symbol(j, Decl(contextuallyTypedIifeStrict.ts, 13, 2))
|
||||
|
||||
((k?) => k + 1)();
|
||||
>k : Symbol(k, Decl(contextuallyTypedIifeStrict.ts, 14, 2))
|
||||
>k : Symbol(k, Decl(contextuallyTypedIifeStrict.ts, 14, 2))
|
||||
|
||||
((l, o?) => l + o)(12); // o should be any
|
||||
>l : Symbol(l, Decl(contextuallyTypedIifeStrict.ts, 15, 2))
|
||||
>o : Symbol(o, Decl(contextuallyTypedIifeStrict.ts, 15, 4))
|
||||
>l : Symbol(l, Decl(contextuallyTypedIifeStrict.ts, 15, 2))
|
||||
>o : Symbol(o, Decl(contextuallyTypedIifeStrict.ts, 15, 4))
|
||||
|
||||
// rest parameters
|
||||
((...numbers) => numbers.every(n => n > 0))(5,6,7);
|
||||
>numbers : Symbol(numbers, Decl(contextuallyTypedIifeStrict.ts, 17, 2))
|
||||
>numbers.every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
||||
>numbers : Symbol(numbers, Decl(contextuallyTypedIifeStrict.ts, 17, 2))
|
||||
>every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 17, 31))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 17, 31))
|
||||
|
||||
((...mixed) => mixed.every(n => !!n))(5,'oops','oh no');
|
||||
>mixed : Symbol(mixed, Decl(contextuallyTypedIifeStrict.ts, 18, 2))
|
||||
>mixed.every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
||||
>mixed : Symbol(mixed, Decl(contextuallyTypedIifeStrict.ts, 18, 2))
|
||||
>every : Symbol(Array.every, Decl(lib.d.ts, --, --))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 18, 27))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 18, 27))
|
||||
|
||||
((...noNumbers) => noNumbers.some(n => n > 0))();
|
||||
>noNumbers : Symbol(noNumbers, Decl(contextuallyTypedIifeStrict.ts, 19, 2))
|
||||
>noNumbers.some : Symbol(Array.some, Decl(lib.d.ts, --, --))
|
||||
>noNumbers : Symbol(noNumbers, Decl(contextuallyTypedIifeStrict.ts, 19, 2))
|
||||
>some : Symbol(Array.some, Decl(lib.d.ts, --, --))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 19, 34))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 19, 34))
|
||||
|
||||
((first, ...rest) => first ? [] : rest.map(n => n > 0))(8,9,10);
|
||||
>first : Symbol(first, Decl(contextuallyTypedIifeStrict.ts, 20, 2))
|
||||
>rest : Symbol(rest, Decl(contextuallyTypedIifeStrict.ts, 20, 8))
|
||||
>first : Symbol(first, Decl(contextuallyTypedIifeStrict.ts, 20, 2))
|
||||
>rest.map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>rest : Symbol(rest, Decl(contextuallyTypedIifeStrict.ts, 20, 8))
|
||||
>map : Symbol(Array.map, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 20, 43))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 20, 43))
|
||||
|
||||
// destructuring parameters (with defaults too!)
|
||||
(({ q }) => q)({ q : 13 });
|
||||
>q : Symbol(q, Decl(contextuallyTypedIifeStrict.ts, 22, 3))
|
||||
>q : Symbol(q, Decl(contextuallyTypedIifeStrict.ts, 22, 3))
|
||||
>q : Symbol(q, Decl(contextuallyTypedIifeStrict.ts, 22, 16))
|
||||
|
||||
(({ p = 14 }) => p)({ p : 15 });
|
||||
>p : Symbol(p, Decl(contextuallyTypedIifeStrict.ts, 23, 3))
|
||||
>p : Symbol(p, Decl(contextuallyTypedIifeStrict.ts, 23, 3))
|
||||
>p : Symbol(p, Decl(contextuallyTypedIifeStrict.ts, 23, 21))
|
||||
|
||||
(({ r = 17 } = { r: 18 }) => r)({r : 19});
|
||||
>r : Symbol(r, Decl(contextuallyTypedIifeStrict.ts, 24, 3))
|
||||
>r : Symbol(r, Decl(contextuallyTypedIifeStrict.ts, 24, 16))
|
||||
>r : Symbol(r, Decl(contextuallyTypedIifeStrict.ts, 24, 3))
|
||||
>r : Symbol(r, Decl(contextuallyTypedIifeStrict.ts, 24, 33))
|
||||
|
||||
(({ u = 22 } = { u: 23 }) => u)();
|
||||
>u : Symbol(u, Decl(contextuallyTypedIifeStrict.ts, 25, 3))
|
||||
>u : Symbol(u, Decl(contextuallyTypedIifeStrict.ts, 25, 16))
|
||||
>u : Symbol(u, Decl(contextuallyTypedIifeStrict.ts, 25, 3))
|
||||
|
||||
// contextually typed parameters.
|
||||
let twelve = (f => f(12))(i => i);
|
||||
>twelve : Symbol(twelve, Decl(contextuallyTypedIifeStrict.ts, 27, 3))
|
||||
>f : Symbol(f, Decl(contextuallyTypedIifeStrict.ts, 27, 14))
|
||||
>f : Symbol(f, Decl(contextuallyTypedIifeStrict.ts, 27, 14))
|
||||
>i : Symbol(i, Decl(contextuallyTypedIifeStrict.ts, 27, 26))
|
||||
>i : Symbol(i, Decl(contextuallyTypedIifeStrict.ts, 27, 26))
|
||||
|
||||
let eleven = (o => o.a(11))({ a: function(n) { return n; } });
|
||||
>eleven : Symbol(eleven, Decl(contextuallyTypedIifeStrict.ts, 28, 3))
|
||||
>o : Symbol(o, Decl(contextuallyTypedIifeStrict.ts, 28, 14))
|
||||
>o.a : Symbol(a, Decl(contextuallyTypedIifeStrict.ts, 28, 29))
|
||||
>o : Symbol(o, Decl(contextuallyTypedIifeStrict.ts, 28, 14))
|
||||
>a : Symbol(a, Decl(contextuallyTypedIifeStrict.ts, 28, 29))
|
||||
>a : Symbol(a, Decl(contextuallyTypedIifeStrict.ts, 28, 29))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 28, 42))
|
||||
>n : Symbol(n, Decl(contextuallyTypedIifeStrict.ts, 28, 42))
|
||||
|
||||
// missing arguments
|
||||
(function(x, undefined) { return x; })(42);
|
||||
>x : Symbol(x, Decl(contextuallyTypedIifeStrict.ts, 30, 10))
|
||||
>undefined : Symbol(undefined, Decl(contextuallyTypedIifeStrict.ts, 30, 12))
|
||||
>x : Symbol(x, Decl(contextuallyTypedIifeStrict.ts, 30, 10))
|
||||
|
||||
((x, y, z) => 42)();
|
||||
>x : Symbol(x, Decl(contextuallyTypedIifeStrict.ts, 31, 2))
|
||||
>y : Symbol(y, Decl(contextuallyTypedIifeStrict.ts, 31, 4))
|
||||
>z : Symbol(z, Decl(contextuallyTypedIifeStrict.ts, 31, 7))
|
||||
|
271
tests/baselines/reference/contextuallyTypedIifeStrict.types
Normal file
271
tests/baselines/reference/contextuallyTypedIifeStrict.types
Normal file
|
@ -0,0 +1,271 @@
|
|||
=== tests/cases/conformance/expressions/functions/contextuallyTypedIifeStrict.ts ===
|
||||
// arrow
|
||||
(jake => { })("build");
|
||||
>(jake => { })("build") : void
|
||||
>(jake => { }) : (jake: string) => void
|
||||
>jake => { } : (jake: string) => void
|
||||
>jake : string
|
||||
>"build" : "build"
|
||||
|
||||
// function expression
|
||||
(function (cats) { })("lol");
|
||||
>(function (cats) { })("lol") : void
|
||||
>(function (cats) { }) : (cats: string) => void
|
||||
>function (cats) { } : (cats: string) => void
|
||||
>cats : string
|
||||
>"lol" : "lol"
|
||||
|
||||
// Lots of Irritating Superfluous Parentheses
|
||||
(function (x) { } ("!"));
|
||||
>(function (x) { } ("!")) : void
|
||||
>function (x) { } ("!") : void
|
||||
>function (x) { } : (x: string) => void
|
||||
>x : string
|
||||
>"!" : "!"
|
||||
|
||||
((((function (y) { }))))("-");
|
||||
>((((function (y) { }))))("-") : void
|
||||
>((((function (y) { })))) : (y: string) => void
|
||||
>(((function (y) { }))) : (y: string) => void
|
||||
>((function (y) { })) : (y: string) => void
|
||||
>(function (y) { }) : (y: string) => void
|
||||
>function (y) { } : (y: string) => void
|
||||
>y : string
|
||||
>"-" : "-"
|
||||
|
||||
// multiple arguments
|
||||
((a, b, c) => { })("foo", 101, false);
|
||||
>((a, b, c) => { })("foo", 101, false) : void
|
||||
>((a, b, c) => { }) : (a: string, b: number, c: boolean) => void
|
||||
>(a, b, c) => { } : (a: string, b: number, c: boolean) => void
|
||||
>a : string
|
||||
>b : number
|
||||
>c : boolean
|
||||
>"foo" : "foo"
|
||||
>101 : 101
|
||||
>false : false
|
||||
|
||||
// default parameters
|
||||
((m = 10) => m + 1)(12);
|
||||
>((m = 10) => m + 1)(12) : number
|
||||
>((m = 10) => m + 1) : (m?: number) => number
|
||||
>(m = 10) => m + 1 : (m?: number) => number
|
||||
>m : number
|
||||
>10 : 10
|
||||
>m + 1 : number
|
||||
>m : number
|
||||
>1 : 1
|
||||
>12 : 12
|
||||
|
||||
((n = 10) => n + 1)();
|
||||
>((n = 10) => n + 1)() : number
|
||||
>((n = 10) => n + 1) : (n?: number) => number
|
||||
>(n = 10) => n + 1 : (n?: number) => number
|
||||
>n : number
|
||||
>10 : 10
|
||||
>n + 1 : number
|
||||
>n : number
|
||||
>1 : 1
|
||||
|
||||
// optional parameters
|
||||
((j?) => j + 1)(12);
|
||||
>((j?) => j + 1)(12) : number
|
||||
>((j?) => j + 1) : (j?: number | undefined) => number
|
||||
>(j?) => j + 1 : (j?: number | undefined) => number
|
||||
>j : number | undefined
|
||||
>j + 1 : number
|
||||
>j : number | undefined
|
||||
>1 : 1
|
||||
>12 : 12
|
||||
|
||||
((k?) => k + 1)();
|
||||
>((k?) => k + 1)() : number
|
||||
>((k?) => k + 1) : (k?: undefined) => number
|
||||
>(k?) => k + 1 : (k?: undefined) => number
|
||||
>k : undefined
|
||||
>k + 1 : number
|
||||
>k : undefined
|
||||
>1 : 1
|
||||
|
||||
((l, o?) => l + o)(12); // o should be any
|
||||
>((l, o?) => l + o)(12) : number
|
||||
>((l, o?) => l + o) : (l: number, o?: undefined) => number
|
||||
>(l, o?) => l + o : (l: number, o?: undefined) => number
|
||||
>l : number
|
||||
>o : undefined
|
||||
>l + o : number
|
||||
>l : number
|
||||
>o : undefined
|
||||
>12 : 12
|
||||
|
||||
// rest parameters
|
||||
((...numbers) => numbers.every(n => n > 0))(5,6,7);
|
||||
>((...numbers) => numbers.every(n => n > 0))(5,6,7) : boolean
|
||||
>((...numbers) => numbers.every(n => n > 0)) : (...numbers: number[]) => boolean
|
||||
>(...numbers) => numbers.every(n => n > 0) : (...numbers: number[]) => boolean
|
||||
>numbers : number[]
|
||||
>numbers.every(n => n > 0) : boolean
|
||||
>numbers.every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean
|
||||
>numbers : number[]
|
||||
>every : (callbackfn: (value: number, index: number, array: number[]) => boolean, thisArg?: any) => boolean
|
||||
>n => n > 0 : (n: number) => boolean
|
||||
>n : number
|
||||
>n > 0 : boolean
|
||||
>n : number
|
||||
>0 : 0
|
||||
>5 : 5
|
||||
>6 : 6
|
||||
>7 : 7
|
||||
|
||||
((...mixed) => mixed.every(n => !!n))(5,'oops','oh no');
|
||||
>((...mixed) => mixed.every(n => !!n))(5,'oops','oh no') : boolean
|
||||
>((...mixed) => mixed.every(n => !!n)) : (...mixed: (string | number)[]) => boolean
|
||||
>(...mixed) => mixed.every(n => !!n) : (...mixed: (string | number)[]) => boolean
|
||||
>mixed : (string | number)[]
|
||||
>mixed.every(n => !!n) : boolean
|
||||
>mixed.every : (callbackfn: (value: string | number, index: number, array: (string | number)[]) => boolean, thisArg?: any) => boolean
|
||||
>mixed : (string | number)[]
|
||||
>every : (callbackfn: (value: string | number, index: number, array: (string | number)[]) => boolean, thisArg?: any) => boolean
|
||||
>n => !!n : (n: string | number) => boolean
|
||||
>n : string | number
|
||||
>!!n : boolean
|
||||
>!n : boolean
|
||||
>n : string | number
|
||||
>5 : 5
|
||||
>'oops' : "oops"
|
||||
>'oh no' : "oh no"
|
||||
|
||||
((...noNumbers) => noNumbers.some(n => n > 0))();
|
||||
>((...noNumbers) => noNumbers.some(n => n > 0))() : boolean
|
||||
>((...noNumbers) => noNumbers.some(n => n > 0)) : (...noNumbers: any[]) => boolean
|
||||
>(...noNumbers) => noNumbers.some(n => n > 0) : (...noNumbers: any[]) => boolean
|
||||
>noNumbers : any[]
|
||||
>noNumbers.some(n => n > 0) : boolean
|
||||
>noNumbers.some : (callbackfn: (value: any, index: number, array: any[]) => boolean, thisArg?: any) => boolean
|
||||
>noNumbers : any[]
|
||||
>some : (callbackfn: (value: any, index: number, array: any[]) => boolean, thisArg?: any) => boolean
|
||||
>n => n > 0 : (n: any) => boolean
|
||||
>n : any
|
||||
>n > 0 : boolean
|
||||
>n : any
|
||||
>0 : 0
|
||||
|
||||
((first, ...rest) => first ? [] : rest.map(n => n > 0))(8,9,10);
|
||||
>((first, ...rest) => first ? [] : rest.map(n => n > 0))(8,9,10) : boolean[]
|
||||
>((first, ...rest) => first ? [] : rest.map(n => n > 0)) : (first: number, ...rest: number[]) => boolean[]
|
||||
>(first, ...rest) => first ? [] : rest.map(n => n > 0) : (first: number, ...rest: number[]) => boolean[]
|
||||
>first : number
|
||||
>rest : number[]
|
||||
>first ? [] : rest.map(n => n > 0) : boolean[]
|
||||
>first : number
|
||||
>[] : never[]
|
||||
>rest.map(n => n > 0) : boolean[]
|
||||
>rest.map : { <U>(this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; <U>(this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; }
|
||||
>rest : number[]
|
||||
>map : { <U>(this: [number, number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U, U]; <U>(this: [number, number], callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): [U, U]; <U>(callbackfn: (value: number, index: number, array: number[]) => U, thisArg?: any): U[]; }
|
||||
>n => n > 0 : (n: number) => boolean
|
||||
>n : number
|
||||
>n > 0 : boolean
|
||||
>n : number
|
||||
>0 : 0
|
||||
>8 : 8
|
||||
>9 : 9
|
||||
>10 : 10
|
||||
|
||||
// destructuring parameters (with defaults too!)
|
||||
(({ q }) => q)({ q : 13 });
|
||||
>(({ q }) => q)({ q : 13 }) : number
|
||||
>(({ q }) => q) : ({q}: { q: number; }) => number
|
||||
>({ q }) => q : ({q}: { q: number; }) => number
|
||||
>q : number
|
||||
>q : number
|
||||
>{ q : 13 } : { q: number; }
|
||||
>q : number
|
||||
>13 : 13
|
||||
|
||||
(({ p = 14 }) => p)({ p : 15 });
|
||||
>(({ p = 14 }) => p)({ p : 15 }) : number
|
||||
>(({ p = 14 }) => p) : ({p}: { p: number; }) => number
|
||||
>({ p = 14 }) => p : ({p}: { p: number; }) => number
|
||||
>p : number
|
||||
>14 : 14
|
||||
>p : number
|
||||
>{ p : 15 } : { p: number; }
|
||||
>p : number
|
||||
>15 : 15
|
||||
|
||||
(({ r = 17 } = { r: 18 }) => r)({r : 19});
|
||||
>(({ r = 17 } = { r: 18 }) => r)({r : 19}) : number
|
||||
>(({ r = 17 } = { r: 18 }) => r) : ({r}?: { r: number; }) => number
|
||||
>({ r = 17 } = { r: 18 }) => r : ({r}?: { r: number; }) => number
|
||||
>r : number
|
||||
>17 : 17
|
||||
>{ r: 18 } : { r: number; }
|
||||
>r : number
|
||||
>18 : 18
|
||||
>r : number
|
||||
>{r : 19} : { r: number; }
|
||||
>r : number
|
||||
>19 : 19
|
||||
|
||||
(({ u = 22 } = { u: 23 }) => u)();
|
||||
>(({ u = 22 } = { u: 23 }) => u)() : number
|
||||
>(({ u = 22 } = { u: 23 }) => u) : ({u}?: { u?: number; }) => number
|
||||
>({ u = 22 } = { u: 23 }) => u : ({u}?: { u?: number; }) => number
|
||||
>u : number
|
||||
>22 : 22
|
||||
>{ u: 23 } : { u?: number; }
|
||||
>u : number
|
||||
>23 : 23
|
||||
>u : number
|
||||
|
||||
// contextually typed parameters.
|
||||
let twelve = (f => f(12))(i => i);
|
||||
>twelve : any
|
||||
>(f => f(12))(i => i) : any
|
||||
>(f => f(12)) : (f: (i: any) => any) => any
|
||||
>f => f(12) : (f: (i: any) => any) => any
|
||||
>f : (i: any) => any
|
||||
>f(12) : any
|
||||
>f : (i: any) => any
|
||||
>12 : 12
|
||||
>i => i : (i: any) => any
|
||||
>i : any
|
||||
>i : any
|
||||
|
||||
let eleven = (o => o.a(11))({ a: function(n) { return n; } });
|
||||
>eleven : any
|
||||
>(o => o.a(11))({ a: function(n) { return n; } }) : any
|
||||
>(o => o.a(11)) : (o: { a: (n: any) => any; }) => any
|
||||
>o => o.a(11) : (o: { a: (n: any) => any; }) => any
|
||||
>o : { a: (n: any) => any; }
|
||||
>o.a(11) : any
|
||||
>o.a : (n: any) => any
|
||||
>o : { a: (n: any) => any; }
|
||||
>a : (n: any) => any
|
||||
>11 : 11
|
||||
>{ a: function(n) { return n; } } : { a: (n: any) => any; }
|
||||
>a : (n: any) => any
|
||||
>function(n) { return n; } : (n: any) => any
|
||||
>n : any
|
||||
>n : any
|
||||
|
||||
// missing arguments
|
||||
(function(x, undefined) { return x; })(42);
|
||||
>(function(x, undefined) { return x; })(42) : number
|
||||
>(function(x, undefined) { return x; }) : (x: number, undefined: undefined) => number
|
||||
>function(x, undefined) { return x; } : (x: number, undefined: undefined) => number
|
||||
>x : number
|
||||
>undefined : undefined
|
||||
>x : number
|
||||
>42 : 42
|
||||
|
||||
((x, y, z) => 42)();
|
||||
>((x, y, z) => 42)() : number
|
||||
>((x, y, z) => 42) : (x: undefined, y: undefined, z: undefined) => number
|
||||
>(x, y, z) => 42 : (x: undefined, y: undefined, z: undefined) => number
|
||||
>x : undefined
|
||||
>y : undefined
|
||||
>z : undefined
|
||||
>42 : 42
|
||||
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,19 @@
|
|||
//// [mappedTypeNestedGenericInstantiation.ts]
|
||||
// Repro from #13346
|
||||
|
||||
interface Chainable<T> {
|
||||
value(): T;
|
||||
mapValues<U>(func: (v: T[keyof T]) => U): Chainable<{[k in keyof T]: U}>;
|
||||
}
|
||||
|
||||
declare function chain<T>(t: T): Chainable<T>;
|
||||
|
||||
const square = (x: number) => x * x;
|
||||
|
||||
const v = chain({a: 1, b: 2}).mapValues(square).value();
|
||||
|
||||
|
||||
//// [mappedTypeNestedGenericInstantiation.js]
|
||||
// Repro from #13346
|
||||
var square = function (x) { return x * x; };
|
||||
var v = chain({ a: 1, b: 2 }).mapValues(square).value();
|
|
@ -0,0 +1,50 @@
|
|||
=== tests/cases/compiler/mappedTypeNestedGenericInstantiation.ts ===
|
||||
// Repro from #13346
|
||||
|
||||
interface Chainable<T> {
|
||||
>Chainable : Symbol(Chainable, Decl(mappedTypeNestedGenericInstantiation.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 20))
|
||||
|
||||
value(): T;
|
||||
>value : Symbol(Chainable.value, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 24))
|
||||
>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 20))
|
||||
|
||||
mapValues<U>(func: (v: T[keyof T]) => U): Chainable<{[k in keyof T]: U}>;
|
||||
>mapValues : Symbol(Chainable.mapValues, Decl(mappedTypeNestedGenericInstantiation.ts, 3, 13))
|
||||
>U : Symbol(U, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 12))
|
||||
>func : Symbol(func, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 15))
|
||||
>v : Symbol(v, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 22))
|
||||
>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 20))
|
||||
>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 20))
|
||||
>U : Symbol(U, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 12))
|
||||
>Chainable : Symbol(Chainable, Decl(mappedTypeNestedGenericInstantiation.ts, 0, 0))
|
||||
>k : Symbol(k, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 56))
|
||||
>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 20))
|
||||
>U : Symbol(U, Decl(mappedTypeNestedGenericInstantiation.ts, 4, 12))
|
||||
}
|
||||
|
||||
declare function chain<T>(t: T): Chainable<T>;
|
||||
>chain : Symbol(chain, Decl(mappedTypeNestedGenericInstantiation.ts, 5, 1))
|
||||
>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 7, 23))
|
||||
>t : Symbol(t, Decl(mappedTypeNestedGenericInstantiation.ts, 7, 26))
|
||||
>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 7, 23))
|
||||
>Chainable : Symbol(Chainable, Decl(mappedTypeNestedGenericInstantiation.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(mappedTypeNestedGenericInstantiation.ts, 7, 23))
|
||||
|
||||
const square = (x: number) => x * x;
|
||||
>square : Symbol(square, Decl(mappedTypeNestedGenericInstantiation.ts, 9, 5))
|
||||
>x : Symbol(x, Decl(mappedTypeNestedGenericInstantiation.ts, 9, 16))
|
||||
>x : Symbol(x, Decl(mappedTypeNestedGenericInstantiation.ts, 9, 16))
|
||||
>x : Symbol(x, Decl(mappedTypeNestedGenericInstantiation.ts, 9, 16))
|
||||
|
||||
const v = chain({a: 1, b: 2}).mapValues(square).value();
|
||||
>v : Symbol(v, Decl(mappedTypeNestedGenericInstantiation.ts, 11, 5))
|
||||
>chain({a: 1, b: 2}).mapValues(square).value : Symbol(Chainable.value, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 24))
|
||||
>chain({a: 1, b: 2}).mapValues : Symbol(Chainable.mapValues, Decl(mappedTypeNestedGenericInstantiation.ts, 3, 13))
|
||||
>chain : Symbol(chain, Decl(mappedTypeNestedGenericInstantiation.ts, 5, 1))
|
||||
>a : Symbol(a, Decl(mappedTypeNestedGenericInstantiation.ts, 11, 17))
|
||||
>b : Symbol(b, Decl(mappedTypeNestedGenericInstantiation.ts, 11, 22))
|
||||
>mapValues : Symbol(Chainable.mapValues, Decl(mappedTypeNestedGenericInstantiation.ts, 3, 13))
|
||||
>square : Symbol(square, Decl(mappedTypeNestedGenericInstantiation.ts, 9, 5))
|
||||
>value : Symbol(Chainable.value, Decl(mappedTypeNestedGenericInstantiation.ts, 2, 24))
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
=== tests/cases/compiler/mappedTypeNestedGenericInstantiation.ts ===
|
||||
// Repro from #13346
|
||||
|
||||
interface Chainable<T> {
|
||||
>Chainable : Chainable<T>
|
||||
>T : T
|
||||
|
||||
value(): T;
|
||||
>value : () => T
|
||||
>T : T
|
||||
|
||||
mapValues<U>(func: (v: T[keyof T]) => U): Chainable<{[k in keyof T]: U}>;
|
||||
>mapValues : <U>(func: (v: T[keyof T]) => U) => Chainable<{ [k in keyof T]: U; }>
|
||||
>U : U
|
||||
>func : (v: T[keyof T]) => U
|
||||
>v : T[keyof T]
|
||||
>T : T
|
||||
>T : T
|
||||
>U : U
|
||||
>Chainable : Chainable<T>
|
||||
>k : k
|
||||
>T : T
|
||||
>U : U
|
||||
}
|
||||
|
||||
declare function chain<T>(t: T): Chainable<T>;
|
||||
>chain : <T>(t: T) => Chainable<T>
|
||||
>T : T
|
||||
>t : T
|
||||
>T : T
|
||||
>Chainable : Chainable<T>
|
||||
>T : T
|
||||
|
||||
const square = (x: number) => x * x;
|
||||
>square : (x: number) => number
|
||||
>(x: number) => x * x : (x: number) => number
|
||||
>x : number
|
||||
>x * x : number
|
||||
>x : number
|
||||
>x : number
|
||||
|
||||
const v = chain({a: 1, b: 2}).mapValues(square).value();
|
||||
>v : { a: number; b: number; }
|
||||
>chain({a: 1, b: 2}).mapValues(square).value() : { a: number; b: number; }
|
||||
>chain({a: 1, b: 2}).mapValues(square).value : () => { a: number; b: number; }
|
||||
>chain({a: 1, b: 2}).mapValues(square) : Chainable<{ a: number; b: number; }>
|
||||
>chain({a: 1, b: 2}).mapValues : <U>(func: (v: number) => U) => Chainable<{ a: U; b: U; }>
|
||||
>chain({a: 1, b: 2}) : Chainable<{ a: number; b: number; }>
|
||||
>chain : <T>(t: T) => Chainable<T>
|
||||
>{a: 1, b: 2} : { a: number; b: number; }
|
||||
>a : number
|
||||
>1 : 1
|
||||
>b : number
|
||||
>2 : 2
|
||||
>mapValues : <U>(func: (v: number) => U) => Chainable<{ a: U; b: U; }>
|
||||
>square : (x: number) => number
|
||||
>value : () => { a: number; b: number; }
|
||||
|
33
tests/baselines/reference/spreadMethods.errors.txt
Normal file
33
tests/baselines/reference/spreadMethods.errors.txt
Normal file
|
@ -0,0 +1,33 @@
|
|||
tests/cases/conformance/types/spread/spreadMethods.ts(7,4): error TS2339: Property 'm' does not exist on type '{ p: number; }'.
|
||||
tests/cases/conformance/types/spread/spreadMethods.ts(9,5): error TS2339: Property 'm' does not exist on type '{ p: number; }'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/types/spread/spreadMethods.ts (2 errors) ====
|
||||
class K { p = 12; m() { } }
|
||||
interface I { p: number, m(): void }
|
||||
let k = new K()
|
||||
let sk = { ...k };
|
||||
let ssk = { ...k, ...k };
|
||||
sk.p;
|
||||
sk.m(); // error
|
||||
~
|
||||
!!! error TS2339: Property 'm' does not exist on type '{ p: number; }'.
|
||||
ssk.p;
|
||||
ssk.m(); // error
|
||||
~
|
||||
!!! error TS2339: Property 'm' does not exist on type '{ p: number; }'.
|
||||
let i: I = { p: 12, m() { } };
|
||||
let si = { ...i };
|
||||
let ssi = { ...i, ...i };
|
||||
si.p;
|
||||
si.m(); // ok
|
||||
ssi.p;
|
||||
ssi.m(); // ok
|
||||
let o = { p: 12, m() { } };
|
||||
let so = { ...o };
|
||||
let sso = { ...o, ...o };
|
||||
so.p;
|
||||
so.m(); // ok
|
||||
sso.p;
|
||||
sso.m(); // ok
|
||||
|
63
tests/baselines/reference/spreadMethods.js
Normal file
63
tests/baselines/reference/spreadMethods.js
Normal file
|
@ -0,0 +1,63 @@
|
|||
//// [spreadMethods.ts]
|
||||
class K { p = 12; m() { } }
|
||||
interface I { p: number, m(): void }
|
||||
let k = new K()
|
||||
let sk = { ...k };
|
||||
let ssk = { ...k, ...k };
|
||||
sk.p;
|
||||
sk.m(); // error
|
||||
ssk.p;
|
||||
ssk.m(); // error
|
||||
let i: I = { p: 12, m() { } };
|
||||
let si = { ...i };
|
||||
let ssi = { ...i, ...i };
|
||||
si.p;
|
||||
si.m(); // ok
|
||||
ssi.p;
|
||||
ssi.m(); // ok
|
||||
let o = { p: 12, m() { } };
|
||||
let so = { ...o };
|
||||
let sso = { ...o, ...o };
|
||||
so.p;
|
||||
so.m(); // ok
|
||||
sso.p;
|
||||
sso.m(); // ok
|
||||
|
||||
|
||||
//// [spreadMethods.js]
|
||||
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
||||
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
||||
s = arguments[i];
|
||||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
||||
t[p] = s[p];
|
||||
}
|
||||
return t;
|
||||
};
|
||||
var K = (function () {
|
||||
function K() {
|
||||
this.p = 12;
|
||||
}
|
||||
K.prototype.m = function () { };
|
||||
return K;
|
||||
}());
|
||||
var k = new K();
|
||||
var sk = __assign({}, k);
|
||||
var ssk = __assign({}, k, k);
|
||||
sk.p;
|
||||
sk.m(); // error
|
||||
ssk.p;
|
||||
ssk.m(); // error
|
||||
var i = { p: 12, m: function () { } };
|
||||
var si = __assign({}, i);
|
||||
var ssi = __assign({}, i, i);
|
||||
si.p;
|
||||
si.m(); // ok
|
||||
ssi.p;
|
||||
ssi.m(); // ok
|
||||
var o = { p: 12, m: function () { } };
|
||||
var so = __assign({}, o);
|
||||
var sso = __assign({}, o, o);
|
||||
so.p;
|
||||
so.m(); // ok
|
||||
sso.p;
|
||||
sso.m(); // ok
|
12
tests/cases/compiler/mappedTypeNestedGenericInstantiation.ts
Normal file
12
tests/cases/compiler/mappedTypeNestedGenericInstantiation.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
// Repro from #13346
|
||||
|
||||
interface Chainable<T> {
|
||||
value(): T;
|
||||
mapValues<U>(func: (v: T[keyof T]) => U): Chainable<{[k in keyof T]: U}>;
|
||||
}
|
||||
|
||||
declare function chain<T>(t: T): Chainable<T>;
|
||||
|
||||
const square = (x: number) => x * x;
|
||||
|
||||
const v = chain({a: 1, b: 2}).mapValues(square).value();
|
|
@ -27,3 +27,6 @@
|
|||
// contextually typed parameters.
|
||||
let twelve = (f => f(12))(i => i);
|
||||
let eleven = (o => o.a(11))({ a: function(n) { return n; } });
|
||||
// missing arguments
|
||||
(function(x, undefined) { return x; })(42);
|
||||
((x, y, z) => 42)();
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
// @strictNullChecks: true
|
||||
// arrow
|
||||
(jake => { })("build");
|
||||
// function expression
|
||||
(function (cats) { })("lol");
|
||||
// Lots of Irritating Superfluous Parentheses
|
||||
(function (x) { } ("!"));
|
||||
((((function (y) { }))))("-");
|
||||
// multiple arguments
|
||||
((a, b, c) => { })("foo", 101, false);
|
||||
// default parameters
|
||||
((m = 10) => m + 1)(12);
|
||||
((n = 10) => n + 1)();
|
||||
// optional parameters
|
||||
((j?) => j + 1)(12);
|
||||
((k?) => k + 1)();
|
||||
((l, o?) => l + o)(12); // o should be any
|
||||
// rest parameters
|
||||
((...numbers) => numbers.every(n => n > 0))(5,6,7);
|
||||
((...mixed) => mixed.every(n => !!n))(5,'oops','oh no');
|
||||
((...noNumbers) => noNumbers.some(n => n > 0))();
|
||||
((first, ...rest) => first ? [] : rest.map(n => n > 0))(8,9,10);
|
||||
// destructuring parameters (with defaults too!)
|
||||
(({ q }) => q)({ q : 13 });
|
||||
(({ p = 14 }) => p)({ p : 15 });
|
||||
(({ r = 17 } = { r: 18 }) => r)({r : 19});
|
||||
(({ u = 22 } = { u: 23 }) => u)();
|
||||
// contextually typed parameters.
|
||||
let twelve = (f => f(12))(i => i);
|
||||
let eleven = (o => o.a(11))({ a: function(n) { return n; } });
|
||||
// missing arguments
|
||||
(function(x, undefined) { return x; })(42);
|
||||
((x, y, z) => 42)();
|
23
tests/cases/conformance/types/spread/spreadMethods.ts
Normal file
23
tests/cases/conformance/types/spread/spreadMethods.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
class K { p = 12; m() { } }
|
||||
interface I { p: number, m(): void }
|
||||
let k = new K()
|
||||
let sk = { ...k };
|
||||
let ssk = { ...k, ...k };
|
||||
sk.p;
|
||||
sk.m(); // error
|
||||
ssk.p;
|
||||
ssk.m(); // error
|
||||
let i: I = { p: 12, m() { } };
|
||||
let si = { ...i };
|
||||
let ssi = { ...i, ...i };
|
||||
si.p;
|
||||
si.m(); // ok
|
||||
ssi.p;
|
||||
ssi.m(); // ok
|
||||
let o = { p: 12, m() { } };
|
||||
let so = { ...o };
|
||||
let sso = { ...o, ...o };
|
||||
so.p;
|
||||
so.m(); // ok
|
||||
sso.p;
|
||||
sso.m(); // ok
|
12
tests/cases/fourslash/completionForStringLiteral6.ts
Normal file
12
tests/cases/fourslash/completionForStringLiteral6.ts
Normal file
|
@ -0,0 +1,12 @@
|
|||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
////interface Foo {
|
||||
//// x: "abc" | "def";
|
||||
////}
|
||||
////function bar(f: Foo) { };
|
||||
////bar({x: "/**/"});
|
||||
|
||||
goTo.marker();
|
||||
verify.completionListContains("abc");
|
||||
verify.completionListContains("def");
|
||||
verify.completionListCount(2);
|
|
@ -129,7 +129,7 @@ function dir(dirPath: string, spec?: string, options?: any) {
|
|||
function deleteFolderRecursive(dirPath: string) {
|
||||
if (fs.existsSync(dirPath)) {
|
||||
fs.readdirSync(dirPath).forEach((file) => {
|
||||
const curPath = path.join(path, file);
|
||||
const curPath = path.join(dirPath, file);
|
||||
if (fs.statSync(curPath).isDirectory()) { // recurse
|
||||
deleteFolderRecursive(curPath);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue