Merge branch 'master' into fallthrough

This commit is contained in:
Andy Hanson 2017-04-18 09:48:21 -07:00
commit 455492d887
326 changed files with 6384 additions and 2450 deletions

View File

@ -18,12 +18,12 @@ branches:
- master
- release-2.1
- release-2.2
- release-2.3
install:
- npm uninstall typescript
- npm uninstall tslint
- npm install
- npm update
cache:
directories:

View File

@ -41,6 +41,7 @@ const cmdLineOptions = minimist(process.argv.slice(2), {
boolean: ["debug", "inspect", "light", "colors", "lint", "soft"],
string: ["browser", "tests", "host", "reporter", "stackTraceLimit"],
alias: {
b: "browser",
d: "debug",
t: "tests",
test: "tests",
@ -162,7 +163,10 @@ const librarySourceMap = [
// JavaScript + all host library
{ target: "lib.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(hostsLibrarySources) },
{ target: "lib.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") }
{ target: "lib.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") },
{ target: "lib.es2016.full.d.ts", sources: ["header.d.ts", "es2016.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") },
{ target: "lib.es2017.full.d.ts", sources: ["header.d.ts", "es2017.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") },
{ target: "lib.esnext.full.d.ts", sources: ["header.d.ts", "esnext.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") },
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap, esnextLibrarySourceMap);
const libraryTargets = librarySourceMap.map(function(f) {
@ -1024,7 +1028,7 @@ gulp.task("lint", "Runs tslint on the compiler sources. Optional arguments are:
const fileMatcher = cmdLineOptions["files"];
const files = fileMatcher
? `src/**/${fileMatcher}`
: "Gulpfile.ts 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'";
: "Gulpfile.ts 'scripts/tslint/*.ts' 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'";
const cmd = `node node_modules/tslint/bin/tslint ${files} --format stylish`;
console.log("Linting: " + cmd);
child_process.execSync(cmd, { stdio: [0, 1, 2] });

View File

@ -205,7 +205,10 @@ var librarySourceMap = [
// JavaScript + all host library
{ target: "lib.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(hostsLibrarySources) },
{ target: "lib.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") }
{ target: "lib.es6.d.ts", sources: ["header.d.ts", "es5.d.ts"].concat(es2015LibrarySources, hostsLibrarySources, "dom.iterable.d.ts") },
{ target: "lib.es2016.full.d.ts", sources: ["header.d.ts", "es2016.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
{ target: "lib.es2017.full.d.ts", sources: ["header.d.ts", "es2017.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
{ target: "lib.esnext.full.d.ts", sources: ["header.d.ts", "esnext.d.ts"].concat(hostsLibrarySources, "dom.iterable.d.ts") },
].concat(es2015LibrarySourceMap, es2016LibrarySourceMap, es2017LibrarySourceMap, esnextLibrarySourceMap);
var libraryTargets = librarySourceMap.map(function (f) {
@ -1197,7 +1200,7 @@ task("lint", ["build-rules"], () => {
const fileMatcher = process.env.f || process.env.file || process.env.files;
const files = fileMatcher
? `src/**/${fileMatcher}`
: "Gulpfile.ts 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'";
: "Gulpfile.ts 'scripts/tslint/*.ts' 'src/**/*.ts' --exclude src/lib/es5.d.ts --exclude 'src/lib/*.generated.d.ts'";
const cmd = `node node_modules/tslint/bin/tslint ${files} --format stylish`;
console.log("Linting: " + cmd);
jake.exec([cmd], { interactive: true }, () => {

View File

@ -1,6 +1,6 @@
[![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript)
[![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
[![Downloads](https://img.shields.io/npm/dm/TypeScript.svg)](https://www.npmjs.com/package/typescript)
[![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
# TypeScript

View File

@ -67,7 +67,7 @@ function walk(ctx: Lint.WalkContext<void>): void {
return;
}
let ranges = ts.getTrailingCommentRanges(sourceFile.text, arg.pos) || ts.getLeadingCommentRanges(sourceFile.text, arg.pos);
const ranges = ts.getTrailingCommentRanges(sourceFile.text, arg.pos) || ts.getLeadingCommentRanges(sourceFile.text, arg.pos);
if (ranges === undefined || ranges.length !== 1 || ranges[0].kind !== ts.SyntaxKind.MultiLineCommentTrivia) {
ctx.addFailureAtNode(arg, "Tag boolean argument with parameter name");
return;

View File

@ -2300,7 +2300,7 @@ namespace ts {
function isNameOfExportsOrModuleExportsAliasDeclaration(node: Node) {
if (node.kind === SyntaxKind.Identifier) {
const symbol = container.locals.get((<Identifier>node).text);
const symbol = lookupSymbolForName((<Identifier>node).text);
if (symbol && symbol.valueDeclaration && symbol.valueDeclaration.kind === SyntaxKind.VariableDeclaration) {
const declaration = symbol.valueDeclaration as VariableDeclaration;
if (declaration.initializer) {
@ -2402,8 +2402,12 @@ namespace ts {
}
}
function lookupSymbolForName(name: string) {
return (container.symbol && container.symbol.exports && container.symbol.exports.get(name)) || container.locals.get(name);
}
function bindPropertyAssignment(functionName: string, propertyAccessExpression: PropertyAccessExpression, isPrototypeProperty: boolean) {
let targetSymbol = container.locals.get(functionName);
let targetSymbol = lookupSymbolForName(functionName);
if (targetSymbol && isDeclarationOfFunctionOrClassExpression(targetSymbol)) {
targetSymbol = (targetSymbol.valueDeclaration as VariableDeclaration).initializer.symbol;

View File

@ -81,6 +81,7 @@ namespace ts {
isUndefinedSymbol: symbol => symbol === undefinedSymbol,
isArgumentsSymbol: symbol => symbol === argumentsSymbol,
isUnknownSymbol: symbol => symbol === unknownSymbol,
getMergedSymbol,
getDiagnostics,
getGlobalDiagnostics,
getTypeOfSymbolAtLocation: (symbol, location) => {
@ -172,6 +173,17 @@ namespace ts {
node = getParseTreeNode(node, isFunctionLike);
return node ? isImplementationOfOverload(node) : undefined;
},
getImmediateAliasedSymbol: symbol => {
Debug.assert((symbol.flags & SymbolFlags.Alias) !== 0, "Should only get Alias here.");
const links = getSymbolLinks(symbol);
if (!links.immediateTarget) {
const node = getDeclarationOfAliasSymbol(symbol);
Debug.assert(!!node);
links.immediateTarget = getTargetOfAliasDeclaration(node, /*dontRecursivelyResolve*/ true);
}
return links.immediateTarget;
},
getAliasedSymbol: resolveAlias,
getEmitResolver,
getExportsOfModule: getExportsOfModuleAsArray,
@ -337,7 +349,7 @@ namespace ts {
TypeofNEHostObject = 1 << 13, // typeof x !== "xxx"
EQUndefined = 1 << 14, // x === undefined
EQNull = 1 << 15, // x === null
EQUndefinedOrNull = 1 << 16, // x == undefined / x == null
EQUndefinedOrNull = 1 << 16, // x === undefined / x === null
NEUndefined = 1 << 17, // x !== undefined
NENull = 1 << 18, // x !== null
NEUndefinedOrNull = 1 << 19, // x != undefined / x != null
@ -748,9 +760,15 @@ namespace ts {
// declaration is after usage, but it can still be legal if usage is deferred:
// 1. inside a function
// 2. inside an instance property initializer, a reference to a non-instance property
// 3. inside a static property initializer, a reference to a static method in the same class
// 1. inside an export specifier
// 2. inside a function
// 3. inside an instance property initializer, a reference to a non-instance property
// 4. inside a static property initializer, a reference to a static method in the same class
if (usage.parent.kind === SyntaxKind.ExportSpecifier) {
// export specifiers do not use the variable, they only make it available for use
return true;
}
const container = getEnclosingBlockScopeContainer(declaration);
return isUsedInFunctionOrInstanceProperty(usage, declaration, container);
@ -1057,7 +1075,8 @@ namespace ts {
!checkAndReportErrorForMissingPrefix(errorLocation, name, nameArg) &&
!checkAndReportErrorForExtendingInterface(errorLocation) &&
!checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) &&
!checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning)) {
!checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) &&
!checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning)) {
error(errorLocation, nameNotFoundMessage, typeof nameArg === "string" ? nameArg : declarationNameToString(nameArg));
}
}
@ -1201,6 +1220,24 @@ namespace ts {
return false;
}
function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation: Node, name: string, meaning: SymbolFlags): boolean {
if (meaning & (SymbolFlags.Value & ~SymbolFlags.NamespaceModule & ~SymbolFlags.Type)) {
const symbol = resolveSymbol(resolveName(errorLocation, name, SymbolFlags.NamespaceModule & ~SymbolFlags.Value, /*nameNotFoundMessage*/undefined, /*nameArg*/ undefined));
if (symbol) {
error(errorLocation, Diagnostics.Cannot_use_namespace_0_as_a_value, name);
return true;
}
}
else if (meaning & (SymbolFlags.Type & ~SymbolFlags.NamespaceModule & ~SymbolFlags.Value)) {
const symbol = resolveSymbol(resolveName(errorLocation, name, SymbolFlags.NamespaceModule & ~SymbolFlags.Type, /*nameNotFoundMessage*/undefined, /*nameArg*/ undefined));
if (symbol) {
error(errorLocation, Diagnostics.Cannot_use_namespace_0_as_a_type, name);
return true;
}
}
return false;
}
function checkResolvedBlockScopedVariable(result: Symbol, errorLocation: Node): void {
Debug.assert(!!(result.flags & SymbolFlags.BlockScopedVariable || result.flags & SymbolFlags.Class || result.flags & SymbolFlags.Enum));
// Block-scoped variables cannot be used before their definition
@ -1254,14 +1291,14 @@ namespace ts {
return find<Declaration>(symbol.declarations, isAliasSymbolDeclaration);
}
function getTargetOfImportEqualsDeclaration(node: ImportEqualsDeclaration): Symbol {
function getTargetOfImportEqualsDeclaration(node: ImportEqualsDeclaration, dontResolveAlias: boolean): Symbol {
if (node.moduleReference.kind === SyntaxKind.ExternalModuleReference) {
return resolveExternalModuleSymbol(resolveExternalModuleName(node, getExternalModuleImportEqualsDeclarationExpression(node)));
}
return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>node.moduleReference);
return getSymbolOfPartOfRightHandSideOfImportEquals(<EntityName>node.moduleReference, dontResolveAlias);
}
function getTargetOfImportClause(node: ImportClause): Symbol {
function getTargetOfImportClause(node: ImportClause, dontResolveAlias: boolean): Symbol {
const moduleSymbol = resolveExternalModuleName(node, (<ImportDeclaration>node.parent).moduleSpecifier);
if (moduleSymbol) {
@ -1273,22 +1310,22 @@ namespace ts {
const exportValue = moduleSymbol.exports.get("export=");
exportDefaultSymbol = exportValue
? getPropertyOfType(getTypeOfSymbol(exportValue), "default")
: resolveSymbol(moduleSymbol.exports.get("default"));
: resolveSymbol(moduleSymbol.exports.get("default"), dontResolveAlias);
}
if (!exportDefaultSymbol && !allowSyntheticDefaultImports) {
error(node.name, Diagnostics.Module_0_has_no_default_export, symbolToString(moduleSymbol));
}
else if (!exportDefaultSymbol && allowSyntheticDefaultImports) {
return resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol);
return resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
}
return exportDefaultSymbol;
}
}
function getTargetOfNamespaceImport(node: NamespaceImport): Symbol {
function getTargetOfNamespaceImport(node: NamespaceImport, dontResolveAlias: boolean): Symbol {
const moduleSpecifier = (<ImportDeclaration>node.parent.parent).moduleSpecifier;
return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier);
return resolveESModuleSymbol(resolveExternalModuleName(node, moduleSpecifier), moduleSpecifier, dontResolveAlias);
}
// This function creates a synthetic symbol that combines the value side of one symbol with the
@ -1322,12 +1359,9 @@ namespace ts {
return result;
}
function getExportOfModule(symbol: Symbol, name: string): Symbol {
function getExportOfModule(symbol: Symbol, name: string, dontResolveAlias: boolean): Symbol {
if (symbol.flags & SymbolFlags.Module) {
const exportedSymbol = getExportsOfSymbol(symbol).get(name);
if (exportedSymbol) {
return resolveSymbol(exportedSymbol);
}
return resolveSymbol(getExportsOfSymbol(symbol).get(name), dontResolveAlias);
}
}
@ -1340,9 +1374,9 @@ namespace ts {
}
}
function getExternalModuleMember(node: ImportDeclaration | ExportDeclaration, specifier: ImportOrExportSpecifier): Symbol {
function getExternalModuleMember(node: ImportDeclaration | ExportDeclaration, specifier: ImportOrExportSpecifier, dontResolveAlias?: boolean): Symbol {
const moduleSymbol = resolveExternalModuleName(node, node.moduleSpecifier);
const targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier);
const targetSymbol = resolveESModuleSymbol(moduleSymbol, node.moduleSpecifier, dontResolveAlias);
if (targetSymbol) {
const name = specifier.propertyName || specifier.name;
if (name.text) {
@ -1359,11 +1393,11 @@ namespace ts {
symbolFromVariable = getPropertyOfVariable(targetSymbol, name.text);
}
// if symbolFromVariable is export - get its final target
symbolFromVariable = resolveSymbol(symbolFromVariable);
let symbolFromModule = getExportOfModule(targetSymbol, name.text);
symbolFromVariable = resolveSymbol(symbolFromVariable, dontResolveAlias);
let symbolFromModule = getExportOfModule(targetSymbol, name.text, dontResolveAlias);
// If the export member we're looking for is default, and there is no real default but allowSyntheticDefaultImports is on, return the entire module as the default
if (!symbolFromModule && allowSyntheticDefaultImports && name.text === "default") {
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol) || resolveSymbol(moduleSymbol);
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
}
const symbol = symbolFromModule && symbolFromVariable ?
combineValueAndTypeSymbols(symbolFromVariable, symbolFromModule) :
@ -1376,45 +1410,46 @@ namespace ts {
}
}
function getTargetOfImportSpecifier(node: ImportSpecifier): Symbol {
return getExternalModuleMember(<ImportDeclaration>node.parent.parent.parent, node);
function getTargetOfImportSpecifier(node: ImportSpecifier, dontResolveAlias: boolean): Symbol {
return getExternalModuleMember(<ImportDeclaration>node.parent.parent.parent, node, dontResolveAlias);
}
function getTargetOfNamespaceExportDeclaration(node: NamespaceExportDeclaration): Symbol {
return resolveExternalModuleSymbol(node.parent.symbol);
function getTargetOfNamespaceExportDeclaration(node: NamespaceExportDeclaration, dontResolveAlias: boolean): Symbol {
return resolveExternalModuleSymbol(node.parent.symbol, dontResolveAlias);
}
function getTargetOfExportSpecifier(node: ExportSpecifier): Symbol {
function getTargetOfExportSpecifier(node: ExportSpecifier, dontResolveAlias?: boolean): Symbol {
return (<ExportDeclaration>node.parent.parent).moduleSpecifier ?
getExternalModuleMember(<ExportDeclaration>node.parent.parent, node) :
resolveEntityName(node.propertyName || node.name, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
getExternalModuleMember(<ExportDeclaration>node.parent.parent, node, dontResolveAlias) :
resolveEntityName(node.propertyName || node.name, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, /*ignoreErrors*/ false, dontResolveAlias);
}
function getTargetOfExportAssignment(node: ExportAssignment): Symbol {
return resolveEntityName(<EntityNameExpression>node.expression, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace);
function getTargetOfExportAssignment(node: ExportAssignment, dontResolveAlias: boolean): Symbol {
return resolveEntityName(<EntityNameExpression>node.expression, SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace, /*ignoreErrors*/ false, dontResolveAlias);
}
function getTargetOfAliasDeclaration(node: Declaration): Symbol {
function getTargetOfAliasDeclaration(node: Declaration, dontRecursivelyResolve?: boolean): Symbol {
switch (node.kind) {
case SyntaxKind.ImportEqualsDeclaration:
return getTargetOfImportEqualsDeclaration(<ImportEqualsDeclaration>node);
return getTargetOfImportEqualsDeclaration(<ImportEqualsDeclaration>node, dontRecursivelyResolve);
case SyntaxKind.ImportClause:
return getTargetOfImportClause(<ImportClause>node);
return getTargetOfImportClause(<ImportClause>node, dontRecursivelyResolve);
case SyntaxKind.NamespaceImport:
return getTargetOfNamespaceImport(<NamespaceImport>node);
return getTargetOfNamespaceImport(<NamespaceImport>node, dontRecursivelyResolve);
case SyntaxKind.ImportSpecifier:
return getTargetOfImportSpecifier(<ImportSpecifier>node);
return getTargetOfImportSpecifier(<ImportSpecifier>node, dontRecursivelyResolve);
case SyntaxKind.ExportSpecifier:
return getTargetOfExportSpecifier(<ExportSpecifier>node);
return getTargetOfExportSpecifier(<ExportSpecifier>node, dontRecursivelyResolve);
case SyntaxKind.ExportAssignment:
return getTargetOfExportAssignment(<ExportAssignment>node);
return getTargetOfExportAssignment(<ExportAssignment>node, dontRecursivelyResolve);
case SyntaxKind.NamespaceExportDeclaration:
return getTargetOfNamespaceExportDeclaration(<NamespaceExportDeclaration>node);
return getTargetOfNamespaceExportDeclaration(<NamespaceExportDeclaration>node, dontRecursivelyResolve);
}
}
function resolveSymbol(symbol: Symbol): Symbol {
return symbol && symbol.flags & SymbolFlags.Alias && !(symbol.flags & (SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace)) ? resolveAlias(symbol) : symbol;
function resolveSymbol(symbol: Symbol, dontResolveAlias?: boolean): Symbol {
const shouldResolve = !dontResolveAlias && symbol && symbol.flags & SymbolFlags.Alias && !(symbol.flags & (SymbolFlags.Value | SymbolFlags.Type | SymbolFlags.Namespace));
return shouldResolve ? resolveAlias(symbol) : symbol;
}
function resolveAlias(symbol: Symbol): Symbol {
@ -1654,16 +1689,16 @@ namespace ts {
// An external module with an 'export =' declaration resolves to the target of the 'export =' declaration,
// and an external module with no 'export =' declaration resolves to the module itself.
function resolveExternalModuleSymbol(moduleSymbol: Symbol): Symbol {
return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export="))) || moduleSymbol;
function resolveExternalModuleSymbol(moduleSymbol: Symbol, dontResolveAlias?: boolean): Symbol {
return moduleSymbol && getMergedSymbol(resolveSymbol(moduleSymbol.exports.get("export="), dontResolveAlias)) || moduleSymbol;
}
// An external module with an 'export =' declaration may be referenced as an ES6 module provided the 'export ='
// references a symbol that is at least declared as a module or a variable. The target of the 'export =' may
// combine other declarations with the module or variable (e.g. a class/module, function/module, interface/variable).
function resolveESModuleSymbol(moduleSymbol: Symbol, moduleReferenceExpression: Expression): Symbol {
let symbol = resolveExternalModuleSymbol(moduleSymbol);
if (symbol && !(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable))) {
function resolveESModuleSymbol(moduleSymbol: Symbol, moduleReferenceExpression: Expression, dontResolveAlias: boolean): Symbol {
let symbol = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias);
if (!dontResolveAlias && symbol && !(symbol.flags & (SymbolFlags.Module | SymbolFlags.Variable))) {
error(moduleReferenceExpression, Diagnostics.Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct, symbolToString(moduleSymbol));
symbol = undefined;
}
@ -5504,7 +5539,7 @@ namespace ts {
prop.checkFlags = templateReadonly || modifiersProp && isReadonlySymbol(modifiersProp) ? CheckFlags.Readonly : 0;
prop.type = propType;
if (propertySymbol) {
prop.mappedTypeOrigin = propertySymbol;
prop.syntheticOrigin = propertySymbol;
}
members.set(propName, prop);
}
@ -7453,7 +7488,7 @@ namespace ts {
skippedPrivateMembers.set(rightProp.name, true);
}
else if (!isClassMethod(rightProp) && !isSetterWithoutGetter) {
members.set(rightProp.name, rightProp);
members.set(rightProp.name, getNonReadonlySymbol(rightProp));
}
}
for (const leftProp of getPropertiesOfType(left)) {
@ -7469,7 +7504,6 @@ namespace ts {
const declarations: Declaration[] = concatenate(leftProp.declarations, rightProp.declarations);
const flags = SymbolFlags.Property | (leftProp.flags & SymbolFlags.Optional);
const result = createSymbol(flags, leftProp.name);
result.checkFlags = isReadonlySymbol(leftProp) || isReadonlySymbol(rightProp) ? CheckFlags.Readonly : 0;
result.type = getUnionType([getTypeOfSymbol(leftProp), getTypeWithFacts(rightType, TypeFacts.NEUndefined)]);
result.leftSpread = leftProp;
result.rightSpread = rightProp;
@ -7478,12 +7512,24 @@ namespace ts {
}
}
else {
members.set(leftProp.name, leftProp);
members.set(leftProp.name, getNonReadonlySymbol(leftProp));
}
}
return createAnonymousType(undefined, members, emptyArray, emptyArray, stringIndexInfo, numberIndexInfo);
}
function getNonReadonlySymbol(prop: Symbol) {
if (!isReadonlySymbol(prop)) {
return prop;
}
const flags = SymbolFlags.Property | (prop.flags & SymbolFlags.Optional);
const result = createSymbol(flags, prop.name);
result.type = getTypeOfSymbol(prop);
result.declarations = prop.declarations;
result.syntheticOrigin = prop;
return result;
}
function isClassMethod(prop: Symbol) {
return prop.flags & SymbolFlags.Method && find(prop.declarations, decl => isClassLike(decl.parent));
}
@ -8337,8 +8383,11 @@ namespace ts {
!t.numberIndexInfo;
}
function isEmptyObjectType(type: Type) {
return type.flags & TypeFlags.Object && isEmptyResolvedType(resolveStructuredTypeMembers(<ObjectType>type));
function isEmptyObjectType(type: Type): boolean {
return type.flags & TypeFlags.Object ? isEmptyResolvedType(resolveStructuredTypeMembers(<ObjectType>type)) :
type.flags & TypeFlags.Union ? forEach((<UnionType>type).types, isEmptyObjectType) :
type.flags & TypeFlags.Intersection ? !forEach((<UnionType>type).types, t => !isEmptyObjectType(t)) :
false;
}
function isEnumTypeRelatedTo(source: EnumType, target: EnumType, errorReporter?: ErrorReporter) {
@ -8654,14 +8703,8 @@ namespace ts {
function isKnownProperty(type: Type, name: string, isComparingJsxAttributes: boolean): boolean {
if (type.flags & TypeFlags.Object) {
const resolved = resolveStructuredTypeMembers(<ObjectType>type);
if ((relation === assignableRelation || relation === comparableRelation) &&
(type === globalObjectType || (!isComparingJsxAttributes && isEmptyObjectType(resolved)))) {
return true;
}
else if (resolved.stringIndexInfo || (resolved.numberIndexInfo && isNumericLiteralName(name))) {
return true;
}
else if (getPropertyOfType(type, name) || (isComparingJsxAttributes && !isUnhyphenatedJsxName(name))) {
if (resolved.stringIndexInfo || resolved.numberIndexInfo && isNumericLiteralName(name) ||
getPropertyOfType(type, name) || isComparingJsxAttributes && !isUnhyphenatedJsxName(name)) {
// For JSXAttributes, if the attribute has a hyphenated name, consider that the attribute to be known.
return true;
}
@ -8679,6 +8722,10 @@ namespace ts {
function hasExcessProperties(source: FreshObjectLiteralType, target: Type, reportErrors: boolean): boolean {
if (maybeTypeOfKind(target, TypeFlags.Object) && !(getObjectFlags(target) & ObjectFlags.ObjectLiteralPatternWithComputedProperties)) {
const isComparingJsxAttributes = !!(source.flags & TypeFlags.JsxAttributes);
if ((relation === assignableRelation || relation === comparableRelation) &&
(target === globalObjectType || (!isComparingJsxAttributes && isEmptyObjectType(target)))) {
return false;
}
for (const prop of getPropertiesOfObjectType(source)) {
if (!isKnownProperty(target, prop.name, isComparingJsxAttributes)) {
if (reportErrors) {
@ -10896,7 +10943,7 @@ namespace ts {
// we defer subtype reduction until the evolving array type is finalized into a manifest
// array type.
function addEvolvingArrayElementType(evolvingArrayType: EvolvingArrayType, node: Expression): EvolvingArrayType {
const elementType = getBaseTypeOfLiteralType(getTypeOfExpression(node));
const elementType = getBaseTypeOfLiteralType(getContextFreeTypeOfExpression(node));
return isTypeSubsetOf(elementType, evolvingArrayType.elementType) ? evolvingArrayType : getEvolvingArrayType(getUnionType([evolvingArrayType.elementType, elementType]));
}
@ -11058,7 +11105,7 @@ namespace ts {
else if (flow.flags & FlowFlags.Start) {
// Check if we should continue with the control flow of the containing function.
const container = (<FlowStart>flow).container;
if (container && container !== flowContainer && reference.kind !== SyntaxKind.PropertyAccessExpression) {
if (container && container !== flowContainer && reference.kind !== SyntaxKind.PropertyAccessExpression && reference.kind !== SyntaxKind.ThisKeyword) {
flow = container.flowNode;
continue;
}
@ -17067,10 +17114,12 @@ namespace ts {
return type;
}
// Returns the type of an expression. Unlike checkExpression, this function is simply concerned
// with computing the type and may not fully check all contained sub-expressions for errors.
// A cache argument of true indicates that if the function performs a full type check, it is ok
// to cache the result.
/**
* Returns the type of an expression. Unlike checkExpression, this function is simply concerned
* with computing the type and may not fully check all contained sub-expressions for errors.
* A cache argument of true indicates that if the function performs a full type check, it is ok
* to cache the result.
*/
function getTypeOfExpression(node: Expression, cache?: boolean) {
// Optimize for the common case of a call to a function with a single non-generic call
// signature where we can just fetch the return type without checking the arguments.
@ -17087,6 +17136,21 @@ namespace ts {
return cache ? checkExpressionCached(node) : checkExpression(node);
}
/**
* Returns the type of an expression. Unlike checkExpression, this function is simply concerned
* with computing the type and may not fully check all contained sub-expressions for errors.
* It is intended for uses where you know there is no contextual type,
* and requesting the contextual type might cause a circularity or other bad behaviour.
* It sets the contextual type of the node to any before calling getTypeOfExpression.
*/
function getContextFreeTypeOfExpression(node: Expression) {
const saveContextualType = node.contextualType;
node.contextualType = anyType;
const type = getTypeOfExpression(node);
node.contextualType = saveContextualType;
return type;
}
// Checks an expression and returns its type. The contextualMapper parameter serves two purposes: When
// contextualMapper is not undefined and not equal to the identityMapper function object it indicates that the
// expression is being inferentially typed (section 4.15.2 in spec) and provides the type mapper to use in
@ -17555,7 +17619,7 @@ namespace ts {
function checkObjectTypeForDuplicateDeclarations(node: TypeLiteralNode | InterfaceDeclaration) {
const names = createMap<boolean>();
for (const member of node.members) {
if (member.kind == SyntaxKind.PropertySignature) {
if (member.kind === SyntaxKind.PropertySignature) {
let memberName: string;
switch (member.name.kind) {
case SyntaxKind.StringLiteral:
@ -22149,10 +22213,10 @@ namespace ts {
else if (symbol.flags & SymbolFlags.Transient) {
if ((symbol as SymbolLinks).leftSpread) {
const links = symbol as SymbolLinks;
return [links.leftSpread, links.rightSpread];
return [...getRootSymbols(links.leftSpread), ...getRootSymbols(links.rightSpread)];
}
if ((symbol as SymbolLinks).mappedTypeOrigin) {
return getRootSymbols((symbol as SymbolLinks).mappedTypeOrigin);
if ((symbol as SymbolLinks).syntheticOrigin) {
return getRootSymbols((symbol as SymbolLinks).syntheticOrigin);
}
let target: Symbol;

View File

@ -1007,7 +1007,7 @@ namespace ts {
let seenKnownKeys = 0;
const nameColumn: string[] = [];
const descriptionColumn: string[] = [];
const knownKesyCount = getOwnKeys(configurations.compilerOptions).length;
const knownKeysCount = getOwnKeys(configurations.compilerOptions).length;
for (const category in categorizedOptions) {
if (nameColumn.length !== 0) {
nameColumn.push("");
@ -1018,7 +1018,7 @@ namespace ts {
for (const option of categorizedOptions[category]) {
let optionName;
if (hasProperty(configurations.compilerOptions, option.name)) {
optionName = `"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${(seenKnownKeys += 1) === knownKesyCount ? "" : ","}`;
optionName = `"${option.name}": ${JSON.stringify(configurations.compilerOptions[option.name])}${(seenKnownKeys += 1) === knownKeysCount ? "" : ","}`;
}
else {
optionName = `// "${option.name}": ${JSON.stringify(getDefaultValueForOption(option))},`;

View File

@ -887,10 +887,12 @@ namespace ts {
}
/** Shims `Array.from`. */
export function arrayFrom<T>(iterator: Iterator<T>): T[] {
const result: T[] = [];
export function arrayFrom<T, U>(iterator: Iterator<T>, map: (t: T) => U): U[];
export function arrayFrom<T>(iterator: Iterator<T>): T[];
export function arrayFrom(iterator: Iterator<any>, map?: (t: any) => any): any[] {
const result: any[] = [];
for (let { value, done } = iterator.next(); !done; { value, done } = iterator.next()) {
result.push(value);
result.push(map ? map(value) : value);
}
return result;
}
@ -943,7 +945,7 @@ namespace ts {
export function assign<T1 extends MapLike<{}>>(t: T1, ...args: any[]): any;
export function assign<T1 extends MapLike<{}>>(t: T1, ...args: any[]) {
for (const arg of args) {
for (const p of getOwnKeys(arg)) {
for (const p in arg) if (hasProperty(arg, p)) {
t[p] = arg[p];
}
}

View File

@ -2099,6 +2099,14 @@
"category": "Error",
"code": 2707
},
"Cannot use namespace '{0}' as a value.": {
"category": "Error",
"code": 2708
},
"Cannot use namespace '{0}' as a type.": {
"category": "Error",
"code": 2709
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
@ -3177,6 +3185,10 @@
"category": "Message",
"code": 6181
},
"Scoped package detected, looking in '{0}'": {
"category": "Message",
"code": "6182"
},
"Variable '{0}' implicitly has an '{1}' type.": {
"category": "Error",

View File

@ -3058,7 +3058,18 @@ namespace ts {
* @param ensureUseStrict: boolean determining whether the function need to add prologue-directives
* @param visitor: Optional callback used to visit any custom prologue directives.
*/
export function addPrologueDirectives(target: Statement[], source: Statement[], ensureUseStrict?: boolean, visitor?: (node: Node) => VisitResult<Node>): number {
export function addPrologue(target: Statement[], source: Statement[], ensureUseStrict?: boolean, visitor?: (node: Node) => VisitResult<Node>): number {
const offset = addStandardPrologue(target, source, ensureUseStrict);
return addCustomPrologue(target, source, offset, visitor);
}
/**
* Add just the standard (string-expression) prologue-directives into target statement-array.
* The function needs to be called during each transformation step.
* This function needs to be called whenever we transform the statement
* list of a source file, namespace, or function-like body.
*/
export function addStandardPrologue(target: Statement[], source: Statement[], ensureUseStrict?: boolean): number {
Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array");
let foundUseStrict = false;
let statementOffset = 0;
@ -3066,7 +3077,7 @@ namespace ts {
while (statementOffset < numStatements) {
const statement = source[statementOffset];
if (isPrologueDirective(statement)) {
if (isUseStrictPrologue(statement as ExpressionStatement)) {
if (isUseStrictPrologue(statement)) {
foundUseStrict = true;
}
target.push(statement);
@ -3079,6 +3090,17 @@ namespace ts {
if (ensureUseStrict && !foundUseStrict) {
target.push(startOnNewLine(createStatement(createLiteral("use strict"))));
}
return statementOffset;
}
/**
* Add just the custom prologue-directives into target statement-array.
* The function needs to be called during each transformation step.
* This function needs to be called whenever we transform the statement
* list of a source file, namespace, or function-like body.
*/
export function addCustomPrologue(target: Statement[], source: Statement[], statementOffset: number, visitor?: (node: Node) => VisitResult<Node>): number {
const numStatements = source.length;
while (statementOffset < numStatements) {
const statement = source[statementOffset];
if (getEmitFlags(statement) & EmitFlags.CustomPrologue) {

View File

@ -378,7 +378,7 @@ namespace ts {
directoryPathMap.set(parent, result);
current = parent;
if (current == commonPrefix) {
if (current === commonPrefix) {
break;
}
}
@ -954,10 +954,25 @@ namespace ts {
}
nodeModulesAtTypesExists = false;
}
return loadModuleFromNodeModulesFolder(Extensions.DtsOnly, moduleName, nodeModulesAtTypes, nodeModulesAtTypesExists, failedLookupLocations, state);
return loadModuleFromNodeModulesFolder(Extensions.DtsOnly, mangleScopedPackage(moduleName, state), nodeModulesAtTypes, nodeModulesAtTypesExists, failedLookupLocations, state);
}
}
/** For a scoped package, we must look in `@types/foo__bar` instead of `@types/@foo/bar`. */
function mangleScopedPackage(moduleName: string, state: ModuleResolutionState): string {
if (startsWith(moduleName, "@")) {
const replaceSlash = moduleName.replace(ts.directorySeparator, "__");
if (replaceSlash !== moduleName) {
const mangled = replaceSlash.slice(1); // Take off the "@"
if (state.traceEnabled) {
trace(state.host, Diagnostics.Scoped_package_detected_looking_in_0, mangled);
}
return mangled;
}
}
return moduleName;
}
function tryFindNonRelativeModuleNameInCache(cache: PerModuleNameCache | undefined, moduleName: string, containingDirectory: string, traceEnabled: boolean, host: ModuleResolutionHost): SearchResult<Resolved> {
const result = cache && cache.get(containingDirectory);
if (result) {

View File

@ -458,6 +458,7 @@ namespace ts {
return Parser.parseIsolatedEntityName(text, languageVersion);
}
// See also `isExternalOrCommonJsModule` in utilities.ts
export function isExternalModule(file: SourceFile): boolean {
return file.externalModuleIndicator !== undefined;
}

View File

@ -557,7 +557,7 @@ namespace ts {
// combine results of resolutions and predicted results
let j = 0;
for (let i = 0; i < result.length; i++) {
if (result[i] == predictedToResolveToAmbientModuleMarker) {
if (result[i] === predictedToResolveToAmbientModuleMarker) {
result[i] = undefined;
}
else {
@ -1364,7 +1364,7 @@ namespace ts {
// If the file was previously found via a node_modules search, but is now being processed as a root file,
// then everything it sucks in may also be marked incorrectly, and needs to be checked again.
if (file && sourceFilesFoundSearchingNodeModules.get(file.path) && currentNodeModulesDepth == 0) {
if (file && sourceFilesFoundSearchingNodeModules.get(file.path) && currentNodeModulesDepth === 0) {
sourceFilesFoundSearchingNodeModules.set(file.path, false);
if (!options.noResolve) {
processReferencedFiles(file, isDefaultLib);

View File

@ -515,8 +515,9 @@ namespace ts {
const ancestorFacts = enterSubtree(HierarchyFacts.SourceFileExcludes, HierarchyFacts.SourceFileIncludes);
const statements: Statement[] = [];
startLexicalEnvironment();
const statementOffset = addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ false, visitor);
let statementOffset = addStandardPrologue(statements, node.statements, /*ensureUseStrict*/ false);
addCaptureThisForNodeIfNeeded(statements, node);
statementOffset = addCustomPrologue(statements, node.statements, statementOffset, visitor);
addRange(statements, visitNodes(node.statements, visitor, isStatement, statementOffset));
addRange(statements, endLexicalEnvironment());
exitSubtree(ancestorFacts, HierarchyFacts.None, HierarchyFacts.None);
@ -924,13 +925,16 @@ namespace ts {
statementOffset = 0;
}
else if (constructor) {
// Otherwise, try to emit all potential prologue directives first.
statementOffset = addPrologueDirectives(statements, constructor.body.statements, /*ensureUseStrict*/ false, visitor);
statementOffset = addStandardPrologue(statements, constructor.body.statements, /*ensureUseStrict*/ false);
}
if (constructor) {
addDefaultValueAssignmentsIfNeeded(statements, constructor);
addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper);
if (!hasSynthesizedSuper) {
// If no super call has been synthesized, emit custom prologue directives.
statementOffset = addCustomPrologue(statements, constructor.body.statements, statementOffset, visitor);
}
Debug.assert(statementOffset >= 0, "statementOffset not initialized correctly!");
}
@ -1821,8 +1825,8 @@ namespace ts {
resumeLexicalEnvironment();
if (isBlock(body)) {
// ensureUseStrict is false because no new prologue-directive should be added.
// addPrologueDirectives will simply put already-existing directives at the beginning of the target statement-array
statementOffset = addPrologueDirectives(statements, body.statements, /*ensureUseStrict*/ false, visitor);
// addStandardPrologue will put already-existing directives at the beginning of the target statement-array
statementOffset = addStandardPrologue(statements, body.statements, /*ensureUseStrict*/ false);
}
addCaptureThisForNodeIfNeeded(statements, node);
@ -1835,6 +1839,9 @@ namespace ts {
}
if (isBlock(body)) {
// addCustomPrologue puts already-existing directives at the beginning of the target statement-array
statementOffset = addCustomPrologue(statements, body.statements, statementOffset, visitor);
statementsLocation = body.statements;
addRange(statements, visitNodes(body.statements, visitor, isStatement, statementOffset));
@ -2875,7 +2882,12 @@ namespace ts {
!state.labeledNonLocalContinues;
const call = createCall(loopFunctionExpressionName, /*typeArguments*/ undefined, map(parameters, p => <Identifier>p.name));
const callResult = isAsyncBlockContainingAwait ? createYield(createToken(SyntaxKind.AsteriskToken), call) : call;
const callResult = isAsyncBlockContainingAwait
? createYield(
createToken(SyntaxKind.AsteriskToken),
setEmitFlags(call, EmitFlags.Iterator)
)
: call;
if (isSimpleLoop) {
statements.push(createStatement(callResult));
copyOutParameters(state.loopOutParameters, CopyDirection.ToOriginal, statements);

View File

@ -222,7 +222,7 @@ namespace ts {
if (!isArrowFunction) {
const statements: Statement[] = [];
const statementOffset = addPrologueDirectives(statements, (<Block>node.body).statements, /*ensureUseStrict*/ false, visitor);
const statementOffset = addPrologue(statements, (<Block>node.body).statements, /*ensureUseStrict*/ false, visitor);
statements.push(
createReturn(
createAwaiterHelper(

View File

@ -618,7 +618,7 @@ namespace ts {
function transformAsyncGeneratorFunctionBody(node: MethodDeclaration | AccessorDeclaration | FunctionDeclaration | FunctionExpression): FunctionBody {
resumeLexicalEnvironment();
const statements: Statement[] = [];
const statementOffset = addPrologueDirectives(statements, node.body.statements, /*ensureUseStrict*/ false, visitor);
const statementOffset = addPrologue(statements, node.body.statements, /*ensureUseStrict*/ false, visitor);
appendObjectRestAssignmentsIfNeeded(statements, node);
statements.push(
@ -663,12 +663,19 @@ namespace ts {
function transformFunctionBody(node: ArrowFunction): ConciseBody;
function transformFunctionBody(node: FunctionLikeDeclaration): ConciseBody {
resumeLexicalEnvironment();
const leadingStatements = appendObjectRestAssignmentsIfNeeded(/*statements*/ undefined, node);
let statementOffset = 0;
const statements: Statement[] = [];
const body = visitNode(node.body, visitor, isConciseBody);
if (isBlock(body)) {
statementOffset = addPrologue(statements, body.statements, /*ensureUseStrict*/ false, visitor);
}
addRange(statements, appendObjectRestAssignmentsIfNeeded(/*statements*/ undefined, node));
const trailingStatements = endLexicalEnvironment();
if (some(leadingStatements) || some(trailingStatements)) {
if (statementOffset > 0 || some(statements) || some(trailingStatements)) {
const block = convertToFunctionBody(body, /*multiLine*/ true);
return updateBlock(block, setTextRange(createNodeArray(concatenate(concatenate(leadingStatements, block.statements), trailingStatements)), block.statements));
addRange(statements, block.statements.slice(statementOffset));
addRange(statements, trailingStatements);
return updateBlock(block, setTextRange(createNodeArray(statements), block.statements));
}
return body;
}

View File

@ -587,7 +587,7 @@ namespace ts {
// Build the generator
resumeLexicalEnvironment();
const statementOffset = addPrologueDirectives(statements, body.statements, /*ensureUseStrict*/ false, visitor);
const statementOffset = addPrologue(statements, body.statements, /*ensureUseStrict*/ false, visitor);
transformAndEmitStatements(body.statements, statementOffset);
@ -939,7 +939,10 @@ namespace ts {
const resumeLabel = defineLabel();
const expression = visitNode(node.expression, visitor, isExpression);
if (node.asteriskToken) {
emitYieldStar(createValuesHelper(context, expression, /*location*/ node), /*location*/ node);
const iterator = (getEmitFlags(node.expression) & EmitFlags.Iterator) === 0
? createValuesHelper(context, expression, /*location*/ node)
: expression;
emitYieldStar(iterator, /*location*/ node);
}
else {
emitYield(expression, /*location*/ node);

View File

@ -24,7 +24,7 @@ namespace ts {
const externalHelpersModuleName = getOrCreateExternalHelpersModuleNameIfNeeded(node, compilerOptions);
if (externalHelpersModuleName) {
const statements: Statement[] = [];
const statementOffset = addPrologueDirectives(statements, node.statements);
const statementOffset = addPrologue(statements, node.statements);
append(statements,
createImportDeclaration(
/*decorators*/ undefined,

View File

@ -90,7 +90,7 @@ namespace ts {
const statements: Statement[] = [];
const ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && isExternalModule(currentSourceFile));
const statementOffset = addPrologueDirectives(statements, node.statements, ensureUseStrict, sourceElementVisitor);
const statementOffset = addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor);
if (shouldEmitUnderscoreUnderscoreESModule()) {
append(statements, createUnderscoreUnderscoreESModule());
@ -388,7 +388,7 @@ namespace ts {
startLexicalEnvironment();
const statements: Statement[] = [];
const statementOffset = addPrologueDirectives(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor);
const statementOffset = addPrologue(statements, node.statements, /*ensureUseStrict*/ !compilerOptions.noImplicitUseStrict, sourceElementVisitor);
if (shouldEmitUnderscoreUnderscoreESModule()) {
append(statements, createUnderscoreUnderscoreESModule());

View File

@ -228,7 +228,7 @@ namespace ts {
// Add any prologue directives.
const ensureUseStrict = compilerOptions.alwaysStrict || (!compilerOptions.noImplicitUseStrict && isExternalModule(currentSourceFile));
const statementOffset = addPrologueDirectives(statements, node.statements, ensureUseStrict, sourceElementVisitor);
const statementOffset = addPrologue(statements, node.statements, ensureUseStrict, sourceElementVisitor);
// var __moduleName = context_1 && context_1.id;
statements.push(

View File

@ -954,7 +954,7 @@ namespace ts {
if (ctor.body) {
const statements = ctor.body.statements;
// add prologue directives to the list (if any)
const index = addPrologueDirectives(result, statements, /*ensureUseStrict*/ false, visitor);
const index = addPrologue(result, statements, /*ensureUseStrict*/ false, visitor);
if (index === statements.length) {
// list contains nothing but prologue directives (or empty) - exit
return index;
@ -1707,6 +1707,9 @@ namespace ts {
case SyntaxKind.StringKeyword:
return createIdentifier("String");
case SyntaxKind.ObjectKeyword:
return createIdentifier("Object");
case SyntaxKind.LiteralType:
switch ((<LiteralTypeNode>node).literal.kind) {
case SyntaxKind.StringLiteral:

View File

@ -30,7 +30,7 @@ namespace ts {
}
function reportEmittedFiles(files: string[]): void {
if (!files || files.length == 0) {
if (!files || files.length === 0) {
return;
}
@ -282,7 +282,7 @@ namespace ts {
// When the configFileName is just "tsconfig.json", the watched directory should be
// the current directory; if there is a given "project" parameter, then the configFileName
// is an absolute file name.
directory == "" ? "." : directory,
directory === "" ? "." : directory,
watchedDirectoryChanged, /*recursive*/ true);
}
}
@ -334,7 +334,7 @@ namespace ts {
// When the configFileName is just "tsconfig.json", the watched directory should be
// the current directory; if there is a given "project" parameter, then the configFileName
// is an absolute file name.
directory == "" ? "." : directory,
directory === "" ? "." : directory,
watchedDirectoryChanged, /*recursive*/ true);
}
}

View File

@ -1886,6 +1886,7 @@ namespace ts {
kind: SyntaxKind.ImportDeclaration;
parent?: SourceFile | ModuleBlock;
importClause?: ImportClause;
/** If this is not a StringLiteral it will be a grammar error. */
moduleSpecifier: Expression;
}
@ -1919,6 +1920,7 @@ namespace ts {
kind: SyntaxKind.ExportDeclaration;
parent?: SourceFile | ModuleBlock;
exportClause?: NamedExports;
/** If this is not a StringLiteral it will be a grammar error. */
moduleSpecifier?: Expression;
}
@ -2305,8 +2307,8 @@ namespace ts {
// Content of this field should never be used directly - use getResolvedModuleFileName/setResolvedModuleFileName functions instead
/* @internal */ resolvedModules: Map<ResolvedModuleFull>;
/* @internal */ resolvedTypeReferenceDirectiveNames: Map<ResolvedTypeReferenceDirective>;
/* @internal */ imports: LiteralExpression[];
/* @internal */ moduleAugmentations: LiteralExpression[];
/* @internal */ imports: StringLiteral[];
/* @internal */ moduleAugmentations: StringLiteral[];
/* @internal */ patternAmbientModules?: PatternAmbientModule[];
/* @internal */ ambientModuleNames: string[];
/* @internal */ checkJsDirective: CheckJsDirective | undefined;
@ -2522,10 +2524,14 @@ namespace ts {
isUndefinedSymbol(symbol: Symbol): boolean;
isArgumentsSymbol(symbol: Symbol): boolean;
isUnknownSymbol(symbol: Symbol): boolean;
/* @internal */ getMergedSymbol(symbol: Symbol): Symbol;
getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): number;
isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean;
/** Follow all aliases to get the original symbol. */
getAliasedSymbol(symbol: Symbol): Symbol;
/** Follow a *single* alias to get the immediately aliased symbol. */
/* @internal */ getImmediateAliasedSymbol(symbol: Symbol): Symbol;
getExportsOfModule(moduleSymbol: Symbol): Symbol[];
/** Unlike `getExportsOfModule`, this includes properties of an `export =` value. */
/* @internal */ getExportsAndPropertiesOfModule(moduleSymbol: Symbol): Symbol[];
@ -2841,6 +2847,7 @@ namespace ts {
/* @internal */
export interface SymbolLinks {
immediateTarget?: Symbol; // Immediate target of an alias. May be another alias. Do not access directly, use `checker.getImmediateAliasedSymbol` instead.
target?: Symbol; // Resolved (non-alias) target of an alias
type?: Type; // Type of value symbol
declaredType?: Type; // Type of class, interface, enum, type alias, or type parameter
@ -2852,7 +2859,7 @@ namespace ts {
containingType?: UnionOrIntersectionType; // Containing union or intersection type for synthetic property
leftSpread?: Symbol; // Left source for synthetic spread property
rightSpread?: Symbol; // Right source for synthetic spread property
mappedTypeOrigin?: Symbol; // For a property on a mapped type, points back to the orignal 'T' from 'keyof T'.
syntheticOrigin?: Symbol; // For a property on a mapped or spread type, points back to the original property
isDiscriminantProperty?: boolean; // True if discriminant synthetic property
resolvedExports?: SymbolTable; // Resolved exports of module
exportsChecked?: boolean; // True if exports of external module have been checked
@ -3937,6 +3944,7 @@ namespace ts {
CustomPrologue = 1 << 19, // Treat the statement as if it were a prologue directive (NOTE: Prologue directives are *not* transformed).
NoHoisting = 1 << 20, // Do not hoist this declaration in --module system
HasEndOfDeclarationMarker = 1 << 21, // Declaration has an associated NotEmittedStatement to mark the end of the declaration
Iterator = 1 << 22, // The expression to a `yield*` should be treated as an Iterator when down-leveling, not an Iterable.
}
export interface EmitHelper {

View File

@ -3137,7 +3137,7 @@ namespace ts {
return isExportDefaultSymbol(symbol) ? symbol.valueDeclaration.localSymbol : undefined;
}
export function isExportDefaultSymbol(symbol: Symbol): boolean {
function isExportDefaultSymbol(symbol: Symbol): boolean {
return symbol && symbol.valueDeclaration && hasModifier(symbol.valueDeclaration, ModifierFlags.Default);
}
@ -4205,12 +4205,13 @@ namespace ts {
export function getDefaultLibFileName(options: CompilerOptions): string {
switch (options.target) {
case ScriptTarget.ESNext:
return "lib.esnext.full.d.ts";
case ScriptTarget.ES2017:
return "lib.es2017.d.ts";
return "lib.es2017.full.d.ts";
case ScriptTarget.ES2016:
return "lib.es2016.d.ts";
return "lib.es2016.full.d.ts";
case ScriptTarget.ES2015:
return "lib.es6.d.ts";
return "lib.es6.d.ts"; // We don't use lib.es2015.full.d.ts due to breaking change.
default:
return "lib.d.ts";
}
@ -4430,7 +4431,7 @@ namespace ts {
newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
}
return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength:*/ newEndN - oldStartN);
return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), /*newLength*/ newEndN - oldStartN);
}
export function getTypeParameterOwner(d: Declaration): Declaration {
@ -4606,7 +4607,7 @@ namespace ts {
*/
export function getParseTreeNode<T extends Node>(node: Node, nodeTest?: (node: Node) => node is T): T;
export function getParseTreeNode(node: Node, nodeTest?: (node: Node) => boolean): Node {
if (node == undefined || isParseTreeNode(node)) {
if (node === undefined || isParseTreeNode(node)) {
return node;
}

View File

@ -549,10 +549,21 @@ namespace FourSlash {
Harness.IO.log("Unexpected error(s) found. Error list is:");
}
errors.forEach(function (error: ts.Diagnostic) {
Harness.IO.log(" minChar: " + error.start +
", limChar: " + (error.start + error.length) +
", message: " + ts.flattenDiagnosticMessageText(error.messageText, Harness.IO.newLine()) + "\n");
for (const { start, length, messageText } of errors) {
Harness.IO.log(" minChar: " + start +
", limChar: " + (start + length) +
", message: " + ts.flattenDiagnosticMessageText(messageText, Harness.IO.newLine()) + "\n");
}
}
public verifyNoErrors() {
ts.forEachKey(this.inputFiles, fileName => {
const errors = this.getDiagnostics(fileName);
if (errors.length) {
this.printErrorLog(/*expectErrors*/ false, errors);
const error = errors[0];
this.raiseError(`Found an error: ${error.file.fileName}@${error.start}: ${error.messageText}`);
}
});
}
@ -882,7 +893,68 @@ namespace FourSlash {
}
}
public verifyReferencesAre(expectedReferences: Range[]) {
/** Use `getProgram` instead of accessing this directly. */
private _program: ts.Program;
/** Use `getChecker` instead of accessing this directly. */
private _checker: ts.TypeChecker;
private getProgram(): ts.Program {
return this._program || (this._program = this.languageService.getProgram());
}
private getChecker() {
return this._checker || (this._checker = this.getProgram().getTypeChecker());
}
private getSourceFile(): ts.SourceFile {
const { fileName } = this.activeFile;
const result = this.getProgram().getSourceFile(fileName);
if (!result) {
throw new Error(`Could not get source file ${fileName}`);
}
return result;
}
private getNode(): ts.Node {
return ts.getTouchingPropertyName(this.getSourceFile(), this.currentCaretPosition);
}
private goToAndGetNode(range: Range): ts.Node {
this.goToRangeStart(range);
const node = this.getNode();
this.verifyRange("touching property name", range, node);
return node;
}
private verifyRange(desc: string, expected: Range, actual: ts.Node) {
const actualStart = actual.getStart();
const actualEnd = actual.getEnd();
if (actualStart !== expected.start || actualEnd !== expected.end) {
this.raiseError(`${desc} should be ${expected.start}-${expected.end}, got ${actualStart}-${actualEnd}`);
}
}
private verifySymbol(symbol: ts.Symbol, declarationRanges: Range[]) {
const { declarations } = symbol;
if (declarations.length !== declarationRanges.length) {
this.raiseError(`Expected to get ${declarationRanges.length} declarations, got ${declarations.length}`);
}
ts.zipWith(declarations, declarationRanges, (decl, range) => {
this.verifyRange("symbol declaration", range, decl);
});
}
public verifySymbolAtLocation(startRange: Range, declarationRanges: Range[]): void {
const node = this.goToAndGetNode(startRange);
const symbol = this.getChecker().getSymbolAtLocation(node);
if (!symbol) {
this.raiseError("Could not get symbol at location");
}
this.verifySymbol(symbol, declarationRanges);
}
private verifyReferencesAre(expectedReferences: Range[]) {
const actualReferences = this.getReferencesAtCaret() || [];
if (actualReferences.length > expectedReferences.length) {
@ -928,7 +1000,7 @@ namespace FourSlash {
for (const startRange of toArray(startRanges)) {
this.goToRangeStart(startRange);
const fullActual = this.findReferencesAtCaret().map<ReferenceJson>(({ definition, references }) => ({
const fullActual = ts.map<ts.ReferencedSymbol, ReferenceJson>(this.findReferencesAtCaret(), ({ definition, references }) => ({
definition: definition.displayParts.map(d => d.text).join(""),
ranges: references
}));
@ -1108,9 +1180,32 @@ namespace FourSlash {
});
}
public verifyRenameLocations(findInStrings: boolean, findInComments: boolean, ranges?: Range[]) {
const renameInfo = this.languageService.getRenameInfo(this.activeFile.fileName, this.currentCaretPosition);
if (renameInfo.canRename) {
public verifyRangesAreRenameLocations(options?: Range[] | { findInStrings?: boolean, findInComments?: boolean, ranges?: Range[] }) {
const ranges = ts.isArray(options) ? options : options && options.ranges || this.getRanges();
this.verifyRenameLocations(ranges, { ranges, ...options });
}
public verifyRenameLocations(startRanges: Range | Range[], options: Range[] | { findInStrings?: boolean, findInComments?: boolean, ranges: Range[] }) {
let findInStrings: boolean, findInComments: boolean, ranges: Range[];
if (ts.isArray(options)) {
findInStrings = findInComments = false;
ranges = options;
}
else {
findInStrings = !!options.findInStrings;
findInComments = !!options.findInComments;
ranges = options.ranges;
}
for (const startRange of toArray(startRanges)) {
this.goToRangeStart(startRange);
const renameInfo = this.languageService.getRenameInfo(this.activeFile.fileName, this.currentCaretPosition);
if (!renameInfo.canRename) {
this.raiseError("Expected rename to succeed, but it actually failed.");
break;
}
let references = this.languageService.findRenameLocations(
this.activeFile.fileName, this.currentCaretPosition, findInStrings, findInComments);
@ -1132,13 +1227,10 @@ namespace FourSlash {
ts.zipWith(references, ranges, (reference, range) => {
if (reference.textSpan.start !== range.start || ts.textSpanEnd(reference.textSpan) !== range.end) {
this.raiseError("Rename location results do not match.\n\nExpected: " + stringify(ranges) + "\n\nActual:" + JSON.stringify(references));
this.raiseError("Rename location results do not match.\n\nExpected: " + stringify(ranges) + "\n\nActual:" + stringify(references));
}
});
}
else {
this.raiseError("Expected rename to succeed, but it actually failed.");
}
}
public verifyQuickInfoExists(negative: boolean) {
@ -2275,13 +2367,13 @@ namespace FourSlash {
public verifyImportFixAtPosition(expectedTextArray: string[], errorCode?: number) {
const ranges = this.getRanges();
if (ranges.length == 0) {
if (ranges.length === 0) {
this.raiseError("At least one range should be specified in the testfile.");
}
const codeFixes = this.getCodeFixActions(this.activeFile.fileName, errorCode);
if (!codeFixes || codeFixes.length == 0) {
if (!codeFixes || codeFixes.length === 0) {
this.raiseError("No codefixes returned.");
}
@ -2551,8 +2643,8 @@ namespace FourSlash {
}
}
public verifyRangesAreRenameLocations(findInStrings: boolean, findInComments: boolean) {
this.goToEachRange(() => this.verifyRenameLocations(findInStrings, findInComments));
public verifyRangesWithSameTextAreRenameLocations() {
this.rangesByText().forEach(ranges => this.verifyRangesAreRenameLocations(ranges));
}
public verifyRangesWithSameTextAreDocumentHighlights() {
@ -2591,7 +2683,7 @@ namespace FourSlash {
ts.zipWith(expectedRangesInFile, spansInFile, (expectedRange, span) => {
if (span.textSpan.start !== expectedRange.start || ts.textSpanEnd(span.textSpan) !== expectedRange.end) {
this.raiseError(`verifyDocumentHighlights failed - span does not match, actual: ${JSON.stringify(span.textSpan)}, expected: ${expectedRange.start}--${expectedRange.end}`);
this.raiseError(`verifyDocumentHighlights failed - span does not match, actual: ${stringify(span.textSpan)}, expected: ${expectedRange.start}--${expectedRange.end}`);
}
});
}
@ -2646,7 +2738,7 @@ namespace FourSlash {
private assertItemInCompletionList(items: ts.CompletionEntry[], name: string, text?: string, documentation?: string, kind?: string, spanIndex?: number) {
for (const item of items) {
if (item.name === name) {
if (documentation != undefined || text !== undefined) {
if (documentation !== undefined || text !== undefined) {
const details = this.getCompletionEntryDetails(item.name);
if (documentation !== undefined) {
@ -2897,9 +2989,8 @@ ${code}
}
}
}
// TODO: should be '==='?
}
else if (line == "" || lineLength === 0) {
else if (line === "" || lineLength === 0) {
// Previously blank lines between fourslash content caused it to be considered as 2 files,
// Remove this behavior since it just causes errors now
}
@ -3495,8 +3586,8 @@ namespace FourSlashInterface {
this.state.verifyGetEmitOutputContentsForCurrentFile(expected);
}
public referencesAre(ranges: FourSlash.Range[]) {
this.state.verifyReferencesAre(ranges);
public symbolAtLocation(startRange: FourSlash.Range, ...declarationRanges: FourSlash.Range[]) {
this.state.verifySymbolAtLocation(startRange, declarationRanges);
}
public referencesOf(start: FourSlash.Range, references: FourSlash.Range[]) {
@ -3563,6 +3654,10 @@ namespace FourSlashInterface {
this.state.verifyCurrentSignatureHelpIs(expected);
}
public noErrors() {
this.state.verifyNoErrors();
}
public numberOfErrorsInCurrentFile(expected: number) {
this.state.verifyNumberOfErrorsInCurrentFile(expected);
}
@ -3659,8 +3754,12 @@ namespace FourSlashInterface {
this.state.verifyRangesAreOccurrences(isWriteAccess);
}
public rangesAreRenameLocations(findInStrings = false, findInComments = false) {
this.state.verifyRangesAreRenameLocations(findInStrings, findInComments);
public rangesWithSameTextAreRenameLocations() {
this.state.verifyRangesWithSameTextAreRenameLocations();
}
public rangesAreRenameLocations(options?: FourSlash.Range[] | { findInStrings?: boolean, findInComments?: boolean, ranges?: FourSlash.Range[] }) {
this.state.verifyRangesAreRenameLocations(options);
}
public rangesAreDocumentHighlights(ranges?: FourSlash.Range[]) {
@ -3697,8 +3796,8 @@ namespace FourSlashInterface {
this.state.verifyRenameInfoFailed(message);
}
public renameLocations(findInStrings: boolean, findInComments: boolean, ranges?: FourSlash.Range[]) {
this.state.verifyRenameLocations(findInStrings, findInComments, ranges);
public renameLocations(startRanges: FourSlash.Range | FourSlash.Range[], options: FourSlash.Range[] | { findInStrings?: boolean, findInComments?: boolean, ranges: FourSlash.Range[] }) {
this.state.verifyRenameLocations(startRanges, options);
}
public verifyQuickInfoDisplayParts(kind: string, kindModifiers: string, textSpan: { start: number; length: number; },

View File

@ -1933,7 +1933,7 @@ namespace Harness {
}
const parentDirectory = IO.directoryName(dirName);
if (parentDirectory != "") {
if (parentDirectory !== "") {
createDirectoryStructure(parentDirectory);
}
IO.createDirectory(dirName);

View File

@ -818,13 +818,17 @@ namespace Harness.LanguageService {
// This host is just a proxy for the clientHost, it uses the client
// host to answer server queries about files on disk
const serverHost = new SessionServerHost(clientHost);
const server = new ts.server.Session(serverHost,
ts.server.nullCancellationToken,
/*useOneInferredProject*/ false,
/*typingsInstaller*/ undefined,
Utils.byteLength,
process.hrtime, serverHost,
/*canUseEvents*/ true);
const opts: ts.server.SessionOptions = {
host: serverHost,
cancellationToken: ts.server.nullCancellationToken,
useSingleInferredProject: false,
typingsInstaller: undefined,
byteLength: Utils.byteLength,
hrtime: process.hrtime,
logger: serverHost,
canUseEvents: true
};
const server = new ts.server.Session(opts);
// Fake the connection between the client and the server
serverHost.writeMessage = client.onMessage.bind(client);

View File

@ -111,8 +111,7 @@ class ProjectRunner extends RunnerBase {
else if (url.indexOf(diskProjectPath) === 0) {
// Replace the disk specific path into the project root path
url = url.substr(diskProjectPath.length);
// TODO: should be '!=='?
if (url.charCodeAt(0) != ts.CharacterCodes.slash) {
if (url.charCodeAt(0) !== ts.CharacterCodes.slash) {
url = "/" + url;
}
}

View File

@ -50,11 +50,11 @@ namespace Harness.SourceMapRecorder {
return true;
}
if (sourceMapMappings.charAt(decodingIndex) == ",") {
if (sourceMapMappings.charAt(decodingIndex) === ",") {
return true;
}
if (sourceMapMappings.charAt(decodingIndex) == ";") {
if (sourceMapMappings.charAt(decodingIndex) === ";") {
return true;
}
@ -117,7 +117,7 @@ namespace Harness.SourceMapRecorder {
}
while (decodingIndex < sourceMapMappings.length) {
if (sourceMapMappings.charAt(decodingIndex) == ";") {
if (sourceMapMappings.charAt(decodingIndex) === ";") {
// New line
decodeOfEncodedMapping.emittedLine++;
decodeOfEncodedMapping.emittedColumn = 1;
@ -125,7 +125,7 @@ namespace Harness.SourceMapRecorder {
continue;
}
if (sourceMapMappings.charAt(decodingIndex) == ",") {
if (sourceMapMappings.charAt(decodingIndex) === ",") {
// Next entry is on same line - no action needed
decodingIndex++;
continue;

View File

@ -64,8 +64,16 @@ namespace ts {
getLogFileName: (): string => undefined
};
const projectService = new server.ProjectService(serverHost, logger, { isCancellationRequested: () => false }, /*useOneInferredProject*/ false, /*typingsInstaller*/ undefined);
const rootScriptInfo = projectService.getOrCreateScriptInfo(rootFile, /*openedByClient*/ true, /*containingProject*/ undefined);
const svcOpts: server.ProjectServiceOptions = {
host: serverHost,
logger,
cancellationToken: { isCancellationRequested: () => false },
useSingleInferredProject: false,
typingsInstaller: undefined
};
const projectService = new server.ProjectService(svcOpts);
const rootScriptInfo = projectService.getOrCreateScriptInfo(rootFile, /* openedByClient */ true, /*containingProject*/ undefined);
const project = projectService.createInferredProjectWithRootFileIfNecessary(rootScriptInfo);
project.setCompilerOptions({ module: ts.ModuleKind.AMD } );
return {

View File

@ -31,6 +31,20 @@ namespace ts.projectSystem {
}
}
function createSession(host: server.ServerHost, typingsInstaller?: server.ITypingsInstaller): server.Session {
const opts: server.SessionOptions = {
host,
cancellationToken: nullCancellationToken,
useSingleInferredProject: false,
typingsInstaller: typingsInstaller || server.nullTypingsInstaller,
byteLength: Utils.byteLength,
hrtime: process.hrtime,
logger: nullLogger,
canUseEvents: false
};
return new server.Session(opts);
}
describe("for configured projects", () => {
let moduleFile1: FileOrFolder;
let file1Consumer1: FileOrFolder;
@ -113,7 +127,7 @@ namespace ts.projectSystem {
it("should contains only itself if a module file's shape didn't change, and all files referencing it if its shape changed", () => {
const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([moduleFile1, file1Consumer1], session);
@ -138,7 +152,7 @@ namespace ts.projectSystem {
it("should be up-to-date with the reference map changes", () => {
const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([moduleFile1, file1Consumer1], session);
@ -185,7 +199,7 @@ namespace ts.projectSystem {
it("should be up-to-date with changes made in non-open files", () => {
const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([moduleFile1], session);
@ -203,7 +217,7 @@ namespace ts.projectSystem {
it("should be up-to-date with deleted files", () => {
const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([moduleFile1], session);
sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]);
@ -218,7 +232,7 @@ namespace ts.projectSystem {
it("should be up-to-date with newly created files", () => {
const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([moduleFile1], session);
sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer2] }]);
@ -255,7 +269,7 @@ namespace ts.projectSystem {
const host = createServerHost([moduleFile1, file1Consumer1, configFile, libFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([moduleFile1, file1Consumer1], session);
sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1] }]);
@ -272,7 +286,7 @@ namespace ts.projectSystem {
it("should return all files if a global file changed shape", () => {
const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, globalFile3, moduleFile2, configFile, libFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([globalFile3], session);
const changeGlobalFile3ShapeRequest = makeSessionRequest<server.protocol.ChangeRequestArgs>(CommandNames.Change, {
@ -298,7 +312,7 @@ namespace ts.projectSystem {
const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer2, configFile, libFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([moduleFile1], session);
sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, []);
});
@ -316,7 +330,7 @@ namespace ts.projectSystem {
const host = createServerHost([moduleFile1, file1Consumer1, configFile, libFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([moduleFile1], session);
const file1ChangeShapeRequest = makeSessionRequest<server.protocol.ChangeRequestArgs>(CommandNames.Change, {
@ -345,7 +359,7 @@ namespace ts.projectSystem {
const host = createServerHost([moduleFile1, file1Consumer1, configFile, libFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([moduleFile1], session);
const file1ChangeShapeRequest = makeSessionRequest<server.protocol.ChangeRequestArgs>(CommandNames.Change, {
@ -367,7 +381,7 @@ namespace ts.projectSystem {
};
const host = createServerHost([moduleFile1, file1Consumer1, file1Consumer1Consumer1, globalFile3, configFile, libFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([moduleFile1, file1Consumer1], session);
sendAffectedFileRequestAndCheckResult(session, moduleFile1FileListRequest, [{ projectFileName: configFile.path, files: [moduleFile1, file1Consumer1, file1Consumer1Consumer1] }]);
@ -400,7 +414,7 @@ namespace ts.projectSystem {
};
const host = createServerHost([file1, file2, configFile]);
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([file1, file2], session);
const file1AffectedListRequest = makeSessionRequest<server.protocol.FileRequestArgs>(CommandNames.CompileOnSaveAffectedFileList, { file: file1.path });
@ -513,7 +527,7 @@ namespace ts.projectSystem {
};
const host = createServerHost([file1, file2, configFile, libFile], { newLine: "\r\n" });
const typingsInstaller = createTestTypingsInstaller(host);
const session = new server.Session(host, nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ false);
const session = createSession(host, typingsInstaller);
openFilesForSession([file1, file2], session);
const compileFileRequest = makeSessionRequest<server.protocol.CompileOnSaveEmitFileRequestArgs>(CommandNames.CompileOnSaveEmitFile, { file: file1.path, projectFileName: configFile.path });

View File

@ -2,84 +2,84 @@
/// <reference path="..\virtualFileSystem.ts" />
namespace ts {
const testContents = createMapFromTemplate({
"/dev/tsconfig.json": `{
"extends": "./configs/base",
"files": [
"main.ts",
"supplemental.ts"
]
}`,
"/dev/tsconfig.nostrictnull.json": `{
"extends": "./tsconfig",
"compilerOptions": {
"strictNullChecks": false
}
}`,
"/dev/configs/base.json": `{
"compilerOptions": {
"allowJs": true,
"noImplicitAny": true,
"strictNullChecks": true
}
}`,
"/dev/configs/tests.json": `{
"compilerOptions": {
"preserveConstEnums": true,
"removeComments": false,
"sourceMap": true
},
"exclude": [
"../tests/baselines",
"../tests/scenarios"
],
"include": [
"../tests/**/*.ts"
]
}`,
"/dev/circular.json": `{
"extends": "./circular2",
"compilerOptions": {
"module": "amd"
}
}`,
"/dev/circular2.json": `{
"extends": "./circular",
"compilerOptions": {
"module": "commonjs"
}
}`,
"/dev/missing.json": `{
"extends": "./missing2",
"compilerOptions": {
"types": []
}
}`,
"/dev/failure.json": `{
"extends": "./failure2.json",
"compilerOptions": {
"typeRoots": []
}
}`,
"/dev/failure2.json": `{
"excludes": ["*.js"]
}`,
"/dev/configs/first.json": `{
"extends": "./base",
"compilerOptions": {
"module": "commonjs"
},
"files": ["../main.ts"]
}`,
"/dev/configs/second.json": `{
"extends": "./base",
"compilerOptions": {
"module": "amd"
},
"include": ["../supplemental.*"]
}`,
"/dev/extends.json": `{ "extends": 42 }`,
"/dev/extends2.json": `{ "extends": "configs/base" }`,
const testContentsJson = createMapFromTemplate({
"/dev/tsconfig.json": {
extends: "./configs/base",
files: [
"main.ts",
"supplemental.ts"
]
},
"/dev/tsconfig.nostrictnull.json": {
extends: "./tsconfig",
compilerOptions: {
strictNullChecks: false
}
},
"/dev/configs/base.json": {
compilerOptions: {
allowJs: true,
noImplicitAny: true,
strictNullChecks: true
}
},
"/dev/configs/tests.json": {
compilerOptions: {
"preserveConstEnums": true,
"removeComments": false,
"sourceMap": true
},
exclude: [
"../tests/baselines",
"../tests/scenarios"
],
include: [
"../tests/**/*.ts"
]
},
"/dev/circular.json": {
extends: "./circular2",
compilerOptions: {
module: "amd"
}
},
"/dev/circular2.json": {
extends: "./circular",
compilerOptions: {
module: "commonjs"
}
},
"/dev/missing.json": {
extends: "./missing2",
compilerOptions: {
"types": []
}
},
"/dev/failure.json": {
extends: "./failure2.json",
compilerOptions: {
typeRoots: []
}
},
"/dev/failure2.json": {
excludes: ["*.js"]
},
"/dev/configs/first.json": {
extends: "./base",
compilerOptions: {
module: "commonjs"
},
files: ["../main.ts"]
},
"/dev/configs/second.json": {
extends: "./base",
compilerOptions: {
module: "amd"
},
include: ["../supplemental.*"]
},
"/dev/extends.json": { extends: 42 },
"/dev/extends2.json": { extends: "configs/base" },
"/dev/main.ts": "",
"/dev/supplemental.ts": "",
"/dev/tests/unit/spec.ts": "",
@ -87,6 +87,7 @@ namespace ts {
"/dev/tests/scenarios/first.json": "",
"/dev/tests/baselines/first/output.ts": ""
});
const testContents = mapEntries(testContentsJson, (k, v) => [k, typeof v === "string" ? v : JSON.stringify(v)]);
const caseInsensitiveBasePath = "c:/dev/";
const caseInsensitiveHost = new Utils.MockParseConfigHost(caseInsensitiveBasePath, /*useCaseSensitiveFileNames*/ false, mapEntries(testContents, (key, content) => [`c:${key}`, content]));

View File

@ -50,8 +50,22 @@ namespace ts.server {
let session: TestSession;
let lastSent: protocol.Message;
function createSession(): TestSession {
const opts: server.SessionOptions = {
host: mockHost,
cancellationToken: nullCancellationToken,
useSingleInferredProject: false,
typingsInstaller: undefined,
byteLength: Utils.byteLength,
hrtime: process.hrtime,
logger: mockLogger,
canUseEvents: true
};
return new TestSession(opts);
}
beforeEach(() => {
session = new TestSession(mockHost, nullCancellationToken, /*useOneInferredProject*/ false, /*typingsInstaller*/ undefined, Utils.byteLength, process.hrtime, mockLogger, /*canUseEvents*/ true);
session = createSession();
session.send = (msg: protocol.Message) => {
lastSent = msg;
};
@ -318,7 +332,16 @@ namespace ts.server {
lastSent: protocol.Message;
customHandler = "testhandler";
constructor() {
super(mockHost, nullCancellationToken, /*useOneInferredProject*/ false, /*typingsInstaller*/ undefined, Utils.byteLength, process.hrtime, mockLogger, /*canUseEvents*/ true);
super({
host: mockHost,
cancellationToken: nullCancellationToken,
useSingleInferredProject: false,
typingsInstaller: undefined,
byteLength: Utils.byteLength,
hrtime: process.hrtime,
logger: mockLogger,
canUseEvents: true
});
this.addProtocolHandler(this.customHandler, () => {
return { response: undefined, responseRequired: true };
});
@ -376,7 +399,16 @@ namespace ts.server {
class InProcSession extends Session {
private queue: protocol.Request[] = [];
constructor(private client: InProcClient) {
super(mockHost, nullCancellationToken, /*useOneInferredProject*/ false, /*typingsInstaller*/ undefined, Utils.byteLength, process.hrtime, mockLogger, /*canUseEvents*/ true);
super({
host: mockHost,
cancellationToken: nullCancellationToken,
useSingleInferredProject: false,
typingsInstaller: undefined,
byteLength: Utils.byteLength,
hrtime: process.hrtime,
logger: mockLogger,
canUseEvents: true
});
this.addProtocolHandler("echo", (req: protocol.Request) => ({
response: req.arguments,
responseRequired: true

View File

@ -190,7 +190,19 @@ namespace ts.projectSystem {
if (typingsInstaller === undefined) {
typingsInstaller = new TestTypingsInstaller("/a/data/", /*throttleLimit*/5, host);
}
return new TestSession(host, cancellationToken || server.nullCancellationToken, /*useSingleInferredProject*/ false, typingsInstaller, Utils.byteLength, process.hrtime, nullLogger, /*canUseEvents*/ projectServiceEventHandler !== undefined, projectServiceEventHandler, throttleWaitMilliseconds);
const opts: server.SessionOptions = {
host,
cancellationToken: cancellationToken || server.nullCancellationToken,
useSingleInferredProject: false,
typingsInstaller,
byteLength: Utils.byteLength,
hrtime: process.hrtime,
logger: nullLogger,
canUseEvents: projectServiceEventHandler !== undefined,
eventHandler: projectServiceEventHandler,
throttleWaitMilliseconds
};
return new TestSession(opts);
}
export interface CreateProjectServiceParameters {
@ -205,7 +217,9 @@ namespace ts.projectSystem {
export class TestProjectService extends server.ProjectService {
constructor(host: server.ServerHost, logger: server.Logger, cancellationToken: HostCancellationToken, useSingleInferredProject: boolean,
typingsInstaller: server.ITypingsInstaller, eventHandler: server.ProjectServiceEventHandler) {
super(host, logger, cancellationToken, useSingleInferredProject, typingsInstaller, eventHandler);
super({
host, logger, cancellationToken, useSingleInferredProject, typingsInstaller, eventHandler
});
}
checkNumberOfProjects(count: { inferredProjects?: number, configuredProjects?: number, externalProjects?: number }) {
@ -3214,7 +3228,7 @@ namespace ts.projectSystem {
checkNumberOfInferredProjects(projectService, 1);
const configuredProject = projectService.configuredProjects[0];
assert.isTrue(configuredProject.getFileNames().length == 0);
assert.isTrue(configuredProject.getFileNames().length === 0);
const inferredProject = projectService.inferredProjects[0];
assert.isTrue(inferredProject.containsFile(<server.NormalizedPath>file1.path));

View File

@ -278,7 +278,7 @@ and grew 1cm per day`;
const insertString = testContent.substring(rsa[i], rsa[i] + las[i]);
svc.edit(ersa[i], elas[i], insertString);
checkText = editFlat(ersa[i], elas[i], insertString, checkText);
if (0 == (i % 4)) {
if (0 === (i % 4)) {
const snap = svc.getSnapshot();
const snapText = snap.getText(0, checkText.length);
assert.equal(checkText, snapText);

View File

@ -78,8 +78,8 @@ interface ConstrainLongRange extends LongRange {
}
interface ConstrainVideoFacingModeParameters {
exact?: string | string[];
ideal?: string | string[];
exact?: VideoFacingModeEnum | VideoFacingModeEnum[];
ideal?: VideoFacingModeEnum | VideoFacingModeEnum[];
}
interface CustomEventInit extends EventInit {
@ -308,7 +308,7 @@ interface MSAudioSendSignal {
}
interface MSConnectivity {
iceType?: string;
iceType?: MSIceType;
iceWarningFlags?: MSIceWarningFlags;
relayAddress?: MSRelayAddress;
}
@ -318,11 +318,11 @@ interface MSCredentialFilter {
}
interface MSCredentialParameters {
type?: string;
type?: MSCredentialType;
}
interface MSCredentialSpec {
type?: string;
type?: MSCredentialType;
id?: string;
}
@ -333,7 +333,7 @@ interface MSDelay {
interface MSDescription extends RTCStats {
connectivity?: MSConnectivity;
transport?: string;
transport?: RTCIceProtocol;
networkconnectivity?: MSNetworkConnectivityInfo;
localAddr?: MSIPAddressInfo;
remoteAddr?: MSIPAddressInfo;
@ -457,11 +457,11 @@ interface MSTransportDiagnosticsStats extends RTCStats {
numConsentRespReceived?: number;
interfaces?: MSNetworkInterfaceType;
baseInterface?: MSNetworkInterfaceType;
protocol?: string;
protocol?: RTCIceProtocol;
localInterface?: MSNetworkInterfaceType;
localAddrType?: string;
remoteAddrType?: string;
iceRole?: string;
localAddrType?: MSIceAddrType;
remoteAddrType?: MSIceAddrType;
iceRole?: RTCIceRole;
rtpRtcpMux?: boolean;
allocationTimeInMs?: number;
msRtcEngineVersion?: string;
@ -534,7 +534,7 @@ interface MediaEncryptedEventInit extends EventInit {
}
interface MediaKeyMessageEventInit extends EventInit {
messageType?: string;
messageType?: MediaKeyMessageType;
message?: ArrayBuffer;
}
@ -542,8 +542,8 @@ interface MediaKeySystemConfiguration {
initDataTypes?: string[];
audioCapabilities?: MediaKeySystemMediaCapability[];
videoCapabilities?: MediaKeySystemMediaCapability[];
distinctiveIdentifier?: string;
persistentState?: string;
distinctiveIdentifier?: MediaKeysRequirement;
persistentState?: MediaKeysRequirement;
}
interface MediaKeySystemMediaCapability {
@ -667,7 +667,7 @@ interface MutationObserverInit {
}
interface NotificationOptions {
dir?: string;
dir?: NotificationDirection;
lang?: string;
body?: string;
tag?: string;
@ -766,8 +766,8 @@ interface PushSubscriptionOptionsInit {
interface RTCConfiguration {
iceServers?: RTCIceServer[];
iceTransportPolicy?: string;
bundlePolicy?: string;
iceTransportPolicy?: RTCIceTransportPolicy;
bundlePolicy?: RTCBundlePolicy;
peerIdentity?: string;
}
@ -781,7 +781,7 @@ interface RTCDtlsFingerprint {
}
interface RTCDtlsParameters {
role?: string;
role?: RTCDtlsRole;
fingerprints?: RTCDtlsFingerprint[];
}
@ -789,7 +789,7 @@ interface RTCIceCandidateAttributes extends RTCStats {
ipAddress?: string;
portNumber?: number;
transport?: string;
candidateType?: string;
candidateType?: RTCStatsIceCandidateType;
priority?: number;
addressSourceUrl?: string;
}
@ -801,10 +801,10 @@ interface RTCIceCandidateDictionary {
foundation?: string;
priority?: number;
ip?: string;
protocol?: string;
protocol?: RTCIceProtocol;
port?: number;
type?: string;
tcpType?: string;
type?: RTCIceCandidateType;
tcpType?: RTCIceTcpCandidateType;
relatedAddress?: string;
relatedPort?: number;
msMTurnSessionId?: string;
@ -825,7 +825,7 @@ interface RTCIceCandidatePairStats extends RTCStats {
transportId?: string;
localCandidateId?: string;
remoteCandidateId?: string;
state?: string;
state?: RTCStatsIceCandidatePairState;
priority?: number;
nominated?: boolean;
writable?: boolean;
@ -838,7 +838,7 @@ interface RTCIceCandidatePairStats extends RTCStats {
}
interface RTCIceGatherOptions {
gatherPolicy?: string;
gatherPolicy?: RTCIceGatherPolicy;
iceservers?: RTCIceServer[];
portRange?: MSPortRange;
}
@ -1003,7 +1003,7 @@ interface RTCRtpParameters {
headerExtensions?: RTCRtpHeaderExtensionParameters[];
encodings?: RTCRtpEncodingParameters[];
rtcp?: RTCRtcpParameters;
degradationPreference?: string;
degradationPreference?: RTCDegradationPreference;
}
interface RTCRtpRtxParameters {
@ -1017,7 +1017,7 @@ interface RTCRtpUnhandled {
}
interface RTCSessionDescriptionInit {
type?: string;
type?: RTCSdpType;
sdp?: string;
}
@ -1043,9 +1043,9 @@ interface RTCSsrcRange {
interface RTCStats {
timestamp?: number;
type?: string;
type?: RTCStatsType;
id?: string;
msType?: string;
msType?: MSStatsType;
}
interface RTCStatsReport {
@ -1070,11 +1070,11 @@ interface RequestInit {
headers?: any;
body?: any;
referrer?: string;
referrerPolicy?: string;
mode?: string;
credentials?: string;
cache?: string;
redirect?: string;
referrerPolicy?: ReferrerPolicy;
mode?: RequestMode;
credentials?: RequestCredentials;
cache?: RequestCache;
redirect?: RequestRedirect;
integrity?: string;
keepalive?: boolean;
window?: any;
@ -1087,9 +1087,9 @@ interface ResponseInit {
}
interface ScopedCredentialDescriptor {
type?: string;
type?: ScopedCredentialType;
id?: any;
transports?: string[];
transports?: Transport[];
}
interface ScopedCredentialOptions {
@ -1100,7 +1100,7 @@ interface ScopedCredentialOptions {
}
interface ScopedCredentialParameters {
type?: string;
type?: ScopedCredentialType;
algorithm?: string | Algorithm;
}
@ -1330,7 +1330,7 @@ interface AudioContextBase extends EventTarget {
readonly listener: AudioListener;
onstatechange: (this: AudioContext, ev: Event) => any;
readonly sampleRate: number;
readonly state: string;
readonly state: AudioContextState;
close(): Promise<void>;
createAnalyser(): AnalyserNode;
createBiquadFilter(): BiquadFilterNode;
@ -1390,8 +1390,8 @@ declare var AudioListener: {
interface AudioNode extends EventTarget {
channelCount: number;
channelCountMode: string;
channelInterpretation: string;
channelCountMode: ChannelCountMode;
channelInterpretation: ChannelInterpretation;
readonly context: AudioContext;
readonly numberOfInputs: number;
readonly numberOfOutputs: number;
@ -1494,7 +1494,7 @@ interface BiquadFilterNode extends AudioNode {
readonly detune: AudioParam;
readonly frequency: AudioParam;
readonly gain: AudioParam;
type: string;
type: BiquadFilterType;
getFrequencyResponse(frequencyHz: Float32Array, magResponse: Float32Array, phaseResponse: Float32Array): void;
}
@ -2134,7 +2134,7 @@ interface CanvasRenderingContext2D extends Object, CanvasPathMethods {
lineJoin: string;
lineWidth: number;
miterLimit: number;
msFillRule: string;
msFillRule: CanvasFillRule;
shadowBlur: number;
shadowColor: string;
shadowOffsetX: number;
@ -2147,7 +2147,7 @@ interface CanvasRenderingContext2D extends Object, CanvasPathMethods {
oImageSmoothingEnabled: boolean;
beginPath(): void;
clearRect(x: number, y: number, w: number, h: number): void;
clip(fillRule?: string): void;
clip(fillRule?: CanvasFillRule): void;
createImageData(imageDataOrSw: number | ImageData, sh?: number): ImageData;
createLinearGradient(x0: number, y0: number, x1: number, y1: number): CanvasGradient;
createPattern(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement, repetition: string): CanvasPattern;
@ -2156,12 +2156,12 @@ interface CanvasRenderingContext2D extends Object, CanvasPathMethods {
drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number): void;
drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, dstX: number, dstY: number, dstW: number, dstH: number): void;
drawImage(image: HTMLImageElement | HTMLCanvasElement | HTMLVideoElement | ImageBitmap, srcX: number, srcY: number, srcW: number, srcH: number, dstX: number, dstY: number, dstW: number, dstH: number): void;
fill(fillRule?: string): void;
fill(fillRule?: CanvasFillRule): void;
fillRect(x: number, y: number, w: number, h: number): void;
fillText(text: string, x: number, y: number, maxWidth?: number): void;
getImageData(sx: number, sy: number, sw: number, sh: number): ImageData;
getLineDash(): number[];
isPointInPath(x: number, y: number, fillRule?: string): boolean;
isPointInPath(x: number, y: number, fillRule?: CanvasFillRule): boolean;
measureText(text: string): TextMetrics;
putImageData(imagedata: ImageData, dx: number, dy: number, dirtyX?: number, dirtyY?: number, dirtyWidth?: number, dirtyHeight?: number): void;
restore(): void;
@ -2538,6 +2538,7 @@ interface DataTransfer {
clearData(format?: string): boolean;
getData(format: string): string;
setData(format: string, data: string): boolean;
setDragImage(image: Element, x: number, y: number): void;
}
declare var DataTransfer: {
@ -2574,7 +2575,7 @@ declare var DataTransferItemList: {
interface DeferredPermissionRequest {
readonly id: number;
readonly type: string;
readonly type: MSWebViewPermissionType;
readonly uri: string;
allow(): void;
deny(): void;
@ -3192,7 +3193,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* Contains the title of the document.
*/
title: string;
readonly visibilityState: string;
readonly visibilityState: VisibilityState;
/**
* Sets or gets the color of the links that the user has visited.
*/
@ -3207,7 +3208,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* Gets or sets the version attribute specified in the declaration of an XML document.
*/
xmlVersion: string | null;
adoptNode(source: Node): Node;
adoptNode<T extends Node>(source: T): T;
captureEvents(): void;
caretRangeFromPoint(x: number, y: number): Range;
clear(): void;
@ -3384,7 +3385,7 @@ interface Document extends Node, GlobalEventHandlers, NodeSelector, DocumentEven
* Gets a value indicating whether the object currently has focus.
*/
hasFocus(): boolean;
importNode(importedNode: Node, deep: boolean): Node;
importNode<T extends Node>(importedNode: T, deep: boolean): T;
msElementsFromPoint(x: number, y: number): NodeListOf<Element>;
msElementsFromRect(left: number, top: number, width: number, height: number): NodeListOf<Element>;
/**
@ -3700,9 +3701,9 @@ declare var Event: {
}
interface EventTarget {
addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
dispatchEvent(evt: Event): boolean;
removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var EventTarget: {
@ -3781,7 +3782,7 @@ declare var FocusEvent: {
}
interface FocusNavigationEvent extends Event {
readonly navigationReason: string;
readonly navigationReason: NavigationReason;
readonly originHeight: number;
readonly originLeft: number;
readonly originTop: number;
@ -3795,7 +3796,12 @@ declare var FocusNavigationEvent: {
}
interface FormData {
append(name: any, value: any, blobName?: string): void;
append(name: string, value: string | Blob, fileName?: string): void;
delete(name: string): void;
get(name: string): FormDataEntryValue | null;
getAll(name: string): FormDataEntryValue[];
has(name: string): boolean;
set(name: string, value: string | Blob, fileName?: string): void;
}
declare var FormData: {
@ -6957,7 +6963,7 @@ declare var History: {
}
interface IDBCursor {
readonly direction: string;
readonly direction: IDBCursorDirection;
key: IDBKeyRange | IDBValidKey;
readonly primaryKey: any;
source: IDBObjectStore | IDBIndex;
@ -7109,7 +7115,7 @@ interface IDBRequest extends EventTarget {
readonly error: DOMError;
onerror: (this: IDBRequest, ev: Event) => any;
onsuccess: (this: IDBRequest, ev: Event) => any;
readonly readyState: string;
readonly readyState: IDBRequestReadyState;
readonly result: any;
source: IDBObjectStore | IDBIndex | IDBCursor;
readonly transaction: IDBTransaction;
@ -7131,7 +7137,7 @@ interface IDBTransactionEventMap {
interface IDBTransaction extends EventTarget {
readonly db: IDBDatabase;
readonly error: DOMError;
readonly mode: string;
readonly mode: IDBTransactionMode;
onabort: (this: IDBTransaction, ev: Event) => any;
oncomplete: (this: IDBTransaction, ev: Event) => any;
onerror: (this: IDBTransaction, ev: Event) => any;
@ -7249,7 +7255,7 @@ declare var KeyboardEvent: {
interface ListeningStateChangedEvent extends Event {
readonly label: string;
readonly state: string;
readonly state: ListeningState;
}
declare var ListeningStateChangedEvent: {
@ -7340,7 +7346,7 @@ declare var MSAppAsyncOperation: {
interface MSAssertion {
readonly id: string;
readonly type: string;
readonly type: MSCredentialType;
}
declare var MSAssertion: {
@ -7372,7 +7378,7 @@ interface MSFIDOCredentialAssertion extends MSAssertion {
readonly algorithm: string | Algorithm;
readonly attestation: any;
readonly publicKey: string;
readonly transportHints: string[];
readonly transportHints: MSTransportType[];
}
declare var MSFIDOCredentialAssertion: {
@ -7476,7 +7482,7 @@ interface MSHTMLWebViewElement extends HTMLElement {
goForward(): void;
invokeScriptAsync(scriptName: string, ...args: any[]): MSWebViewAsyncOperation;
navigate(uri: string): void;
navigateFocus(navigationReason: string, origin: FocusNavigationOrigin): void;
navigateFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;
navigateToLocalStreamUri(source: string, streamResolver: any): void;
navigateToString(contents: string): void;
navigateWithHttpRequestMessage(requestMessage: any): void;
@ -7731,7 +7737,7 @@ declare var MSWebViewSettings: {
interface MediaDeviceInfo {
readonly deviceId: string;
readonly groupId: string;
readonly kind: string;
readonly kind: MediaDeviceKind;
readonly label: string;
}
@ -7798,7 +7804,7 @@ declare var MediaError: {
interface MediaKeyMessageEvent extends Event {
readonly message: ArrayBuffer;
readonly messageType: string;
readonly messageType: MediaKeyMessageType;
}
declare var MediaKeyMessageEvent: {
@ -7826,7 +7832,7 @@ declare var MediaKeySession: {
interface MediaKeyStatusMap {
readonly size: number;
forEach(callback: ForEachCallback): void;
get(keyId: any): string;
get(keyId: any): MediaKeyStatus;
has(keyId: any): boolean;
}
@ -7847,7 +7853,7 @@ declare var MediaKeySystemAccess: {
}
interface MediaKeys {
createSession(sessionType?: string): MediaKeySession;
createSession(sessionType?: MediaKeySessionType): MediaKeySession;
setServerCertificate(serverCertificate: any): Promise<void>;
}
@ -7985,7 +7991,7 @@ interface MediaStreamTrack extends EventTarget {
onoverconstrained: (this: MediaStreamTrack, ev: MediaStreamErrorEvent) => any;
onunmute: (this: MediaStreamTrack, ev: Event) => any;
readonly readonly: boolean;
readonly readyState: string;
readonly readyState: MediaStreamTrackState;
readonly remote: boolean;
applyConstraints(constraints: MediaTrackConstraints): Promise<void>;
clone(): MediaStreamTrack;
@ -8206,7 +8212,7 @@ declare var NavigationEventWithReferrer: {
interface Navigator extends Object, NavigatorID, NavigatorOnLine, NavigatorContentUtils, NavigatorStorageUtils, NavigatorGeolocation, MSNavigatorDoNotTrack, MSFileSaver, NavigatorBeacon, NavigatorConcurrentHardware, NavigatorUserMedia {
readonly authentication: WebAuthentication;
readonly cookieEnabled: boolean;
gamepadInputEmulation: string;
gamepadInputEmulation: GamepadInputEmulationType;
readonly language: string;
readonly maxTouchPoints: number;
readonly mimeTypes: MimeTypeArray;
@ -8253,15 +8259,15 @@ interface Node extends EventTarget {
contains(child: Node): boolean;
hasAttributes(): boolean;
hasChildNodes(): boolean;
insertBefore(newChild: Node, refChild: Node | null): Node;
insertBefore<T extends Node>(newChild: T, refChild: Node | null): T;
isDefaultNamespace(namespaceURI: string | null): boolean;
isEqualNode(arg: Node): boolean;
isSameNode(other: Node): boolean;
lookupNamespaceURI(prefix: string | null): string | null;
lookupPrefix(namespaceURI: string | null): string | null;
normalize(): void;
removeChild(oldChild: Node): Node;
replaceChild(newChild: Node, oldChild: Node): Node;
removeChild<T extends Node>(oldChild: T): T;
replaceChild<T extends Node>(newChild: Node, oldChild: T): T;
readonly ATTRIBUTE_NODE: number;
readonly CDATA_SECTION_NODE: number;
readonly COMMENT_NODE: number;
@ -8363,14 +8369,14 @@ interface NotificationEventMap {
interface Notification extends EventTarget {
readonly body: string;
readonly dir: string;
readonly dir: NotificationDirection;
readonly icon: string;
readonly lang: string;
onclick: (this: Notification, ev: Event) => any;
onclose: (this: Notification, ev: Event) => any;
onerror: (this: Notification, ev: Event) => any;
onshow: (this: Notification, ev: Event) => any;
readonly permission: string;
readonly permission: NotificationPermission;
readonly tag: string;
readonly title: string;
close(): void;
@ -8381,7 +8387,7 @@ interface Notification extends EventTarget {
declare var Notification: {
prototype: Notification;
new(title: string, options?: NotificationOptions): Notification;
requestPermission(callback?: NotificationPermissionCallback): Promise<string>;
requestPermission(callback?: NotificationPermissionCallback): Promise<NotificationPermission>;
}
interface OES_element_index_uint {
@ -8471,7 +8477,7 @@ interface OscillatorNode extends AudioNode {
readonly detune: AudioParam;
readonly frequency: AudioParam;
onended: (this: OscillatorNode, ev: MediaStreamErrorEvent) => any;
type: string;
type: OscillatorType;
setPeriodicWave(periodicWave: PeriodicWave): void;
start(when?: number): void;
stop(when?: number): void;
@ -8514,9 +8520,9 @@ interface PannerNode extends AudioNode {
coneInnerAngle: number;
coneOuterAngle: number;
coneOuterGain: number;
distanceModel: string;
distanceModel: DistanceModelType;
maxDistance: number;
panningModel: string;
panningModel: PanningModelType;
refDistance: number;
rolloffFactor: number;
setOrientation(x: number, y: number, z: number): void;
@ -8567,7 +8573,7 @@ interface PaymentRequest extends EventTarget {
onshippingoptionchange: (this: PaymentRequest, ev: Event) => any;
readonly shippingAddress: PaymentAddress | null;
readonly shippingOption: string | null;
readonly shippingType: string | null;
readonly shippingType: PaymentShippingType | null;
abort(): Promise<void>;
show(): Promise<PaymentResponse>;
addEventListener<K extends keyof PaymentRequestEventMap>(type: K, listener: (this: PaymentRequest, ev: PaymentRequestEventMap[K]) => any, useCapture?: boolean): void;
@ -8596,7 +8602,7 @@ interface PaymentResponse {
readonly payerPhone: string | null;
readonly shippingAddress: PaymentAddress | null;
readonly shippingOption: string | null;
complete(result?: string): Promise<void>;
complete(result?: PaymentComplete): Promise<void>;
toJSON(): any;
}
@ -8724,7 +8730,7 @@ interface PerformanceNavigationTiming extends PerformanceEntry {
readonly requestStart: number;
readonly responseEnd: number;
readonly responseStart: number;
readonly type: string;
readonly type: NavigationType;
readonly unloadEventEnd: number;
readonly unloadEventStart: number;
}
@ -8793,7 +8799,7 @@ declare var PeriodicWave: {
}
interface PermissionRequest extends DeferredPermissionRequest {
readonly state: string;
readonly state: MSWebViewPermissionState;
defer(): void;
}
@ -8923,7 +8929,7 @@ declare var ProgressEvent: {
interface PushManager {
getSubscription(): Promise<PushSubscription>;
permissionState(options?: PushSubscriptionOptionsInit): Promise<string>;
permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;
subscribe(options?: PushSubscriptionOptionsInit): Promise<PushSubscription>;
}
@ -8935,7 +8941,7 @@ declare var PushManager: {
interface PushSubscription {
readonly endpoint: USVString;
readonly options: PushSubscriptionOptions;
getKey(name: string): ArrayBuffer | null;
getKey(name: PushEncryptionKeyName): ArrayBuffer | null;
toJSON(): any;
unsubscribe(): Promise<boolean>;
}
@ -8972,7 +8978,7 @@ interface RTCDtlsTransportEventMap {
interface RTCDtlsTransport extends RTCStatsProvider {
ondtlsstatechange: ((this: RTCDtlsTransport, ev: RTCDtlsTransportStateChangedEvent) => any) | null;
onerror: ((this: RTCDtlsTransport, ev: Event) => any) | null;
readonly state: string;
readonly state: RTCDtlsTransportState;
readonly transport: RTCIceTransport;
getLocalParameters(): RTCDtlsParameters;
getRemoteCertificates(): ArrayBuffer[];
@ -8989,7 +8995,7 @@ declare var RTCDtlsTransport: {
}
interface RTCDtlsTransportStateChangedEvent extends Event {
readonly state: string;
readonly state: RTCDtlsTransportState;
}
declare var RTCDtlsTransportStateChangedEvent: {
@ -9045,7 +9051,7 @@ interface RTCIceGathererEventMap {
}
interface RTCIceGatherer extends RTCStatsProvider {
readonly component: string;
readonly component: RTCIceComponent;
onerror: ((this: RTCIceGatherer, ev: Event) => any) | null;
onlocalcandidate: ((this: RTCIceGatherer, ev: RTCIceGathererEvent) => any) | null;
createAssociatedGatherer(): RTCIceGatherer;
@ -9075,19 +9081,19 @@ interface RTCIceTransportEventMap {
}
interface RTCIceTransport extends RTCStatsProvider {
readonly component: string;
readonly component: RTCIceComponent;
readonly iceGatherer: RTCIceGatherer | null;
oncandidatepairchange: ((this: RTCIceTransport, ev: RTCIceCandidatePairChangedEvent) => any) | null;
onicestatechange: ((this: RTCIceTransport, ev: RTCIceTransportStateChangedEvent) => any) | null;
readonly role: string;
readonly state: string;
readonly role: RTCIceRole;
readonly state: RTCIceTransportState;
addRemoteCandidate(remoteCandidate: RTCIceCandidateDictionary | RTCIceCandidateComplete): void;
createAssociatedTransport(): RTCIceTransport;
getNominatedCandidatePair(): RTCIceCandidatePair | null;
getRemoteCandidates(): RTCIceCandidateDictionary[];
getRemoteParameters(): RTCIceParameters | null;
setRemoteCandidates(remoteCandidates: RTCIceCandidateDictionary[]): void;
start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: string): void;
start(gatherer: RTCIceGatherer, remoteParameters: RTCIceParameters, role?: RTCIceRole): void;
stop(): void;
addEventListener<K extends keyof RTCIceTransportEventMap>(type: K, listener: (this: RTCIceTransport, ev: RTCIceTransportEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
@ -9099,7 +9105,7 @@ declare var RTCIceTransport: {
}
interface RTCIceTransportStateChangedEvent extends Event {
readonly state: string;
readonly state: RTCIceTransportState;
}
declare var RTCIceTransportStateChangedEvent: {
@ -9119,8 +9125,8 @@ interface RTCPeerConnectionEventMap {
interface RTCPeerConnection extends EventTarget {
readonly canTrickleIceCandidates: boolean | null;
readonly iceConnectionState: string;
readonly iceGatheringState: string;
readonly iceConnectionState: RTCIceConnectionState;
readonly iceGatheringState: RTCIceGatheringState;
readonly localDescription: RTCSessionDescription | null;
onaddstream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any;
onicecandidate: (this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any;
@ -9130,7 +9136,7 @@ interface RTCPeerConnection extends EventTarget {
onremovestream: (this: RTCPeerConnection, ev: MediaStreamEvent) => any;
onsignalingstatechange: (this: RTCPeerConnection, ev: Event) => any;
readonly remoteDescription: RTCSessionDescription | null;
readonly signalingState: string;
readonly signalingState: RTCSignalingState;
addIceCandidate(candidate: RTCIceCandidate, successCallback?: VoidFunction, failureCallback?: RTCPeerConnectionErrorCallback): Promise<void>;
addStream(stream: MediaStream): void;
close(): void;
@ -9213,7 +9219,7 @@ declare var RTCRtpSender: {
interface RTCSessionDescription {
sdp: string | null;
type: string | null;
type: RTCSdpType | null;
toJSON(): any;
}
@ -9272,7 +9278,7 @@ interface Range {
createContextualFragment(fragment: string): DocumentFragment;
deleteContents(): void;
detach(): void;
expand(Unit: string): boolean;
expand(Unit: ExpandGranularity): boolean;
extractContents(): DocumentFragment;
getBoundingClientRect(): ClientRect;
getClientRects(): ClientRectList;
@ -9325,18 +9331,18 @@ declare var ReadableStreamReader: {
}
interface Request extends Object, Body {
readonly cache: string;
readonly credentials: string;
readonly destination: string;
readonly cache: RequestCache;
readonly credentials: RequestCredentials;
readonly destination: RequestDestination;
readonly headers: Headers;
readonly integrity: string;
readonly keepalive: boolean;
readonly method: string;
readonly mode: string;
readonly redirect: string;
readonly mode: RequestMode;
readonly redirect: RequestRedirect;
readonly referrer: string;
readonly referrerPolicy: string;
readonly type: string;
readonly referrerPolicy: ReferrerPolicy;
readonly type: RequestType;
readonly url: string;
clone(): Request;
}
@ -9352,7 +9358,7 @@ interface Response extends Object, Body {
readonly ok: boolean;
readonly status: number;
readonly statusText: string;
readonly type: string;
readonly type: ResponseType;
readonly url: string;
clone(): Response;
}
@ -11152,7 +11158,7 @@ declare var SVGZoomEvent: {
interface ScopedCredential {
readonly id: ArrayBuffer;
readonly type: string;
readonly type: ScopedCredentialType;
}
declare var ScopedCredential: {
@ -11269,7 +11275,7 @@ interface ServiceWorkerEventMap extends AbstractWorkerEventMap {
interface ServiceWorker extends EventTarget, AbstractWorker {
onstatechange: (this: ServiceWorker, ev: Event) => any;
readonly scriptURL: USVString;
readonly state: string;
readonly state: ServiceWorkerState;
postMessage(message: any, transfer?: any[]): void;
addEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
@ -11345,7 +11351,7 @@ interface SourceBuffer extends EventTarget {
appendWindowStart: number;
readonly audioTracks: AudioTrackList;
readonly buffered: TimeRanges;
mode: string;
mode: AppendMode;
timestampOffset: number;
readonly updating: boolean;
readonly videoTracks: VideoTrackList;
@ -11581,7 +11587,7 @@ interface Text extends CharacterData {
declare var Text: {
prototype: Text;
new(): Text;
new(data?: string): Text;
}
interface TextEvent extends UIEvent {
@ -11764,7 +11770,7 @@ interface TouchEvent extends UIEvent {
declare var TouchEvent: {
prototype: TouchEvent;
new(): TouchEvent;
new(type: string, touchEventInit?: TouchEventInit): TouchEvent;
}
interface TouchList {
@ -11970,7 +11976,7 @@ declare var WEBGL_depth_texture: {
interface WaveShaperNode extends AudioNode {
curve: Float32Array | null;
oversample: string;
oversample: OverSampleType;
}
declare var WaveShaperNode: {
@ -13231,6 +13237,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
readonly top: Window;
readonly window: Window;
URL: typeof URL;
URLSearchParams: typeof URLSearchParams;
Blob: typeof Blob;
customElements: CustomElementRegistry;
alert(message?: any): void;
@ -13239,7 +13246,7 @@ interface Window extends EventTarget, WindowTimers, WindowSessionStorage, Window
captureEvents(): void;
close(): void;
confirm(message?: string): boolean;
departFocus(navigationReason: string, origin: FocusNavigationOrigin): void;
departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;
focus(): void;
getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;
getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList;
@ -13314,7 +13321,7 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {
readonly readyState: number;
readonly response: any;
readonly responseText: string;
responseType: string;
responseType: XMLHttpRequestResponseType;
readonly responseURL: string;
readonly responseXML: Document | null;
readonly status: number;
@ -14171,6 +14178,21 @@ interface PromiseRejectionEventInit extends EventInit {
reason?: any;
}
interface EventListenerOptions {
capture?: boolean;
}
interface AddEventListenerOptions extends EventListenerOptions {
passive?: boolean;
once?: boolean;
}
interface TouchEventInit extends EventModifierInit {
touches?: Touch[];
targetTouches?: Touch[];
changedTouches?: Touch[];
}
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface ErrorEventHandler {
@ -14228,10 +14250,10 @@ interface NavigatorUserMediaErrorCallback {
(error: MediaStreamError): void;
}
interface ForEachCallback {
(keyId: any, status: string): void;
(keyId: any, status: MediaKeyStatus): void;
}
interface NotificationPermissionCallback {
(permission: string): void;
(permission: NotificationPermission): void;
}
interface IntersectionObserverCallback {
(entries: IntersectionObserverEntry[], observer: IntersectionObserver): void;
@ -14838,7 +14860,7 @@ declare function cancelAnimationFrame(handle: number): void;
declare function captureEvents(): void;
declare function close(): void;
declare function confirm(message?: string): boolean;
declare function departFocus(navigationReason: string, origin: FocusNavigationOrigin): void;
declare function departFocus(navigationReason: NavigationReason, origin: FocusNavigationOrigin): void;
declare function focus(): void;
declare function getComputedStyle(elt: Element, pseudoElt?: string): CSSStyleDeclaration;
declare function getMatchedCSSRules(elt: Element, pseudoElt?: string): CSSRuleList;
@ -14870,7 +14892,7 @@ declare function scrollTo(options?: ScrollToOptions): void;
declare function scrollBy(options?: ScrollToOptions): void;
declare function toString(): string;
declare function dispatchEvent(evt: Event): boolean;
declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
declare function clearInterval(handle: number): void;
declare function clearTimeout(handle: number): void;
declare function setInterval(handler: (...args: any[]) => void, timeout: number): number;
@ -14939,4 +14961,76 @@ type ScrollLogicalPosition = "start" | "center" | "end" | "nearest";
type IDBValidKey = number | string | Date | IDBArrayKey;
type BufferSource = ArrayBuffer | ArrayBufferView;
type MouseWheelEvent = WheelEvent;
type ScrollRestoration = "auto" | "manual";
type ScrollRestoration = "auto" | "manual";
type FormDataEntryValue = string | File;
type AppendMode = "segments" | "sequence";
type AudioContextState = "suspended" | "running" | "closed";
type BiquadFilterType = "lowpass" | "highpass" | "bandpass" | "lowshelf" | "highshelf" | "peaking" | "notch" | "allpass";
type CanvasFillRule = "nonzero" | "evenodd";
type ChannelCountMode = "max" | "clamped-max" | "explicit";
type ChannelInterpretation = "speakers" | "discrete";
type DistanceModelType = "linear" | "inverse" | "exponential";
type ExpandGranularity = "character" | "word" | "sentence" | "textedit";
type GamepadInputEmulationType = "mouse" | "keyboard" | "gamepad";
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
type IDBRequestReadyState = "pending" | "done";
type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
type ListeningState = "inactive" | "active" | "disambiguation";
type MSCredentialType = "FIDO_2_0";
type MSIceAddrType = "os" | "stun" | "turn" | "peer-derived";
type MSIceType = "failed" | "direct" | "relay";
type MSStatsType = "description" | "localclientevent" | "inbound-network" | "outbound-network" | "inbound-payload" | "outbound-payload" | "transportdiagnostics";
type MSTransportType = "Embedded" | "USB" | "NFC" | "BT";
type MSWebViewPermissionState = "unknown" | "defer" | "allow" | "deny";
type MSWebViewPermissionType = "geolocation" | "unlimitedIndexedDBQuota" | "media" | "pointerlock" | "webnotifications";
type MediaDeviceKind = "audioinput" | "audiooutput" | "videoinput";
type MediaKeyMessageType = "license-request" | "license-renewal" | "license-release" | "individualization-request";
type MediaKeySessionType = "temporary" | "persistent-license" | "persistent-release-message";
type MediaKeyStatus = "usable" | "expired" | "output-downscaled" | "output-not-allowed" | "status-pending" | "internal-error";
type MediaKeysRequirement = "required" | "optional" | "not-allowed";
type MediaStreamTrackState = "live" | "ended";
type NavigationReason = "up" | "down" | "left" | "right";
type NavigationType = "navigate" | "reload" | "back_forward" | "prerender";
type NotificationDirection = "auto" | "ltr" | "rtl";
type NotificationPermission = "default" | "denied" | "granted";
type OscillatorType = "sine" | "square" | "sawtooth" | "triangle" | "custom";
type OverSampleType = "none" | "2x" | "4x";
type PanningModelType = "equalpower";
type PaymentComplete = "success" | "fail" | "";
type PaymentShippingType = "shipping" | "delivery" | "pickup";
type PushEncryptionKeyName = "p256dh" | "auth";
type PushPermissionState = "granted" | "denied" | "prompt";
type RTCBundlePolicy = "balanced" | "max-compat" | "max-bundle";
type RTCDegradationPreference = "maintain-framerate" | "maintain-resolution" | "balanced";
type RTCDtlsRole = "auto" | "client" | "server";
type RTCDtlsTransportState = "new" | "connecting" | "connected" | "closed";
type RTCIceCandidateType = "host" | "srflx" | "prflx" | "relay";
type RTCIceComponent = "RTP" | "RTCP";
type RTCIceConnectionState = "new" | "checking" | "connected" | "completed" | "failed" | "disconnected" | "closed";
type RTCIceGatherPolicy = "all" | "nohost" | "relay";
type RTCIceGathererState = "new" | "gathering" | "complete";
type RTCIceGatheringState = "new" | "gathering" | "complete";
type RTCIceProtocol = "udp" | "tcp";
type RTCIceRole = "controlling" | "controlled";
type RTCIceTcpCandidateType = "active" | "passive" | "so";
type RTCIceTransportPolicy = "none" | "relay" | "all";
type RTCIceTransportState = "new" | "checking" | "connected" | "completed" | "disconnected" | "closed";
type RTCSdpType = "offer" | "pranswer" | "answer";
type RTCSignalingState = "stable" | "have-local-offer" | "have-remote-offer" | "have-local-pranswer" | "have-remote-pranswer" | "closed";
type RTCStatsIceCandidatePairState = "frozen" | "waiting" | "inprogress" | "failed" | "succeeded" | "cancelled";
type RTCStatsIceCandidateType = "host" | "serverreflexive" | "peerreflexive" | "relayed";
type RTCStatsType = "inboundrtp" | "outboundrtp" | "session" | "datachannel" | "track" | "transport" | "candidatepair" | "localcandidate" | "remotecandidate";
type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin-only" | "origin-when-cross-origin" | "unsafe-url";
type RequestCache = "default" | "no-store" | "reload" | "no-cache" | "force-cache";
type RequestCredentials = "omit" | "same-origin" | "include";
type RequestDestination = "" | "document" | "sharedworker" | "subresource" | "unknown" | "worker";
type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors";
type RequestRedirect = "follow" | "error" | "manual";
type RequestType = "" | "audio" | "font" | "image" | "script" | "style" | "track" | "video";
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
type ScopedCredentialType = "ScopedCred";
type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant";
type Transport = "usb" | "nfc" | "ble";
type VideoFacingModeEnum = "user" | "environment" | "left" | "right";
type VisibilityState = "hidden" | "visible" | "prerender" | "unloaded";
type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";

View File

@ -30,9 +30,9 @@ interface WeakMap<K extends object, V> {
}
interface WeakMapConstructor {
new (): WeakMap<any, any>;
new (): WeakMap<object, any>;
new <K extends object, V>(entries?: [K, V][]): WeakMap<K, V>;
readonly prototype: WeakMap<any, any>;
readonly prototype: WeakMap<object, any>;
}
declare var WeakMap: WeakMapConstructor;
@ -58,15 +58,15 @@ interface ReadonlySet<T> {
readonly size: number;
}
interface WeakSet<T> {
interface WeakSet<T extends object> {
add(value: T): this;
delete(value: T): boolean;
has(value: T): boolean;
}
interface WeakSetConstructor {
new (): WeakSet<any>;
new <T>(values?: T[]): WeakSet<T>;
readonly prototype: WeakSet<any>;
new (): WeakSet<object>;
new <T extends object>(values?: T[]): WeakSet<T>;
readonly prototype: WeakSet<object>;
}
declare var WeakSet: WeakSetConstructor;

View File

@ -10,8 +10,8 @@ interface Array<T> {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (this: undefined, value: T, index: number, obj: Array<T>) => boolean): T | undefined;
find(predicate: (this: undefined, value: T, index: number, obj: Array<T>) => boolean, thisArg: undefined): T | undefined;
find(predicate: (this: void, value: T, index: number, obj: Array<T>) => boolean): T | undefined;
find(predicate: (this: void, value: T, index: number, obj: Array<T>) => boolean, thisArg: undefined): T | undefined;
find<Z>(predicate: (this: Z, value: T, index: number, obj: Array<T>) => boolean, thisArg: Z): T | undefined;
/**
@ -23,8 +23,8 @@ interface Array<T> {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (this: undefined, value: T, index: number, obj: Array<T>) => boolean): number;
findIndex(predicate: (this: undefined, value: T, index: number, obj: Array<T>) => boolean, thisArg: undefined): number;
findIndex(predicate: (this: void, value: T, index: number, obj: Array<T>) => boolean): number;
findIndex(predicate: (this: void, value: T, index: number, obj: Array<T>) => boolean, thisArg: undefined): number;
findIndex<Z>(predicate: (this: Z, value: T, index: number, obj: Array<T>) => boolean, thisArg: Z): number;
/**
@ -56,8 +56,8 @@ interface ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (this: undefined, v: T, k: number) => U): Array<U>;
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (this: undefined, v: T, k: number) => U, thisArg: undefined): Array<U>;
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (this: void, v: T, k: number) => U): Array<U>;
from<T, U>(arrayLike: ArrayLike<T>, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array<U>;
from<Z, T, U>(arrayLike: ArrayLike<T>, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array<U>;
@ -311,7 +311,7 @@ interface ObjectConstructor {
* @param target The target object to copy to.
* @param sources One or more source objects from which to copy properties
*/
assign(target: any, ...sources: any[]): any;
assign(target: object, ...sources: any[]): any;
/**
* Returns an array of all symbol properties found directly on object o.
@ -363,8 +363,8 @@ interface ReadonlyArray<T> {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (this: undefined, value: T, index: number, obj: ReadonlyArray<T>) => boolean): T | undefined;
find(predicate: (this: undefined, value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg: undefined): T | undefined;
find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray<T>) => boolean): T | undefined;
find(predicate: (this: void, value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg: undefined): T | undefined;
find<Z>(predicate: (this: Z, value: T, index: number, obj: ReadonlyArray<T>) => boolean, thisArg: Z): T | undefined;
/**
@ -376,8 +376,8 @@ interface ReadonlyArray<T> {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (this: undefined, value: T, index: number, obj: Array<T>) => boolean): number;
findIndex(predicate: (this: undefined, value: T, index: number, obj: Array<T>) => boolean, thisArg: undefined): number;
findIndex(predicate: (this: void, value: T, index: number, obj: Array<T>) => boolean): number;
findIndex(predicate: (this: void, value: T, index: number, obj: Array<T>) => boolean, thisArg: undefined): number;
findIndex<Z>(predicate: (this: Z, value: T, index: number, obj: Array<T>) => boolean, thisArg: Z): number;
}

View File

@ -54,8 +54,8 @@ interface ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from<T, U>(iterable: Iterable<T>, mapfn: (this: undefined, v: T, k: number) => U): Array<U>;
from<T, U>(iterable: Iterable<T>, mapfn: (this: undefined, v: T, k: number) => U, thisArg: undefined): Array<U>;
from<T, U>(iterable: Iterable<T>, mapfn: (this: void, v: T, k: number) => U): Array<U>;
from<T, U>(iterable: Iterable<T>, mapfn: (this: void, v: T, k: number) => U, thisArg: undefined): Array<U>;
from<Z, T, U>(iterable: Iterable<T>, mapfn: (this: Z, v: T, k: number) => U, thisArg: Z): Array<U>;
/**
@ -118,10 +118,10 @@ interface SetConstructor {
new <T>(iterable: Iterable<T>): Set<T>;
}
interface WeakSet<T> { }
interface WeakSet<T extends object> { }
interface WeakSetConstructor {
new <T>(iterable: Iterable<T>): WeakSet<T>;
new <T extends object>(iterable: Iterable<T>): WeakSet<T>;
}
interface Promise<T> { }
@ -145,7 +145,7 @@ interface PromiseConstructor {
}
declare namespace Reflect {
function enumerate(target: any): IterableIterator<any>;
function enumerate(target: object): IterableIterator<any>;
}
interface String {
@ -182,8 +182,8 @@ interface Int8ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number): Int8Array;
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Int8Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number): Int8Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array;
from<Z>(arrayLike: Iterable<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array;
from(arrayLike: Iterable<number>): Int8Array;
@ -218,8 +218,8 @@ interface Uint8ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number): Uint8Array;
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Uint8Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number): Uint8Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array;
from<Z>(arrayLike: Iterable<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array;
from(arrayLike: Iterable<number>): Uint8Array;
@ -257,8 +257,8 @@ interface Uint8ClampedArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number): Uint8ClampedArray;
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number): Uint8ClampedArray;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray;
from<Z>(arrayLike: Iterable<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray;
from(arrayLike: Iterable<number>): Uint8ClampedArray;
@ -295,8 +295,8 @@ interface Int16ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number): Int16Array;
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Int16Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number): Int16Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array;
from<Z>(arrayLike: Iterable<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array;
from(arrayLike: Iterable<number>): Int16Array;
@ -331,8 +331,8 @@ interface Uint16ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number): Uint16Array;
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Uint16Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number): Uint16Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array;
from<Z>(arrayLike: Iterable<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array;
from(arrayLike: Iterable<number>): Uint16Array;
@ -367,8 +367,8 @@ interface Int32ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number): Int32Array;
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Int32Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number): Int32Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array;
from<Z>(arrayLike: Iterable<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array;
from(arrayLike: Iterable<number>): Int32Array;
@ -403,8 +403,8 @@ interface Uint32ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number): Uint32Array;
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Uint32Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number): Uint32Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array;
from<Z>(arrayLike: Iterable<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array;
from(arrayLike: Iterable<number>): Uint32Array;
@ -439,8 +439,8 @@ interface Float32ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number): Float32Array;
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Float32Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number): Float32Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array;
from<Z>(arrayLike: Iterable<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array;
from(arrayLike: Iterable<number>): Float32Array;
@ -475,8 +475,8 @@ interface Float64ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number): Float64Array;
from(arrayLike: Iterable<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Float64Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number): Float64Array;
from(arrayLike: Iterable<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array;
from<Z>(arrayLike: Iterable<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array;
from(arrayLike: Iterable<number>): Float64Array;

View File

@ -1,4 +1,4 @@
interface ProxyHandler<T> {
interface ProxyHandler<T extends object> {
getPrototypeOf? (target: T): object | null;
setPrototypeOf? (target: T, v: any): boolean;
isExtensible? (target: T): boolean;
@ -16,7 +16,7 @@ interface ProxyHandler<T> {
}
interface ProxyConstructor {
revocable<T>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
new <T>(target: T, handler: ProxyHandler<T>): T;
revocable<T extends object>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
new <T extends object>(target: T, handler: ProxyHandler<T>): T;
}
declare var Proxy: ProxyConstructor;

View File

@ -1,15 +1,15 @@
declare namespace Reflect {
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
function construct(target: Function, argumentsList: ArrayLike<any>, newTarget?: any): any;
function defineProperty(target: any, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
function deleteProperty(target: any, propertyKey: PropertyKey): boolean;
function get(target: any, propertyKey: PropertyKey, receiver?: any): any;
function getOwnPropertyDescriptor(target: any, propertyKey: PropertyKey): PropertyDescriptor;
function getPrototypeOf(target: any): any;
function has(target: any, propertyKey: PropertyKey): boolean;
function isExtensible(target: any): boolean;
function ownKeys(target: any): Array<PropertyKey>;
function preventExtensions(target: any): boolean;
function set(target: any, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
function setPrototypeOf(target: any, proto: any): boolean;
}
function defineProperty(target: object, propertyKey: PropertyKey, attributes: PropertyDescriptor): boolean;
function deleteProperty(target: object, propertyKey: PropertyKey): boolean;
function get(target: object, propertyKey: PropertyKey, receiver?: any): any;
function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor;
function getPrototypeOf(target: object): object;
function has(target: object, propertyKey: PropertyKey): boolean;
function isExtensible(target: object): boolean;
function ownKeys(target: object): Array<PropertyKey>;
function preventExtensions(target: object): boolean;
function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
function setPrototypeOf(target: object, proto: any): boolean;
}

View File

@ -118,7 +118,7 @@ interface Set<T> {
readonly [Symbol.toStringTag]: "Set";
}
interface WeakSet<T> {
interface WeakSet<T extends object> {
readonly [Symbol.toStringTag]: "WeakSet";
}

348
src/lib/es5.d.ts vendored
View File

@ -1017,48 +1017,48 @@ interface ReadonlyArray<T> {
* @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => boolean): boolean;
every(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => boolean, thisArg: undefined): boolean;
every(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => boolean): boolean;
every(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => boolean, thisArg: undefined): boolean;
every<Z>(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray<T>) => boolean, thisArg: Z): boolean;
/**
* Determines whether the specified callback function returns true for any element of an array.
* @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => boolean): boolean;
some(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => boolean, thisArg: undefined): boolean;
some(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => boolean): boolean;
some(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => boolean, thisArg: undefined): boolean;
some<Z>(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray<T>) => boolean, thisArg: Z): boolean;
/**
* Performs the specified action for each element in an array.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => void): void;
forEach(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => void, thisArg: undefined): void;
forEach(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => void): void;
forEach(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => void, thisArg: undefined): void;
forEach<Z>(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray<T>) => void, thisArg: Z): void;
/**
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
map<U>(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => U): U[];
map<U>(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => U, thisArg: undefined): U[];
map<U>(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => U): U[];
map<U>(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => U, thisArg: undefined): U[];
map<Z, U>(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray<T>) => U, thisArg: Z): U[];
/**
* Returns the elements of an array that meet the condition specified in a callback function.
* @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
filter<S extends T>(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => value is S): S[];
filter<S extends T>(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => value is S, thisArg: undefined): S[];
filter<S extends T>(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => value is S): S[];
filter<S extends T>(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => value is S, thisArg: undefined): S[];
filter<Z, S extends T>(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray<T>) => value is S, thisArg: Z): S[];
/**
* Returns the elements of an array that meet the condition specified in a callback function.
* @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => any): T[];
filter(callbackfn: (this: undefined, value: T, index: number, array: ReadonlyArray<T>) => any, thisArg: undefined): T[];
filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => any): T[];
filter(callbackfn: (this: void, value: T, index: number, array: ReadonlyArray<T>) => any, thisArg: undefined): T[];
filter<Z>(callbackfn: (this: Z, value: T, index: number, array: ReadonlyArray<T>) => any, thisArg: Z): T[];
/**
* Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
@ -1176,72 +1176,72 @@ interface Array<T> {
* @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (this: undefined, value: T, index: number, array: T[]) => boolean): boolean;
every(callbackfn: (this: undefined, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean;
every(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean): boolean;
every(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean;
every<Z>(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): boolean;
/**
* Determines whether the specified callback function returns true for any element of an array.
* @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (this: undefined, value: T, index: number, array: T[]) => boolean): boolean;
some(callbackfn: (this: undefined, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean;
some(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean): boolean;
some(callbackfn: (this: void, value: T, index: number, array: T[]) => boolean, thisArg: undefined): boolean;
some<Z>(callbackfn: (this: Z, value: T, index: number, array: T[]) => boolean, thisArg: Z): boolean;
/**
* Performs the specified action for each element in an array.
* @param callbackfn A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (this: undefined, value: T, index: number, array: T[]) => void): void;
forEach(callbackfn: (this: undefined, value: T, index: number, array: T[]) => void, thisArg: undefined): void;
forEach(callbackfn: (this: void, value: T, index: number, array: T[]) => void): void;
forEach(callbackfn: (this: void, value: T, index: number, array: T[]) => void, thisArg: undefined): void;
forEach<Z>(callbackfn: (this: Z, value: T, index: number, array: T[]) => void, thisArg: Z): void;
/**
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
map<U>(this: [T, T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U, U, U, U];
map<U>(this: [T, T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U];
map<U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U];
map<U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U];
map<Z, U>(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U];
/**
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
map<U>(this: [T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U, U, U];
map<U>(this: [T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U];
map<U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U];
map<U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U];
map<Z, U>(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U];
/**
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
map<U>(this: [T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U, U];
map<U>(this: [T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U];
map<U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U];
map<U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U];
map<Z, U>(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U];
/**
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
map<U>(this: [T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U];
map<U>(this: [T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U];
map<U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U];
map<U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U];
map<Z, U>(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U];
/**
* Calls a defined callback function on each element of an array, and returns an array that contains the results.
* @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
map<U>(callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): U[];
map<U>(callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): U[];
map<U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U): U[];
map<U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[];
map<Z, U>(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[];
/**
* Returns the elements of an array that meet the condition specified in a callback function.
* @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
* @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (this: undefined, value: T, index: number, array: T[]) => any): T[];
filter(callbackfn: (this: undefined, value: T, index: number, array: T[]) => any, thisArg: undefined): T[];
filter(callbackfn: (this: void, value: T, index: number, array: T[]) => any): T[];
filter(callbackfn: (this: void, value: T, index: number, array: T[]) => any, thisArg: undefined): T[];
filter<Z>(callbackfn: (this: Z, value: T, index: number, array: T[]) => any, thisArg: Z): T[];
/**
* Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
@ -1587,8 +1587,8 @@ interface Int8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (this: undefined, value: number, index: number, array: Int8Array) => boolean): boolean;
every(callbackfn: (this: undefined, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean;
every<Z>(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): boolean;
/**
@ -1608,8 +1608,8 @@ interface Int8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (this: undefined, value: number, index: number, array: Int8Array) => any): Int8Array;
filter(callbackfn: (this: undefined, value: number, index: number, array: Int8Array) => any, thisArg: undefined): Int8Array;
filter(callbackfn: (this: void, value: number, index: number, array: Int8Array) => any): Int8Array;
filter(callbackfn: (this: void, value: number, index: number, array: Int8Array) => any, thisArg: undefined): Int8Array;
filter<Z>(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => any, thisArg: Z): Int8Array;
/**
@ -1621,8 +1621,8 @@ interface Int8Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number | undefined;
/**
@ -1634,8 +1634,8 @@ interface Int8Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number;
/**
@ -1645,8 +1645,8 @@ interface Int8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (this: undefined, value: number, index: number, array: Int8Array) => void): void;
forEach(callbackfn: (this: undefined, value: number, index: number, array: Int8Array) => void, thisArg: undefined): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Int8Array) => void): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Int8Array) => void, thisArg: undefined): void;
forEach<Z>(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => void, thisArg: Z): void;
/**
@ -1685,8 +1685,8 @@ interface Int8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: undefined, value: number, index: number, array: Int8Array) => number): Int8Array;
map(callbackfn: (this: undefined, value: number, index: number, array: Int8Array) => number, thisArg: undefined): Int8Array;
map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number): Int8Array;
map(callbackfn: (this: void, value: number, index: number, array: Int8Array) => number, thisArg: undefined): Int8Array;
map<Z>(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => number, thisArg: Z): Int8Array;
/**
@ -1771,8 +1771,8 @@ interface Int8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (this: undefined, value: number, index: number, array: Int8Array) => boolean): boolean;
some(callbackfn: (this: undefined, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Int8Array) => boolean, thisArg: undefined): boolean;
some<Z>(callbackfn: (this: Z, value: number, index: number, array: Int8Array) => boolean, thisArg: Z): boolean;
/**
@ -1825,8 +1825,8 @@ interface Int8ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number): Int8Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Int8Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number): Int8Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int8Array;
from<Z>(arrayLike: ArrayLike<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int8Array;
from(arrayLike: ArrayLike<number>): Int8Array;
@ -1878,8 +1878,8 @@ interface Uint8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (this: undefined, value: number, index: number, array: Uint8Array) => boolean): boolean;
every(callbackfn: (this: undefined, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean;
every<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): boolean;
/**
@ -1899,8 +1899,8 @@ interface Uint8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (this: undefined, value: number, index: number, array: Uint8Array) => any): Uint8Array;
filter(callbackfn: (this: undefined, value: number, index: number, array: Uint8Array) => any, thisArg: undefined): Uint8Array;
filter(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => any): Uint8Array;
filter(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => any, thisArg: undefined): Uint8Array;
filter<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => any, thisArg: Z): Uint8Array;
/**
@ -1912,8 +1912,8 @@ interface Uint8Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number | undefined;
/**
@ -1925,8 +1925,8 @@ interface Uint8Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number;
/**
@ -1936,8 +1936,8 @@ interface Uint8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (this: undefined, value: number, index: number, array: Uint8Array) => void): void;
forEach(callbackfn: (this: undefined, value: number, index: number, array: Uint8Array) => void, thisArg: undefined): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => void): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => void, thisArg: undefined): void;
forEach<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => void, thisArg: Z): void;
/**
@ -1976,8 +1976,8 @@ interface Uint8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: undefined, value: number, index: number, array: Uint8Array) => number): Uint8Array;
map(callbackfn: (this: undefined, value: number, index: number, array: Uint8Array) => number, thisArg: undefined): Uint8Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number): Uint8Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => number, thisArg: undefined): Uint8Array;
map<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => number, thisArg: Z): Uint8Array;
/**
@ -2062,8 +2062,8 @@ interface Uint8Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (this: undefined, value: number, index: number, array: Uint8Array) => boolean): boolean;
some(callbackfn: (this: undefined, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Uint8Array) => boolean, thisArg: undefined): boolean;
some<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint8Array) => boolean, thisArg: Z): boolean;
/**
@ -2117,8 +2117,8 @@ interface Uint8ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number): Uint8Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Uint8Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number): Uint8Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8Array;
from<Z>(arrayLike: ArrayLike<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8Array;
from(arrayLike: ArrayLike<number>): Uint8Array;
@ -2170,8 +2170,8 @@ interface Uint8ClampedArray {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (this: undefined, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean;
every(callbackfn: (this: undefined, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean;
every<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): boolean;
/**
@ -2191,8 +2191,8 @@ interface Uint8ClampedArray {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (this: undefined, value: number, index: number, array: Uint8ClampedArray) => any): Uint8ClampedArray;
filter(callbackfn: (this: undefined, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: undefined): Uint8ClampedArray;
filter(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => any): Uint8ClampedArray;
filter(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: undefined): Uint8ClampedArray;
filter<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => any, thisArg: Z): Uint8ClampedArray;
/**
@ -2204,8 +2204,8 @@ interface Uint8ClampedArray {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number | undefined;
/**
@ -2217,8 +2217,8 @@ interface Uint8ClampedArray {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number;
/**
@ -2228,8 +2228,8 @@ interface Uint8ClampedArray {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (this: undefined, value: number, index: number, array: Uint8ClampedArray) => void): void;
forEach(callbackfn: (this: undefined, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: undefined): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => void): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: undefined): void;
forEach<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => void, thisArg: Z): void;
/**
@ -2268,8 +2268,8 @@ interface Uint8ClampedArray {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: undefined, value: number, index: number, array: Uint8ClampedArray) => number): Uint8ClampedArray;
map(callbackfn: (this: undefined, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: undefined): Uint8ClampedArray;
map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number): Uint8ClampedArray;
map(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: undefined): Uint8ClampedArray;
map<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => number, thisArg: Z): Uint8ClampedArray;
/**
@ -2354,8 +2354,8 @@ interface Uint8ClampedArray {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (this: undefined, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean;
some(callbackfn: (this: undefined, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: undefined): boolean;
some<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint8ClampedArray) => boolean, thisArg: Z): boolean;
/**
@ -2409,8 +2409,8 @@ interface Uint8ClampedArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number): Uint8ClampedArray;
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number): Uint8ClampedArray;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint8ClampedArray;
from<Z>(arrayLike: ArrayLike<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint8ClampedArray;
from(arrayLike: ArrayLike<number>): Uint8ClampedArray;
@ -2461,8 +2461,8 @@ interface Int16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (this: undefined, value: number, index: number, array: Int16Array) => boolean): boolean;
every(callbackfn: (this: undefined, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean;
every<Z>(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): boolean;
/**
@ -2482,8 +2482,8 @@ interface Int16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (this: undefined, value: number, index: number, array: Int16Array) => any): Int16Array;
filter(callbackfn: (this: undefined, value: number, index: number, array: Int16Array) => any, thisArg: undefined): Int16Array;
filter(callbackfn: (this: void, value: number, index: number, array: Int16Array) => any): Int16Array;
filter(callbackfn: (this: void, value: number, index: number, array: Int16Array) => any, thisArg: undefined): Int16Array;
filter<Z>(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => any, thisArg: Z): Int16Array;
/**
@ -2495,8 +2495,8 @@ interface Int16Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number | undefined;
/**
@ -2508,8 +2508,8 @@ interface Int16Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number;
/**
@ -2519,8 +2519,8 @@ interface Int16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (this: undefined, value: number, index: number, array: Int16Array) => void): void;
forEach(callbackfn: (this: undefined, value: number, index: number, array: Int16Array) => void, thisArg: undefined): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Int16Array) => void): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Int16Array) => void, thisArg: undefined): void;
forEach<Z>(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => void, thisArg: Z): void;
/**
@ -2559,8 +2559,8 @@ interface Int16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: undefined, value: number, index: number, array: Int16Array) => number): Int16Array;
map(callbackfn: (this: undefined, value: number, index: number, array: Int16Array) => number, thisArg: undefined): Int16Array;
map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number): Int16Array;
map(callbackfn: (this: void, value: number, index: number, array: Int16Array) => number, thisArg: undefined): Int16Array;
map<Z>(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => number, thisArg: Z): Int16Array;
/**
@ -2645,8 +2645,8 @@ interface Int16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (this: undefined, value: number, index: number, array: Int16Array) => boolean): boolean;
some(callbackfn: (this: undefined, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Int16Array) => boolean, thisArg: undefined): boolean;
some<Z>(callbackfn: (this: Z, value: number, index: number, array: Int16Array) => boolean, thisArg: Z): boolean;
/**
@ -2700,8 +2700,8 @@ interface Int16ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number): Int16Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Int16Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number): Int16Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int16Array;
from<Z>(arrayLike: ArrayLike<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int16Array;
from(arrayLike: ArrayLike<number>): Int16Array;
@ -2753,8 +2753,8 @@ interface Uint16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (this: undefined, value: number, index: number, array: Uint16Array) => boolean): boolean;
every(callbackfn: (this: undefined, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean;
every<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): boolean;
/**
@ -2774,8 +2774,8 @@ interface Uint16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (this: undefined, value: number, index: number, array: Uint16Array) => any): Uint16Array;
filter(callbackfn: (this: undefined, value: number, index: number, array: Uint16Array) => any, thisArg: undefined): Uint16Array;
filter(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => any): Uint16Array;
filter(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => any, thisArg: undefined): Uint16Array;
filter<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => any, thisArg: Z): Uint16Array;
/**
@ -2787,8 +2787,8 @@ interface Uint16Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number | undefined;
/**
@ -2800,8 +2800,8 @@ interface Uint16Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number;
/**
@ -2811,8 +2811,8 @@ interface Uint16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (this: undefined, value: number, index: number, array: Uint16Array) => void): void;
forEach(callbackfn: (this: undefined, value: number, index: number, array: Uint16Array) => void, thisArg: undefined): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => void): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => void, thisArg: undefined): void;
forEach<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => void, thisArg: Z): void;
/**
@ -2851,8 +2851,8 @@ interface Uint16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: undefined, value: number, index: number, array: Uint16Array) => number): Uint16Array;
map(callbackfn: (this: undefined, value: number, index: number, array: Uint16Array) => number, thisArg: undefined): Uint16Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number): Uint16Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => number, thisArg: undefined): Uint16Array;
map<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => number, thisArg: Z): Uint16Array;
/**
@ -2937,8 +2937,8 @@ interface Uint16Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (this: undefined, value: number, index: number, array: Uint16Array) => boolean): boolean;
some(callbackfn: (this: undefined, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Uint16Array) => boolean, thisArg: undefined): boolean;
some<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint16Array) => boolean, thisArg: Z): boolean;
/**
@ -2992,8 +2992,8 @@ interface Uint16ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number): Uint16Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Uint16Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number): Uint16Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint16Array;
from<Z>(arrayLike: ArrayLike<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint16Array;
from(arrayLike: ArrayLike<number>): Uint16Array;
@ -3044,8 +3044,8 @@ interface Int32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (this: undefined, value: number, index: number, array: Int32Array) => boolean): boolean;
every(callbackfn: (this: undefined, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean;
every<Z>(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): boolean;
/**
@ -3065,8 +3065,8 @@ interface Int32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (this: undefined, value: number, index: number, array: Int32Array) => any): Int32Array;
filter(callbackfn: (this: undefined, value: number, index: number, array: Int32Array) => any, thisArg: undefined): Int32Array;
filter(callbackfn: (this: void, value: number, index: number, array: Int32Array) => any): Int32Array;
filter(callbackfn: (this: void, value: number, index: number, array: Int32Array) => any, thisArg: undefined): Int32Array;
filter<Z>(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => any, thisArg: Z): Int32Array;
/**
@ -3078,8 +3078,8 @@ interface Int32Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number | undefined;
/**
@ -3091,8 +3091,8 @@ interface Int32Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number;
/**
@ -3102,8 +3102,8 @@ interface Int32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (this: undefined, value: number, index: number, array: Int32Array) => void): void;
forEach(callbackfn: (this: undefined, value: number, index: number, array: Int32Array) => void, thisArg: undefined): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Int32Array) => void): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Int32Array) => void, thisArg: undefined): void;
forEach<Z>(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => void, thisArg: Z): void;
/**
@ -3142,8 +3142,8 @@ interface Int32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: undefined, value: number, index: number, array: Int32Array) => number): Int32Array;
map(callbackfn: (this: undefined, value: number, index: number, array: Int32Array) => number, thisArg: undefined): Int32Array;
map(callbackfn: (this: void, value: number, index: number, array: Int32Array) => number): Int32Array;
map(callbackfn: (this: void, value: number, index: number, array: Int32Array) => number, thisArg: undefined): Int32Array;
map<Z>(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => number, thisArg: Z): Int32Array;
/**
@ -3228,8 +3228,8 @@ interface Int32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (this: undefined, value: number, index: number, array: Int32Array) => boolean): boolean;
some(callbackfn: (this: undefined, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Int32Array) => boolean, thisArg: undefined): boolean;
some<Z>(callbackfn: (this: Z, value: number, index: number, array: Int32Array) => boolean, thisArg: Z): boolean;
/**
@ -3283,8 +3283,8 @@ interface Int32ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number): Int32Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Int32Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number): Int32Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Int32Array;
from<Z>(arrayLike: ArrayLike<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Int32Array;
from(arrayLike: ArrayLike<number>): Int32Array;
@ -3335,8 +3335,8 @@ interface Uint32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (this: undefined, value: number, index: number, array: Uint32Array) => boolean): boolean;
every(callbackfn: (this: undefined, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean;
every<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): boolean;
/**
@ -3356,8 +3356,8 @@ interface Uint32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (this: undefined, value: number, index: number, array: Uint32Array) => any): Uint32Array;
filter(callbackfn: (this: undefined, value: number, index: number, array: Uint32Array) => any, thisArg: undefined): Uint32Array;
filter(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => any): Uint32Array;
filter(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => any, thisArg: undefined): Uint32Array;
filter<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => any, thisArg: Z): Uint32Array;
/**
@ -3369,8 +3369,8 @@ interface Uint32Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number | undefined;
/**
@ -3382,8 +3382,8 @@ interface Uint32Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number;
/**
@ -3393,8 +3393,8 @@ interface Uint32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (this: undefined, value: number, index: number, array: Uint32Array) => void): void;
forEach(callbackfn: (this: undefined, value: number, index: number, array: Uint32Array) => void, thisArg: undefined): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => void): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => void, thisArg: undefined): void;
forEach<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => void, thisArg: Z): void;
/**
@ -3433,8 +3433,8 @@ interface Uint32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: undefined, value: number, index: number, array: Uint32Array) => number): Uint32Array;
map(callbackfn: (this: undefined, value: number, index: number, array: Uint32Array) => number, thisArg: undefined): Uint32Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number): Uint32Array;
map(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => number, thisArg: undefined): Uint32Array;
map<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => number, thisArg: Z): Uint32Array;
/**
@ -3519,8 +3519,8 @@ interface Uint32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (this: undefined, value: number, index: number, array: Uint32Array) => boolean): boolean;
some(callbackfn: (this: undefined, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Uint32Array) => boolean, thisArg: undefined): boolean;
some<Z>(callbackfn: (this: Z, value: number, index: number, array: Uint32Array) => boolean, thisArg: Z): boolean;
/**
@ -3574,8 +3574,8 @@ interface Uint32ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number): Uint32Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Uint32Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number): Uint32Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Uint32Array;
from<Z>(arrayLike: ArrayLike<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Uint32Array;
from(arrayLike: ArrayLike<number>): Uint32Array;
@ -3626,8 +3626,8 @@ interface Float32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (this: undefined, value: number, index: number, array: Float32Array) => boolean): boolean;
every(callbackfn: (this: undefined, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean;
every<Z>(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): boolean;
/**
@ -3647,8 +3647,8 @@ interface Float32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (this: undefined, value: number, index: number, array: Float32Array) => any): Float32Array;
filter(callbackfn: (this: undefined, value: number, index: number, array: Float32Array) => any, thisArg: undefined): Float32Array;
filter(callbackfn: (this: void, value: number, index: number, array: Float32Array) => any): Float32Array;
filter(callbackfn: (this: void, value: number, index: number, array: Float32Array) => any, thisArg: undefined): Float32Array;
filter<Z>(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => any, thisArg: Z): Float32Array;
/**
@ -3660,8 +3660,8 @@ interface Float32Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number | undefined;
/**
@ -3673,8 +3673,8 @@ interface Float32Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number;
/**
@ -3684,8 +3684,8 @@ interface Float32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (this: undefined, value: number, index: number, array: Float32Array) => void): void;
forEach(callbackfn: (this: undefined, value: number, index: number, array: Float32Array) => void, thisArg: undefined): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Float32Array) => void): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Float32Array) => void, thisArg: undefined): void;
forEach<Z>(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => void, thisArg: Z): void;
/**
@ -3724,8 +3724,8 @@ interface Float32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: undefined, value: number, index: number, array: Float32Array) => number): Float32Array;
map(callbackfn: (this: undefined, value: number, index: number, array: Float32Array) => number, thisArg: undefined): Float32Array;
map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number): Float32Array;
map(callbackfn: (this: void, value: number, index: number, array: Float32Array) => number, thisArg: undefined): Float32Array;
map<Z>(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => number, thisArg: Z): Float32Array;
/**
@ -3810,8 +3810,8 @@ interface Float32Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (this: undefined, value: number, index: number, array: Float32Array) => boolean): boolean;
some(callbackfn: (this: undefined, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Float32Array) => boolean, thisArg: undefined): boolean;
some<Z>(callbackfn: (this: Z, value: number, index: number, array: Float32Array) => boolean, thisArg: Z): boolean;
/**
@ -3865,8 +3865,8 @@ interface Float32ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number): Float32Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Float32Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number): Float32Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float32Array;
from<Z>(arrayLike: ArrayLike<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float32Array;
from(arrayLike: ArrayLike<number>): Float32Array;
@ -3918,8 +3918,8 @@ interface Float64Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
every(callbackfn: (this: undefined, value: number, index: number, array: Float64Array) => boolean): boolean;
every(callbackfn: (this: undefined, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean;
every(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean;
every<Z>(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): boolean;
/**
@ -3939,8 +3939,8 @@ interface Float64Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
filter(callbackfn: (this: undefined, value: number, index: number, array: Float64Array) => any): Float64Array;
filter(callbackfn: (this: undefined, value: number, index: number, array: Float64Array) => any, thisArg: undefined): Float64Array;
filter(callbackfn: (this: void, value: number, index: number, array: Float64Array) => any): Float64Array;
filter(callbackfn: (this: void, value: number, index: number, array: Float64Array) => any, thisArg: undefined): Float64Array;
filter<Z>(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => any, thisArg: Z): Float64Array;
/**
@ -3952,8 +3952,8 @@ interface Float64Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number | undefined;
find(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number | undefined;
find<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number | undefined;
/**
@ -3965,8 +3965,8 @@ interface Float64Array {
* @param thisArg If provided, it will be used as the this value for each invocation of
* predicate. If it is not provided, undefined is used instead.
*/
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: undefined, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean): number;
findIndex(predicate: (this: void, value: number, index: number, obj: Array<number>) => boolean, thisArg: undefined): number;
findIndex<Z>(predicate: (this: Z, value: number, index: number, obj: Array<number>) => boolean, thisArg: Z): number;
/**
@ -3976,8 +3976,8 @@ interface Float64Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
forEach(callbackfn: (this: undefined, value: number, index: number, array: Float64Array) => void): void;
forEach(callbackfn: (this: undefined, value: number, index: number, array: Float64Array) => void, thisArg: undefined): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Float64Array) => void): void;
forEach(callbackfn: (this: void, value: number, index: number, array: Float64Array) => void, thisArg: undefined): void;
forEach<Z>(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => void, thisArg: Z): void;
/**
@ -4016,8 +4016,8 @@ interface Float64Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
map(callbackfn: (this: undefined, value: number, index: number, array: Float64Array) => number): Float64Array;
map(callbackfn: (this: undefined, value: number, index: number, array: Float64Array) => number, thisArg: undefined): Float64Array;
map(callbackfn: (this: void, value: number, index: number, array: Float64Array) => number): Float64Array;
map(callbackfn: (this: void, value: number, index: number, array: Float64Array) => number, thisArg: undefined): Float64Array;
map<Z>(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => number, thisArg: Z): Float64Array;
/**
@ -4102,8 +4102,8 @@ interface Float64Array {
* @param thisArg An object to which the this keyword can refer in the callbackfn function.
* If thisArg is omitted, undefined is used as the this value.
*/
some(callbackfn: (this: undefined, value: number, index: number, array: Float64Array) => boolean): boolean;
some(callbackfn: (this: undefined, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean): boolean;
some(callbackfn: (this: void, value: number, index: number, array: Float64Array) => boolean, thisArg: undefined): boolean;
some<Z>(callbackfn: (this: Z, value: number, index: number, array: Float64Array) => boolean, thisArg: Z): boolean;
/**
@ -4157,8 +4157,8 @@ interface Float64ArrayConstructor {
* @param mapfn A mapping function to call on every element of the array.
* @param thisArg Value of 'this' used to invoke the mapfn.
*/
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number): Float64Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: undefined, v: number, k: number) => number, thisArg: undefined): Float64Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number): Float64Array;
from(arrayLike: ArrayLike<number>, mapfn: (this: void, v: number, k: number) => number, thisArg: undefined): Float64Array;
from<Z>(arrayLike: ArrayLike<number>, mapfn: (this: Z, v: number, k: number) => number, thisArg: Z): Float64Array;
from(arrayLike: ArrayLike<number>): Float64Array;

View File

@ -54,13 +54,17 @@ interface MessageEventInit extends EventInit {
}
interface NotificationOptions {
dir?: string;
dir?: NotificationDirection;
lang?: string;
body?: string;
tag?: string;
icon?: string;
}
interface ObjectURLOptions {
oneTimeOnly?: boolean;
}
interface PushSubscriptionOptionsInit {
userVisibleOnly?: boolean;
applicationServerKey?: any;
@ -71,11 +75,11 @@ interface RequestInit {
headers?: any;
body?: any;
referrer?: string;
referrerPolicy?: string;
mode?: string;
credentials?: string;
cache?: string;
redirect?: string;
referrerPolicy?: ReferrerPolicy;
mode?: RequestMode;
credentials?: RequestCredentials;
cache?: RequestCache;
redirect?: RequestRedirect;
integrity?: string;
keepalive?: boolean;
window?: any;
@ -89,7 +93,7 @@ interface ResponseInit {
interface ClientQueryOptions {
includeUncontrolled?: boolean;
type?: string;
type?: ClientType;
}
interface ExtendableEventInit extends EventInit {
@ -399,9 +403,9 @@ declare var Event: {
}
interface EventTarget {
addEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
addEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
dispatchEvent(evt: Event): boolean;
removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
}
declare var EventTarget: {
@ -461,7 +465,7 @@ declare var Headers: {
}
interface IDBCursor {
readonly direction: string;
readonly direction: IDBCursorDirection;
key: IDBKeyRange | IDBValidKey;
readonly primaryKey: any;
source: IDBObjectStore | IDBIndex;
@ -613,7 +617,7 @@ interface IDBRequest extends EventTarget {
readonly error: DOMError;
onerror: (this: IDBRequest, ev: Event) => any;
onsuccess: (this: IDBRequest, ev: Event) => any;
readonly readyState: string;
readonly readyState: IDBRequestReadyState;
readonly result: any;
source: IDBObjectStore | IDBIndex | IDBCursor;
readonly transaction: IDBTransaction;
@ -635,7 +639,7 @@ interface IDBTransactionEventMap {
interface IDBTransaction extends EventTarget {
readonly db: IDBDatabase;
readonly error: DOMError;
readonly mode: string;
readonly mode: IDBTransactionMode;
onabort: (this: IDBTransaction, ev: Event) => any;
oncomplete: (this: IDBTransaction, ev: Event) => any;
onerror: (this: IDBTransaction, ev: Event) => any;
@ -728,14 +732,14 @@ interface NotificationEventMap {
interface Notification extends EventTarget {
readonly body: string;
readonly dir: string;
readonly dir: NotificationDirection;
readonly icon: string;
readonly lang: string;
onclick: (this: Notification, ev: Event) => any;
onclose: (this: Notification, ev: Event) => any;
onerror: (this: Notification, ev: Event) => any;
onshow: (this: Notification, ev: Event) => any;
readonly permission: string;
readonly permission: NotificationPermission;
readonly tag: string;
readonly title: string;
close(): void;
@ -746,7 +750,7 @@ interface Notification extends EventTarget {
declare var Notification: {
prototype: Notification;
new(title: string, options?: NotificationOptions): Notification;
requestPermission(callback?: NotificationPermissionCallback): Promise<string>;
requestPermission(callback?: NotificationPermissionCallback): Promise<NotificationPermission>;
}
interface Performance {
@ -863,7 +867,7 @@ declare var ProgressEvent: {
interface PushManager {
getSubscription(): Promise<PushSubscription>;
permissionState(options?: PushSubscriptionOptionsInit): Promise<string>;
permissionState(options?: PushSubscriptionOptionsInit): Promise<PushPermissionState>;
subscribe(options?: PushSubscriptionOptionsInit): Promise<PushSubscription>;
}
@ -875,7 +879,7 @@ declare var PushManager: {
interface PushSubscription {
readonly endpoint: USVString;
readonly options: PushSubscriptionOptions;
getKey(name: string): ArrayBuffer | null;
getKey(name: PushEncryptionKeyName): ArrayBuffer | null;
toJSON(): any;
unsubscribe(): Promise<boolean>;
}
@ -918,18 +922,18 @@ declare var ReadableStreamReader: {
}
interface Request extends Object, Body {
readonly cache: string;
readonly credentials: string;
readonly destination: string;
readonly cache: RequestCache;
readonly credentials: RequestCredentials;
readonly destination: RequestDestination;
readonly headers: Headers;
readonly integrity: string;
readonly keepalive: boolean;
readonly method: string;
readonly mode: string;
readonly redirect: string;
readonly mode: RequestMode;
readonly redirect: RequestRedirect;
readonly referrer: string;
readonly referrerPolicy: string;
readonly type: string;
readonly referrerPolicy: ReferrerPolicy;
readonly type: RequestType;
readonly url: string;
clone(): Request;
}
@ -945,7 +949,7 @@ interface Response extends Object, Body {
readonly ok: boolean;
readonly status: number;
readonly statusText: string;
readonly type: string;
readonly type: ResponseType;
readonly url: string;
clone(): Response;
}
@ -962,7 +966,7 @@ interface ServiceWorkerEventMap extends AbstractWorkerEventMap {
interface ServiceWorker extends EventTarget, AbstractWorker {
onstatechange: (this: ServiceWorker, ev: Event) => any;
readonly scriptURL: USVString;
readonly state: string;
readonly state: ServiceWorkerState;
postMessage(message: any, transfer?: any[]): void;
addEventListener<K extends keyof ServiceWorkerEventMap>(type: K, listener: (this: ServiceWorker, ev: ServiceWorkerEventMap[K]) => any, useCapture?: boolean): void;
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
@ -1008,6 +1012,29 @@ declare var SyncManager: {
new(): SyncManager;
}
interface URL {
hash: string;
host: string;
hostname: string;
href: string;
readonly origin: string;
password: string;
pathname: string;
port: string;
protocol: string;
search: string;
username: string;
readonly searchParams: URLSearchParams;
toString(): string;
}
declare var URL: {
prototype: URL;
new(url: string, base?: string): URL;
createObjectURL(object: any, options?: ObjectURLOptions): string;
revokeObjectURL(url: string): void;
}
interface WebSocketEventMap {
"close": CloseEvent;
"error": Event;
@ -1071,7 +1098,7 @@ interface XMLHttpRequest extends EventTarget, XMLHttpRequestEventTarget {
readonly readyState: number;
readonly response: any;
readonly responseText: string;
responseType: string;
responseType: XMLHttpRequestResponseType;
readonly responseURL: string;
readonly responseXML: any;
readonly status: number;
@ -1222,7 +1249,7 @@ interface XMLHttpRequestEventTarget {
}
interface Client {
readonly frameType: string;
readonly frameType: FrameType;
readonly id: string;
readonly url: USVString;
postMessage(message: any, transfer?: any[]): void;
@ -1385,7 +1412,7 @@ declare var SyncEvent: {
interface WindowClient extends Client {
readonly focused: boolean;
readonly visibilityState: string;
readonly visibilityState: VisibilityState;
focus(): Promise<WindowClient>;
navigate(url: USVString): Promise<WindowClient>;
}
@ -1484,6 +1511,41 @@ interface ImageBitmap {
close(): void;
}
interface URLSearchParams {
/**
* Appends a specified key/value pair as a new search parameter.
*/
append(name: string, value: string): void;
/**
* Deletes the given search parameter, and its associated value, from the list of all search parameters.
*/
delete(name: string): void;
/**
* Returns the first value associated to the given search parameter.
*/
get(name: string): string | null;
/**
* Returns all the values association with a given search parameter.
*/
getAll(name: string): string[];
/**
* Returns a Boolean indicating if such a search parameter exists.
*/
has(name: string): boolean;
/**
* Sets the value associated to a given search parameter to the given value. If there were several values, delete the others.
*/
set(name: string, value: string): void;
}
declare var URLSearchParams: {
prototype: URLSearchParams;
/**
* Constructor returning a URLSearchParams object.
*/
new (init?: string | URLSearchParams): URLSearchParams;
}
interface BlobPropertyBag {
type?: string;
endings?: string;
@ -1678,6 +1740,15 @@ interface JsonWebKey {
k?: string;
}
interface EventListenerOptions {
capture?: boolean;
}
interface AddEventListenerOptions extends EventListenerOptions {
passive?: boolean;
once?: boolean;
}
declare type EventListenerOrEventListenerObject = EventListener | EventListenerObject;
interface ErrorEventHandler {
@ -1699,10 +1770,10 @@ interface FunctionStringCallback {
(data: string): void;
}
interface ForEachCallback {
(keyId: any, status: string): void;
(keyId: any, status: MediaKeyStatus): void;
}
interface NotificationPermissionCallback {
(permission: string): void;
(permission: NotificationPermission): void;
}
declare var onmessage: (this: DedicatedWorkerGlobalScope, ev: MessageEvent) => any;
declare function close(): void;
@ -1717,7 +1788,7 @@ declare function msWriteProfilerMark(profilerMarkName: string): void;
declare function createImageBitmap(image: ImageBitmap | ImageData | Blob, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function createImageBitmap(image: ImageBitmap | ImageData | Blob, sx: number, sy: number, sw: number, sh: number, options?: ImageBitmapOptions): Promise<ImageBitmap>;
declare function dispatchEvent(evt: Event): boolean;
declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
declare var indexedDB: IDBFactory;
declare var msIndexedDB: IDBFactory;
declare var navigator: WorkerNavigator;
@ -1736,7 +1807,7 @@ declare function btoa(rawString: string): string;
declare var console: Console;
declare function fetch(input: RequestInfo, init?: RequestInit): Promise<Response>;
declare function dispatchEvent(evt: Event): boolean;
declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, useCapture?: boolean): void;
declare function removeEventListener(type: string, listener?: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
declare function addEventListener<K extends keyof DedicatedWorkerGlobalScopeEventMap>(type: K, listener: (this: DedicatedWorkerGlobalScope, ev: DedicatedWorkerGlobalScopeEventMap[K]) => any, useCapture?: boolean): void;
declare function addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean): void;
type AlgorithmIdentifier = string | Algorithm;
@ -1745,4 +1816,26 @@ type IDBKeyPath = string;
type RequestInfo = Request | string;
type USVString = string;
type IDBValidKey = number | string | Date | IDBArrayKey;
type BufferSource = ArrayBuffer | ArrayBufferView;
type BufferSource = ArrayBuffer | ArrayBufferView;
type FormDataEntryValue = string | File;
type IDBCursorDirection = "next" | "nextunique" | "prev" | "prevunique";
type IDBRequestReadyState = "pending" | "done";
type IDBTransactionMode = "readonly" | "readwrite" | "versionchange";
type MediaKeyStatus = "usable" | "expired" | "output-downscaled" | "output-not-allowed" | "status-pending" | "internal-error";
type NotificationDirection = "auto" | "ltr" | "rtl";
type NotificationPermission = "default" | "denied" | "granted";
type PushEncryptionKeyName = "p256dh" | "auth";
type PushPermissionState = "granted" | "denied" | "prompt";
type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "origin-only" | "origin-when-cross-origin" | "unsafe-url";
type RequestCache = "default" | "no-store" | "reload" | "no-cache" | "force-cache";
type RequestCredentials = "omit" | "same-origin" | "include";
type RequestDestination = "" | "document" | "sharedworker" | "subresource" | "unknown" | "worker";
type RequestMode = "navigate" | "same-origin" | "no-cors" | "cors";
type RequestRedirect = "follow" | "error" | "manual";
type RequestType = "" | "audio" | "font" | "image" | "script" | "style" | "track" | "video";
type ResponseType = "basic" | "cors" | "default" | "error" | "opaque" | "opaqueredirect";
type ServiceWorkerState = "installing" | "installed" | "activating" | "activated" | "redundant";
type VisibilityState = "hidden" | "visible" | "prerender" | "unloaded";
type XMLHttpRequestResponseType = "" | "arraybuffer" | "blob" | "document" | "json" | "text";
type ClientType = "window" | "worker" | "sharedworker" | "all";
type FrameType = "auxiliary" | "top-level" | "nested" | "none";

View File

@ -257,7 +257,7 @@ namespace ts.server {
startWatchingContainingDirectoriesForFile(fileName: string, project: InferredProject, callback: (fileName: string) => void) {
let currentPath = getDirectoryPath(fileName);
let parentPath = getDirectoryPath(currentPath);
while (currentPath != parentPath) {
while (currentPath !== parentPath) {
if (!this.directoryWatchersForTsconfig.has(currentPath)) {
this.projectService.logger.info(`Add watcher for: ${currentPath}`);
this.directoryWatchersForTsconfig.set(currentPath, this.projectService.host.watchDirectory(currentPath, callback));
@ -273,6 +273,18 @@ namespace ts.server {
}
}
export interface ProjectServiceOptions {
host: ServerHost;
logger: Logger;
cancellationToken: HostCancellationToken;
useSingleInferredProject: boolean;
typingsInstaller: ITypingsInstaller;
eventHandler?: ProjectServiceEventHandler;
throttleWaitMilliseconds?: number;
globalPlugins?: string[];
pluginProbeLocations?: string[];
}
export class ProjectService {
public readonly typingsCache: TypingsCache;
@ -320,19 +332,33 @@ namespace ts.server {
public lastDeletedFile: ScriptInfo;
constructor(public readonly host: ServerHost,
public readonly logger: Logger,
public readonly cancellationToken: HostCancellationToken,
public readonly useSingleInferredProject: boolean,
readonly typingsInstaller: ITypingsInstaller = nullTypingsInstaller,
private readonly eventHandler?: ProjectServiceEventHandler,
public readonly throttleWaitMilliseconds?: number) {
public readonly host: ServerHost;
public readonly logger: Logger;
public readonly cancellationToken: HostCancellationToken;
public readonly useSingleInferredProject: boolean;
public readonly typingsInstaller: ITypingsInstaller;
public readonly throttleWaitMilliseconds?: number;
private readonly eventHandler?: ProjectServiceEventHandler;
Debug.assert(!!host.createHash, "'ServerHost.createHash' is required for ProjectService");
public readonly globalPlugins: ReadonlyArray<string>;
public readonly pluginProbeLocations: ReadonlyArray<string>;
this.toCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames);
constructor(opts: ProjectServiceOptions) {
this.host = opts.host;
this.logger = opts.logger;
this.cancellationToken = opts.cancellationToken;
this.useSingleInferredProject = opts.useSingleInferredProject;
this.typingsInstaller = opts.typingsInstaller || nullTypingsInstaller;
this.throttleWaitMilliseconds = opts.throttleWaitMilliseconds;
this.eventHandler = opts.eventHandler;
this.globalPlugins = opts.globalPlugins || emptyArray;
this.pluginProbeLocations = opts.pluginProbeLocations || emptyArray;
Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService");
this.toCanonicalFileName = createGetCanonicalFileName(this.host.useCaseSensitiveFileNames);
this.directoryWatchers = new DirectoryWatchers(this);
this.throttledOperations = new ThrottledOperations(host);
this.throttledOperations = new ThrottledOperations(this.host);
this.typingsInstaller.attach(this);
@ -344,7 +370,7 @@ namespace ts.server {
extraFileExtensions: []
};
this.documentRegistry = createDocumentRegistry(host.useCaseSensitiveFileNames, host.getCurrentDirectory());
this.documentRegistry = createDocumentRegistry(this.host.useCaseSensitiveFileNames, this.host.getCurrentDirectory());
}
/* @internal */
@ -592,7 +618,7 @@ namespace ts.server {
*/
private onConfigFileAddedForInferredProject(fileName: string) {
// TODO: check directory separators
if (getBaseFileName(fileName) != "tsconfig.json") {
if (getBaseFileName(fileName) !== "tsconfig.json") {
this.logger.info(`${fileName} is not tsconfig.json`);
return;
}
@ -1007,7 +1033,7 @@ namespace ts.server {
const scriptKind = propertyReader.getScriptKind(f);
const hasMixedContent = propertyReader.hasMixedContent(f, this.hostConfiguration.extraFileExtensions);
if (this.host.fileExists(rootFilename)) {
const info = this.getOrCreateScriptInfoForNormalizedPath(toNormalizedPath(rootFilename), /*openedByClient*/ clientFileName == rootFilename, /*fileContent*/ undefined, scriptKind, hasMixedContent);
const info = this.getOrCreateScriptInfoForNormalizedPath(toNormalizedPath(rootFilename), /*openedByClient*/ clientFileName === rootFilename, /*fileContent*/ undefined, scriptKind, hasMixedContent);
project.addRoot(info);
}
else {

View File

@ -643,7 +643,7 @@ namespace ts.server {
// check if requested version is the same that we have reported last time
if (this.lastReportedFileNames && lastKnownVersion === this.lastReportedVersion) {
// if current structure version is the same - return info without any changes
if (this.projectStructureVersion == this.lastReportedVersion && !updatedFileNames) {
if (this.projectStructureVersion === this.lastReportedVersion && !updatedFileNames) {
return { info, projectErrors: this.projectErrors };
}
// compute and return the difference
@ -843,7 +843,7 @@ namespace ts.server {
/** Used for configured projects which may have multiple open roots */
openRefCount = 0;
constructor(private configFileName: NormalizedPath,
constructor(configFileName: NormalizedPath,
projectService: ProjectService,
documentRegistry: ts.DocumentRegistry,
hasExplicitListOfFiles: boolean,
@ -863,28 +863,48 @@ namespace ts.server {
enablePlugins() {
const host = this.projectService.host;
const options = this.getCompilerOptions();
const log = (message: string) => {
this.projectService.logger.info(message);
};
if (!(options.plugins && options.plugins.length)) {
this.projectService.logger.info("No plugins exist");
// No plugins
return;
}
if (!host.require) {
this.projectService.logger.info("Plugins were requested but not running in environment that supports 'require'. Nothing will be loaded");
return;
}
for (const pluginConfigEntry of options.plugins) {
const searchPath = getDirectoryPath(this.configFileName);
const resolvedModule = <PluginModuleFactory>Project.resolveModule(pluginConfigEntry.name, searchPath, host, log);
if (resolvedModule) {
this.enableProxy(resolvedModule, pluginConfigEntry);
// Search our peer node_modules, then any globally-specified probe paths
// ../../.. to walk from X/node_modules/typescript/lib/tsserver.js to X/node_modules/
const searchPaths = [combinePaths(host.getExecutingFilePath(), "../../.."), ...this.projectService.pluginProbeLocations];
// Enable tsconfig-specified plugins
if (options.plugins) {
for (const pluginConfigEntry of options.plugins) {
this.enablePlugin(pluginConfigEntry, searchPaths);
}
}
if (this.projectService.globalPlugins) {
// Enable global plugins with synthetic configuration entries
for (const globalPluginName of this.projectService.globalPlugins) {
// Skip already-locally-loaded plugins
if (options.plugins && options.plugins.some(p => p.name === globalPluginName)) continue;
// Provide global: true so plugins can detect why they can't find their config
this.enablePlugin({ name: globalPluginName, global: true } as PluginImport, searchPaths);
}
}
}
private enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[]) {
const log = (message: string) => {
this.projectService.logger.info(message);
};
for (const searchPath of searchPaths) {
const resolvedModule = <PluginModuleFactory>Project.resolveModule(pluginConfigEntry.name, searchPath, this.projectService.host, log);
if (resolvedModule) {
this.enableProxy(resolvedModule, pluginConfigEntry);
return;
}
}
this.projectService.logger.info(`Couldn't find ${pluginConfigEntry.name} anywhere in paths: ${searchPaths.join(",")}`);
}
private enableProxy(pluginModuleFactory: PluginModuleFactory, configEntry: PluginImport) {

View File

@ -79,7 +79,7 @@ namespace ts.server {
const lm = LineIndex.linesFromText(insertedText);
const lines = lm.lines;
if (lines.length > 1) {
if (lines[lines.length - 1] == "") {
if (lines[lines.length - 1] === "") {
lines.length--;
}
}
@ -570,7 +570,7 @@ namespace ts.server {
}
if (this.checkEdits) {
const updatedText = this.getText(0, this.root.charCount());
Debug.assert(checkText == updatedText, "buffer edit mismatch");
Debug.assert(checkText === updatedText, "buffer edit mismatch");
}
return walker.lineIndex;
}

View File

@ -3,6 +3,20 @@
/// <reference path="session.ts" />
namespace ts.server {
interface IOSessionOptions {
host: ServerHost;
cancellationToken: ServerCancellationToken;
canUseEvents: boolean;
installerEventPort: number;
useSingleInferredProject: boolean;
disableAutomaticTypingAcquisition: boolean;
globalTypingsCacheLocation: string;
logger: Logger;
typingSafeListLocation: string;
telemetryEnabled: boolean;
globalPlugins: string[];
pluginProbeLocations: string[];
}
const net: {
connect(options: { port: number }, onConnect?: () => void): NodeSocket
@ -366,41 +380,34 @@ namespace ts.server {
}
this.projectService.updateTypingsForProject(response);
if (response.kind == ActionSet && this.socket) {
if (response.kind === ActionSet && this.socket) {
this.sendEvent(0, "setTypings", response);
}
}
}
class IOSession extends Session {
constructor(
host: ServerHost,
cancellationToken: ServerCancellationToken,
installerEventPort: number,
canUseEvents: boolean,
useSingleInferredProject: boolean,
disableAutomaticTypingAcquisition: boolean,
globalTypingsCacheLocation: string,
typingSafeListLocation: string,
telemetryEnabled: boolean,
logger: server.Logger) {
const typingsInstaller = disableAutomaticTypingAcquisition
? undefined
: new NodeTypingsInstaller(telemetryEnabled, logger, host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, host.newLine);
constructor(options: IOSessionOptions) {
const { host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, canUseEvents } = options;
const typingsInstaller = disableAutomaticTypingAcquisition
? undefined
: new NodeTypingsInstaller(telemetryEnabled, logger, host, installerEventPort, globalTypingsCacheLocation, typingSafeListLocation, host.newLine);
super(
host,
cancellationToken,
useSingleInferredProject,
typingsInstaller || nullTypingsInstaller,
Buffer.byteLength,
process.hrtime,
logger,
canUseEvents);
super({
host,
cancellationToken,
useSingleInferredProject,
typingsInstaller: typingsInstaller || nullTypingsInstaller,
byteLength: Buffer.byteLength,
hrtime: process.hrtime,
logger,
canUseEvents,
globalPlugins: options.globalPlugins,
pluginProbeLocations: options.pluginProbeLocations});
if (telemetryEnabled && typingsInstaller) {
typingsInstaller.setTelemetrySender(this);
}
if (telemetryEnabled && typingsInstaller) {
typingsInstaller.setTelemetrySender(this);
}
}
exit() {
@ -735,21 +742,29 @@ namespace ts.server {
const typingSafeListLocation = findArgument("--typingSafeListLocation");
const globalPlugins = (findArgument("--globalPlugins") || "").split(",");
const pluginProbeLocations = (findArgument("--pluginProbeLocations") || "").split(",");
const useSingleInferredProject = hasArgument("--useSingleInferredProject");
const disableAutomaticTypingAcquisition = hasArgument("--disableAutomaticTypingAcquisition");
const telemetryEnabled = hasArgument(Arguments.EnableTelemetry);
const ioSession = new IOSession(
sys,
const options: IOSessionOptions = {
host: sys,
cancellationToken,
eventPort,
/*canUseEvents*/ eventPort === undefined,
installerEventPort: eventPort,
canUseEvents: eventPort === undefined,
useSingleInferredProject,
disableAutomaticTypingAcquisition,
getGlobalTypingsCacheLocation(),
globalTypingsCacheLocation: getGlobalTypingsCacheLocation(),
typingSafeListLocation,
telemetryEnabled,
logger);
logger,
globalPlugins,
pluginProbeLocations
};
const ioSession = new IOSession(options);
process.on("uncaughtException", function (err: Error) {
ioSession.logError(err, "unknown");
});

View File

@ -49,7 +49,7 @@ namespace ts.server {
if (a.file < b.file) {
return -1;
}
else if (a.file == b.file) {
else if (a.file === b.file) {
const n = compareNumber(a.start.line, b.start.line);
if (n === 0) {
return compareNumber(a.start.offset, b.start.offset);
@ -319,6 +319,22 @@ namespace ts.server {
}
}
export interface SessionOptions {
host: ServerHost;
cancellationToken: ServerCancellationToken;
useSingleInferredProject: boolean;
typingsInstaller: ITypingsInstaller;
byteLength: (buf: string, encoding?: string) => number;
hrtime: (start?: number[]) => number[];
logger: Logger;
canUseEvents: boolean;
eventHandler?: ProjectServiceEventHandler;
throttleWaitMilliseconds?: number;
globalPlugins?: string[];
pluginProbeLocations?: string[];
}
export class Session implements EventSender {
private readonly gcTimer: GcTimer;
protected projectService: ProjectService;
@ -327,22 +343,29 @@ namespace ts.server {
private currentRequestId: number;
private errorCheck: MultistepOperation;
private eventHander: ProjectServiceEventHandler;
private eventHandler: ProjectServiceEventHandler;
constructor(
private host: ServerHost,
private readonly cancellationToken: ServerCancellationToken,
useSingleInferredProject: boolean,
protected readonly typingsInstaller: ITypingsInstaller,
private byteLength: (buf: string, encoding?: string) => number,
private hrtime: (start?: number[]) => number[],
protected logger: Logger,
protected readonly canUseEvents: boolean,
eventHandler?: ProjectServiceEventHandler,
private readonly throttleWaitMilliseconds?: number) {
private host: ServerHost;
private readonly cancellationToken: ServerCancellationToken;
protected readonly typingsInstaller: ITypingsInstaller;
private byteLength: (buf: string, encoding?: string) => number;
private hrtime: (start?: number[]) => number[];
protected logger: Logger;
private canUseEvents: boolean;
this.eventHander = canUseEvents
? eventHandler || (event => this.defaultEventHandler(event))
constructor(opts: SessionOptions) {
this.host = opts.host;
this.cancellationToken = opts.cancellationToken;
this.typingsInstaller = opts.typingsInstaller;
this.byteLength = opts.byteLength;
this.hrtime = opts.hrtime;
this.logger = opts.logger;
this.canUseEvents = opts.canUseEvents;
const { throttleWaitMilliseconds } = opts;
this.eventHandler = this.canUseEvents
? opts.eventHandler || (event => this.defaultEventHandler(event))
: undefined;
const multistepOperationHost: MultistepOperationHost = {
@ -351,11 +374,22 @@ namespace ts.server {
getServerHost: () => this.host,
logError: (err, cmd) => this.logError(err, cmd),
sendRequestCompletedEvent: requestId => this.sendRequestCompletedEvent(requestId),
isCancellationRequested: () => cancellationToken.isCancellationRequested()
isCancellationRequested: () => this.cancellationToken.isCancellationRequested()
};
this.errorCheck = new MultistepOperation(multistepOperationHost);
this.projectService = new ProjectService(host, logger, cancellationToken, useSingleInferredProject, typingsInstaller, this.eventHander, this.throttleWaitMilliseconds);
this.gcTimer = new GcTimer(host, /*delay*/ 7000, logger);
const settings: ProjectServiceOptions = {
host: this.host,
logger: this.logger,
cancellationToken: this.cancellationToken,
useSingleInferredProject: opts.useSingleInferredProject,
typingsInstaller: this.typingsInstaller,
throttleWaitMilliseconds,
eventHandler: this.eventHandler,
globalPlugins: opts.globalPlugins,
pluginProbeLocations: opts.pluginProbeLocations
};
this.projectService = new ProjectService(settings);
this.gcTimer = new GcTimer(this.host, /*delay*/ 7000, this.logger);
}
private sendRequestCompletedEvent(requestId: number): void {
@ -947,8 +981,8 @@ namespace ts.server {
*/
private openClientFile(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind) {
const { configFileName, configFileErrors } = this.projectService.openClientFileWithNormalizedPath(fileName, fileContent, scriptKind);
if (this.eventHander) {
this.eventHander({
if (this.eventHandler) {
this.eventHandler({
eventName: "configFileDiag",
data: { triggerFile: fileName, configFileName, diagnostics: configFileErrors || [] }
});
@ -1094,7 +1128,7 @@ namespace ts.server {
// getFormattingEditsAfterKeystroke either empty or pertaining
// only to the previous line. If all this is true, then
// add edits necessary to properly indent the current line.
if ((args.key == "\n") && ((!edits) || (edits.length === 0) || allEditsBeforePos(edits, position))) {
if ((args.key === "\n") && ((!edits) || (edits.length === 0) || allEditsBeforePos(edits, position))) {
const lineInfo = scriptInfo.getLineInfo(args.line);
if (lineInfo && (lineInfo.leaf) && (lineInfo.leaf.text)) {
const lineText = lineInfo.leaf.text;
@ -1103,10 +1137,10 @@ namespace ts.server {
let hasIndent = 0;
let i: number, len: number;
for (i = 0, len = lineText.length; i < len; i++) {
if (lineText.charAt(i) == " ") {
if (lineText.charAt(i) === " ") {
hasIndent++;
}
else if (lineText.charAt(i) == "\t") {
else if (lineText.charAt(i) === "\t") {
hasIndent += formatOptions.tabSize;
}
else {
@ -1509,7 +1543,7 @@ namespace ts.server {
const normalizedFileName = toNormalizedPath(fileName);
const project = this.projectService.getDefaultProjectForFile(normalizedFileName, /*refreshInferredProjects*/ true);
for (const fileNameInProject of fileNamesInProject) {
if (this.getCanonicalFileName(fileNameInProject) == this.getCanonicalFileName(fileName))
if (this.getCanonicalFileName(fileNameInProject) === this.getCanonicalFileName(fileName))
highPriorityFiles.push(fileNameInProject);
else {
const info = this.projectService.getScriptInfo(fileNameInProject);
@ -1530,7 +1564,7 @@ namespace ts.server {
const checkList = fileNamesInProject.map(fileName => ({ fileName, project }));
// Project level error analysis runs on background files too, therefore
// doesn't require the file to be opened
this.updateErrorCheck(next, checkList, this.changeSeq, (n) => n == this.changeSeq, delay, 200, /*requireOpen*/ false);
this.updateErrorCheck(next, checkList, this.changeSeq, (n) => n === this.changeSeq, delay, 200, /*requireOpen*/ false);
}
}

View File

@ -61,7 +61,7 @@ namespace ts.server {
function compilerOptionsChanged(opt1: CompilerOptions, opt2: CompilerOptions): boolean {
// TODO: add more relevant properties
return opt1.allowJs != opt2.allowJs;
return opt1.allowJs !== opt2.allowJs;
}
function unresolvedImportsChanged(imports1: SortedReadonlyArray<string>, imports2: SortedReadonlyArray<string>): boolean {

View File

@ -31,7 +31,7 @@ namespace ts.server.typingsInstaller {
}
function getNPMLocation(processName: string) {
if (path.basename(processName).indexOf("node") == 0) {
if (path.basename(processName).indexOf("node") === 0) {
return `"${path.join(path.dirname(process.argv[0]), "npm")}"`;
}
else {

View File

@ -219,7 +219,7 @@ namespace ts.server {
}
public scheduleCollect() {
if (!this.host.gc || this.timerId != undefined) {
if (!this.host.gc || this.timerId !== undefined) {
// no global.gc or collection was already scheduled - skip this request
return;
}

View File

@ -265,7 +265,7 @@ namespace ts.BreakpointResolver {
// a or ...c or d: x from
// [a, b, ...c] or { a, b } or { d: x } from destructuring pattern
if ((node.kind === SyntaxKind.Identifier ||
node.kind == SyntaxKind.SpreadElement ||
node.kind === SyntaxKind.SpreadElement ||
node.kind === SyntaxKind.PropertyAssignment ||
node.kind === SyntaxKind.ShorthandPropertyAssignment) &&
isArrayLiteralOrObjectLiteralDestructuringPattern(node.parent)) {

View File

@ -14,7 +14,7 @@ namespace ts.codefix {
// ^^^^^^^
const token = getTokenAtPosition(sourceFile, start);
if (token.kind != SyntaxKind.Identifier) {
if (token.kind !== SyntaxKind.Identifier) {
return undefined;
}

View File

@ -18,7 +18,7 @@ namespace ts.codefix {
// figure out if the `this` access is actually inside the supercall
// i.e. super(this.a), since in that case we won't suggest a fix
if (superCall.expression && superCall.expression.kind == SyntaxKind.CallExpression) {
if (superCall.expression && superCall.expression.kind === SyntaxKind.CallExpression) {
const arguments = (<CallExpression>superCall.expression).arguments;
for (let i = 0; i < arguments.length; i++) {
if ((<PropertyAccessExpression>arguments[i]).expression === token) {

View File

@ -127,7 +127,7 @@ namespace ts.codefix {
case SyntaxKind.NamespaceImport:
const namespaceImport = <NamespaceImport>token.parent;
if (namespaceImport.name == token && !(<ImportClause>namespaceImport.parent).name) {
if (namespaceImport.name === token && !(<ImportClause>namespaceImport.parent).name) {
const importDecl = getAncestor(namespaceImport, SyntaxKind.ImportDeclaration);
return deleteNode(importDecl);
}

View File

@ -1311,7 +1311,7 @@ namespace ts.Completions {
}
function isEqualityOperatorKind(kind: SyntaxKind) {
return kind == SyntaxKind.EqualsEqualsToken ||
return kind === SyntaxKind.EqualsEqualsToken ||
kind === SyntaxKind.ExclamationEqualsToken ||
kind === SyntaxKind.EqualsEqualsEqualsToken ||
kind === SyntaxKind.ExclamationEqualsEqualsToken;

View File

@ -17,34 +17,22 @@ namespace ts.DocumentHighlights {
}
function getSemanticDocumentHighlights(node: Node, typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFilesToSearch: SourceFile[]): DocumentHighlights[] {
const context = new FindAllReferences.DefaultFindReferencesContext(typeChecker, cancellationToken);
const referencedSymbols = FindAllReferences.getReferencedSymbolsForNode(context, node, sourceFilesToSearch);
return referencedSymbols && convertReferencedSymbols(referencedSymbols);
const referenceEntries = FindAllReferences.getReferenceEntriesForNode(node, sourceFilesToSearch, typeChecker, cancellationToken);
return referenceEntries && convertReferencedSymbols(referenceEntries);
}
function convertReferencedSymbols(referencedSymbols: ReferencedSymbol[]): DocumentHighlights[] {
const fileNameToDocumentHighlights = createMap<DocumentHighlights>();
const result: DocumentHighlights[] = [];
for (const referencedSymbol of referencedSymbols) {
for (const referenceEntry of referencedSymbol.references) {
const fileName = referenceEntry.fileName;
let documentHighlights = fileNameToDocumentHighlights.get(fileName);
if (!documentHighlights) {
documentHighlights = { fileName, highlightSpans: [] };
fileNameToDocumentHighlights.set(fileName, documentHighlights);
result.push(documentHighlights);
}
documentHighlights.highlightSpans.push({
textSpan: referenceEntry.textSpan,
kind: referenceEntry.isWriteAccess ? HighlightSpanKind.writtenReference : HighlightSpanKind.reference,
isInString: referenceEntry.isInString
});
function convertReferencedSymbols(referenceEntries: FindAllReferences.Entry[]): DocumentHighlights[] {
const fileNameToDocumentHighlights = createMap<HighlightSpan[]>();
for (const entry of referenceEntries) {
const { fileName, span } = FindAllReferences.toHighlightSpan(entry);
let highlightSpans = fileNameToDocumentHighlights.get(fileName);
if (!highlightSpans) {
fileNameToDocumentHighlights.set(fileName, highlightSpans = []);
}
highlightSpans.push(span);
}
return result;
return arrayFrom(fileNameToDocumentHighlights.entries(), ([fileName, highlightSpans ]) => ({ fileName, highlightSpans }));
}
function getSyntacticDocumentHighlights(node: Node, sourceFile: SourceFile): DocumentHighlights[] {

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,567 @@
/* Code for finding imports of an exported symbol. Used only by FindAllReferences. */
/* @internal */
namespace ts.FindAllReferences {
export interface ImportsResult {
/** For every import of the symbol, the location and local symbol for the import. */
importSearches: Array<[Identifier, Symbol]>;
/** For rename imports/exports `{ foo as bar }`, `foo` is not a local, so it may be added as a reference immediately without further searching. */
singleReferences: Identifier[];
/** List of source files that may (or may not) use the symbol via a namespace. (For UMD modules this is every file.) */
indirectUsers: SourceFile[];
}
export type ImportTracker = (exportSymbol: Symbol, exportInfo: ExportInfo, isForRename: boolean) => ImportsResult;
/** Creates the imports map and returns an ImportTracker that uses it. Call this lazily to avoid calling `getDirectImportsMap` unnecessarily. */
export function createImportTracker(sourceFiles: SourceFile[], checker: TypeChecker, cancellationToken: CancellationToken): ImportTracker {
const allDirectImports = getDirectImportsMap(sourceFiles, checker, cancellationToken);
return (exportSymbol, exportInfo, isForRename) => {
const { directImports, indirectUsers } = getImportersForExport(sourceFiles, allDirectImports, exportInfo, checker, cancellationToken);
return { indirectUsers, ...getSearchesFromDirectImports(directImports, exportSymbol, exportInfo.exportKind, checker, isForRename) };
};
}
/** Info about an exported symbol to perform recursive search on. */
export interface ExportInfo {
exportingModuleSymbol: Symbol;
exportKind: ExportKind;
}
export const enum ExportKind { Named, Default, ExportEquals }
export const enum ImportExport { Import, Export }
interface AmbientModuleDeclaration extends ModuleDeclaration { body?: ModuleBlock; }
type SourceFileLike = SourceFile | AmbientModuleDeclaration;
// Identifier for the case of `const x = require("y")`.
type Importer = AnyImportSyntax | Identifier | ExportDeclaration;
type ImporterOrCallExpression = Importer | CallExpression;
/** Returns import statements that directly reference the exporting module, and a list of files that may access the module through a namespace. */
function getImportersForExport(
sourceFiles: SourceFile[],
allDirectImports: Map<ImporterOrCallExpression[]>,
{ exportingModuleSymbol, exportKind }: ExportInfo,
checker: TypeChecker,
cancellationToken: CancellationToken
): { directImports: Importer[], indirectUsers: SourceFile[] } {
const markSeenDirectImport = nodeSeenTracker<ImporterOrCallExpression>();
const markSeenIndirectUser = nodeSeenTracker<SourceFileLike>();
const directImports: Importer[] = [];
const isAvailableThroughGlobal = !!exportingModuleSymbol.globalExports;
const indirectUserDeclarations: SourceFileLike[] = isAvailableThroughGlobal ? undefined : [];
handleDirectImports(exportingModuleSymbol);
return { directImports, indirectUsers: getIndirectUsers() };
function getIndirectUsers(): SourceFile[] {
if (isAvailableThroughGlobal) {
// It has `export as namespace`, so anything could potentially use it.
return sourceFiles;
}
// Module augmentations may use this module's exports without importing it.
for (const decl of exportingModuleSymbol.declarations) {
if (isExternalModuleAugmentation(decl)) {
addIndirectUser(decl as SourceFileLike);
}
}
// This may return duplicates (if there are multiple module declarations in a single source file, all importing the same thing as a namespace), but `State.markSearchedSymbol` will handle that.
return indirectUserDeclarations.map(getSourceFileOfNode);
}
function handleDirectImports(exportingModuleSymbol: Symbol): void {
const theseDirectImports = getDirectImports(exportingModuleSymbol);
if (theseDirectImports) for (const direct of theseDirectImports) {
if (!markSeenDirectImport(direct)) {
continue;
}
cancellationToken.throwIfCancellationRequested();
switch (direct.kind) {
case SyntaxKind.CallExpression:
if (!isAvailableThroughGlobal) {
const parent = direct.parent!;
if (exportKind === ExportKind.ExportEquals && parent.kind === SyntaxKind.VariableDeclaration) {
const { name } = parent as ts.VariableDeclaration;
if (name.kind === SyntaxKind.Identifier) {
directImports.push(name);
break;
}
}
// Don't support re-exporting 'require()' calls, so just add a single indirect user.
addIndirectUser(direct.getSourceFile());
}
break;
case SyntaxKind.ImportEqualsDeclaration:
handleNamespaceImport(direct, direct.name, hasModifier(direct, ModifierFlags.Export));
break;
case SyntaxKind.ImportDeclaration:
const namedBindings = direct.importClause && direct.importClause.namedBindings;
if (namedBindings && namedBindings.kind === SyntaxKind.NamespaceImport) {
handleNamespaceImport(direct, namedBindings.name);
}
else {
directImports.push(direct);
}
break;
case SyntaxKind.ExportDeclaration:
if (!direct.exportClause) {
// This is `export * from "foo"`, so imports of this module may import the export too.
handleDirectImports(getContainingModuleSymbol(direct, checker));
}
else {
// This is `export { foo } from "foo"` and creates an alias symbol, so recursive search will get handle re-exports.
directImports.push(direct);
}
break;
}
}
}
function handleNamespaceImport(importDeclaration: ImportEqualsDeclaration | ImportDeclaration, name: Identifier, isReExport?: boolean): void {
if (exportKind === ExportKind.ExportEquals) {
// This is a direct import, not import-as-namespace.
directImports.push(importDeclaration);
}
else if (!isAvailableThroughGlobal) {
const sourceFileLike = getSourceFileLikeForImportDeclaration(importDeclaration);
Debug.assert(sourceFileLike.kind === SyntaxKind.SourceFile || sourceFileLike.kind === SyntaxKind.ModuleDeclaration);
if (isReExport || findNamespaceReExports(sourceFileLike, name, checker)) {
addIndirectUsers(sourceFileLike);
}
else {
addIndirectUser(sourceFileLike);
}
}
}
function addIndirectUser(sourceFileLike: SourceFileLike): boolean {
Debug.assert(!isAvailableThroughGlobal);
const isNew = markSeenIndirectUser(sourceFileLike);
if (isNew) {
indirectUserDeclarations.push(sourceFileLike);
}
return isNew;
}
/** Adds a module and all of its transitive dependencies as possible indirect users. */
function addIndirectUsers(sourceFileLike: SourceFileLike): void {
if (!addIndirectUser(sourceFileLike)) {
return;
}
const moduleSymbol = checker.getMergedSymbol(sourceFileLike.symbol);
Debug.assert(!!(moduleSymbol.flags & SymbolFlags.Module));
const directImports = getDirectImports(moduleSymbol);
if (directImports) for (const directImport of directImports) {
addIndirectUsers(getSourceFileLikeForImportDeclaration(directImport));
}
}
function getDirectImports(moduleSymbol: Symbol): ImporterOrCallExpression[] | undefined {
return allDirectImports.get(getSymbolId(moduleSymbol).toString());
}
}
/**
* Given the set of direct imports of a module, we need to find which ones import the particular exported symbol.
* The returned `importSearches` will result in the entire source file being searched.
* But re-exports will be placed in 'singleReferences' since they cannot be locally referenced.
*/
function getSearchesFromDirectImports(directImports: Importer[], exportSymbol: Symbol, exportKind: ExportKind, checker: TypeChecker, isForRename: boolean): Pick<ImportsResult, "importSearches" | "singleReferences"> {
const exportName = exportSymbol.name;
const importSearches: Array<[Identifier, Symbol]> = [];
const singleReferences: Identifier[] = [];
function addSearch(location: Identifier, symbol: Symbol): void {
importSearches.push([location, symbol]);
}
if (directImports) for (const decl of directImports) {
handleImport(decl);
}
return { importSearches, singleReferences };
function handleImport(decl: Importer): void {
if (decl.kind === SyntaxKind.ImportEqualsDeclaration) {
if (isExternalModuleImportEquals(decl)) {
handleNamespaceImportLike(decl.name);
}
return;
}
if (decl.kind === ts.SyntaxKind.Identifier) {
handleNamespaceImportLike(decl);
return;
}
// Ignore if there's a grammar error
if (decl.moduleSpecifier.kind !== SyntaxKind.StringLiteral) {
return;
}
if (decl.kind === SyntaxKind.ExportDeclaration) {
searchForNamedImport(decl.exportClause);
return;
}
const { importClause } = decl;
const { namedBindings } = importClause;
if (namedBindings && namedBindings.kind === SyntaxKind.NamespaceImport) {
handleNamespaceImportLike(namedBindings.name);
return;
}
if (exportKind === ExportKind.Named) {
searchForNamedImport(namedBindings as NamedImports | undefined);
}
else {
// `export =` might be imported by a default import if `--allowSyntheticDefaultImports` is on, so this handles both ExportKind.Default and ExportKind.ExportEquals
const { name } = importClause;
// If a default import has the same name as the default export, allow to rename it.
// Given `import f` and `export default function f`, we will rename both, but for `import g` we will rename just that.
if (name && (!isForRename || name.text === symbolName(exportSymbol))) {
const defaultImportAlias = checker.getSymbolAtLocation(name);
addSearch(name, defaultImportAlias);
}
// 'default' might be accessed as a named import `{ default as foo }`.
if (!isForRename && exportKind === ExportKind.Default) {
Debug.assert(exportName === "default");
searchForNamedImport(namedBindings as NamedImports | undefined);
}
}
}
/**
* `import x = require("./x") or `import * as x from "./x"`.
* An `export =` may be imported by this syntax, so it may be a direct import.
* If it's not a direct import, it will be in `indirectUsers`, so we don't have to do anything here.
*/
function handleNamespaceImportLike(importName: Identifier): void {
// Don't rename an import that already has a different name than the export.
if (exportKind === ExportKind.ExportEquals && (!isForRename || importName.text === exportName)) {
addSearch(importName, checker.getSymbolAtLocation(importName));
}
}
function searchForNamedImport(namedBindings: NamedImportsOrExports | undefined): void {
if (namedBindings) for (const element of namedBindings.elements) {
const { name, propertyName } = element;
if ((propertyName || name).text !== exportName) {
continue;
}
if (propertyName) {
// This is `import { foo as bar } from "./a"` or `export { foo as bar } from "./a"`. `foo` isn't a local in the file, so just add it as a single reference.
singleReferences.push(propertyName);
if (!isForRename) { // If renaming `foo`, don't touch `bar`, just `foo`.
// Search locally for `bar`.
addSearch(name, checker.getSymbolAtLocation(name));
}
}
else {
const localSymbol = element.kind === SyntaxKind.ExportSpecifier && element.propertyName
? checker.getExportSpecifierLocalTargetSymbol(element) // For re-exporting under a different name, we want to get the re-exported symbol.
: checker.getSymbolAtLocation(name);
addSearch(name, localSymbol);
}
}
}
}
/** Returns 'true' is the namespace 'name' is re-exported from this module, and 'false' if it is only used locally. */
function findNamespaceReExports(sourceFileLike: SourceFileLike, name: Identifier, checker: TypeChecker): boolean {
const namespaceImportSymbol = checker.getSymbolAtLocation(name);
return forEachPossibleImportOrExportStatement(sourceFileLike, statement => {
if (statement.kind !== SyntaxKind.ExportDeclaration) return;
const { exportClause, moduleSpecifier } = statement as ExportDeclaration;
if (moduleSpecifier || !exportClause) return;
for (const element of exportClause.elements) {
if (checker.getExportSpecifierLocalTargetSymbol(element) === namespaceImportSymbol) {
return true;
}
}
});
}
/** Returns a map from a module symbol Id to all import statements that directly reference the module. */
function getDirectImportsMap(sourceFiles: SourceFile[], checker: TypeChecker, cancellationToken: CancellationToken): Map<ImporterOrCallExpression[]> {
const map = createMap<ImporterOrCallExpression[]>();
for (const sourceFile of sourceFiles) {
cancellationToken.throwIfCancellationRequested();
forEachImport(sourceFile, (importDecl, moduleSpecifier) => {
const moduleSymbol = checker.getSymbolAtLocation(moduleSpecifier);
if (moduleSymbol) {
const id = getSymbolId(moduleSymbol).toString();
let imports = map.get(id);
if (!imports) {
map.set(id, imports = []);
}
imports.push(importDecl);
}
});
}
return map;
}
/** Iterates over all statements at the top level or in module declarations. Returns the first truthy result. */
function forEachPossibleImportOrExportStatement<T>(sourceFileLike: SourceFileLike, action: (statement: Statement) => T): T {
return forEach(sourceFileLike.kind === SyntaxKind.SourceFile ? sourceFileLike.statements : sourceFileLike.body.statements, statement =>
action(statement) || (isAmbientModuleDeclaration(statement) && forEach(statement.body && statement.body.statements, action)));
}
/** Calls `action` for each import, re-export, or require() in a file. */
function forEachImport(sourceFile: SourceFile, action: (importStatement: ImporterOrCallExpression, imported: StringLiteral) => void): void {
if (sourceFile.externalModuleIndicator) {
for (const moduleSpecifier of sourceFile.imports) {
action(importerFromModuleSpecifier(moduleSpecifier), moduleSpecifier);
}
}
else {
forEachPossibleImportOrExportStatement(sourceFile, statement => {
switch (statement.kind) {
case SyntaxKind.ExportDeclaration:
case SyntaxKind.ImportDeclaration: {
const decl = statement as ImportDeclaration | ExportDeclaration;
if (decl.moduleSpecifier && decl.moduleSpecifier.kind === SyntaxKind.StringLiteral) {
action(decl, decl.moduleSpecifier as StringLiteral);
}
break;
}
case SyntaxKind.ImportEqualsDeclaration: {
const decl = statement as ImportEqualsDeclaration;
const { moduleReference } = decl;
if (moduleReference.kind === SyntaxKind.ExternalModuleReference &&
moduleReference.expression.kind === SyntaxKind.StringLiteral) {
action(decl, moduleReference.expression as StringLiteral);
}
break;
}
}
});
if (sourceFile.flags & NodeFlags.JavaScriptFile) {
// Find all 'require()' calls.
sourceFile.forEachChild(function recur(node: Node): void {
if (isRequireCall(node, /*checkArgumentIsStringLiteral*/ true)) {
action(node, node.arguments[0] as StringLiteral);
} else {
node.forEachChild(recur);
}
});
}
}
}
function importerFromModuleSpecifier(moduleSpecifier: StringLiteral): Importer {
const decl = moduleSpecifier.parent;
if (decl.kind === SyntaxKind.ImportDeclaration || decl.kind === SyntaxKind.ExportDeclaration) {
return decl as ImportDeclaration | ExportDeclaration;
}
Debug.assert(decl.kind === SyntaxKind.ExternalModuleReference);
return (decl as ExternalModuleReference).parent;
}
export interface ImportedSymbol {
kind: ImportExport.Import;
symbol: Symbol;
isNamedImport: boolean;
}
export interface ExportedSymbol {
kind: ImportExport.Export;
symbol: Symbol;
exportInfo: ExportInfo;
}
/**
* Given a local reference, we might notice that it's an import/export and recursively search for references of that.
* If at an import, look locally for the symbol it imports.
* If an an export, look for all imports of it.
* This doesn't handle export specifiers; that is done in `getReferencesAtExportSpecifier`.
* @param comingFromExport If we are doing a search for all exports, don't bother looking backwards for the imported symbol, since that's the reason we're here.
*/
export function getImportOrExportSymbol(node: Node, symbol: Symbol, checker: TypeChecker, comingFromExport: boolean): ImportedSymbol | ExportedSymbol | undefined {
return comingFromExport ? getExport() : getExport() || getImport();
function getExport(): ExportedSymbol | ImportedSymbol | undefined {
const { parent } = node;
if (symbol.flags & SymbolFlags.Export) {
if (parent.kind === SyntaxKind.PropertyAccessExpression) {
// When accessing an export of a JS module, there's no alias. The symbol will still be flagged as an export even though we're at the use.
// So check that we are at the declaration.
return symbol.declarations.some(d => d === parent) && parent.parent.kind === ts.SyntaxKind.BinaryExpression
? getSpecialPropertyExport(parent.parent as ts.BinaryExpression, /*useLhsSymbol*/ false)
: undefined;
}
else {
const { exportSymbol } = symbol;
Debug.assert(!!exportSymbol);
return exportInfo(exportSymbol, getExportKindForDeclaration(parent));
}
}
else {
const exportNode = parent.kind === SyntaxKind.VariableDeclaration ? getAncestor(parent, SyntaxKind.VariableStatement) : parent;
if (hasModifier(exportNode, ModifierFlags.Export)) {
if (exportNode.kind === SyntaxKind.ImportEqualsDeclaration && (exportNode as ImportEqualsDeclaration).moduleReference === node) {
// We're at `Y` in `export import X = Y`. This is not the exported symbol, the left-hand-side is. So treat this as an import statement.
if (comingFromExport) {
return undefined;
}
const lhsSymbol = checker.getSymbolAtLocation((exportNode as ImportEqualsDeclaration).name);
return { kind: ImportExport.Import, symbol: lhsSymbol, isNamedImport: false };
}
else {
return exportInfo(symbol, getExportKindForDeclaration(exportNode));
}
}
else if (parent.kind === SyntaxKind.ExportAssignment) {
// Get the symbol for the `export =` node; its parent is the module it's the export of.
const exportingModuleSymbol = parent.symbol.parent;
Debug.assert(!!exportingModuleSymbol);
return { kind: ImportExport.Export, symbol, exportInfo: { exportingModuleSymbol, exportKind: ExportKind.ExportEquals } };
}
else if (parent.kind === ts.SyntaxKind.BinaryExpression) {
return getSpecialPropertyExport(parent as ts.BinaryExpression, /*useLhsSymbol*/ true);
}
else if (parent.parent.kind === SyntaxKind.BinaryExpression) {
return getSpecialPropertyExport(parent.parent as ts.BinaryExpression, /*useLhsSymbol*/ true);
}
}
function getSpecialPropertyExport(node: ts.BinaryExpression, useLhsSymbol: boolean): ExportedSymbol | undefined {
let kind: ExportKind;
switch (getSpecialPropertyAssignmentKind(node)) {
case SpecialPropertyAssignmentKind.ExportsProperty:
kind = ExportKind.Named;
break;
case SpecialPropertyAssignmentKind.ModuleExports:
kind = ExportKind.ExportEquals;
break;
default:
return undefined;
}
const sym = useLhsSymbol ? checker.getSymbolAtLocation((node.left as ts.PropertyAccessExpression).name) : symbol;
return sym && exportInfo(sym, kind);
}
}
function getImport(): ImportedSymbol | undefined {
const isImport = isNodeImport(node);
if (!isImport) return;
// A symbol being imported is always an alias. So get what that aliases to find the local symbol.
let importedSymbol = checker.getImmediateAliasedSymbol(symbol);
if (importedSymbol) {
// Search on the local symbol in the exporting module, not the exported symbol.
importedSymbol = skipExportSpecifierSymbol(importedSymbol, checker);
// Similarly, skip past the symbol for 'export ='
if (importedSymbol.name === "export=") {
importedSymbol = checker.getImmediateAliasedSymbol(importedSymbol);
}
if (symbolName(importedSymbol) === symbol.name) { // If this is a rename import, do not continue searching.
return { kind: ImportExport.Import, symbol: importedSymbol, ...isImport };
}
}
}
function exportInfo(symbol: Symbol, kind: ExportKind): ExportedSymbol {
const exportInfo = getExportInfo(symbol, kind, checker);
return exportInfo && { kind: ImportExport.Export, symbol, exportInfo };
}
// Not meant for use with export specifiers or export assignment.
function getExportKindForDeclaration(node: Node): ExportKind | undefined {
return hasModifier(node, ModifierFlags.Default) ? ExportKind.Default : ExportKind.Named;
}
}
function isNodeImport(node: Node): { isNamedImport: boolean } | undefined {
const { parent } = node;
switch (parent.kind) {
case SyntaxKind.ImportEqualsDeclaration:
return (parent as ImportEqualsDeclaration).name === node && isExternalModuleImportEquals(parent as ImportEqualsDeclaration)
? { isNamedImport: false }
: undefined;
case SyntaxKind.ImportSpecifier:
// For a rename import `{ foo as bar }`, don't search for the imported symbol. Just find local uses of `bar`.
return (parent as ImportSpecifier).propertyName ? undefined : { isNamedImport: true };
case SyntaxKind.ImportClause:
case SyntaxKind.NamespaceImport:
Debug.assert((parent as ImportClause | NamespaceImport).name === node);
return { isNamedImport: false };
default:
return undefined;
}
}
export function getExportInfo(exportSymbol: Symbol, exportKind: ExportKind, checker: TypeChecker): ExportInfo | undefined {
const exportingModuleSymbol = checker.getMergedSymbol(exportSymbol.parent); // Need to get merged symbol in case there's an augmentation.
// `export` may appear in a namespace. In that case, just rely on global search.
return isExternalModuleSymbol(exportingModuleSymbol) ? { exportingModuleSymbol, exportKind } : undefined;
}
function symbolName(symbol: Symbol): string {
if (symbol.name !== "default") {
return symbol.name;
}
const name = forEach(symbol.declarations, ({ name }) => name && name.kind === SyntaxKind.Identifier && name.text);
Debug.assert(!!name);
return name;
}
/** If at an export specifier, go to the symbol it refers to. */
function skipExportSpecifierSymbol(symbol: Symbol, checker: TypeChecker): Symbol {
// For `export { foo } from './bar", there's nothing to skip, because it does not create a new alias. But `export { foo } does.
if (symbol.declarations) for (const declaration of symbol.declarations) {
if (isExportSpecifier(declaration) && !(declaration as ExportSpecifier).propertyName && !(declaration as ExportSpecifier).parent.parent.moduleSpecifier) {
return checker.getExportSpecifierLocalTargetSymbol(declaration);
}
}
return symbol;
}
function getContainingModuleSymbol(importer: Importer, checker: TypeChecker): Symbol {
return checker.getMergedSymbol(getSourceFileLikeForImportDeclaration(importer).symbol);
}
function getSourceFileLikeForImportDeclaration(node: ImporterOrCallExpression): SourceFileLike {
if (node.kind === SyntaxKind.CallExpression) {
return node.getSourceFile();
}
const { parent } = node;
if (parent.kind === SyntaxKind.SourceFile) {
return parent as SourceFile;
}
Debug.assert(parent.kind === SyntaxKind.ModuleBlock && isAmbientModuleDeclaration(parent.parent));
return parent.parent as AmbientModuleDeclaration;
}
function isAmbientModuleDeclaration(node: Node): node is AmbientModuleDeclaration {
return node.kind === SyntaxKind.ModuleDeclaration && (node as ModuleDeclaration).name.kind === SyntaxKind.StringLiteral;
}
function isExternalModuleImportEquals({ moduleReference }: ImportEqualsDeclaration): boolean {
return moduleReference.kind === SyntaxKind.ExternalModuleReference && moduleReference.expression.kind === SyntaxKind.StringLiteral;
}
}

View File

@ -31,21 +31,25 @@ namespace ts.Rename {
return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);
}
// Cannot rename `default` as in `import { default as foo } from "./someModule";
if (node.kind === SyntaxKind.Identifier &&
(node as Identifier).originalKeywordKind === SyntaxKind.DefaultKeyword &&
symbol.parent.flags & ts.SymbolFlags.Module) {
return undefined;
}
const displayName = stripQuotes(getDeclaredName(typeChecker, symbol, node));
const kind = SymbolDisplay.getSymbolKind(typeChecker, symbol, node);
return kind ? getRenameInfoSuccess(displayName, typeChecker.getFullyQualifiedName(symbol), kind, SymbolDisplay.getSymbolModifiers(symbol), node, sourceFile) : undefined;
}
}
else if (node.kind === SyntaxKind.StringLiteral) {
const type = getStringLiteralTypeForNode(<StringLiteral>node, typeChecker);
if (type) {
if (isDefinedInLibraryFile(node)) {
return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);
}
const displayName = stripQuotes(type.text);
return getRenameInfoSuccess(displayName, displayName, ScriptElementKind.variableElement, ScriptElementKindModifier.none, node, sourceFile);
if (isDefinedInLibraryFile(node)) {
return getRenameInfoError(Diagnostics.You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library);
}
const displayName = stripQuotes((node as StringLiteral).text);
return getRenameInfoSuccess(displayName, displayName, ScriptElementKind.variableElement, ScriptElementKindModifier.none, node, sourceFile);
}
}
@ -84,8 +88,9 @@ namespace ts.Rename {
return createTextSpan(start, width);
}
function nodeIsEligibleForRename(node: Node) {
return node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.StringLiteral ||
function nodeIsEligibleForRename(node: Node): boolean {
return node.kind === ts.SyntaxKind.Identifier ||
node.kind === SyntaxKind.StringLiteral ||
isLiteralNameOfPropertyDeclarationOrIndexAccess(node) ||
isThis(node);
}

View File

@ -10,7 +10,6 @@
/// <reference path='documentRegistry.ts' />
/// <reference path='findAllReferences.ts' />
/// <reference path='goToDefinition.ts' />
/// <reference path='goToImplementation.ts' />
/// <reference path='jsDoc.ts' />
/// <reference path='jsTyping.ts' />
/// <reference path='navigateTo.ts' />
@ -502,8 +501,8 @@ namespace ts {
public nameTable: Map<number>;
public resolvedModules: Map<ResolvedModuleFull>;
public resolvedTypeReferenceDirectiveNames: Map<ResolvedTypeReferenceDirective>;
public imports: LiteralExpression[];
public moduleAugmentations: LiteralExpression[];
public imports: StringLiteral[];
public moduleAugmentations: StringLiteral[];
private namedDeclarations: Map<Declaration[]>;
public ambientModuleNames: string[];
public checkJsDirective: CheckJsDirective | undefined;
@ -1411,18 +1410,18 @@ namespace ts {
return GoToDefinition.getDefinitionAtPosition(program, getValidSourceFile(fileName), position);
}
/// Goto implementation
function getImplementationAtPosition(fileName: string, position: number): ImplementationLocation[] {
synchronizeHostData();
return GoToImplementation.getImplementationAtPosition(program.getTypeChecker(), cancellationToken,
program.getSourceFiles(), getTouchingPropertyName(getValidSourceFile(fileName), position));
}
function getTypeDefinitionAtPosition(fileName: string, position: number): DefinitionInfo[] {
synchronizeHostData();
return GoToDefinition.getTypeDefinitionAtPosition(program.getTypeChecker(), getValidSourceFile(fileName), position);
}
/// Goto implementation
function getImplementationAtPosition(fileName: string, position: number): ImplementationLocation[] {
synchronizeHostData();
return FindAllReferences.getImplementationsAtPosition(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position);
}
/// References and Occurrences
function getOccurrencesAtPosition(fileName: string, position: number): ReferenceEntry[] {
let results = getOccurrencesAtPositionCore(fileName, position);
@ -1444,10 +1443,7 @@ namespace ts {
return DocumentHighlights.getDocumentHighlights(program.getTypeChecker(), cancellationToken, sourceFile, position, sourceFilesToSearch);
}
/// References and Occurrences
function getOccurrencesAtPositionCore(fileName: string, position: number): ReferenceEntry[] {
synchronizeHostData();
return convertDocumentHighlights(getDocumentHighlights(fileName, position, [fileName]));
function convertDocumentHighlights(documentHighlights: DocumentHighlights[]): ReferenceEntry[] {
@ -1473,24 +1469,21 @@ namespace ts {
}
function findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): RenameLocation[] {
const referencedSymbols = findReferencedSymbols(fileName, position, findInStrings, findInComments, /*isForRename*/ true);
return FindAllReferences.convertReferences(referencedSymbols);
return getReferences(fileName, position, { findInStrings, findInComments, isForRename: true });
}
function getReferencesAtPosition(fileName: string, position: number): ReferenceEntry[] {
const referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false, /*isForRename*/ false);
return FindAllReferences.convertReferences(referencedSymbols);
return getReferences(fileName, position);
}
function getReferences(fileName: string, position: number, options?: FindAllReferences.Options) {
synchronizeHostData();
return FindAllReferences.findReferencedEntries(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, options);
}
function findReferences(fileName: string, position: number): ReferencedSymbol[] {
const referencedSymbols = findReferencedSymbols(fileName, position, /*findInStrings*/ false, /*findInComments*/ false, /*isForRename*/ false);
// Only include referenced symbols that have a valid definition.
return filter(referencedSymbols, rs => !!rs.definition);
}
function findReferencedSymbols(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, isForRename: boolean): ReferencedSymbol[] {
synchronizeHostData();
return FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position, findInStrings, findInComments, isForRename);
return FindAllReferences.findReferencedSymbols(program.getTypeChecker(), cancellationToken, program.getSourceFiles(), getValidSourceFile(fileName), position);
}
/// NavigateTo
@ -2014,6 +2007,7 @@ namespace ts {
}
/* @internal */
/** Names in the name table are escaped, so an identifier `__foo` will have a name table entry `___foo`. */
export function getNameTable(sourceFile: SourceFile): Map<number> {
if (!sourceFile.nameTable) {
initializeNameTable(sourceFile);

View File

@ -37,7 +37,7 @@ namespace ts {
*
* Or undefined value if there was no change.
*/
getChangeRange(oldSnapshot: ScriptSnapshotShim): string;
getChangeRange(oldSnapshot: ScriptSnapshotShim): string | undefined;
/** Releases all resources held by this script snapshot */
dispose?(): void;
@ -292,8 +292,7 @@ namespace ts {
public getChangeRange(oldSnapshot: IScriptSnapshot): TextChangeRange {
const oldSnapshotShim = <ScriptSnapshotShimAdapter>oldSnapshot;
const encoded = this.scriptSnapshotShim.getChangeRange(oldSnapshotShim.scriptSnapshotShim);
// TODO: should this be '==='?
if (encoded == null) {
if (encoded === null) {
return null;
}
@ -381,8 +380,7 @@ namespace ts {
public getCompilationSettings(): CompilerOptions {
const settingsJson = this.shimHost.getCompilationSettings();
// TODO: should this be '==='?
if (settingsJson == null || settingsJson == "") {
if (settingsJson === null || settingsJson === "") {
throw Error("LanguageServiceShimHostAdapter.getCompilationSettings: empty compilationSettings");
}
const compilerOptions = <CompilerOptions>JSON.parse(settingsJson);
@ -416,7 +414,7 @@ namespace ts {
public getLocalizedDiagnosticMessages(): any {
const diagnosticMessagesJson = this.shimHost.getLocalizedDiagnosticMessages();
if (diagnosticMessagesJson == null || diagnosticMessagesJson == "") {
if (diagnosticMessagesJson === null || diagnosticMessagesJson === "") {
return null;
}

View File

@ -56,7 +56,7 @@ namespace ts.SignatureHelp {
// break;
// case TypeScript.SyntaxKind.CommaToken:
// if (stack == 0) {
// if (stack === 0) {
// argumentIndex++;
// }

View File

@ -465,7 +465,7 @@ namespace ts.textChanges {
change.options.indentation !== undefined
? change.options.indentation
: change.useIndentationFromFile
? formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix == this.newLineCharacter))
? formatting.SmartIndenter.getIndentation(change.range.pos, sourceFile, formatOptions, posStartsLine || (change.options.prefix === this.newLineCharacter))
: 0;
const delta =
change.options.delta !== undefined

View File

@ -46,8 +46,8 @@
"documentHighlights.ts",
"documentRegistry.ts",
"findAllReferences.ts",
"importTracker.ts",
"goToDefinition.ts",
"goToImplementation.ts",
"jsDoc.ts",
"jsTyping.ts",
"navigateTo.ts",

View File

@ -483,12 +483,9 @@ namespace ts {
displayParts: SymbolDisplayPart[];
}
export interface ReferencedSymbolOf<T extends DocumentSpan> {
export interface ReferencedSymbol {
definition: ReferencedSymbolDefinitionInfo;
references: T[];
}
export interface ReferencedSymbol extends ReferencedSymbolOf<ReferenceEntry> {
references: ReferenceEntry[];
}
export enum SymbolDisplayPartKind {

View File

@ -364,15 +364,6 @@ namespace ts {
}
}
export function getStringLiteralTypeForNode(node: StringLiteral | LiteralTypeNode, typeChecker: TypeChecker): LiteralType {
const searchNode = node.parent.kind === SyntaxKind.LiteralType ? <LiteralTypeNode>node.parent : node;
const type = typeChecker.getTypeAtLocation(searchNode);
if (type && type.flags & TypeFlags.StringLiteral) {
return <LiteralType>type;
}
return undefined;
}
export function isThis(node: Node): boolean {
switch (node.kind) {
case SyntaxKind.ThisKeyword:
@ -911,10 +902,10 @@ namespace ts {
// Internally, we represent the end of the comment at the newline and closing '/', respectively.
return predicate ?
forEach(commentRanges, c => c.pos < position &&
(c.kind == SyntaxKind.SingleLineCommentTrivia ? position <= c.end : position < c.end) &&
(c.kind === SyntaxKind.SingleLineCommentTrivia ? position <= c.end : position < c.end) &&
predicate(c)) :
forEach(commentRanges, c => c.pos < position &&
(c.kind == SyntaxKind.SingleLineCommentTrivia ? position <= c.end : position < c.end));
(c.kind === SyntaxKind.SingleLineCommentTrivia ? position <= c.end : position < c.end));
}
return false;
@ -1132,6 +1123,21 @@ namespace ts {
return false;
}
}
/** True if the symbol is for an external module, as opposed to a namespace. */
export function isExternalModuleSymbol(moduleSymbol: Symbol): boolean {
Debug.assert(!!(moduleSymbol.flags & SymbolFlags.Module));
return moduleSymbol.name.charCodeAt(0) === CharacterCodes.doubleQuote;
}
/** Returns `true` the first time it encounters a node and `false` afterwards. */
export function nodeSeenTracker<T extends Node>(): (node: T) => boolean {
const seen: Array<true> = [];
return node => {
const id = getNodeId(node);
return !seen[id] && (seen[id] = true);
};
}
}
// Display-part writer helpers
@ -1300,21 +1306,14 @@ namespace ts {
export function getDeclaredName(typeChecker: TypeChecker, symbol: Symbol, location: Node): string {
// If this is an export or import specifier it could have been renamed using the 'as' syntax.
// If so we want to search for whatever is under the cursor.
if (isImportOrExportSpecifierName(location)) {
return location.getText();
}
else if (isStringOrNumericLiteral(location) &&
location.parent.kind === SyntaxKind.ComputedPropertyName) {
return (<LiteralExpression>location).text;
if (isImportOrExportSpecifierName(location) || isStringOrNumericLiteral(location) && location.parent.kind === SyntaxKind.ComputedPropertyName) {
return location.text;
}
// Try to get the local symbol if we're dealing with an 'export default'
// since that symbol has the "true" name.
const localExportDefaultSymbol = getLocalSymbolForExportDefault(symbol);
const name = typeChecker.symbolToString(localExportDefaultSymbol || symbol);
return name;
return typeChecker.symbolToString(localExportDefaultSymbol || symbol);
}
export function isImportOrExportSpecifierName(location: Node): location is Identifier {

View File

@ -26,12 +26,12 @@ class Board {
return this.ships.every(function (val) { return val.isSunk; });
>this.ships.every(function (val) { return val.isSunk; }) : boolean
>this.ships.every : { (callbackfn: (this: undefined, value: Ship, index: number, array: Ship[]) => boolean): boolean; (callbackfn: (this: undefined, value: Ship, index: number, array: Ship[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: Ship, index: number, array: Ship[]) => boolean, thisArg: Z): boolean; }
>this.ships.every : { (callbackfn: (this: void, value: Ship, index: number, array: Ship[]) => boolean): boolean; (callbackfn: (this: void, value: Ship, index: number, array: Ship[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: Ship, index: number, array: Ship[]) => boolean, thisArg: Z): boolean; }
>this.ships : Ship[]
>this : this
>ships : Ship[]
>every : { (callbackfn: (this: undefined, value: Ship, index: number, array: Ship[]) => boolean): boolean; (callbackfn: (this: undefined, value: Ship, index: number, array: Ship[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: Ship, index: number, array: Ship[]) => boolean, thisArg: Z): boolean; }
>function (val) { return val.isSunk; } : (this: undefined, val: Ship) => boolean
>every : { (callbackfn: (this: void, value: Ship, index: number, array: Ship[]) => boolean): boolean; (callbackfn: (this: void, value: Ship, index: number, array: Ship[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: Ship, index: number, array: Ship[]) => boolean, thisArg: Z): boolean; }
>function (val) { return val.isSunk; } : (this: void, val: Ship) => boolean
>val : Ship
>val.isSunk : boolean
>val : Ship

View File

@ -1,5 +1,5 @@
tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts(5,9): error TS2304: Cannot find name 'M'.
tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts(7,15): error TS2304: Cannot find name 'M'.
tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts(5,9): error TS2708: Cannot use namespace 'M' as a value.
tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts(7,15): error TS2708: Cannot use namespace 'M' as a value.
==== tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts (2 errors) ====
@ -9,9 +9,9 @@ tests/cases/conformance/internalModules/moduleDeclarations/InvalidNonInstantiate
var m = M; // Error, not instantiated can not be used as var
~
!!! error TS2304: Cannot find name 'M'.
!!! error TS2708: Cannot use namespace 'M' as a value.
var x: typeof M; // Error only a namespace
~
!!! error TS2304: Cannot find name 'M'.
!!! error TS2708: Cannot use namespace 'M' as a value.

View File

@ -1,4 +1,4 @@
tests/cases/compiler/aliasOnMergedModuleInterface_1.ts(5,16): error TS2304: Cannot find name 'foo'.
tests/cases/compiler/aliasOnMergedModuleInterface_1.ts(5,16): error TS2708: Cannot use namespace 'foo' as a value.
==== tests/cases/compiler/aliasOnMergedModuleInterface_1.ts (1 errors) ====
@ -8,7 +8,7 @@ tests/cases/compiler/aliasOnMergedModuleInterface_1.ts(5,16): error TS2304: Cann
z.bar("hello"); // This should be ok
var x: foo.A = foo.bar("hello"); // foo.A should be ok but foo.bar should be error
~~~
!!! error TS2304: Cannot find name 'foo'.
!!! error TS2708: Cannot use namespace 'foo' as a value.
==== tests/cases/compiler/aliasOnMergedModuleInterface_0.ts (0 errors) ====
declare module "foo"

View File

@ -0,0 +1,24 @@
tests/cases/compiler/anonymousClassExpression2.ts(13,18): error TS2339: Property 'methodA' does not exist on type 'B'.
==== tests/cases/compiler/anonymousClassExpression2.ts (1 errors) ====
// Fixes #14860
// note: repros with `while (0);` too
// but it's less inscrutable and more obvious to put it *inside* the loop
while (0) {
class A {
methodA() {
this; //note: a this reference of some kind is required to trigger the bug
}
}
class B {
methodB() {
this.methodA; // error
~~~~~~~
!!! error TS2339: Property 'methodA' does not exist on type 'B'.
this.methodB; // ok
}
}
}

View File

@ -0,0 +1,43 @@
//// [anonymousClassExpression2.ts]
// Fixes #14860
// note: repros with `while (0);` too
// but it's less inscrutable and more obvious to put it *inside* the loop
while (0) {
class A {
methodA() {
this; //note: a this reference of some kind is required to trigger the bug
}
}
class B {
methodB() {
this.methodA; // error
this.methodB; // ok
}
}
}
//// [anonymousClassExpression2.js]
// Fixes #14860
// note: repros with `while (0);` too
// but it's less inscrutable and more obvious to put it *inside* the loop
while (0) {
var A = (function () {
function A() {
}
A.prototype.methodA = function () {
this; //note: a this reference of some kind is required to trigger the bug
};
return A;
}());
var B = (function () {
function B() {
}
B.prototype.methodB = function () {
this.methodA; // error
this.methodB; // ok
};
return B;
}());
}

View File

@ -57,10 +57,10 @@ paired.reduce((b3, b4) => b3.concat({}), []);
paired.map((c1) => c1.count);
>paired.map((c1) => c1.count) : any[]
>paired.map : { <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>paired.map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>paired : any[]
>map : { <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>(c1) => c1.count : (this: undefined, c1: any) => any
>map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>(c1) => c1.count : (this: void, c1: any) => any
>c1 : any
>c1.count : any
>c1 : any
@ -68,10 +68,10 @@ paired.map((c1) => c1.count);
paired.map(function (c2) { return c2.count; });
>paired.map(function (c2) { return c2.count; }) : any[]
>paired.map : { <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>paired.map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>paired : any[]
>map : { <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>function (c2) { return c2.count; } : (this: undefined, c2: any) => any
>map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>function (c2) { return c2.count; } : (this: void, c2: any) => any
>c2 : any
>c2.count : any
>c2 : any

View File

@ -42,13 +42,13 @@ function myFunction(myType: MyType) {
[1, 2, 3].forEach(function(j) { use(x); })
>[1, 2, 3].forEach(function(j) { use(x); }) : void
>[1, 2, 3].forEach : { (callbackfn: (this: undefined, value: number, index: number, array: number[]) => void): void; (callbackfn: (this: undefined, value: number, index: number, array: number[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => void, thisArg: Z): void; }
>[1, 2, 3].forEach : { (callbackfn: (this: void, value: number, index: number, array: number[]) => void): void; (callbackfn: (this: void, value: number, index: number, array: number[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => void, thisArg: Z): void; }
>[1, 2, 3] : number[]
>1 : 1
>2 : 2
>3 : 3
>forEach : { (callbackfn: (this: undefined, value: number, index: number, array: number[]) => void): void; (callbackfn: (this: undefined, value: number, index: number, array: number[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => void, thisArg: Z): void; }
>function(j) { use(x); } : (this: undefined, j: number) => void
>forEach : { (callbackfn: (this: void, value: number, index: number, array: number[]) => void): void; (callbackfn: (this: void, value: number, index: number, array: number[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => void, thisArg: Z): void; }
>function(j) { use(x); } : (this: void, j: number) => void
>j : number
>use(x) : any
>use : (s: any) => any

View File

@ -2,7 +2,7 @@
var x = [].concat([{ a: 1 }], [{ a: 2 }])
>x : any[]
>[].concat([{ a: 1 }], [{ a: 2 }]) .map(b => b.a) : any[]
>[].concat([{ a: 1 }], [{ a: 2 }]) .map : { <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>[].concat([{ a: 1 }], [{ a: 2 }]) .map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>[].concat([{ a: 1 }], [{ a: 2 }]) : any[]
>[].concat : { (...items: any[][]): any[]; (...items: any[]): any[]; }
>[] : undefined[]
@ -17,8 +17,8 @@ var x = [].concat([{ a: 1 }], [{ a: 2 }])
>2 : 2
.map(b => b.a);
>map : { <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: undefined, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>b => b.a : (this: undefined, b: any) => any
>map : { <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U, U]; <U>(this: [any, any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [any, any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U, U]; <U>(this: [any, any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [any, any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U, U]; <U>(this: [any, any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [any, any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U): [U, U]; <U>(this: [any, any], callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [any, any], callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U): U[]; <U>(callbackfn: (this: void, value: any, index: number, array: any[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: any, index: number, array: any[]) => U, thisArg: Z): U[]; }
>b => b.a : (this: void, b: any) => any
>b : any
>b.a : any
>b : any

View File

@ -22,10 +22,10 @@ var foo = [
foo.filter(x => x.name); //should accepted all possible types not only boolean!
>foo.filter(x => x.name) : { name: string; }[]
>foo.filter : { (callbackfn: (this: undefined, value: { name: string; }, index: number, array: { name: string; }[]) => any): { name: string; }[]; (callbackfn: (this: undefined, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: undefined): { name: string; }[]; <Z>(callbackfn: (this: Z, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: Z): { name: string; }[]; }
>foo.filter : { (callbackfn: (this: void, value: { name: string; }, index: number, array: { name: string; }[]) => any): { name: string; }[]; (callbackfn: (this: void, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: undefined): { name: string; }[]; <Z>(callbackfn: (this: Z, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: Z): { name: string; }[]; }
>foo : { name: string; }[]
>filter : { (callbackfn: (this: undefined, value: { name: string; }, index: number, array: { name: string; }[]) => any): { name: string; }[]; (callbackfn: (this: undefined, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: undefined): { name: string; }[]; <Z>(callbackfn: (this: Z, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: Z): { name: string; }[]; }
>x => x.name : (this: undefined, x: { name: string; }) => string
>filter : { (callbackfn: (this: void, value: { name: string; }, index: number, array: { name: string; }[]) => any): { name: string; }[]; (callbackfn: (this: void, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: undefined): { name: string; }[]; <Z>(callbackfn: (this: Z, value: { name: string; }, index: number, array: { name: string; }[]) => any, thisArg: Z): { name: string; }[]; }
>x => x.name : (this: void, x: { name: string; }) => string
>x : { name: string; }
>x.name : string
>x : { name: string; }

View File

@ -1,8 +1,8 @@
tests/cases/compiler/assignToModule.ts(2,1): error TS2304: Cannot find name 'A'.
tests/cases/compiler/assignToModule.ts(2,1): error TS2708: Cannot use namespace 'A' as a value.
==== tests/cases/compiler/assignToModule.ts (1 errors) ====
module A {}
A = undefined; // invalid LHS
~
!!! error TS2304: Cannot find name 'A'.
!!! error TS2708: Cannot use namespace 'A' as a value.

View File

@ -0,0 +1,56 @@
//// [assignmentToExpandingArrayType.ts]
// Fixes exponential time/space in #14628
let x = []
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' } // previously ran out of memory here
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
x[0] = { foo: 'hi' }
//// [assignmentToExpandingArrayType.js]
// Fixes exponential time/space in #14628
var x = [];
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' }; // previously ran out of memory here
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };
x[0] = { foo: 'hi' };

View File

@ -0,0 +1,101 @@
=== tests/cases/compiler/assignmentToExpandingArrayType.ts ===
// Fixes exponential time/space in #14628
let x = []
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 2, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 3, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 4, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 5, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 6, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 7, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 8, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 9, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 10, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 11, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 12, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 13, 8))
x[0] = { foo: 'hi' } // previously ran out of memory here
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 14, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 15, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 16, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 17, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 18, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 19, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 20, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 21, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 22, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 23, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 24, 8))
x[0] = { foo: 'hi' }
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 25, 8))

View File

@ -0,0 +1,222 @@
=== tests/cases/compiler/assignmentToExpandingArrayType.ts ===
// Fixes exponential time/space in #14628
let x = []
>x : any[]
>[] : undefined[]
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' } // previously ran out of memory here
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"
x[0] = { foo: 'hi' }
>x[0] = { foo: 'hi' } : { foo: string; }
>x[0] : any
>x : any[]
>0 : 0
>{ foo: 'hi' } : { foo: string; }
>foo : string
>'hi' : "hi"

View File

@ -1,4 +1,4 @@
tests/cases/compiler/assignmentToReferenceTypes.ts(5,1): error TS2304: Cannot find name 'M'.
tests/cases/compiler/assignmentToReferenceTypes.ts(5,1): error TS2708: Cannot use namespace 'M' as a value.
tests/cases/compiler/assignmentToReferenceTypes.ts(9,1): error TS2539: Cannot assign to 'C' because it is not a variable.
tests/cases/compiler/assignmentToReferenceTypes.ts(13,1): error TS2539: Cannot assign to 'E' because it is not a variable.
tests/cases/compiler/assignmentToReferenceTypes.ts(16,1): error TS2539: Cannot assign to 'f' because it is not a variable.
@ -11,7 +11,7 @@ tests/cases/compiler/assignmentToReferenceTypes.ts(16,1): error TS2539: Cannot a
}
M = null;
~
!!! error TS2304: Cannot find name 'M'.
!!! error TS2708: Cannot use namespace 'M' as a value.
class C {
}

View File

@ -1,4 +1,4 @@
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(11,1): error TS2304: Cannot find name 'M'.
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(11,1): error TS2708: Cannot use namespace 'M' as a value.
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(14,1): error TS2539: Cannot assign to 'C' because it is not a variable.
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(17,1): error TS2539: Cannot assign to 'E' because it is not a variable.
tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(18,3): error TS2540: Cannot assign to 'A' because it is a constant or a read-only property.
@ -19,7 +19,7 @@ tests/cases/conformance/expressions/valuesAndReferences/assignments.ts(31,1): er
module M { }
M = null; // Error
~
!!! error TS2304: Cannot find name 'M'.
!!! error TS2708: Cannot use namespace 'M' as a value.
class C { }
C = null; // Error

View File

@ -58,7 +58,7 @@ function fn1() {
_a.label = 1;
case 1:
if (!(i < 1)) return [3 /*break*/, 4];
return [5 /*yield**/, __values(_loop_1(i))];
return [5 /*yield**/, _loop_1(i)];
case 2:
_a.sent();
_a.label = 3;
@ -92,7 +92,7 @@ function fn2() {
_a.label = 1;
case 1:
if (!(i < 1)) return [3 /*break*/, 4];
return [5 /*yield**/, __values(_loop_2(i))];
return [5 /*yield**/, _loop_2(i)];
case 2:
state_1 = _a.sent();
if (state_1 === "break")
@ -128,7 +128,7 @@ function fn3() {
_a.label = 1;
case 1:
if (!(i < 1)) return [3 /*break*/, 4];
return [5 /*yield**/, __values(_loop_3(i))];
return [5 /*yield**/, _loop_3(i)];
case 2:
_a.sent();
_a.label = 3;
@ -162,7 +162,7 @@ function fn4() {
_a.label = 1;
case 1:
if (!(i < 1)) return [3 /*break*/, 4];
return [5 /*yield**/, __values(_loop_4(i))];
return [5 /*yield**/, _loop_4(i)];
case 2:
state_2 = _a.sent();
if (typeof state_2 === "object")

View File

@ -3,7 +3,7 @@
(''.match(/ /) || []).map(s => s.toLowerCase());
>(''.match(/ /) || []).map(s => s.toLowerCase()) : string[]
>(''.match(/ /) || []).map : { <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>(''.match(/ /) || []).map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>(''.match(/ /) || []) : RegExpMatchArray
>''.match(/ /) || [] : RegExpMatchArray
>''.match(/ /) : RegExpMatchArray | null
@ -12,8 +12,8 @@
>match : (regexp: string | RegExp) => RegExpMatchArray | null
>/ / : RegExp
>[] : never[]
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>s => s.toLowerCase() : (this: undefined, s: string) => string
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>s => s.toLowerCase() : (this: void, s: string) => string
>s : string
>s.toLowerCase() : string
>s.toLowerCase : () => string
@ -42,10 +42,10 @@ function f1() {
let z = y.map(s => s.toLowerCase());
>z : string[]
>y.map(s => s.toLowerCase()) : string[]
>y.map : { <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>y.map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>y : RegExpMatchArray
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>s => s.toLowerCase() : (this: undefined, s: string) => string
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>s => s.toLowerCase() : (this: void, s: string) => string
>s : string
>s.toLowerCase() : string
>s.toLowerCase : () => string
@ -74,10 +74,10 @@ function f2() {
let z = y.map(s => s.toLowerCase());
>z : string[]
>y.map(s => s.toLowerCase()) : string[]
>y.map : { <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>y.map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>y : RegExpMatchArray
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>s => s.toLowerCase() : (this: undefined, s: string) => string
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>s => s.toLowerCase() : (this: void, s: string) => string
>s : string
>s.toLowerCase() : string
>s.toLowerCase : () => string

View File

@ -13,10 +13,10 @@ class A {
x.forEach((v) => {
>x.forEach((v) => { switch(v) { case "test": use(this); } }) : void
>x.forEach : { (callbackfn: (this: undefined, value: string, index: number, array: string[]) => void): void; (callbackfn: (this: undefined, value: string, index: number, array: string[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: string, index: number, array: string[]) => void, thisArg: Z): void; }
>x.forEach : { (callbackfn: (this: void, value: string, index: number, array: string[]) => void): void; (callbackfn: (this: void, value: string, index: number, array: string[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: string, index: number, array: string[]) => void, thisArg: Z): void; }
>x : string[]
>forEach : { (callbackfn: (this: undefined, value: string, index: number, array: string[]) => void): void; (callbackfn: (this: undefined, value: string, index: number, array: string[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: string, index: number, array: string[]) => void, thisArg: Z): void; }
>(v) => { switch(v) { case "test": use(this); } } : (this: undefined, v: string) => void
>forEach : { (callbackfn: (this: void, value: string, index: number, array: string[]) => void): void; (callbackfn: (this: void, value: string, index: number, array: string[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: string, index: number, array: string[]) => void, thisArg: Z): void; }
>(v) => { switch(v) { case "test": use(this); } } : (this: void, v: string) => void
>v : string
switch(v) {

View File

@ -41,10 +41,10 @@ for (let i = 0; i < 3; i++) {
}
arr.forEach(C => console.log(C.y()));
>arr.forEach(C => console.log(C.y())) : void
>arr.forEach : { (callbackfn: (this: undefined, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: undefined, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
>arr.forEach : { (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
>arr : { y(): number; }[]
>forEach : { (callbackfn: (this: undefined, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: undefined, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
>C => console.log(C.y()) : (this: undefined, C: { y(): number; }) => any
>forEach : { (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
>C => console.log(C.y()) : (this: void, C: { y(): number; }) => any
>C : { y(): number; }
>console.log(C.y()) : any
>console.log : any

View File

@ -41,10 +41,10 @@ for (let i = 0; i < 3; i++) {
}
arr.forEach(C => console.log(C.y()));
>arr.forEach(C => console.log(C.y())) : void
>arr.forEach : { (callbackfn: (this: undefined, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: undefined, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
>arr.forEach : { (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
>arr : { y(): number; }[]
>forEach : { (callbackfn: (this: undefined, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: undefined, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
>C => console.log(C.y()) : (this: undefined, C: { y(): number; }) => any
>forEach : { (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void): void; (callbackfn: (this: void, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: undefined): void; <Z>(callbackfn: (this: Z, value: { y(): number; }, index: number, array: { y(): number; }[]) => void, thisArg: Z): void; }
>C => console.log(C.y()) : (this: void, C: { y(): number; }) => any
>C : { y(): number; }
>console.log(C.y()) : any
>console.log : any

View File

@ -5,13 +5,13 @@ function f (m: string) {
[1, 2, 3].map(i => {
>[1, 2, 3].map(i => { return true? { [m]: i } : { [m]: i + 1 } }) : { [x: string]: number; }[]
>[1, 2, 3].map : { <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>[1, 2, 3].map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>[1, 2, 3] : number[]
>1 : 1
>2 : 2
>3 : 3
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>i => { return true? { [m]: i } : { [m]: i + 1 } } : (this: undefined, i: number) => { [x: string]: number; }
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>i => { return true? { [m]: i } : { [m]: i + 1 } } : (this: void, i: number) => { [x: string]: number; }
>i : number
return true? { [m]: i } : { [m]: i + 1 }

View File

@ -5,10 +5,10 @@ var s: string[];
s.map(// do something
>s.map(// do something function () { }) : void[]
>s.map : { <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>s.map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>s : string[]
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: undefined, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
>map : { <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U, U]; <U>(this: [string, string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [string, string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U, U]; <U>(this: [string, string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [string, string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U, U]; <U>(this: [string, string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [string, string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U): [U, U]; <U>(this: [string, string], callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [string, string], callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U): U[]; <U>(callbackfn: (this: void, value: string, index: number, array: string[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: string, index: number, array: string[]) => U, thisArg: Z): U[]; }
function () { });
>function () { } : (this: undefined) => void
>function () { } : (this: void) => void

View File

@ -13,9 +13,9 @@ function map<T, U>(items: T[], f: (x: T) => U): U[]{
return items.map(f);
>items.map(f) : U[]
>items.map : { <U>(this: [T, T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U, U, U, U]; <U>(this: [T, T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U, U]; <U>(this: [T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U]; <U>(this: [T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U]; <U>(this: [T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): U[]; <U>(callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[]; }
>items.map : { <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U]; <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U): U[]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[]; }
>items : T[]
>map : { <U>(this: [T, T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U, U, U, U]; <U>(this: [T, T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U, U]; <U>(this: [T, T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U]; <U>(this: [T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): [U, U]; <U>(this: [T, T], callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: T, index: number, array: T[]) => U): U[]; <U>(callbackfn: (this: undefined, value: T, index: number, array: T[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[]; }
>map : { <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U, U]; <U>(this: [T, T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [T, T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U, U]; <U>(this: [T, T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [T, T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U, U]; <U>(this: [T, T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [T, T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U): [U, U]; <U>(this: [T, T], callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [T, T], callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U): U[]; <U>(callbackfn: (this: void, value: T, index: number, array: T[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: T, index: number, array: T[]) => U, thisArg: Z): U[]; }
>f : (x: T) => U
}
@ -54,9 +54,9 @@ var v1: number[];
var v1 = xs.map(identity); // Error if not number[]
>v1 : number[]
>xs.map(identity) : number[]
>xs.map : { <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>xs.map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>xs : number[]
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>identity : <T>(x: T) => T
var v1 = map(xs, identity); // Error if not number[]
@ -72,9 +72,9 @@ var v2: number[][];
var v2 = xs.map(singleton); // Error if not number[][]
>v2 : number[][]
>xs.map(singleton) : number[][]
>xs.map : { <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>xs.map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>xs : number[]
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>singleton : <T>(x: T) => T[]
var v2 = map(xs, singleton); // Error if not number[][]

View File

@ -105,10 +105,10 @@
>(...numbers) => numbers.every(n => n > 0) : (...numbers: number[]) => boolean
>numbers : number[]
>numbers.every(n => n > 0) : boolean
>numbers.every : { (callbackfn: (this: undefined, value: number, index: number, array: number[]) => boolean): boolean; (callbackfn: (this: undefined, value: number, index: number, array: number[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => boolean, thisArg: Z): boolean; }
>numbers.every : { (callbackfn: (this: void, value: number, index: number, array: number[]) => boolean): boolean; (callbackfn: (this: void, value: number, index: number, array: number[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => boolean, thisArg: Z): boolean; }
>numbers : number[]
>every : { (callbackfn: (this: undefined, value: number, index: number, array: number[]) => boolean): boolean; (callbackfn: (this: undefined, value: number, index: number, array: number[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => boolean, thisArg: Z): boolean; }
>n => n > 0 : (this: undefined, n: number) => boolean
>every : { (callbackfn: (this: void, value: number, index: number, array: number[]) => boolean): boolean; (callbackfn: (this: void, value: number, index: number, array: number[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: number, index: number, array: number[]) => boolean, thisArg: Z): boolean; }
>n => n > 0 : (this: void, n: number) => boolean
>n : number
>n > 0 : boolean
>n : number
@ -123,10 +123,10 @@
>(...mixed) => mixed.every(n => !!n) : (...mixed: (string | number)[]) => boolean
>mixed : (string | number)[]
>mixed.every(n => !!n) : boolean
>mixed.every : { (callbackfn: (this: undefined, value: string | number, index: number, array: (string | number)[]) => boolean): boolean; (callbackfn: (this: undefined, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: Z): boolean; }
>mixed.every : { (callbackfn: (this: void, value: string | number, index: number, array: (string | number)[]) => boolean): boolean; (callbackfn: (this: void, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: Z): boolean; }
>mixed : (string | number)[]
>every : { (callbackfn: (this: undefined, value: string | number, index: number, array: (string | number)[]) => boolean): boolean; (callbackfn: (this: undefined, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: Z): boolean; }
>n => !!n : (this: undefined, n: string | number) => boolean
>every : { (callbackfn: (this: void, value: string | number, index: number, array: (string | number)[]) => boolean): boolean; (callbackfn: (this: void, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: string | number, index: number, array: (string | number)[]) => boolean, thisArg: Z): boolean; }
>n => !!n : (this: void, n: string | number) => boolean
>n : string | number
>!!n : boolean
>!n : boolean
@ -141,10 +141,10 @@
>(...noNumbers) => noNumbers.some(n => n > 0) : (...noNumbers: any[]) => boolean
>noNumbers : any[]
>noNumbers.some(n => n > 0) : boolean
>noNumbers.some : { (callbackfn: (this: undefined, value: any, index: number, array: any[]) => boolean): boolean; (callbackfn: (this: undefined, value: any, index: number, array: any[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: any, index: number, array: any[]) => boolean, thisArg: Z): boolean; }
>noNumbers.some : { (callbackfn: (this: void, value: any, index: number, array: any[]) => boolean): boolean; (callbackfn: (this: void, value: any, index: number, array: any[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: any, index: number, array: any[]) => boolean, thisArg: Z): boolean; }
>noNumbers : any[]
>some : { (callbackfn: (this: undefined, value: any, index: number, array: any[]) => boolean): boolean; (callbackfn: (this: undefined, value: any, index: number, array: any[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: any, index: number, array: any[]) => boolean, thisArg: Z): boolean; }
>n => n > 0 : (this: undefined, n: any) => boolean
>some : { (callbackfn: (this: void, value: any, index: number, array: any[]) => boolean): boolean; (callbackfn: (this: void, value: any, index: number, array: any[]) => boolean, thisArg: undefined): boolean; <Z>(callbackfn: (this: Z, value: any, index: number, array: any[]) => boolean, thisArg: Z): boolean; }
>n => n > 0 : (this: void, n: any) => boolean
>n : any
>n > 0 : boolean
>n : any
@ -160,10 +160,10 @@
>first : number
>[] : undefined[]
>rest.map(n => n > 0) : boolean[]
>rest.map : { <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>rest.map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>rest : number[]
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: undefined, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>n => n > 0 : (this: undefined, n: number) => boolean
>map : { <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U, U]; <U>(this: [number, number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [number, number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U, U]; <U>(this: [number, number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [number, number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U, U]; <U>(this: [number, number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [number, number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U): [U, U]; <U>(this: [number, number], callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [number, number], callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U): U[]; <U>(callbackfn: (this: void, value: number, index: number, array: number[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: number, index: number, array: number[]) => U, thisArg: Z): U[]; }
>n => n > 0 : (this: void, n: number) => boolean
>n : number
>n > 0 : boolean
>n : number

View File

@ -4,15 +4,15 @@
[{ x: 1 }].map(
>[{ x: 1 }].map( ({ x }) => x) : number[]
>[{ x: 1 }].map : { <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U): U[]; <U>(callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): U[]; }
>[{ x: 1 }].map : { <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): U[]; <U>(callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): U[]; }
>[{ x: 1 }] : { x: number; }[]
>{ x: 1 } : { x: number; }
>x : number
>1 : 1
>map : { <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U): U[]; <U>(callbackfn: (this: undefined, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): U[]; }
>map : { <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ x: number; }, { x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): [U, U]; <U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ x: number; }, { x: number; }], callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U): U[]; <U>(callbackfn: (this: void, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { x: number; }, index: number, array: { x: number; }[]) => U, thisArg: Z): U[]; }
({ x }) => x
>({ x }) => x : (this: undefined, {x}: { x: number; }) => number
>({ x }) => x : (this: void, {x}: { x: number; }) => number
>x : number
>x : number

View File

@ -44,15 +44,15 @@ export async function runSampleWorks<A, B, C, D, E>(
>bluebird : typeof bluebird
>all : bluebird<any>[]
>[a, b, c, d, e].filter(el => !!el) : bluebird<A>[]
>[a, b, c, d, e].filter : { (callbackfn: (this: undefined, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: undefined, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
>[a, b, c, d, e].filter : { (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
>[a, b, c, d, e] : bluebird<A>[]
>a : bluebird<A>
>b : bluebird<B>
>c : bluebird<C>
>d : bluebird<D>
>e : bluebird<E>
>filter : { (callbackfn: (this: undefined, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: undefined, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
>el => !!el : (this: undefined, el: bluebird<A>) => boolean
>filter : { (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
>el => !!el : (this: void, el: bluebird<A>) => boolean
>el : bluebird<A>
>!!el : boolean
>!el : boolean
@ -129,15 +129,15 @@ export async function runSampleBreaks<A, B, C, D, E>(
>bluebird : typeof bluebird
>all : bluebird<any>[]
>[a, b, c, d, e].filter(el => !!el) : bluebird<A>[]
>[a, b, c, d, e].filter : { (callbackfn: (this: undefined, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: undefined, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
>[a, b, c, d, e].filter : { (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
>[a, b, c, d, e] : bluebird<A>[]
>a : bluebird<A>
>b : bluebird<B>
>c : bluebird<C>
>d : bluebird<D>
>e : bluebird<E>
>filter : { (callbackfn: (this: undefined, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: undefined, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
>el => !!el : (this: undefined, el: bluebird<A>) => boolean
>filter : { (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any): bluebird<A>[]; (callbackfn: (this: void, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: undefined): bluebird<A>[]; <Z>(callbackfn: (this: Z, value: bluebird<A>, index: number, array: bluebird<A>[]) => any, thisArg: Z): bluebird<A>[]; }
>el => !!el : (this: void, el: bluebird<A>) => boolean
>el : bluebird<A>
>!!el : boolean
>!el : boolean

View File

@ -5,7 +5,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(11,1): error TS2322: Ty
tests/cases/compiler/defaultArgsInFunctionExpressions.ts(14,51): error TS2352: Type 'string' cannot be converted to type 'number'.
tests/cases/compiler/defaultArgsInFunctionExpressions.ts(17,41): error TS2322: Type '""' is not assignable to type 'number'.
tests/cases/compiler/defaultArgsInFunctionExpressions.ts(20,62): error TS2352: Type 'string' cannot be converted to type 'number'.
tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: Cannot find name 'T'.
tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2708: Cannot use namespace 'T' as a value.
==== tests/cases/compiler/defaultArgsInFunctionExpressions.ts (8 errors) ====
@ -52,7 +52,7 @@ tests/cases/compiler/defaultArgsInFunctionExpressions.ts(28,15): error TS2304: C
var f6 = (t = T) => { };
~
!!! error TS2304: Cannot find name 'T'.
!!! error TS2708: Cannot use namespace 'T' as a value.
var f7 = (t = U) => { return t; };
f7().x;

View File

@ -0,0 +1,38 @@
//// [emitDecoratorMetadata_object.ts]
declare const MyClassDecorator: ClassDecorator;
declare const MyMethodDecorator: MethodDecorator;
@MyClassDecorator
class A {
constructor(hi: object) {}
@MyMethodDecorator
method(there: object) {}
}
//// [emitDecoratorMetadata_object.js]
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var A = (function () {
function A(hi) {
}
A.prototype.method = function (there) { };
return A;
}());
__decorate([
MyMethodDecorator,
__metadata("design:type", Function),
__metadata("design:paramtypes", [Object]),
__metadata("design:returntype", void 0)
], A.prototype, "method", null);
A = __decorate([
MyClassDecorator,
__metadata("design:paramtypes", [Object])
], A);

View File

@ -0,0 +1,26 @@
=== tests/cases/compiler/emitDecoratorMetadata_object.ts ===
declare const MyClassDecorator: ClassDecorator;
>MyClassDecorator : Symbol(MyClassDecorator, Decl(emitDecoratorMetadata_object.ts, 0, 13))
>ClassDecorator : Symbol(ClassDecorator, Decl(lib.d.ts, --, --))
declare const MyMethodDecorator: MethodDecorator;
>MyMethodDecorator : Symbol(MyMethodDecorator, Decl(emitDecoratorMetadata_object.ts, 1, 13))
>MethodDecorator : Symbol(MethodDecorator, Decl(lib.d.ts, --, --))
@MyClassDecorator
>MyClassDecorator : Symbol(MyClassDecorator, Decl(emitDecoratorMetadata_object.ts, 0, 13))
class A {
>A : Symbol(A, Decl(emitDecoratorMetadata_object.ts, 1, 49))
constructor(hi: object) {}
>hi : Symbol(hi, Decl(emitDecoratorMetadata_object.ts, 5, 16))
@MyMethodDecorator
>MyMethodDecorator : Symbol(MyMethodDecorator, Decl(emitDecoratorMetadata_object.ts, 1, 13))
method(there: object) {}
>method : Symbol(A.method, Decl(emitDecoratorMetadata_object.ts, 5, 30))
>there : Symbol(there, Decl(emitDecoratorMetadata_object.ts, 7, 11))
}

View File

@ -0,0 +1,26 @@
=== tests/cases/compiler/emitDecoratorMetadata_object.ts ===
declare const MyClassDecorator: ClassDecorator;
>MyClassDecorator : ClassDecorator
>ClassDecorator : ClassDecorator
declare const MyMethodDecorator: MethodDecorator;
>MyMethodDecorator : MethodDecorator
>MethodDecorator : MethodDecorator
@MyClassDecorator
>MyClassDecorator : ClassDecorator
class A {
>A : A
constructor(hi: object) {}
>hi : object
@MyMethodDecorator
>MyMethodDecorator : MethodDecorator
method(there: object) {}
>method : (there: object) => void
>there : object
}

View File

@ -25,10 +25,10 @@ var enumValue = MyEnumType.foo;
var x = _arr.map(o => MyEnumType[o.key] === enumValue); // these are not same type
>x : boolean[]
>_arr.map(o => MyEnumType[o.key] === enumValue) : boolean[]
>_arr.map : { <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U): U[]; <U>(callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): U[]; }
>_arr.map : { <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): U[]; <U>(callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): U[]; }
>_arr : { key: string; }[]
>map : { <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U): U[]; <U>(callbackfn: (this: undefined, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): U[]; }
>o => MyEnumType[o.key] === enumValue : (this: undefined, o: { key: string; }) => boolean
>map : { <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U, U]; <Z, U>(this: [{ key: string; }, { key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): [U, U]; <U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): [U, U]; <Z, U>(this: [{ key: string; }, { key: string; }], callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): [U, U]; <U>(callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U): U[]; <U>(callbackfn: (this: void, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: undefined): U[]; <Z, U>(callbackfn: (this: Z, value: { key: string; }, index: number, array: { key: string; }[]) => U, thisArg: Z): U[]; }
>o => MyEnumType[o.key] === enumValue : (this: void, o: { key: string; }) => boolean
>o : { key: string; }
>MyEnumType[o.key] === enumValue : boolean
>MyEnumType[o.key] : any

Some files were not shown because too many files have changed in this diff Show More