Merge branch 'master' into referencesPrototypeSourceFile

This commit is contained in:
Sheetal Nandi
2019-07-25 14:03:48 -07:00
271 changed files with 15643 additions and 13119 deletions
+7 -2
View File
@@ -612,7 +612,8 @@ namespace ts {
*/
function getProgramBuildInfo(state: Readonly<ReusableBuilderProgramState>, getCanonicalFileName: GetCanonicalFileName): ProgramBuildInfo | undefined {
if (state.compilerOptions.outFile || state.compilerOptions.out) return undefined;
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getOutputPathForBuildInfo(state.compilerOptions)!, Debug.assertDefined(state.program).getCurrentDirectory()));
const currentDirectory = Debug.assertDefined(state.program).getCurrentDirectory();
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getOutputPathForBuildInfo(state.compilerOptions)!, currentDirectory));
const fileInfos: MapLike<BuilderState.FileInfo> = {};
state.fileInfos.forEach((value, key) => {
const signature = state.currentAffectedFilesSignatures && state.currentAffectedFilesSignatures.get(key);
@@ -621,7 +622,7 @@ namespace ts {
const result: ProgramBuildInfo = {
fileInfos,
options: convertToReusableCompilerOptions(state.compilerOptions, relativeToBuildInfo)
options: convertToReusableCompilerOptions(state.compilerOptions, relativeToBuildInfoEnsuringAbsolutePath)
};
if (state.referencedMap) {
const referencedMap: MapLike<string[]> = {};
@@ -661,6 +662,10 @@ namespace ts {
return result;
function relativeToBuildInfoEnsuringAbsolutePath(path: string) {
return relativeToBuildInfo(getNormalizedAbsolutePath(path, currentDirectory));
}
function relativeToBuildInfo(path: string) {
return ensurePathIsNonModuleName(getRelativePathFromDirectory(buildInfoDirectory, path, getCanonicalFileName));
}
+234 -114
View File
@@ -42,10 +42,10 @@ namespace ts {
iterableCacheKey: "iterationTypesOfAsyncIterable" | "iterationTypesOfIterable";
iteratorCacheKey: "iterationTypesOfAsyncIterator" | "iterationTypesOfIterator";
iteratorSymbolName: "asyncIterator" | "iterator";
getGlobalIteratorType: (reportErrors: boolean) => Type;
getGlobalIterableType: (reportErrors: boolean) => Type;
getGlobalIterableIteratorType: (reportErrors: boolean) => Type;
getGlobalGeneratorType: (reportErrors: boolean) => Type;
getGlobalIteratorType: (reportErrors: boolean) => GenericType;
getGlobalIterableType: (reportErrors: boolean) => GenericType;
getGlobalIterableIteratorType: (reportErrors: boolean) => GenericType;
getGlobalGeneratorType: (reportErrors: boolean) => GenericType;
resolveIterationType: (type: Type, errorNode: Node | undefined) => Type | undefined;
mustHaveANextMethodDiagnostic: DiagnosticMessage;
mustBeAMethodDiagnostic: DiagnosticMessage;
@@ -7247,9 +7247,11 @@ namespace ts {
}
function combineUnionParameters(left: Signature, right: Signature) {
const longest = getParameterCount(left) >= getParameterCount(right) ? left : right;
const leftCount = getParameterCount(left);
const rightCount = getParameterCount(right);
const longest = leftCount >= rightCount ? left : right;
const shorter = longest === left ? right : left;
const longestCount = getParameterCount(longest);
const longestCount = longest === left ? leftCount : rightCount;
const eitherHasEffectiveRest = (hasEffectiveRestParameter(left) || hasEffectiveRestParameter(right));
const needsExtraRestElement = eitherHasEffectiveRest && !hasEffectiveRestParameter(longest);
const params = new Array<Symbol>(longestCount + (needsExtraRestElement ? 1 : 0));
@@ -7259,11 +7261,16 @@ namespace ts {
const unionParamType = getIntersectionType([longestParamType, shorterParamType]);
const isRestParam = eitherHasEffectiveRest && !needsExtraRestElement && i === (longestCount - 1);
const isOptional = i >= getMinArgumentCount(longest) && i >= getMinArgumentCount(shorter);
const leftName = getParameterNameAtPosition(left, i);
const rightName = getParameterNameAtPosition(right, i);
const leftName = i >= leftCount ? undefined : getParameterNameAtPosition(left, i);
const rightName = i >= rightCount ? undefined : getParameterNameAtPosition(right, i);
const paramName = leftName === rightName ? leftName :
!leftName ? rightName :
!rightName ? leftName :
undefined;
const paramSymbol = createSymbol(
SymbolFlags.FunctionScopedVariable | (isOptional && !isRestParam ? SymbolFlags.Optional : 0),
leftName === rightName ? leftName : `arg${i}` as __String
paramName || `arg${i}` as __String
);
paramSymbol.type = isRestParam ? createArrayType(unionParamType) : unionParamType;
params[i] = paramSymbol;
@@ -9524,24 +9531,10 @@ namespace ts {
return createTypeFromGenericGlobalType(getGlobalTypedPropertyDescriptorType(), [propertyType]);
}
function createAsyncGeneratorType(yieldType: Type, returnType: Type, nextType: Type) {
const globalAsyncGeneratorType = getGlobalAsyncGeneratorType(/*reportErrors*/ true);
if (globalAsyncGeneratorType !== emptyGenericType) {
yieldType = getAwaitedType(yieldType) || unknownType;
returnType = getAwaitedType(returnType) || unknownType;
nextType = getAwaitedType(nextType) || unknownType;
}
return createTypeFromGenericGlobalType(globalAsyncGeneratorType, [yieldType, returnType, nextType]);
}
function createIterableType(iteratedType: Type): Type {
return createTypeFromGenericGlobalType(getGlobalIterableType(/*reportErrors*/ true), [iteratedType]);
}
function createGeneratorType(yieldType: Type, returnType: Type, nextType: Type) {
return createTypeFromGenericGlobalType(getGlobalGeneratorType(/*reportErrors*/ true), [yieldType, returnType, nextType]);
}
function createArrayType(elementType: Type, readonly?: boolean): ObjectType {
return createTypeFromGenericGlobalType(readonly ? globalReadonlyArrayType : globalArrayType, [elementType]);
}
@@ -9897,7 +9890,7 @@ namespace ts {
return links.resolvedType;
}
function addTypeToIntersection(typeSet: Type[], includes: TypeFlags, type: Type) {
function addTypeToIntersection(typeSet: Map<Type>, includes: TypeFlags, type: Type) {
const flags = type.flags;
if (flags & TypeFlags.Intersection) {
return addTypesToIntersection(typeSet, includes, (<IntersectionType>type).types);
@@ -9905,20 +9898,20 @@ namespace ts {
if (isEmptyAnonymousObjectType(type)) {
if (!(includes & TypeFlags.IncludesEmptyObject)) {
includes |= TypeFlags.IncludesEmptyObject;
typeSet.push(type);
typeSet.set(type.id.toString(), type);
}
}
else {
if (flags & TypeFlags.AnyOrUnknown) {
if (type === wildcardType) includes |= TypeFlags.IncludesWildcard;
}
else if ((strictNullChecks || !(flags & TypeFlags.Nullable)) && !contains(typeSet, type)) {
else if ((strictNullChecks || !(flags & TypeFlags.Nullable)) && !typeSet.has(type.id.toString())) {
if (type.flags & TypeFlags.Unit && includes & TypeFlags.Unit) {
// We have seen two distinct unit types which means we should reduce to an
// empty intersection. Adding TypeFlags.NonPrimitive causes that to happen.
includes |= TypeFlags.NonPrimitive;
}
typeSet.push(type);
typeSet.set(type.id.toString(), type);
}
includes |= flags & TypeFlags.IncludesMask;
}
@@ -9927,7 +9920,7 @@ namespace ts {
// Add the given types to the given type set. Order is preserved, freshness is removed from literal
// types, duplicates are removed, and nested types of the given kind are flattened into the set.
function addTypesToIntersection(typeSet: Type[], includes: TypeFlags, types: ReadonlyArray<Type>) {
function addTypesToIntersection(typeSet: Map<Type>, includes: TypeFlags, types: ReadonlyArray<Type>) {
for (const type of types) {
includes = addTypeToIntersection(typeSet, includes, getRegularTypeOfLiteralType(type));
}
@@ -10034,8 +10027,9 @@ namespace ts {
// Also, unlike union types, the order of the constituent types is preserved in order that overload resolution
// for intersections of types with signatures can be deterministic.
function getIntersectionType(types: ReadonlyArray<Type>, aliasSymbol?: Symbol, aliasTypeArguments?: ReadonlyArray<Type>): Type {
const typeSet: Type[] = [];
const includes = addTypesToIntersection(typeSet, 0, types);
const typeMembershipMap: Map<Type> = createMap();
const includes = addTypesToIntersection(typeMembershipMap, 0, types);
const typeSet: Type[] = arrayFrom(typeMembershipMap.values());
// An intersection type is considered empty if it contains
// the type never, or
// more than one unit type or,
@@ -13443,7 +13437,8 @@ namespace ts {
if (includeOptional
? !(filteredByApplicability!.flags & TypeFlags.Never)
: isRelatedTo(targetConstraint, sourceKeys)) {
const indexingType = filteredByApplicability || getTypeParameterFromMappedType(target);
const typeParameter = getTypeParameterFromMappedType(target);
const indexingType = filteredByApplicability ? getIntersectionType([filteredByApplicability, typeParameter]) : typeParameter;
const indexedAccessType = getIndexedAccessType(source, indexingType);
const templateType = getTemplateTypeFromMappedType(target);
if (result = isRelatedTo(indexedAccessType, templateType, reportErrors)) {
@@ -13545,6 +13540,9 @@ namespace ts {
if (relation !== identityRelation) {
source = getApparentType(source);
}
else if (isGenericMappedType(source)) {
return Ternary.False;
}
if (getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference && (<TypeReference>source).target === (<TypeReference>target).target &&
!(getObjectFlags(source) & ObjectFlags.MarkerType || getObjectFlags(target) & ObjectFlags.MarkerType)) {
// We have type references to the same generic type, and the type references are not marker
@@ -15258,8 +15256,8 @@ namespace ts {
const inference = inferences[i];
if (t === inference.typeParameter) {
if (fix && !inference.isFixed) {
clearCachedInferences(inferences);
inference.isFixed = true;
inference.inferredType = undefined;
}
return getInferredType(context, i);
}
@@ -15267,6 +15265,14 @@ namespace ts {
return t;
}
function clearCachedInferences(inferences: InferenceInfo[]) {
for (const inference of inferences) {
if (!inference.isFixed) {
inference.inferredType = undefined;
}
}
}
function createInferenceInfo(typeParameter: TypeParameter): InferenceInfo {
return {
typeParameter,
@@ -15453,9 +15459,11 @@ namespace ts {
function inferTypes(inferences: InferenceInfo[], originalSource: Type, originalTarget: Type, priority: InferencePriority = 0, contravariant = false) {
let symbolStack: Symbol[];
let visited: Map<boolean>;
let visited: Map<number>;
let bivariant = false;
let propagationType: Type;
let inferenceCount = 0;
let inferenceIncomplete = false;
let allowComplexConstraintInference = true;
inferFromTypes(originalSource, originalTarget);
@@ -15497,23 +15505,28 @@ namespace ts {
// of all their possible values.
let matchingTypes: Type[] | undefined;
for (const t of (<UnionOrIntersectionType>source).types) {
if (typeIdenticalToSomeType(t, (<UnionOrIntersectionType>target).types)) {
(matchingTypes || (matchingTypes = [])).push(t);
inferFromTypes(t, t);
}
else if (t.flags & (TypeFlags.NumberLiteral | TypeFlags.StringLiteral)) {
const b = getBaseTypeOfLiteralType(t);
if (typeIdenticalToSomeType(b, (<UnionOrIntersectionType>target).types)) {
(matchingTypes || (matchingTypes = [])).push(t, b);
}
const matched = findMatchedType(t, <UnionOrIntersectionType>target);
if (matched) {
(matchingTypes || (matchingTypes = [])).push(matched);
inferFromTypes(matched, matched);
}
}
// Next, to improve the quality of inferences, reduce the source and target types by
// removing the identically matched constituents. For example, when inferring from
// 'string | string[]' to 'string | T' we reduce the types to 'string[]' and 'T'.
if (matchingTypes) {
source = removeTypesFromUnionOrIntersection(<UnionOrIntersectionType>source, matchingTypes);
target = removeTypesFromUnionOrIntersection(<UnionOrIntersectionType>target, matchingTypes);
const s = removeTypesFromUnionOrIntersection(<UnionOrIntersectionType>source, matchingTypes);
const t = removeTypesFromUnionOrIntersection(<UnionOrIntersectionType>target, matchingTypes);
if (!(s && t)) return;
source = s;
target = t;
}
}
else if (target.flags & TypeFlags.Union && !(target.flags & TypeFlags.EnumLiteral) || target.flags & TypeFlags.Intersection) {
const matched = findMatchedType(source, <UnionOrIntersectionType>target);
if (matched) {
inferFromTypes(matched, matched);
return;
}
}
else if (target.flags & (TypeFlags.IndexedAccess | TypeFlags.Substitution)) {
@@ -15546,26 +15559,27 @@ namespace ts {
if (contravariant && !bivariant) {
if (!contains(inference.contraCandidates, candidate)) {
inference.contraCandidates = append(inference.contraCandidates, candidate);
inference.inferredType = undefined;
clearCachedInferences(inferences);
}
}
else if (!contains(inference.candidates, candidate)) {
inference.candidates = append(inference.candidates, candidate);
inference.inferredType = undefined;
clearCachedInferences(inferences);
}
}
if (!(priority & InferencePriority.ReturnType) && target.flags & TypeFlags.TypeParameter && inference.topLevel && !isTypeParameterAtTopLevel(originalTarget, <TypeParameter>target)) {
inference.topLevel = false;
inference.inferredType = undefined;
clearCachedInferences(inferences);
}
}
inferenceCount++;
return;
}
else {
// Infer to the simplified version of an indexed access, if possible, to (hopefully) expose more bare type parameters to the inference engine
const simplified = getSimplifiedType(target, /*writing*/ false);
if (simplified !== target) {
inferFromTypesOnce(source, simplified);
invokeOnce(source, simplified, inferFromTypes);
}
else if (target.flags & TypeFlags.IndexedAccess) {
const indexType = getSimplifiedType((target as IndexedAccessType).indexType, /*writing*/ false);
@@ -15574,13 +15588,14 @@ namespace ts {
if (indexType.flags & TypeFlags.Instantiable) {
const simplified = distributeIndexOverObjectType(getSimplifiedType((target as IndexedAccessType).objectType, /*writing*/ false), indexType, /*writing*/ false);
if (simplified && simplified !== target) {
inferFromTypesOnce(source, simplified);
invokeOnce(source, simplified, inferFromTypes);
}
}
}
}
}
if (getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference && (<TypeReference>source).target === (<TypeReference>target).target) {
if (getObjectFlags(source) & ObjectFlags.Reference && getObjectFlags(target) & ObjectFlags.Reference && (
(<TypeReference>source).target === (<TypeReference>target).target || isArrayType(source) && isArrayType(target))) {
// If source and target are references to the same generic type, infer from type arguments
inferFromTypeArguments((<TypeReference>source).typeArguments || emptyArray, (<TypeReference>target).typeArguments || emptyArray, getVariances((<TypeReference>source).target));
}
@@ -15610,10 +15625,10 @@ namespace ts {
}
else if (target.flags & TypeFlags.Conditional && !contravariant) {
const targetTypes = [getTrueTypeFromConditionalType(<ConditionalType>target), getFalseTypeFromConditionalType(<ConditionalType>target)];
inferToMultipleTypes(source, targetTypes, /*isIntersection*/ false);
inferToMultipleTypes(source, targetTypes, target.flags);
}
else if (target.flags & TypeFlags.UnionOrIntersection) {
inferToMultipleTypes(source, (<UnionOrIntersectionType>target).types, !!(target.flags & TypeFlags.Intersection));
inferToMultipleTypes(source, (<UnionOrIntersectionType>target).types, target.flags);
}
else if (source.flags & TypeFlags.Union) {
// Source is a union or intersection type, infer from each constituent type
@@ -15642,39 +15657,22 @@ namespace ts {
source = apparentSource;
}
if (source.flags & (TypeFlags.Object | TypeFlags.Intersection)) {
const key = source.id + "," + target.id;
if (visited && visited.get(key)) {
return;
}
(visited || (visited = createMap<boolean>())).set(key, true);
// If we are already processing another target type with the same associated symbol (such as
// an instantiation of the same generic type), we do not explore this target as it would yield
// no further inferences. We exclude the static side of classes from this check since it shares
// its symbol with the instance side which would lead to false positives.
const isNonConstructorObject = target.flags & TypeFlags.Object &&
!(getObjectFlags(target) & ObjectFlags.Anonymous && target.symbol && target.symbol.flags & SymbolFlags.Class);
const symbol = isNonConstructorObject ? target.symbol : undefined;
if (symbol) {
if (contains(symbolStack, symbol)) {
return;
}
(symbolStack || (symbolStack = [])).push(symbol);
inferFromObjectTypes(source, target);
symbolStack.pop();
}
else {
inferFromObjectTypes(source, target);
}
invokeOnce(source, target, inferFromObjectTypes);
}
}
}
function inferFromTypesOnce(source: Type, target: Type) {
const key = source.id + "," + target.id;
if (!visited || !visited.get(key)) {
(visited || (visited = createMap<boolean>())).set(key, true);
inferFromTypes(source, target);
}
function invokeOnce(source: Type, target: Type, action: (source: Type, target: Type) => void) {
const key = source.id + "," + target.id;
const count = visited && visited.get(key);
if (count !== undefined) {
inferenceCount += count;
return;
}
(visited || (visited = createMap<number>())).set(key, 0);
const startCount = inferenceCount;
action(source, target);
visited.set(key, inferenceCount - startCount);
}
function inferFromTypeArguments(sourceTypes: readonly Type[], targetTypes: readonly Type[], variances: readonly VarianceFlags[]) {
@@ -15711,24 +15709,60 @@ namespace ts {
return undefined;
}
function inferToMultipleTypes(source: Type, targets: Type[], isIntersection: boolean) {
// We infer from types that are not naked type variables first so that inferences we
// make from nested naked type variables and given slightly higher priority by virtue
// of being first in the candidates array.
function inferToMultipleTypes(source: Type, targets: Type[], targetFlags: TypeFlags) {
let typeVariableCount = 0;
for (const t of targets) {
if (getInferenceInfoForType(t)) {
typeVariableCount++;
if (targetFlags & TypeFlags.Union) {
let nakedTypeVariable: Type | undefined;
const sources = source.flags & TypeFlags.Union ? (<UnionType>source).types : [source];
const matched = new Array<boolean>(sources.length);
const saveInferenceIncomplete = inferenceIncomplete;
inferenceIncomplete = false;
// First infer to types that are not naked type variables. For each source type we
// track whether inferences were made from that particular type to some target.
for (const t of targets) {
if (getInferenceInfoForType(t)) {
nakedTypeVariable = t;
typeVariableCount++;
}
else {
for (let i = 0; i < sources.length; i++) {
const count = inferenceCount;
inferFromTypes(sources[i], t);
if (count !== inferenceCount) matched[i] = true;
}
}
}
else {
inferFromTypes(source, t);
const inferenceComplete = !inferenceIncomplete;
inferenceIncomplete = inferenceIncomplete || saveInferenceIncomplete;
// If the target has a single naked type variable and inference completed (meaning we
// explored the types fully), create a union of the source types from which no inferences
// have been made so far and infer from that union to the naked type variable.
if (typeVariableCount === 1 && inferenceComplete) {
const unmatched = flatMap(sources, (s, i) => matched[i] ? undefined : s);
if (unmatched.length) {
inferFromTypes(getUnionType(unmatched), nakedTypeVariable!);
return;
}
}
}
else {
// We infer from types that are not naked type variables first so that inferences we
// make from nested naked type variables and given slightly higher priority by virtue
// of being first in the candidates array.
for (const t of targets) {
if (getInferenceInfoForType(t)) {
typeVariableCount++;
}
else {
inferFromTypes(source, t);
}
}
}
// Inferences directly to naked type variables are given lower priority as they are
// less specific. For example, when inferring from Promise<string> to T | Promise<T>,
// we want to infer string for T, not Promise<string> | string. For intersection types
// we only infer to single naked type variables.
if (isIntersection ? typeVariableCount === 1 : typeVariableCount !== 0) {
if (targetFlags & TypeFlags.Intersection ? typeVariableCount === 1 : typeVariableCount > 0) {
const savePriority = priority;
priority |= InferencePriority.NakedTypeVariable;
for (const t of targets) {
@@ -15797,6 +15831,28 @@ namespace ts {
}
function inferFromObjectTypes(source: Type, target: Type) {
// If we are already processing another target type with the same associated symbol (such as
// an instantiation of the same generic type), we do not explore this target as it would yield
// no further inferences. We exclude the static side of classes from this check since it shares
// its symbol with the instance side which would lead to false positives.
const isNonConstructorObject = target.flags & TypeFlags.Object &&
!(getObjectFlags(target) & ObjectFlags.Anonymous && target.symbol && target.symbol.flags & SymbolFlags.Class);
const symbol = isNonConstructorObject ? target.symbol : undefined;
if (symbol) {
if (contains(symbolStack, symbol)) {
inferenceIncomplete = true;
return;
}
(symbolStack || (symbolStack = [])).push(symbol);
inferFromObjectTypesWorker(source, target);
symbolStack.pop();
}
else {
inferFromObjectTypesWorker(source, target);
}
}
function inferFromObjectTypesWorker(source: Type, target: Type) {
if (isGenericMappedType(source) && isGenericMappedType(target)) {
// The source and target types are generic types { [P in S]: X } and { [P in T]: Y }, so we infer
// from S to T and from X to Y.
@@ -15899,15 +15955,35 @@ namespace ts {
}
}
function typeIdenticalToSomeType(type: Type, types: Type[]): boolean {
function isMatchableType(type: Type) {
// We exclude non-anonymous object types because some frameworks (e.g. Ember) rely on the ability to
// infer between types that don't witness their type variables. Such types would otherwise be eliminated
// because they appear identical.
return !(type.flags & TypeFlags.Object) || !!(getObjectFlags(type) & ObjectFlags.Anonymous);
}
function typeMatchedBySomeType(type: Type, types: Type[]): boolean {
for (const t of types) {
if (isTypeIdenticalTo(t, type)) {
if (t === type || isMatchableType(t) && isMatchableType(type) && isTypeIdenticalTo(t, type)) {
return true;
}
}
return false;
}
function findMatchedType(type: Type, target: UnionOrIntersectionType) {
if (typeMatchedBySomeType(type, target.types)) {
return type;
}
if (type.flags & (TypeFlags.NumberLiteral | TypeFlags.StringLiteral) && target.flags & TypeFlags.Union) {
const base = getBaseTypeOfLiteralType(type);
if (typeMatchedBySomeType(base, target.types)) {
return base;
}
}
return undefined;
}
/**
* Return a new union or intersection type computed by removing a given set of types
* from a given union or intersection type.
@@ -15915,11 +15991,11 @@ namespace ts {
function removeTypesFromUnionOrIntersection(type: UnionOrIntersectionType, typesToRemove: Type[]) {
const reducedTypes: Type[] = [];
for (const t of type.types) {
if (!typeIdenticalToSomeType(t, typesToRemove)) {
if (!typeMatchedBySomeType(t, typesToRemove)) {
reducedTypes.push(t);
}
}
return type.flags & TypeFlags.Union ? getUnionType(reducedTypes) : getIntersectionType(reducedTypes);
return reducedTypes.length ? type.flags & TypeFlags.Union ? getUnionType(reducedTypes) : getIntersectionType(reducedTypes) : undefined;
}
function hasPrimitiveConstraint(type: TypeParameter): boolean {
@@ -19043,7 +19119,7 @@ namespace ts {
// If the given contextual type contains instantiable types and if a mapper representing
// return type inferences is available, instantiate those types using that mapper.
function instantiateContextualType(contextualType: Type | undefined, node: Expression, contextFlags?: ContextFlags): Type | undefined {
function instantiateContextualType(contextualType: Type | undefined, node: Node, contextFlags?: ContextFlags): Type | undefined {
if (contextualType && maybeTypeOfKind(contextualType, TypeFlags.Instantiable)) {
const inferenceContext = getInferenceContext(node);
// If no inferences have been made, nothing is gained from instantiating as type parameters
@@ -20571,10 +20647,15 @@ namespace ts {
}
propType = getConstraintForLocation(getTypeOfSymbol(prop), node);
}
return getFlowTypeOfAccessExpression(node, prop, propType, right);
}
function getFlowTypeOfAccessExpression(node: ElementAccessExpression | PropertyAccessExpression | QualifiedName, prop: Symbol | undefined, propType: Type, errorNode: Node) {
// Only compute control flow type if this is a property access expression that isn't an
// assignment target, and the referenced property was declared as a variable, property,
// accessor, or optional method.
if (node.kind !== SyntaxKind.PropertyAccessExpression ||
const assignmentKind = getAssignmentTargetKind(node);
if (node.kind !== SyntaxKind.ElementAccessExpression && node.kind !== SyntaxKind.PropertyAccessExpression ||
assignmentKind === AssignmentKind.Definite ||
prop && !(prop.flags & (SymbolFlags.Variable | SymbolFlags.Property | SymbolFlags.Accessor)) && !(prop.flags & SymbolFlags.Method && propType.flags & TypeFlags.Union)) {
return propType;
@@ -20584,7 +20665,7 @@ namespace ts {
// and if we are in a constructor of the same class as the property declaration, assume that
// the property is uninitialized at the top of the control flow.
let assumeUninitialized = false;
if (strictNullChecks && strictPropertyInitialization && left.kind === SyntaxKind.ThisKeyword) {
if (strictNullChecks && strictPropertyInitialization && node.expression.kind === SyntaxKind.ThisKeyword) {
const declaration = prop && prop.valueDeclaration;
if (declaration && isInstancePropertyWithoutInitializer(declaration)) {
const flowContainer = getControlFlowContainer(node);
@@ -20601,7 +20682,7 @@ namespace ts {
}
const flowType = getFlowTypeOfReference(node, propType, assumeUninitialized ? getOptionalType(propType) : propType);
if (assumeUninitialized && !(getFalsyFlags(propType) & TypeFlags.Undefined) && getFalsyFlags(flowType) & TypeFlags.Undefined) {
error(right, Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop!)); // TODO: GH#18217
error(errorNode, Diagnostics.Property_0_is_used_before_being_assigned, symbolToString(prop!)); // TODO: GH#18217
// Return the declared type to reduce follow-on errors
return propType;
}
@@ -20707,7 +20788,8 @@ namespace ts {
else {
const promisedType = getPromisedTypeOfPromise(containingType);
if (promisedType && getPropertyOfType(promisedType, propNode.escapedText)) {
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await, declarationNameToString(propNode), typeToString(containingType));
errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(containingType));
relatedInfo = createDiagnosticForNode(propNode, Diagnostics.Did_you_forget_to_use_await);
}
else {
const suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType);
@@ -20957,7 +21039,7 @@ namespace ts {
AccessFlags.Writing | (isGenericObjectType(objectType) && !isThisTypeParameter(objectType) ? AccessFlags.NoIndexSignatures : 0) :
AccessFlags.None;
const indexedAccessType = getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, node, accessFlags) || errorType;
return checkIndexedAccessIndexType(indexedAccessType, node);
return checkIndexedAccessIndexType(getFlowTypeOfAccessExpression(node, indexedAccessType.symbol, indexedAccessType, indexExpression), node);
}
function checkThatExpressionIsProperSymbolReference(expression: Expression, expressionType: Type, reportError: boolean): boolean {
@@ -22741,7 +22823,7 @@ namespace ts {
isVariableDeclaration(decl.parent) && getSymbolOfNode(decl.parent));
const prototype = assignmentSymbol && assignmentSymbol.exports && assignmentSymbol.exports.get("prototype" as __String);
const init = prototype && prototype.valueDeclaration && getAssignedJSPrototype(prototype.valueDeclaration);
return init ? checkExpression(init) : undefined;
return init ? getWidenedType(checkExpressionCached(init)) : undefined;
}
function getAssignedJSPrototype(node: Node) {
@@ -23354,7 +23436,7 @@ namespace ts {
nextType && isUnitType(nextType)) {
const contextualType = !contextualSignature ? undefined :
contextualSignature === getSignatureFromDeclaration(func) ? isGenerator ? undefined : returnType :
getReturnTypeOfSignature(contextualSignature);
instantiateContextualType(getReturnTypeOfSignature(contextualSignature), func);
if (isGenerator) {
yieldType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(yieldType, contextualType, IterationTypeKind.Yield, isAsync);
returnType = getWidenedLiteralLikeTypeForContextualIterationTypeIfNeeded(returnType, contextualType, IterationTypeKind.Return, isAsync);
@@ -23384,9 +23466,36 @@ namespace ts {
}
function createGeneratorReturnType(yieldType: Type, returnType: Type, nextType: Type, isAsyncGenerator: boolean) {
return isAsyncGenerator
? createAsyncGeneratorType(yieldType, returnType, nextType)
: createGeneratorType(yieldType, returnType, nextType);
const resolver = isAsyncGenerator ? asyncIterationTypesResolver : syncIterationTypesResolver;
const globalGeneratorType = resolver.getGlobalGeneratorType(/*reportErrors*/ false);
yieldType = resolver.resolveIterationType(yieldType, /*errorNode*/ undefined) || unknownType;
returnType = resolver.resolveIterationType(returnType, /*errorNode*/ undefined) || unknownType;
nextType = resolver.resolveIterationType(nextType, /*errorNode*/ undefined) || unknownType;
if (globalGeneratorType === emptyGenericType) {
// Fall back to the global IterableIterator if returnType is assignable to the expected return iteration
// type of IterableIterator, and the expected next iteration type of IterableIterator is assignable to
// nextType.
const globalType = resolver.getGlobalIterableIteratorType(/*reportErrors*/ false);
const iterationTypes = globalType !== emptyGenericType ? getIterationTypesOfGlobalIterableType(globalType, resolver) : undefined;
const iterableIteratorReturnType = iterationTypes ? iterationTypes.returnType : anyType;
const iterableIteratorNextType = iterationTypes ? iterationTypes.nextType : undefinedType;
if (isTypeAssignableTo(returnType, iterableIteratorReturnType) &&
isTypeAssignableTo(iterableIteratorNextType, nextType)) {
if (globalType !== emptyGenericType) {
return createTypeFromGenericGlobalType(globalType, [yieldType]);
}
// The global IterableIterator type doesn't exist, so report an error
resolver.getGlobalIterableIteratorType(/*reportErrors*/ true);
return emptyObjectType;
}
// The global Generator type doesn't exist, so report an error
resolver.getGlobalGeneratorType(/*reportErrors*/ true);
return emptyObjectType;
}
return createTypeFromGenericGlobalType(globalGeneratorType, [yieldType, returnType, nextType]);
}
function checkAndAggregateYieldOperandTypes(func: FunctionLikeDeclaration, checkMode: CheckMode | undefined) {
@@ -24705,6 +24814,12 @@ namespace ts {
|| anyType;
}
const contextualReturnType = getContextualReturnType(func);
if (contextualReturnType) {
return getIterationTypeOfGeneratorFunctionReturnType(IterationTypeKind.Next, contextualReturnType, isAsync)
|| anyType;
}
return anyType;
}
@@ -26394,7 +26509,11 @@ namespace ts {
* The runtime behavior of the `await` keyword.
*/
function checkAwaitedType(type: Type, errorNode: Node, diagnosticMessage: DiagnosticMessage, arg0?: string | number): Type {
return getAwaitedType(type, errorNode, diagnosticMessage, arg0) || errorType;
const awaitedType = getAwaitedType(type, errorNode, diagnosticMessage, arg0);
if (awaitedType === type && !(type.flags & TypeFlags.AnyOrUnknown)) {
addErrorOrSuggestion(/*isError*/ false, createDiagnosticForNode(errorNode, Diagnostics.await_has_no_effect_on_the_type_of_this_expression));
}
return awaitedType || errorType;
}
function getAwaitedType(type: Type, errorNode?: Node, diagnosticMessage?: DiagnosticMessage, arg0?: string | number): Type | undefined {
@@ -28219,6 +28338,13 @@ namespace ts {
return (type as IterableOrIteratorType)[resolver.iterableCacheKey];
}
function getIterationTypesOfGlobalIterableType(globalType: Type, resolver: IterationTypesResolver) {
const globalIterationTypes =
getIterationTypesOfIterableCached(globalType, resolver) ||
getIterationTypesOfIterableSlow(globalType, resolver, /*errorNode*/ undefined);
return globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes;
}
/**
* Gets the *yield*, *return*, and *next* types of an `Iterable`-like or `AsyncIterable`-like
* type from from common heuristics.
@@ -28244,10 +28370,7 @@ namespace ts {
// iteration types of their `[Symbol.iterator]()` method. The same is true for their async cousins.
// While we define these as `any` and `undefined` in our libs by default, a custom lib *could* use
// different definitions.
const globalIterationTypes =
getIterationTypesOfIterableCached(globalType, resolver) ||
getIterationTypesOfIterableSlow(globalType, resolver, /*errorNode*/ undefined);
const { returnType, nextType } = globalIterationTypes === noIterationTypes ? defaultIterationTypes : globalIterationTypes;
const { returnType, nextType } = getIterationTypesOfGlobalIterableType(globalType, resolver);
return (type as IterableOrIteratorType)[resolver.iterableCacheKey] = createIterationTypes(yieldType, returnType, nextType);
}
@@ -33004,9 +33127,6 @@ namespace ts {
return grammarErrorAtPos(node, node.end - 1, ";".length, Diagnostics._0_expected, "{");
}
}
else if (isClassLike(node.parent) && isStringLiteral(node.name) && node.name.text === "constructor" && (!compilerOptions.target || compilerOptions.target < ScriptTarget.ES5)) {
return grammarErrorOnNode(node.name, Diagnostics.Quoted_constructors_have_previously_been_interpreted_as_methods_which_is_incorrect_In_TypeScript_3_6_they_will_be_correctly_parsed_as_constructors_In_the_meantime_consider_using_constructor_to_write_a_constructor_or_constructor_to_write_a_method);
}
if (checkGrammarForGenerator(node)) {
return true;
}
+26 -8
View File
@@ -2076,10 +2076,6 @@
"category": "Error",
"code": 2569
},
"Property '{0}' does not exist on type '{1}'. Did you forget to use 'await'?": {
"category": "Error",
"code": 2570
},
"Object is of type 'unknown'.": {
"category": "Error",
"code": 2571
@@ -4643,6 +4639,11 @@
"category": "Suggestion",
"code": 80006
},
"'await' has no effect on the type of this expression.": {
"category": "Suggestion",
"code": 80007
},
"Add missing 'super()' call": {
"category": "Message",
"code": 90001
@@ -5091,14 +5092,31 @@
"category": "Message",
"code": 95082
},
"Add 'await'": {
"category": "Message",
"code": 95083
},
"Add 'await' to initializer for '{0}'": {
"category": "Message",
"code": 95084
},
"Fix all expressions possibly missing 'await'": {
"category": "Message",
"code": 95085
},
"Remove unnecessary 'await'": {
"category": "Message",
"code": 95086
},
"Remove all unnecessary uses of 'await'": {
"category": "Message",
"code": 95087
},
"No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer.": {
"category": "Error",
"code": 18004
},
"Quoted constructors have previously been interpreted as methods, which is incorrect. In TypeScript 3.6, they will be correctly parsed as constructors. In the meantime, consider using 'constructor()' to write a constructor, or '[\"constructor\"]()' to write a method.": {
"category": "Error",
"code": 18005
},
"Classes may not have a field named 'constructor'.": {
"category": "Error",
"code": 18006
+5 -1
View File
@@ -411,7 +411,11 @@ namespace ts {
}
);
if (emitOnlyDtsFiles && declarationTransform.transformed[0].kind === SyntaxKind.SourceFile) {
const sourceFile = declarationTransform.transformed[0] as SourceFile;
// Improved narrowing in master/3.6 makes this cast unnecessary, triggering a lint rule.
// But at the same time, the LKG (3.5) necessitates it because it doesnt narrow.
// Once the LKG is updated to 3.6, this comment, the cast to `SourceFile`, and the
// tslint directive can be all be removed.
const sourceFile = declarationTransform.transformed[0] as SourceFile; // tslint:disable-line
exportedModulesFromDeclarationEmit = sourceFile.exportedModulesFromDeclarationEmit;
}
}
+1 -1
View File
@@ -4701,7 +4701,7 @@ namespace ts {
}
}
function getLeftmostExpression(node: Expression, stopAtCallExpressions: boolean) {
export function getLeftmostExpression(node: Expression, stopAtCallExpressions: boolean) {
while (true) {
switch (node.kind) {
case SyntaxKind.PostfixUnaryExpression:
+26 -8
View File
@@ -5656,12 +5656,27 @@ namespace ts {
return finishNode(node);
}
function parseConstructorDeclaration(node: ConstructorDeclaration): ConstructorDeclaration {
node.kind = SyntaxKind.Constructor;
parseExpected(SyntaxKind.ConstructorKeyword);
fillSignature(SyntaxKind.ColonToken, SignatureFlags.None, node);
node.body = parseFunctionBlockOrSemicolon(SignatureFlags.None, Diagnostics.or_expected);
return finishNode(node);
function parseConstructorName() {
if (token() === SyntaxKind.ConstructorKeyword) {
return parseExpected(SyntaxKind.ConstructorKeyword);
}
if (token() === SyntaxKind.StringLiteral && lookAhead(nextToken) === SyntaxKind.OpenParenToken) {
return tryParse(() => {
const literalNode = parseLiteralNode();
return literalNode.text === "constructor" ? literalNode : undefined;
});
}
}
function tryParseConstructorDeclaration(node: ConstructorDeclaration): ConstructorDeclaration | undefined {
return tryParse(() => {
if (parseConstructorName()) {
node.kind = SyntaxKind.Constructor;
fillSignature(SyntaxKind.ColonToken, SignatureFlags.None, node);
node.body = parseFunctionBlockOrSemicolon(SignatureFlags.None, Diagnostics.or_expected);
return finishNode(node);
}
});
}
function parseMethodDeclaration(node: MethodDeclaration, asteriskToken: AsteriskToken, diagnosticMessage?: DiagnosticMessage): MethodDeclaration {
@@ -5867,8 +5882,11 @@ namespace ts {
return parseAccessorDeclaration(<AccessorDeclaration>node, SyntaxKind.SetAccessor);
}
if (token() === SyntaxKind.ConstructorKeyword) {
return parseConstructorDeclaration(<ConstructorDeclaration>node);
if (token() === SyntaxKind.ConstructorKeyword || token() === SyntaxKind.StringLiteral) {
const constructorDeclaration = tryParseConstructorDeclaration(<ConstructorDeclaration>node);
if (constructorDeclaration) {
return constructorDeclaration;
}
}
if (isIndexSignature()) {
+1 -1
View File
@@ -197,6 +197,7 @@ namespace ts {
"|=": SyntaxKind.BarEqualsToken,
"^=": SyntaxKind.CaretEqualsToken,
"@": SyntaxKind.AtToken,
"`": SyntaxKind.BacktickToken
});
/*
@@ -298,7 +299,6 @@ namespace ts {
}
const tokenStrings = makeReverseMap(textToToken);
export function tokenToString(t: SyntaxKind): string | undefined {
return tokenStrings[t];
}
+2 -1
View File
@@ -775,10 +775,11 @@ namespace ts {
priority: 5,
text: `
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};`
+28 -3
View File
@@ -229,14 +229,39 @@ namespace ts {
if (node.transformFlags & TransformFlags.ContainsObjectRestOrSpread) {
// spread elements emit like so:
// non-spread elements are chunked together into object literals, and then all are passed to __assign:
// { a, ...o, b } => __assign({a}, o, {b});
// { a, ...o, b } => __assign(__assign({a}, o), {b});
// If the first element is a spread element, then the first argument to __assign is {}:
// { ...o, a, b, ...o2 } => __assign({}, o, {a, b}, o2)
// { ...o, a, b, ...o2 } => __assign(__assign(__assign({}, o), {a, b}), o2)
//
// We cannot call __assign with more than two elements, since any element could cause side effects. For
// example:
// var k = { a: 1, b: 2 };
// var o = { a: 3, ...k, b: k.a++ };
// // expected: { a: 1, b: 1 }
// If we translate the above to `__assign({ a: 3 }, k, { b: k.a++ })`, the `k.a++` will evaluate before
// `k` is spread and we end up with `{ a: 2, b: 1 }`.
//
// This also occurs for spread elements, not just property assignments:
// var k = { a: 1, get b() { l = { z: 9 }; return 2; } };
// var l = { c: 3 };
// var o = { ...k, ...l };
// // expected: { a: 1, b: 2, z: 9 }
// If we translate the above to `__assign({}, k, l)`, the `l` will evaluate before `k` is spread and we
// end up with `{ a: 1, b: 2, c: 3 }`
const objects = chunkObjectLiteralElements(node.properties);
if (objects.length && objects[0].kind !== SyntaxKind.ObjectLiteralExpression) {
objects.unshift(createObjectLiteral());
}
return createAssignHelper(context, objects);
let expression: Expression = objects[0];
if (objects.length > 1) {
for (let i = 1; i < objects.length; i++) {
expression = createAssignHelper(context, [expression, objects[i]]);
}
return expression;
}
else {
return createAssignHelper(context, objects);
}
}
return visitEachChild(node, visitor, context);
}
+3 -2
View File
@@ -1882,6 +1882,7 @@ namespace ts {
}
export interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
kind: SyntaxKind.JsxAttributes;
parent: JsxOpeningLikeElement;
}
@@ -4762,7 +4763,7 @@ namespace ts {
UMD = 3,
System = 4,
ES2015 = 5,
ESNext = 6
ESNext = 99
}
export const enum JsxEmit {
@@ -4810,7 +4811,7 @@ namespace ts {
ES2018 = 5,
ES2019 = 6,
ES2020 = 7,
ESNext = 8,
ESNext = 99,
JSON = 100,
Latest = ESNext,
}
+17
View File
@@ -3150,6 +3150,23 @@ namespace ts {
return s.replace(escapedCharsRegExp, getReplacement);
}
/**
* Strip off existed single quotes or double quotes from a given string
*
* @return non-quoted string
*/
export function stripQuotes(name: string) {
const length = name.length;
if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && startsWithQuote(name)) {
return name.substring(1, length - 1);
}
return name;
}
export function startsWithQuote(name: string): boolean {
return isSingleOrDoubleQuote(name.charCodeAt(0));
}
function getReplacement(c: string, offset: number, input: string) {
if (c.charCodeAt(0) === CharacterCodes.nullCharacter) {
const lookAhead = input.charCodeAt(offset + c.length);
+45 -68
View File
@@ -797,7 +797,7 @@ namespace FourSlash {
for (const include of toArray(options.includes)) {
const name = typeof include === "string" ? include : include.name;
const found = nameToEntries.get(name);
if (!found) throw this.raiseError(`No completion ${name} found`);
if (!found) throw this.raiseError(`Includes: completion '${name}' not found.`);
assert(found.length === 1); // Must use 'exact' for multiple completions with same name
this.verifyCompletionEntry(ts.first(found), include);
}
@@ -806,7 +806,7 @@ namespace FourSlash {
for (const exclude of toArray(options.excludes)) {
assert(typeof exclude === "string");
if (nameToEntries.has(exclude)) {
this.raiseError(`Did not expect to get a completion named ${exclude}`);
this.raiseError(`Excludes: unexpected completion '${exclude}' found.`);
}
}
}
@@ -865,7 +865,7 @@ namespace FourSlash {
ts.zipWith(actual, expected, (completion, expectedCompletion, index) => {
const name = typeof expectedCompletion === "string" ? expectedCompletion : expectedCompletion.name;
if (completion.name !== name) {
this.raiseError(`${marker ? JSON.stringify(marker) : "" } Expected completion at index ${index} to be ${name}, got ${completion.name}`);
this.raiseError(`${marker ? JSON.stringify(marker) : ""} Expected completion at index ${index} to be ${name}, got ${completion.name}`);
}
this.verifyCompletionEntry(completion, expectedCompletion);
});
@@ -948,7 +948,7 @@ namespace FourSlash {
const actual = checker.typeToString(type);
if (actual !== expected) {
this.raiseError(`Expected: '${expected}', actual: '${actual}'`);
this.raiseError(displayExpectedAndActualString(expected, actual));
}
}
@@ -1024,9 +1024,7 @@ namespace FourSlash {
private assertObjectsEqual<T>(fullActual: T, fullExpected: T, msgPrefix = ""): void {
const recur = <U>(actual: U, expected: U, path: string) => {
const fail = (msg: string) => {
this.raiseError(`${msgPrefix} At ${path}: ${msg}
Expected: ${stringify(fullExpected)}
Actual: ${stringify(fullActual)}`);
this.raiseError(`${msgPrefix} At ${path}: ${msg} ${displayExpectedAndActualString(stringify(fullExpected), stringify(fullActual))}`);
};
if ((actual === undefined) !== (expected === undefined)) {
@@ -1058,9 +1056,7 @@ Actual: ${stringify(fullActual)}`);
if (fullActual === fullExpected) {
return;
}
this.raiseError(`${msgPrefix}
Expected: ${stringify(fullExpected)}
Actual: ${stringify(fullActual)}`);
this.raiseError(`${msgPrefix} ${displayExpectedAndActualString(stringify(fullExpected), stringify(fullActual))}`);
}
recur(fullActual, fullExpected, "");
@@ -2111,9 +2107,7 @@ Actual: ${stringify(fullActual)}`);
public verifyCurrentLineContent(text: string) {
const actual = this.getCurrentLineContent();
if (actual !== text) {
throw new Error("verifyCurrentLineContent\n" +
"\tExpected: \"" + text + "\"\n" +
"\t Actual: \"" + actual + "\"");
throw new Error("verifyCurrentLineContent\n" + displayExpectedAndActualString(text, actual, /* quoted */ true));
}
}
@@ -2139,25 +2133,19 @@ Actual: ${stringify(fullActual)}`);
public verifyTextAtCaretIs(text: string) {
const actual = this.getFileContent(this.activeFile.fileName).substring(this.currentCaretPosition, this.currentCaretPosition + text.length);
if (actual !== text) {
throw new Error("verifyTextAtCaretIs\n" +
"\tExpected: \"" + text + "\"\n" +
"\t Actual: \"" + actual + "\"");
throw new Error("verifyTextAtCaretIs\n" + displayExpectedAndActualString(text, actual, /* quoted */ true));
}
}
public verifyCurrentNameOrDottedNameSpanText(text: string) {
const span = this.languageService.getNameOrDottedNameSpan(this.activeFile.fileName, this.currentCaretPosition, this.currentCaretPosition);
if (!span) {
return this.raiseError("verifyCurrentNameOrDottedNameSpanText\n" +
"\tExpected: \"" + text + "\"\n" +
"\t Actual: undefined");
return this.raiseError("verifyCurrentNameOrDottedNameSpanText\n" + displayExpectedAndActualString("\"" + text + "\"", "undefined"));
}
const actual = this.getFileContent(this.activeFile.fileName).substring(span.start, ts.textSpanEnd(span));
if (actual !== text) {
this.raiseError("verifyCurrentNameOrDottedNameSpanText\n" +
"\tExpected: \"" + text + "\"\n" +
"\t Actual: \"" + actual + "\"");
this.raiseError("verifyCurrentNameOrDottedNameSpanText\n" + displayExpectedAndActualString(text, actual, /* quoted */ true));
}
}
@@ -2828,11 +2816,28 @@ Actual: ${stringify(fullActual)}`);
}
}
public verifyCodeFixAvailable(negative: boolean, expected: FourSlashInterface.VerifyCodeFixAvailableOptions[] | undefined): void {
assert(!negative || !expected);
public verifyCodeFixAvailable(negative: boolean, expected: FourSlashInterface.VerifyCodeFixAvailableOptions[] | string | undefined): void {
const codeFixes = this.getCodeFixes(this.activeFile.fileName);
const actuals = codeFixes.map((fix): FourSlashInterface.VerifyCodeFixAvailableOptions => ({ description: fix.description, commands: fix.commands }));
this.assertObjectsEqual(actuals, negative ? ts.emptyArray : expected);
if (negative) {
if (typeof expected === "undefined") {
this.assertObjectsEqual(codeFixes, ts.emptyArray);
}
else if (typeof expected === "string") {
if (codeFixes.some(fix => fix.fixName === expected)) {
this.raiseError(`Expected not to find a fix with the name '${expected}', but one exists.`);
}
}
else {
assert(typeof expected === "undefined" || typeof expected === "string", "With a negated assertion, 'expected' must be undefined or a string value of a codefix name.");
}
}
else if (typeof expected === "string") {
this.assertObjectsEqual(codeFixes.map(fix => fix.fixName), [expected]);
}
else {
const actuals = codeFixes.map((fix): FourSlashInterface.VerifyCodeFixAvailableOptions => ({ description: fix.description, commands: fix.commands }));
this.assertObjectsEqual(actuals, negative ? ts.emptyArray : expected);
}
}
public verifyApplicableRefactorAvailableAtMarker(negative: boolean, markerName: string) {
@@ -3673,7 +3678,7 @@ ${code}
expected = makeWhitespaceVisible(expected);
actual = makeWhitespaceVisible(actual);
}
return `Expected:\n${expected}\nActual:\n${actual}`;
return displayExpectedAndActualString(expected, actual);
}
function differOnlyByWhitespace(a: string, b: string) {
@@ -3693,6 +3698,14 @@ ${code}
}
}
}
function displayExpectedAndActualString(expected: string, actual: string, quoted = false) {
const expectMsg = "\x1b[1mExpected\x1b[0m\x1b[31m";
const actualMsg = "\x1b[1mActual\x1b[0m\x1b[31m";
const expectedString = quoted ? "\"" + expected + "\"" : expected;
const actualString = quoted ? "\"" + actual + "\"" : actual;
return `\n${expectMsg}:\n${expectedString}\n\n${actualMsg}:\n${actualString}`;
}
}
namespace FourSlashInterface {
@@ -3742,7 +3755,7 @@ namespace FourSlashInterface {
}
export class Plugins {
constructor (private state: FourSlash.TestState) {
constructor(private state: FourSlash.TestState) {
}
public configurePlugin(pluginName: string, configuration: any): void {
@@ -4565,7 +4578,7 @@ namespace FourSlashInterface {
export const keywords: ReadonlyArray<ExpectedCompletionEntryObject> = keywordsWithUndefined.filter(k => k.name !== "undefined");
export const typeKeywords: ReadonlyArray<ExpectedCompletionEntryObject> =
["false", "null", "true", "void", "any", "boolean", "keyof", "never", "number", "object", "string", "symbol", "undefined", "unique", "unknown", "bigint"].map(keywordEntry);
["false", "null", "true", "void", "any", "boolean", "keyof", "never", "readonly", "number", "object", "string", "symbol", "undefined", "unique", "unknown", "bigint"].map(keywordEntry);
const globalTypeDecls: ReadonlyArray<ExpectedCompletionEntryObject> = [
interfaceEntry("Symbol"),
@@ -4681,6 +4694,9 @@ namespace FourSlashInterface {
];
}
export const typeAssertionKeywords: ReadonlyArray<ExpectedCompletionEntry> =
globalTypesPlus([keywordEntry("const")]);
function getInJsKeywords(keywords: ReadonlyArray<ExpectedCompletionEntryObject>): ReadonlyArray<ExpectedCompletionEntryObject> {
return keywords.filter(keyword => {
switch (keyword.name) {
@@ -4811,40 +4827,23 @@ namespace FourSlashInterface {
"interface",
"let",
"package",
"private",
"protected",
"public",
"static",
"yield",
"abstract",
"as",
"any",
"async",
"await",
"boolean",
"constructor",
"declare",
"get",
"infer",
"is",
"keyof",
"module",
"namespace",
"never",
"readonly",
"require",
"number",
"object",
"set",
"string",
"symbol",
"type",
"unique",
"unknown",
"from",
"global",
"bigint",
"of",
].map(keywordEntry);
export const statementKeywords: ReadonlyArray<ExpectedCompletionEntryObject> = statementKeywordsWithTypes.filter(k => {
@@ -5025,40 +5024,23 @@ namespace FourSlashInterface {
"interface",
"let",
"package",
"private",
"protected",
"public",
"static",
"yield",
"abstract",
"as",
"any",
"async",
"await",
"boolean",
"constructor",
"declare",
"get",
"infer",
"is",
"keyof",
"module",
"namespace",
"never",
"readonly",
"require",
"number",
"object",
"set",
"string",
"symbol",
"type",
"unique",
"unknown",
"from",
"global",
"bigint",
"of",
].map(keywordEntry);
export const globalInJsKeywords = getInJsKeywords(globalKeywords);
@@ -5111,11 +5093,6 @@ namespace FourSlashInterface {
export const insideMethodInJsKeywords = getInJsKeywords(insideMethodKeywords);
export const globalKeywordsPlusUndefined: ReadonlyArray<ExpectedCompletionEntryObject> = (() => {
const i = ts.findIndex(globalKeywords, x => x.name === "unique");
return [...globalKeywords.slice(0, i), keywordEntry("undefined"), ...globalKeywords.slice(i)];
})();
export const globals: ReadonlyArray<ExpectedCompletionEntryObject> = [
globalThisEntry,
...globalsVars,
+1 -1
View File
@@ -30,7 +30,7 @@ interface Array<T> {}`
return combinePaths(getDirectoryPath(libFile.path), "tsc.js");
}
interface TestServerHostCreationParameters {
export interface TestServerHostCreationParameters {
useCaseSensitiveFileNames?: boolean;
executingFilePath?: string;
currentDirectory?: string;
+51 -24
View File
@@ -289,9 +289,8 @@ namespace ts.JsTyping {
}
export const enum PackageNameValidationResult {
export const enum NameValidationResult {
Ok,
ScopedPackagesNotSupported,
EmptyName,
NameTooLong,
NameStartsWithDot,
@@ -301,49 +300,77 @@ namespace ts.JsTyping {
const maxPackageNameLength = 214;
export interface ScopedPackageNameValidationResult {
name: string;
isScopeName: boolean;
result: NameValidationResult;
}
export type PackageNameValidationResult = NameValidationResult | ScopedPackageNameValidationResult;
/**
* Validates package name using rules defined at https://docs.npmjs.com/files/package.json
*/
export function validatePackageName(packageName: string): PackageNameValidationResult {
return validatePackageNameWorker(packageName, /*supportScopedPackage*/ true);
}
function validatePackageNameWorker(packageName: string, supportScopedPackage: false): NameValidationResult;
function validatePackageNameWorker(packageName: string, supportScopedPackage: true): PackageNameValidationResult;
function validatePackageNameWorker(packageName: string, supportScopedPackage: boolean): PackageNameValidationResult {
if (!packageName) {
return PackageNameValidationResult.EmptyName;
return NameValidationResult.EmptyName;
}
if (packageName.length > maxPackageNameLength) {
return PackageNameValidationResult.NameTooLong;
return NameValidationResult.NameTooLong;
}
if (packageName.charCodeAt(0) === CharacterCodes.dot) {
return PackageNameValidationResult.NameStartsWithDot;
return NameValidationResult.NameStartsWithDot;
}
if (packageName.charCodeAt(0) === CharacterCodes._) {
return PackageNameValidationResult.NameStartsWithUnderscore;
return NameValidationResult.NameStartsWithUnderscore;
}
// check if name is scope package like: starts with @ and has one '/' in the middle
// scoped packages are not currently supported
// TODO: when support will be added we'll need to split and check both scope and package name
if (/^@[^/]+\/[^/]+$/.test(packageName)) {
return PackageNameValidationResult.ScopedPackagesNotSupported;
if (supportScopedPackage) {
const matches = /^@([^/]+)\/([^/]+)$/.exec(packageName);
if (matches) {
const scopeResult = validatePackageNameWorker(matches[1], /*supportScopedPackage*/ false);
if (scopeResult !== NameValidationResult.Ok) {
return { name: matches[1], isScopeName: true, result: scopeResult };
}
const packageResult = validatePackageNameWorker(matches[2], /*supportScopedPackage*/ false);
if (packageResult !== NameValidationResult.Ok) {
return { name: matches[2], isScopeName: false, result: packageResult };
}
return NameValidationResult.Ok;
}
}
if (encodeURIComponent(packageName) !== packageName) {
return PackageNameValidationResult.NameContainsNonURISafeCharacters;
return NameValidationResult.NameContainsNonURISafeCharacters;
}
return PackageNameValidationResult.Ok;
return NameValidationResult.Ok;
}
export function renderPackageNameValidationFailure(result: PackageNameValidationResult, typing: string): string {
return typeof result === "object" ?
renderPackageNameValidationFailureWorker(typing, result.result, result.name, result.isScopeName) :
renderPackageNameValidationFailureWorker(typing, result, typing, /*isScopeName*/ false);
}
function renderPackageNameValidationFailureWorker(typing: string, result: NameValidationResult, name: string, isScopeName: boolean): string {
const kind = isScopeName ? "Scope" : "Package";
switch (result) {
case PackageNameValidationResult.EmptyName:
return `Package name '${typing}' cannot be empty`;
case PackageNameValidationResult.NameTooLong:
return `Package name '${typing}' should be less than ${maxPackageNameLength} characters`;
case PackageNameValidationResult.NameStartsWithDot:
return `Package name '${typing}' cannot start with '.'`;
case PackageNameValidationResult.NameStartsWithUnderscore:
return `Package name '${typing}' cannot start with '_'`;
case PackageNameValidationResult.ScopedPackagesNotSupported:
return `Package '${typing}' is scoped and currently is not supported`;
case PackageNameValidationResult.NameContainsNonURISafeCharacters:
return `Package name '${typing}' contains non URI safe characters`;
case PackageNameValidationResult.Ok:
case NameValidationResult.EmptyName:
return `'${typing}':: ${kind} name '${name}' cannot be empty`;
case NameValidationResult.NameTooLong:
return `'${typing}':: ${kind} name '${name}' should be less than ${maxPackageNameLength} characters`;
case NameValidationResult.NameStartsWithDot:
return `'${typing}':: ${kind} name '${name}' cannot start with '.'`;
case NameValidationResult.NameStartsWithUnderscore:
return `'${typing}':: ${kind} name '${name}' cannot start with '_'`;
case NameValidationResult.NameContainsNonURISafeCharacters:
return `'${typing}':: ${kind} name '${name}' contains non URI safe characters`;
case NameValidationResult.Ok:
return Debug.fail(); // Shouldn't have called this.
default:
throw Debug.assertNever(result);
+1184 -1184
View File
File diff suppressed because it is too large Load Diff
+30 -30
View File
@@ -63,16 +63,16 @@ interface FileList {
interface FormData {
[Symbol.iterator](): IterableIterator<[string, FormDataEntryValue]>;
/**
* Returns an array of key, value pairs for every entry in the list.
/**
* Returns an array of key, value pairs for every entry in the list.
*/
entries(): IterableIterator<[string, FormDataEntryValue]>;
/**
* Returns a list of keys in the list.
/**
* Returns a list of keys in the list.
*/
keys(): IterableIterator<string>;
/**
* Returns a list of values in the list.
/**
* Returns a list of values in the list.
*/
values(): IterableIterator<FormDataEntryValue>;
}
@@ -99,16 +99,16 @@ interface HTMLSelectElement {
interface Headers {
[Symbol.iterator](): IterableIterator<[string, string]>;
/**
* Returns an iterator allowing to go through all key/value pairs contained in this object.
/**
* Returns an iterator allowing to go through all key/value pairs contained in this object.
*/
entries(): IterableIterator<[string, string]>;
/**
* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
/**
* Returns an iterator allowing to go through all keys of the key/value pairs contained in this object.
*/
keys(): IterableIterator<string>;
/**
* Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
/**
* Returns an iterator allowing to go through all values of the key/value pairs contained in this object.
*/
values(): IterableIterator<string>;
}
@@ -147,32 +147,32 @@ interface Navigator {
interface NodeList {
[Symbol.iterator](): IterableIterator<Node>;
/**
* Returns an array of key, value pairs for every entry in the list.
/**
* Returns an array of key, value pairs for every entry in the list.
*/
entries(): IterableIterator<[number, Node]>;
/**
* Returns an list of keys in the list.
/**
* Returns an list of keys in the list.
*/
keys(): IterableIterator<number>;
/**
* Returns an list of values in the list.
/**
* Returns an list of values in the list.
*/
values(): IterableIterator<Node>;
}
interface NodeListOf<TNode extends Node> {
[Symbol.iterator](): IterableIterator<TNode>;
/**
* Returns an array of key, value pairs for every entry in the list.
/**
* Returns an array of key, value pairs for every entry in the list.
*/
entries(): IterableIterator<[number, TNode]>;
/**
* Returns an list of keys in the list.
/**
* Returns an list of keys in the list.
*/
keys(): IterableIterator<number>;
/**
* Returns an list of values in the list.
/**
* Returns an list of values in the list.
*/
values(): IterableIterator<TNode>;
}
@@ -242,16 +242,16 @@ interface TouchList {
interface URLSearchParams {
[Symbol.iterator](): IterableIterator<[string, string]>;
/**
* Returns an array of key, value pairs for every entry in the search params.
/**
* Returns an array of key, value pairs for every entry in the search params.
*/
entries(): IterableIterator<[string, string]>;
/**
* Returns a list of keys in the search params.
/**
* Returns a list of keys in the search params.
*/
keys(): IterableIterator<string>;
/**
* Returns a list of values in the search params.
/**
* Returns a list of values in the search params.
*/
values(): IterableIterator<string>;
}
+1 -1
View File
@@ -12,7 +12,7 @@ declare var Infinity: number;
declare function eval(x: string): any;
/**
* Converts A string to an integer.
* Converts a string to an integer.
* @param s A string to convert into a number.
* @param radix A value between 2 and 36 that specifies the base of the number in numString.
* If this argument is not supplied, strings with a prefix of '0x' are considered hexadecimal.
+12 -12
View File
@@ -3221,28 +3221,28 @@ declare var URL: {
};
interface URLSearchParams {
/**
* Appends a specified key/value pair as a new search parameter.
/**
* 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.
/**
* 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.
/**
* 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.
/**
* Returns all the values association with a given search parameter.
*/
getAll(name: string): string[];
/**
* Returns a Boolean indicating if such a search parameter exists.
/**
* 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.
/**
* 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;
sort(): void;
File diff suppressed because it is too large Load Diff
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LCX SchemaVersion="6.0" Name="f:\ddSetup\sources\typescript\localization\compiler2.resx" PsrId="306" FileType="1" SrcCul="en-US" TgtCul="it-IT" xmlns="http://schemas.microsoft.com/locstudio/2006/6/lcx">
<Props>
<Str Name="CustomName1" Val="Custom 1" />
@@ -3301,7 +3301,7 @@
<Str Cat="Text">
<Val><![CDATA[Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Crea l'origine unitamente alle mappe di origine all'interno di un unico file. Richiede l'impostazione di '--inlineSourceMap' o '--sourceMap'.]]></Val>
<Val><![CDATA[Crea l'origine unitamente ai mapping di origine all'interno di un unico file. Richiede l'impostazione di '--inlineSourceMap' o '--sourceMap'.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -4123,7 +4123,7 @@
<Str Cat="Text">
<Val><![CDATA[Generates a sourcemap for each corresponding '.d.ts' file.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Genera un sourcemap per ogni file '.d.ts' corrispondente.]]></Val>
<Val><![CDATA[Genera un mapping di origine per ogni file '.d.ts' corrispondente.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LCX SchemaVersion="6.0" Name="f:\ddSetup\sources\typescript\localization\compiler2.resx" PsrId="306" FileType="1" SrcCul="en-US" TgtCul="ja-JP" xmlns="http://schemas.microsoft.com/locstudio/2006/6/lcx">
<Props>
<Str Name="CustomName1" Val="Custom 1" />
@@ -3301,7 +3301,7 @@
<Str Cat="Text">
<Val><![CDATA[Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[単一ファイル内で sourcemap と共にソースを生成します。'--inlineSourceMap' または '--sourceMap' を設定する必要があります。]]></Val>
<Val><![CDATA[単一ファイル内でソースマップと共にソースを生成します。'--inlineSourceMap' または '--sourceMap' を設定する必要があります。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -4123,7 +4123,7 @@
<Str Cat="Text">
<Val><![CDATA[Generates a sourcemap for each corresponding '.d.ts' file.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[対応する各 '.d.ts' ファイルに sourcemap を生成します。]]></Val>
<Val><![CDATA[対応する各 '.d.ts' ファイルにソースマップを生成します。]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LCX SchemaVersion="6.0" Name="f:\ddSetup\sources\typescript\localization\compiler2.resx" PsrId="306" FileType="1" SrcCul="en-US" TgtCul="pl-PL" xmlns="http://schemas.microsoft.com/locstudio/2006/6/lcx">
<Props>
<Str Name="HobbitID" Val="6d166059-1f22-4f75-80d1-261d6407ef5d" />
@@ -3291,7 +3291,7 @@
<Str Cat="Text">
<Val><![CDATA[Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Emituj źródło razem z mapami źródłowymi w pojedynczym pliku; wymaga ustawienia opcji „--inlineSourceMap” lub „--sourceMap”.]]></Val>
<Val><![CDATA[Emituj źródło razem z mapami źródeł w pojedynczym pliku; wymaga ustawienia opcji „--inlineSourceMap” lub „--sourceMap”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -4113,7 +4113,7 @@
<Str Cat="Text">
<Val><![CDATA[Generates a sourcemap for each corresponding '.d.ts' file.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Generuje mapę źródła dla każdego odpowiadającego pliku „.d.ts”.]]></Val>
<Val><![CDATA[Generuje mapę źródła dla poszczególnych plików „.d.ts”.]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LCX SchemaVersion="6.0" Name="f:\ddSetup\sources\typescript\localization\compiler2.resx" PsrId="306" FileType="1" SrcCul="en-US" TgtCul="ru-RU" xmlns="http://schemas.microsoft.com/locstudio/2006/6/lcx">
<Props>
<Str Name="CustomName1" Val="Custom 1" />
@@ -3300,7 +3300,7 @@
<Str Cat="Text">
<Val><![CDATA[Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Порождать источник вместе с sourcemap в одном файле (нужно задать параметр --inlineSourceMap или --sourceMap).]]></Val>
<Val><![CDATA[Порождать источник вместе с сопоставителями с исходным кодом в одном файле (нужно задать параметр --inlineSourceMap или --sourceMap).]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
@@ -4122,7 +4122,7 @@
<Str Cat="Text">
<Val><![CDATA[Generates a sourcemap for each corresponding '.d.ts' file.]]></Val>
<Tgt Cat="Text" Stat="Loc" Orig="New">
<Val><![CDATA[Создает sourcemap для каждого соответствующего файла ".d.ts".]]></Val>
<Val><![CDATA[Создает сопоставитель с исходным кодом для каждого соответствующего файла ".d.ts".]]></Val>
</Tgt>
</Str>
<Disp Icon="Str" />
+18 -1
View File
@@ -1087,7 +1087,24 @@ namespace ts.server {
project.close();
if (Debug.shouldAssert(AssertionLevel.Normal)) {
this.filenameToScriptInfo.forEach(info => Debug.assert(!info.isAttached(project), "Found script Info still attached to project", () => `${project.projectName}: ScriptInfos still attached: ${JSON.stringify(mapDefined(arrayFrom(this.filenameToScriptInfo.values()), info => info.isAttached(project) ? info : undefined))}`));
this.filenameToScriptInfo.forEach(info => Debug.assert(
!info.isAttached(project),
"Found script Info still attached to project",
() => `${project.projectName}: ScriptInfos still attached: ${JSON.stringify(
arrayFrom(
mapDefinedIterator(
this.filenameToScriptInfo.values(),
info => info.isAttached(project) ?
{
fileName: info.fileName,
projects: info.containingProjects.map(p => p.projectName),
hasMixedContent: info.hasMixedContent
} : undefined
)
),
/*replacer*/ undefined,
" "
)}`));
}
// Remove the project from pending project updates
this.pendingProjectUpdates.delete(project.getProjectName());
+173
View File
@@ -0,0 +1,173 @@
/* @internal */
namespace ts.codefix {
type ContextualTrackChangesFunction = (cb: (changeTracker: textChanges.ChangeTracker) => void) => FileTextChanges[];
const fixId = "addMissingAwait";
const propertyAccessCode = Diagnostics.Property_0_does_not_exist_on_type_1.code;
const callableConstructableErrorCodes = [
Diagnostics.This_expression_is_not_callable.code,
Diagnostics.This_expression_is_not_constructable.code,
];
const errorCodes = [
Diagnostics.An_arithmetic_operand_must_be_of_type_any_number_bigint_or_an_enum_type.code,
Diagnostics.The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
Diagnostics.The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type.code,
Diagnostics.Operator_0_cannot_be_applied_to_type_1.code,
Diagnostics.Operator_0_cannot_be_applied_to_types_1_and_2.code,
Diagnostics.This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap.code,
Diagnostics.Type_0_is_not_an_array_type.code,
Diagnostics.Type_0_is_not_an_array_type_or_a_string_type.code,
Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators.code,
Diagnostics.Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,
Diagnostics.Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator.code,
Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator.code,
Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator.code,
Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1.code,
propertyAccessCode,
...callableConstructableErrorCodes,
];
registerCodeFix({
fixIds: [fixId],
errorCodes,
getCodeActions: context => {
const { sourceFile, errorCode, span, cancellationToken, program } = context;
const expression = getAwaitableExpression(sourceFile, errorCode, span, cancellationToken, program);
if (!expression) {
return;
}
const checker = context.program.getTypeChecker();
const trackChanges: ContextualTrackChangesFunction = cb => textChanges.ChangeTracker.with(context, cb);
return compact([
getDeclarationSiteFix(context, expression, errorCode, checker, trackChanges),
getUseSiteFix(context, expression, errorCode, checker, trackChanges)]);
},
getAllCodeActions: context => {
const { sourceFile, program, cancellationToken } = context;
const checker = context.program.getTypeChecker();
return codeFixAll(context, errorCodes, (t, diagnostic) => {
const expression = getAwaitableExpression(sourceFile, diagnostic.code, diagnostic, cancellationToken, program);
if (!expression) {
return;
}
const trackChanges: ContextualTrackChangesFunction = cb => (cb(t), []);
return getDeclarationSiteFix(context, expression, diagnostic.code, checker, trackChanges)
|| getUseSiteFix(context, expression, diagnostic.code, checker, trackChanges);
});
},
});
function getDeclarationSiteFix(context: CodeFixContext | CodeFixAllContext, expression: Expression, errorCode: number, checker: TypeChecker, trackChanges: ContextualTrackChangesFunction) {
const { sourceFile } = context;
const awaitableInitializer = findAwaitableInitializer(expression, sourceFile, checker);
if (awaitableInitializer) {
const initializerChanges = trackChanges(t => makeChange(t, errorCode, sourceFile, checker, awaitableInitializer));
return createCodeFixActionNoFixId(
"addMissingAwaitToInitializer",
initializerChanges,
[Diagnostics.Add_await_to_initializer_for_0, expression.getText(sourceFile)]);
}
}
function getUseSiteFix(context: CodeFixContext | CodeFixAllContext, expression: Expression, errorCode: number, checker: TypeChecker, trackChanges: ContextualTrackChangesFunction) {
const changes = trackChanges(t => makeChange(t, errorCode, context.sourceFile, checker, expression));
return createCodeFixAction(fixId, changes, Diagnostics.Add_await, fixId, Diagnostics.Fix_all_expressions_possibly_missing_await);
}
function isMissingAwaitError(sourceFile: SourceFile, errorCode: number, span: TextSpan, cancellationToken: CancellationToken, program: Program) {
const checker = program.getDiagnosticsProducingTypeChecker();
const diagnostics = checker.getDiagnostics(sourceFile, cancellationToken);
return some(diagnostics, ({ start, length, relatedInformation, code }) =>
isNumber(start) && isNumber(length) && textSpansEqual({ start, length }, span) &&
code === errorCode &&
!!relatedInformation &&
some(relatedInformation, related => related.code === Diagnostics.Did_you_forget_to_use_await.code));
}
function getAwaitableExpression(sourceFile: SourceFile, errorCode: number, span: TextSpan, cancellationToken: CancellationToken, program: Program): Expression | undefined {
const token = getTokenAtPosition(sourceFile, span.start);
// Checker has already done work to determine that await might be possible, and has attached
// related info to the node, so start by finding the expression that exactly matches up
// with the diagnostic range.
const expression = findAncestor(token, node => {
if (node.getStart(sourceFile) < span.start || node.getEnd() > textSpanEnd(span)) {
return "quit";
}
return isExpression(node) && textSpansEqual(span, createTextSpanFromNode(node, sourceFile));
}) as Expression | undefined;
return expression
&& isMissingAwaitError(sourceFile, errorCode, span, cancellationToken, program)
&& isInsideAwaitableBody(expression)
? expression
: undefined;
}
function findAwaitableInitializer(expression: Node, sourceFile: SourceFile, checker: TypeChecker): Expression | undefined {
if (!isIdentifier(expression)) {
return;
}
const symbol = checker.getSymbolAtLocation(expression);
if (!symbol) {
return;
}
const declaration = tryCast(symbol.valueDeclaration, isVariableDeclaration);
const variableName = tryCast(declaration && declaration.name, isIdentifier);
const variableStatement = getAncestor(declaration, SyntaxKind.VariableStatement);
if (!declaration || !variableStatement ||
declaration.type ||
!declaration.initializer ||
variableStatement.getSourceFile() !== sourceFile ||
hasModifier(variableStatement, ModifierFlags.Export) ||
!variableName ||
!isInsideAwaitableBody(declaration.initializer)) {
return;
}
const isUsedElsewhere = FindAllReferences.Core.eachSymbolReferenceInFile(variableName, checker, sourceFile, identifier => {
return identifier !== expression;
});
if (isUsedElsewhere) {
return;
}
return declaration.initializer;
}
function isInsideAwaitableBody(node: Node) {
return node.kind & NodeFlags.AwaitContext || !!findAncestor(node, ancestor =>
ancestor.parent && isArrowFunction(ancestor.parent) && ancestor.parent.body === ancestor ||
isBlock(ancestor) && (
ancestor.parent.kind === SyntaxKind.FunctionDeclaration ||
ancestor.parent.kind === SyntaxKind.FunctionExpression ||
ancestor.parent.kind === SyntaxKind.ArrowFunction ||
ancestor.parent.kind === SyntaxKind.MethodDeclaration));
}
function makeChange(changeTracker: textChanges.ChangeTracker, errorCode: number, sourceFile: SourceFile, checker: TypeChecker, insertionSite: Expression) {
if (isBinaryExpression(insertionSite)) {
const { left, right } = insertionSite;
const leftType = checker.getTypeAtLocation(left);
const rightType = checker.getTypeAtLocation(right);
const newLeft = checker.getPromisedTypeOfPromise(leftType) ? createAwait(left) : left;
const newRight = checker.getPromisedTypeOfPromise(rightType) ? createAwait(right) : right;
changeTracker.replaceNode(sourceFile, left, newLeft);
changeTracker.replaceNode(sourceFile, right, newRight);
}
else if (errorCode === propertyAccessCode && isPropertyAccessExpression(insertionSite.parent)) {
changeTracker.replaceNode(
sourceFile,
insertionSite.parent.expression,
createParen(createAwait(insertionSite.parent.expression)));
}
else if (contains(callableConstructableErrorCodes, errorCode) && isCallOrNewExpression(insertionSite.parent)) {
changeTracker.replaceNode(sourceFile, insertionSite, createParen(createAwait(insertionSite)));
}
else {
changeTracker.replaceNode(sourceFile, insertionSite, createAwait(insertionSite));
}
}
}
+5 -2
View File
@@ -445,9 +445,12 @@ namespace ts.codefix {
const aliased = checker.getImmediateAliasedSymbol(defaultExport);
return aliased && getDefaultExportInfoWorker(aliased, Debug.assertDefined(aliased.parent), checker, compilerOptions);
}
else {
return { symbolForMeaning: defaultExport, name: moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target!) };
if (defaultExport.escapedName !== InternalSymbolName.Default &&
defaultExport.escapedName !== InternalSymbolName.ExportEquals) {
return { symbolForMeaning: defaultExport, name: defaultExport.getName() };
}
return { symbolForMeaning: defaultExport, name: moduleSymbolToValidIdentifier(moduleSymbol, compilerOptions.target!) };
}
function getNameForExportDefault(symbol: Symbol): string | undefined {
@@ -0,0 +1,43 @@
/* @internal */
namespace ts.codefix {
const fixId = "removeUnnecessaryAwait";
const errorCodes = [
Diagnostics.await_has_no_effect_on_the_type_of_this_expression.code,
];
registerCodeFix({
errorCodes,
getCodeActions: (context) => {
const changes = textChanges.ChangeTracker.with(context, t => makeChange(t, context.sourceFile, context.span));
if (changes.length > 0) {
return [createCodeFixAction(fixId, changes, Diagnostics.Remove_unnecessary_await, fixId, Diagnostics.Remove_all_unnecessary_uses_of_await)];
}
},
fixIds: [fixId],
getAllCodeActions: context => {
return codeFixAll(context, errorCodes, (changes, diag) => makeChange(changes, diag.file, diag));
},
});
function makeChange(changeTracker: textChanges.ChangeTracker, sourceFile: SourceFile, span: TextSpan) {
const awaitKeyword = tryCast(getTokenAtPosition(sourceFile, span.start), (node): node is AwaitKeywordToken => node.kind === SyntaxKind.AwaitKeyword);
const awaitExpression = awaitKeyword && tryCast(awaitKeyword.parent, isAwaitExpression);
if (!awaitExpression) {
return;
}
let expressionToReplace: Node = awaitExpression;
const hasSurroundingParens = isParenthesizedExpression(awaitExpression.parent);
if (hasSurroundingParens) {
const leftMostExpression = getLeftmostExpression(awaitExpression.expression, /*stopAtCallExpressions*/ false);
if (isIdentifier(leftMostExpression)) {
const precedingToken = findPrecedingToken(awaitExpression.parent.pos, sourceFile);
if (precedingToken && precedingToken.kind !== SyntaxKind.NewKeyword) {
expressionToReplace = awaitExpression.parent;
}
}
}
changeTracker.replaceNode(sourceFile, expressionToReplace, awaitExpression.expression);
}
}
+60 -27
View File
@@ -38,6 +38,7 @@ namespace ts.Completions {
InterfaceElementKeywords, // Keywords inside interface body
ConstructorParameterKeywords, // Keywords at constructor parameter
FunctionLikeBodyKeywords, // Keywords at function like body
TypeAssertionKeywords,
TypeKeywords,
Last = TypeKeywords
}
@@ -441,7 +442,7 @@ namespace ts.Completions {
(symbol.escapedName === InternalSymbolName.ExportEquals))
// Name of "export default foo;" is "foo". Name of "export default 0" is the filename converted to camelCase.
? firstDefined(symbol.declarations, d => isExportAssignment(d) && isIdentifier(d.expression) ? d.expression.text : undefined)
|| codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target)
|| codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target)
: symbol.name;
}
@@ -632,9 +633,9 @@ namespace ts.Completions {
// At `,`, treat this as the next argument after the comma.
? checker.getContextualTypeForArgumentAtIndex(argInfo.invocation, argInfo.argumentIndex + (previousToken.kind === SyntaxKind.CommaToken ? 1 : 0))
: isEqualityOperatorKind(previousToken.kind) && isBinaryExpression(parent) && isEqualityOperatorKind(parent.operatorToken.kind)
// completion at `x ===/**/` should be for the right side
? checker.getTypeAtLocation(parent.left)
: checker.getContextualType(previousToken as Expression);
// completion at `x ===/**/` should be for the right side
? checker.getTypeAtLocation(parent.left)
: checker.getContextualType(previousToken as Expression);
}
}
@@ -946,11 +947,13 @@ namespace ts.Completions {
// Right of dot member completion list
completionKind = CompletionKind.PropertyAccess;
// Since this is qualified name check its a type node location
// Since this is qualified name check it's a type node location
const isImportType = isLiteralImportTypeNode(node);
const isTypeLocation = insideJsDocTagTypeExpression || (isImportType && !(node as ImportTypeNode).isTypeOf) || isPartOfTypeNode(node.parent);
const isTypeLocation = insideJsDocTagTypeExpression
|| (isImportType && !(node as ImportTypeNode).isTypeOf)
|| isPartOfTypeNode(node.parent)
|| isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker);
const isRhsOfImportDeclaration = isInRightSideOfInternalImportEqualsDeclaration(node);
const allowTypeOrValue = isRhsOfImportDeclaration || (!isTypeLocation && isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker));
if (isEntityName(node) || isImportType) {
const isNamespaceName = isModuleDeclaration(node.parent);
if (isNamespaceName) isNewIdentifierLocation = true;
@@ -967,7 +970,7 @@ namespace ts.Completions {
isNamespaceName
// At `namespace N.M/**/`, if this is the only declaration of `M`, don't include `M` as a completion.
? symbol => !!(symbol.flags & SymbolFlags.Namespace) && !symbol.declarations.every(d => d.parent === node.parent)
: allowTypeOrValue ?
: isRhsOfImportDeclaration ?
// Any kind is allowed when dotting off namespace in internal import equals declaration
symbol => isValidTypeAccess(symbol) || isValidValueAccess(symbol) :
isTypeLocation ? isValidTypeAccess : isValidValueAccess;
@@ -1180,8 +1183,11 @@ namespace ts.Completions {
function filterGlobalCompletion(symbols: Symbol[]): void {
const isTypeOnly = isTypeOnlyCompletion();
const allowTypes = isTypeOnly || !isContextTokenValueLocation(contextToken) && isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker);
if (isTypeOnly) keywordFilters = KeywordCompletionFilters.TypeKeywords;
if (isTypeOnly) {
keywordFilters = isTypeAssertion()
? KeywordCompletionFilters.TypeAssertionKeywords
: KeywordCompletionFilters.TypeKeywords;
}
filterMutate(symbols, symbol => {
if (!isSourceFile(location)) {
@@ -1197,12 +1203,9 @@ namespace ts.Completions {
return !!(symbol.flags & SymbolFlags.Namespace);
}
if (allowTypes) {
// Its a type, but you can reach it by namespace.type as well
const symbolAllowedAsType = symbolCanBeReferencedAtTypeLocation(symbol);
if (symbolAllowedAsType || isTypeOnly) {
return symbolAllowedAsType;
}
if (isTypeOnly) {
// It's a type, but you can reach it by namespace.type as well
return symbolCanBeReferencedAtTypeLocation(symbol);
}
}
@@ -1211,8 +1214,16 @@ namespace ts.Completions {
});
}
function isTypeAssertion(): boolean {
return isAssertionExpression(contextToken.parent);
}
function isTypeOnlyCompletion(): boolean {
return insideJsDocTagTypeExpression || !isContextTokenValueLocation(contextToken) && (isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
return insideJsDocTagTypeExpression
|| !isContextTokenValueLocation(contextToken) &&
(isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker)
|| isPartOfTypeNode(location)
|| isContextTokenTypeLocation(contextToken));
}
function isContextTokenValueLocation(contextToken: Node) {
@@ -1238,6 +1249,10 @@ namespace ts.Completions {
case SyntaxKind.AsKeyword:
return parentKind === SyntaxKind.AsExpression;
case SyntaxKind.LessThanToken:
return parentKind === SyntaxKind.TypeReference ||
parentKind === SyntaxKind.TypeAssertionExpression;
case SyntaxKind.ExtendsKeyword:
return parentKind === SyntaxKind.TypeParameter;
}
@@ -1434,7 +1449,7 @@ namespace ts.Completions {
// 3. at the end of a regular expression (due to trailing flags like '/foo/g').
return (isRegularExpressionLiteral(contextToken) || isStringTextContainingNode(contextToken)) && (
rangeContainsPositionExclusive(createTextRangeFromSpan(createTextSpanFromNode(contextToken)), position) ||
position === contextToken.end && (!!contextToken.isUnterminated || isRegularExpressionLiteral(contextToken)));
position === contextToken.end && (!!contextToken.isUnterminated || isRegularExpressionLiteral(contextToken)));
}
/**
@@ -1538,7 +1553,7 @@ namespace ts.Completions {
* Relevant symbols are stored in the captured 'symbols' variable.
*/
function tryGetClassLikeCompletionSymbols(): GlobalsSearch {
const decl = tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location);
const decl = tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position);
if (!decl) return GlobalsSearch.Continue;
// We're looking up possible property names from parent type.
@@ -1944,8 +1959,8 @@ namespace ts.Completions {
return baseSymbols.filter(propertySymbol =>
!existingMemberNames.has(propertySymbol.escapedName) &&
!!propertySymbol.declarations &&
!(getDeclarationModifierFlagsFromSymbol(propertySymbol) & ModifierFlags.Private));
!!propertySymbol.declarations &&
!(getDeclarationModifierFlagsFromSymbol(propertySymbol) & ModifierFlags.Private));
}
/**
@@ -2047,16 +2062,20 @@ namespace ts.Completions {
case KeywordCompletionFilters.None:
return false;
case KeywordCompletionFilters.All:
return kind === SyntaxKind.AsyncKeyword || SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind) || kind === SyntaxKind.DeclareKeyword || kind === SyntaxKind.ModuleKeyword
return isFunctionLikeBodyKeyword(kind)
|| kind === SyntaxKind.DeclareKeyword
|| kind === SyntaxKind.ModuleKeyword
|| isTypeKeyword(kind) && kind !== SyntaxKind.UndefinedKeyword;
case KeywordCompletionFilters.FunctionLikeBodyKeywords:
return isFunctionLikeBodyKeyword(kind);
case KeywordCompletionFilters.ClassElementKeywords:
return isClassMemberCompletionKeyword(kind);
case KeywordCompletionFilters.InterfaceElementKeywords:
return isInterfaceOrTypeLiteralCompletionKeyword(kind);
case KeywordCompletionFilters.ConstructorParameterKeywords:
return isParameterPropertyModifier(kind);
case KeywordCompletionFilters.FunctionLikeBodyKeywords:
return isFunctionLikeBodyKeyword(kind);
case KeywordCompletionFilters.TypeAssertionKeywords:
return isTypeKeyword(kind) || kind === SyntaxKind.ConstKeyword;
case KeywordCompletionFilters.TypeKeywords:
return isTypeKeyword(kind);
default:
@@ -2117,7 +2136,9 @@ namespace ts.Completions {
}
function isFunctionLikeBodyKeyword(kind: SyntaxKind) {
return kind === SyntaxKind.AsyncKeyword || kind === SyntaxKind.AwaitKeyword || !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
return kind === SyntaxKind.AsyncKeyword
|| kind === SyntaxKind.AwaitKeyword
|| !isContextualKeyword(kind) && !isClassMemberCompletionKeyword(kind);
}
function keywordForNode(node: Node): SyntaxKind {
@@ -2155,7 +2176,7 @@ namespace ts.Completions {
* Returns the immediate owning class declaration of a context token,
* on the condition that one exists and that the context implies completion should be given.
*/
function tryGetObjectTypeDeclarationCompletionContainer(sourceFile: SourceFile, contextToken: Node | undefined, location: Node): ObjectTypeDeclaration | undefined {
function tryGetObjectTypeDeclarationCompletionContainer(sourceFile: SourceFile, contextToken: Node | undefined, location: Node, position: number): ObjectTypeDeclaration | undefined {
// class c { method() { } | method2() { } }
switch (location.kind) {
case SyntaxKind.SyntaxList:
@@ -2165,9 +2186,15 @@ namespace ts.Completions {
if (cls && !findChildOfKind(cls, SyntaxKind.CloseBraceToken, sourceFile)) {
return cls;
}
break;
case SyntaxKind.Identifier: // class c extends React.Component { a: () => 1\n compon| }
if (isFromObjectTypeDeclaration(location)) {
return findAncestor(location, isObjectTypeDeclaration);
}
}
if (!contextToken) return undefined;
switch (contextToken.kind) {
case SyntaxKind.SemicolonToken: // class c {getValue(): number; | }
case SyntaxKind.CloseBraceToken: // class c { method() { } | }
@@ -2179,7 +2206,13 @@ namespace ts.Completions {
case SyntaxKind.CommaToken: // class c {getValue(): number, | }
return tryCast(contextToken.parent, isObjectTypeDeclaration);
default:
if (!isFromObjectTypeDeclaration(contextToken)) return undefined;
if (!isFromObjectTypeDeclaration(contextToken)) {
// class c extends React.Component { a: () => 1\n| }
if (getLineAndCharacterOfPosition(sourceFile, contextToken.getEnd()).line !== getLineAndCharacterOfPosition(sourceFile, position).line && isObjectTypeDeclaration(location)) {
return location;
}
return undefined;
}
const isValidKeyword = isClassLike(contextToken.parent.parent) ? isClassMemberCompletionKeyword : isInterfaceOrTypeLiteralCompletionKeyword;
return (isValidKeyword(contextToken.kind) || contextToken.kind === SyntaxKind.AsteriskToken || isIdentifier(contextToken) && isValidKeyword(stringToToken(contextToken.text)!)) // TODO: GH#18217
? contextToken.parent.parent as ObjectTypeDeclaration : undefined;
+3
View File
@@ -490,6 +490,9 @@ namespace ts.formatting {
else if (SmartIndenter.childStartsOnTheSameLineWithElseInIfStatement(parent, node, startLine, sourceFile)) {
return { indentation: parentDynamicIndentation.getIndentation(), delta };
}
else if (SmartIndenter.argumentStartsOnSameLineAsPreviousArgument(parent, node, startLine, sourceFile)) {
return { indentation: parentDynamicIndentation.getIndentation(), delta };
}
else {
return { indentation: parentDynamicIndentation.getIndentation() + parentDynamicIndentation.getDelta(node), delta };
}
+19
View File
@@ -322,6 +322,25 @@ namespace ts.formatting {
return false;
}
export function argumentStartsOnSameLineAsPreviousArgument(parent: Node, child: TextRangeWithKind, childStartLine: number, sourceFile: SourceFileLike): boolean {
if (isCallOrNewExpression(parent)) {
if (!parent.arguments) return false;
const currentNode = Debug.assertDefined(find(parent.arguments, arg => arg.pos === child.pos));
const currentIndex = parent.arguments.indexOf(currentNode);
if (currentIndex === 0) return false; // Can't look at previous node if first
const previousNode = parent.arguments[currentIndex - 1];
const lineOfPreviousNode = getLineAndCharacterOfPosition(sourceFile, previousNode.getEnd()).line;
if (childStartLine === lineOfPreviousNode) {
return true;
}
}
return false;
}
export function getContainingList(node: Node, sourceFile: SourceFile): NodeArray<Node> | undefined {
return node.parent && getListByRange(node.getStart(sourceFile), node.getEnd(), node.parent, sourceFile);
}
@@ -198,6 +198,8 @@ namespace ts.OutliningElementsCollector {
return spanForObjectOrArrayLiteral(n, SyntaxKind.OpenBracketToken);
case SyntaxKind.JsxElement:
return spanForJSXElement(<JsxElement>n);
case SyntaxKind.JsxFragment:
return spanForJSXFragment(<JsxFragment>n);
case SyntaxKind.JsxSelfClosingElement:
case SyntaxKind.JsxOpeningElement:
return spanForJSXAttributes((<JsxOpeningLikeElement>n).attributes);
@@ -210,6 +212,12 @@ namespace ts.OutliningElementsCollector {
return createOutliningSpan(textSpan, OutliningSpanKind.Code, textSpan, /*autoCollapse*/ false, bannerText);
}
function spanForJSXFragment(node: JsxFragment): OutliningSpan | undefined {
const textSpan = createTextSpanFromBounds(node.openingFragment.getStart(sourceFile), node.closingFragment.getEnd());
const bannerText = "<>...</>";
return createOutliningSpan(textSpan, OutliningSpanKind.Code, textSpan, /*autoCollapse*/ false, bannerText);
}
function spanForJSXAttributes(node: JsxAttributes): OutliningSpan | undefined {
if (node.properties.length === 0) {
return undefined;
+4
View File
@@ -704,6 +704,10 @@ namespace ts.textChanges {
}
}
public parenthesizeExpression(sourceFile: SourceFile, expression: Expression) {
this.replaceRange(sourceFile, rangeOfNode(expression), createParen(expression));
}
private finishClassesWithNodesInsertedAtStart(): void {
this.classesWithNodesInsertedAtStart.forEach(({ node, sourceFile }) => {
const [openBraceEnd, closeBraceEnd] = getClassOrObjectBraceEnds(node, sourceFile);
+2
View File
@@ -45,6 +45,7 @@
"codeFixProvider.ts",
"refactorProvider.ts",
"codefixes/addConvertToUnknownForNonOverlappingTypes.ts",
"codefixes/addMissingAwait.ts",
"codefixes/addMissingConst.ts",
"codefixes/addMissingInvocationForDecorator.ts",
"codefixes/addNameToNamelessParameter.ts",
@@ -79,6 +80,7 @@
"codefixes/useDefaultImport.ts",
"codefixes/fixAddModuleReferTypeMissingTypeof.ts",
"codefixes/convertToMappedObjectType.ts",
"codefixes/removeUnnecessaryAwait.ts",
"refactors/convertExport.ts",
"refactors/convertImport.ts",
"refactors/extractSymbol.ts",
+1 -1
View File
@@ -896,7 +896,7 @@ namespace ts {
}
export interface CompletionInfo {
/** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
/** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
isGlobalCompletion: boolean;
isMemberCompletion: boolean;
+3 -19
View File
@@ -1224,6 +1224,7 @@ namespace ts {
SyntaxKind.NullKeyword,
SyntaxKind.NumberKeyword,
SyntaxKind.ObjectKeyword,
SyntaxKind.ReadonlyKeyword,
SyntaxKind.StringKeyword,
SyntaxKind.SymbolKeyword,
SyntaxKind.TrueKeyword,
@@ -1636,23 +1637,6 @@ namespace ts {
return !!location.parent && isImportOrExportSpecifier(location.parent) && location.parent.propertyName === location;
}
/**
* Strip off existed single quotes or double quotes from a given string
*
* @return non-quoted string
*/
export function stripQuotes(name: string) {
const length = name.length;
if (length >= 2 && name.charCodeAt(0) === name.charCodeAt(length - 1) && startsWithQuote(name)) {
return name.substring(1, length - 1);
}
return name;
}
export function startsWithQuote(name: string): boolean {
return isSingleOrDoubleQuote(name.charCodeAt(0));
}
export function scriptKindIs(fileName: string, host: LanguageServiceHost, ...scriptKinds: ScriptKind[]): boolean {
const scriptKind = getScriptKind(fileName, host);
return some(scriptKinds, k => k === scriptKind);
@@ -1751,8 +1735,8 @@ namespace ts {
function getSynthesizedDeepCloneWorker<T extends Node>(node: T, renameMap?: Map<Identifier>, checker?: TypeChecker, callback?: (originalNode: Node, clone: Node) => any): T {
const visited = (renameMap || checker || callback) ?
visitEachChild(node, wrapper, nullTransformationContext) :
visitEachChild(node, getSynthesizedDeepClone, nullTransformationContext);
visitEachChild(node, wrapper, nullTransformationContext) :
visitEachChild(node, getSynthesizedDeepClone, nullTransformationContext);
if (visited === node) {
// This only happens for leaf nodes - internal nodes always see their children change.
+6 -2
View File
@@ -185,7 +185,8 @@ function stripRushStageNumbers(result: string): string {
* so we purge as much of the gulp output as we can
*/
function sanitizeUnimportantGulpOutput(result: string): string {
return result.replace(/^.*(\] (Starting)|(Finished)).*$/gm, "") // task start/end messages (nondeterministic order)
return result.replace(/^.*(\] (Starting)|(Finished)).*$/gm, "") // "gulp" task start/end messages (nondeterministic order)
.replace(/^.*(\] . (finished)|(started)).*$/gm, "") // "just" task start/end messages (nondeterministic order)
.replace(/^.*\] Respawned to PID: \d+.*$/gm, "") // PID of child is OS and system-load dependent (likely stableish in a container but still dangerous)
.replace(/\n+/g, "\n");
}
@@ -193,14 +194,17 @@ function sanitizeUnimportantGulpOutput(result: string): string {
function sanitizeTimestamps(result: string): string {
return result.replace(/\[\d?\d:\d\d:\d\d (A|P)M\]/g, "[XX:XX:XX XM]")
.replace(/\[\d?\d:\d\d:\d\d\]/g, "[XX:XX:XX]")
.replace(/\/\d+-\d+-[\d_TZ]+-debug.log/g, "\/XXXX-XX-XXXXXXXXX-debug.log")
.replace(/\d+(\.\d+)? sec(onds?)?/g, "? seconds")
.replace(/\d+(\.\d+)? min(utes?)?/g, "")
.replace(/\d+(\.\d+)?( m)?s/g, "?s");
.replace(/\d+(\.\d+)? ?m?s/g, "?s")
.replace(/ \(\?s\)/g, "");
}
function sanitizeVersionSpecifiers(result: string): string {
return result
.replace(/\d+.\d+.\d+-insiders.\d\d\d\d\d\d\d\d/g, "X.X.X-insiders.xxxxxxxx")
.replace(/Rush Multi-Project Build Tool (\d+)\.\d+\.\d+/g, "Rush Multi-Project Build Tool $1.X.X")
.replace(/([@v\()])\d+\.\d+\.\d+/g, "$1X.X.X");
}
+2
View File
@@ -73,7 +73,9 @@
"unittests/config/tsconfigParsing.ts",
"unittests/evaluation/asyncArrow.ts",
"unittests/evaluation/asyncGenerator.ts",
"unittests/evaluation/awaiter.ts",
"unittests/evaluation/forAwaitOf.ts",
"unittests/evaluation/objectRest.ts",
"unittests/services/cancellableLanguageServiceOperations.ts",
"unittests/services/colorization.ts",
"unittests/services/convertToAsyncFunction.ts",
@@ -0,0 +1,24 @@
describe("unittests:: evaluation:: awaiter", () => {
// NOTE: This could break if the ECMAScript spec ever changes the timing behavior for Promises (again)
it("await (es5)", async () => {
const result = evaluator.evaluateTypeScript(`
async function a(msg: string) {
await Promise.resolve();
output.push(msg);
}
function b(msg: string) {
return Promise.resolve().then(() => {
output.push(msg);
});
}
export const output: string[] = [];
export async function main() {
const p1 = a('1');
const p2 = b('2');
await Promise.all([p1, p2]);
}
`);
await result.main();
assert.deepEqual(result.output, ["1", "2"]);
});
});
@@ -0,0 +1,28 @@
describe("unittests:: evaluation:: objectRest", () => {
// https://github.com/microsoft/TypeScript/issues/31469
it("side effects in property assignment", async () => {
const result = evaluator.evaluateTypeScript(`
const k = { a: 1, b: 2 };
const o = { a: 3, ...k, b: k.a++ };
export const output = o;
`);
assert.deepEqual(result.output, { a: 1, b: 1 });
});
it("side effects in during spread", async () => {
const result = evaluator.evaluateTypeScript(`
const k = { a: 1, get b() { l = { c: 9 }; return 2; } };
let l = { c: 3 };
const o = { ...k, ...l };
export const output = o;
`);
assert.deepEqual(result.output, { a: 1, b: 2, c: 9 });
});
it("trailing literal-valued object-literal", async () => {
const result = evaluator.evaluateTypeScript(`
const k = { a: 1 }
const o = { ...k, ...{ b: 2 } };
export const output = o;
`);
assert.deepEqual(result.output, { a: 1, b: 2 });
});
});
+15
View File
@@ -31,3 +31,18 @@ describe("Public APIs", () => {
verifyApi("tsserverlibrary.d.ts");
});
});
describe("Public APIs:: token to string", () => {
function assertDefinedTokenToString(initial: ts.SyntaxKind, last: ts.SyntaxKind) {
for (let t = initial; t <= last; t++) {
assert.isDefined(ts.tokenToString(t), `Expected tokenToString defined for ${ts.Debug.formatSyntaxKind(t)}`);
}
}
it("for punctuations", () => {
assertDefinedTokenToString(ts.SyntaxKind.FirstPunctuation, ts.SyntaxKind.LastPunctuation);
});
it("for keywords", () => {
assertDefinedTokenToString(ts.SyntaxKind.FirstKeyword, ts.SyntaxKind.LastKeyword);
});
});
+2 -2
View File
@@ -35,8 +35,8 @@ namespace ts.tscWatch {
close(): void;
}
export function createWatchOfConfigFile(configFileName: string, host: WatchedSystem, maxNumberOfFilesToIterateForInvalidation?: number) {
const compilerHost = createWatchCompilerHostOfConfigFile(configFileName, {}, host);
export function createWatchOfConfigFile(configFileName: string, host: WatchedSystem, optionsToExtend?: CompilerOptions, maxNumberOfFilesToIterateForInvalidation?: number) {
const compilerHost = createWatchCompilerHostOfConfigFile(configFileName, optionsToExtend || {}, host);
compilerHost.maxNumberOfFilesToIterateForInvalidation = maxNumberOfFilesToIterateForInvalidation;
const watch = createWatchProgram(compilerHost);
const result = (() => watch.getCurrentProgram().getProgram()) as Watch;
@@ -9,6 +9,7 @@ namespace ts.tscWatch {
interface VerifyIncrementalWatchEmitInput {
files: ReadonlyArray<File>;
optionsToExtend?: CompilerOptions;
expectedInitialEmit: ReadonlyArray<File>;
expectedInitialErrors: ReadonlyArray<string>;
modifyFs?: (host: WatchedSystem) => void;
@@ -32,9 +33,9 @@ namespace ts.tscWatch {
});
}
function incrementalBuild(configFile: string, host: WatchedSystem) {
function incrementalBuild(configFile: string, host: WatchedSystem, optionsToExtend?: CompilerOptions) {
const reportDiagnostic = createDiagnosticReporter(host);
const config = parseConfigFileWithSystem(configFile, {}, host, reportDiagnostic);
const config = parseConfigFileWithSystem(configFile, optionsToExtend || {}, host, reportDiagnostic);
if (config) {
performIncrementalCompilation({
rootNames: config.fileNames,
@@ -50,12 +51,14 @@ namespace ts.tscWatch {
interface VerifyIncrementalWatchEmitWorkerInput {
input: VerifyIncrementalWatchEmitInput;
emitAndReportErrors: (configFile: string, host: WatchedSystem) => { close(): void; };
emitAndReportErrors: (configFile: string, host: WatchedSystem, optionsToExtend?: CompilerOptions) => { close(): void; };
verifyErrors: (host: WatchedSystem, errors: ReadonlyArray<string>) => void;
}
function verifyIncrementalWatchEmitWorker({
input: {
files, expectedInitialEmit, expectedInitialErrors, modifyFs, expectedIncrementalEmit, expectedIncrementalErrors
files, optionsToExtend,
expectedInitialEmit, expectedInitialErrors,
modifyFs, expectedIncrementalEmit, expectedIncrementalErrors
},
emitAndReportErrors,
verifyErrors
@@ -70,6 +73,7 @@ namespace ts.tscWatch {
};
verifyBuild({
host,
optionsToExtend,
writtenFiles,
emitAndReportErrors,
verifyErrors,
@@ -80,6 +84,7 @@ namespace ts.tscWatch {
modifyFs(host);
verifyBuild({
host,
optionsToExtend,
writtenFiles,
emitAndReportErrors,
verifyErrors,
@@ -91,15 +96,19 @@ namespace ts.tscWatch {
interface VerifyBuildWorker {
host: WatchedSystem;
optionsToExtend?: CompilerOptions;
writtenFiles: Map<string>;
emitAndReportErrors: VerifyIncrementalWatchEmitWorkerInput["emitAndReportErrors"];
verifyErrors: VerifyIncrementalWatchEmitWorkerInput["verifyErrors"];
expectedEmit: ReadonlyArray<File>;
expectedErrors: ReadonlyArray<string>;
}
function verifyBuild({ host, writtenFiles, emitAndReportErrors, verifyErrors, expectedEmit, expectedErrors }: VerifyBuildWorker) {
function verifyBuild({
host, optionsToExtend, writtenFiles, emitAndReportErrors,
verifyErrors, expectedEmit, expectedErrors
}: VerifyBuildWorker) {
writtenFiles.clear();
const result = emitAndReportErrors("tsconfig.json", host);
const result = emitAndReportErrors("tsconfig.json", host, optionsToExtend);
checkFileEmit(writtenFiles, expectedEmit);
verifyErrors(host, expectedErrors);
result.close();
@@ -159,60 +168,69 @@ namespace ts.tscWatch {
content: "var y = 20;\n"
};
describe("own file emit without errors", () => {
const modifiedFile2Content = file2.content.replace("y", "z").replace("20", "10");
verifyIncrementalWatchEmit({
files: [libFile, file1, file2, configFile],
expectedInitialEmit: [
file1Js,
file2Js,
{
path: `${project}/tsconfig.tsbuildinfo`,
content: getBuildInfoText({
program: {
fileInfos: {
[libFilePath]: libFileInfo,
[file1Path]: getFileInfo(file1.content),
[file2Path]: getFileInfo(file2.content)
function verify(optionsToExtend?: CompilerOptions, expectedBuildinfoOptions?: CompilerOptions) {
const modifiedFile2Content = file2.content.replace("y", "z").replace("20", "10");
verifyIncrementalWatchEmit({
files: [libFile, file1, file2, configFile],
optionsToExtend,
expectedInitialEmit: [
file1Js,
file2Js,
{
path: `${project}/tsconfig.tsbuildinfo`,
content: getBuildInfoText({
program: {
fileInfos: {
[libFilePath]: libFileInfo,
[file1Path]: getFileInfo(file1.content),
[file2Path]: getFileInfo(file2.content)
},
options: {
incremental: true,
...expectedBuildinfoOptions,
configFilePath: "./tsconfig.json"
},
referencedMap: {},
exportedModulesMap: {},
semanticDiagnosticsPerFile: [libFilePath, file1Path, file2Path]
},
options: {
incremental: true,
configFilePath: "./tsconfig.json"
version
})
}
],
expectedInitialErrors: emptyArray,
modifyFs: host => host.writeFile(file2.path, modifiedFile2Content),
expectedIncrementalEmit: [
file1Js,
{ path: file2Js.path, content: file2Js.content.replace("y", "z").replace("20", "10") },
{
path: `${project}/tsconfig.tsbuildinfo`,
content: getBuildInfoText({
program: {
fileInfos: {
[libFilePath]: libFileInfo,
[file1Path]: getFileInfo(file1.content),
[file2Path]: getFileInfo(modifiedFile2Content)
},
options: {
incremental: true,
...expectedBuildinfoOptions,
configFilePath: "./tsconfig.json"
},
referencedMap: {},
exportedModulesMap: {},
semanticDiagnosticsPerFile: [libFilePath, file1Path, file2Path]
},
referencedMap: {},
exportedModulesMap: {},
semanticDiagnosticsPerFile: [libFilePath, file1Path, file2Path]
},
version
})
}
],
expectedInitialErrors: emptyArray,
modifyFs: host => host.writeFile(file2.path, modifiedFile2Content),
expectedIncrementalEmit: [
file1Js,
{ path: file2Js.path, content: file2Js.content.replace("y", "z").replace("20", "10") },
{
path: `${project}/tsconfig.tsbuildinfo`,
content: getBuildInfoText({
program: {
fileInfos: {
[libFilePath]: libFileInfo,
[file1Path]: getFileInfo(file1.content),
[file2Path]: getFileInfo(modifiedFile2Content)
},
options: {
incremental: true,
configFilePath: "./tsconfig.json"
},
referencedMap: {},
exportedModulesMap: {},
semanticDiagnosticsPerFile: [libFilePath, file1Path, file2Path]
},
version
})
}
],
expectedIncrementalErrors: emptyArray,
version
})
}
],
expectedIncrementalErrors: emptyArray,
});
}
verify();
describe("with commandline parameters that are not relative", () => {
verify({ project: "tsconfig.json" }, { project: "./tsconfig.json" });
});
});
@@ -337,6 +355,7 @@ namespace ts.tscWatch {
expectedInitialErrors: emptyArray
});
});
});
describe("module compilation", () => {
@@ -931,7 +931,7 @@ namespace ts.tscWatch {
content: generateTSConfig(options, emptyArray, "\n")
};
const host = createWatchedSystem([file1, file2, libFile, tsconfig], { currentDirectory: proj });
const watch = createWatchOfConfigFile(tsconfig.path, host, /*maxNumberOfFilesToIterateForInvalidation*/1);
const watch = createWatchOfConfigFile(tsconfig.path, host, /*optionsToExtend*/ undefined, /*maxNumberOfFilesToIterateForInvalidation*/1);
checkProgramActualFiles(watch(), [file1.path, file2.path, libFile.path]);
outputFiles.forEach(f => host.fileExists(f));
@@ -1467,5 +1467,22 @@ var x = 10;`
openFilesForSession([{ file, projectRootPath }], session);
}
});
it("assert when removing project", () => {
const host = createServerHost([commonFile1, commonFile2, libFile]);
const service = createProjectService(host);
service.openClientFile(commonFile1.path);
const project = service.inferredProjects[0];
checkProjectActualFiles(project, [commonFile1.path, libFile.path]);
// Intentionally create scriptinfo and attach it to project
const info = service.getOrCreateScriptInfoForNormalizedPath(commonFile2.path as server.NormalizedPath, /*openedByClient*/ false)!;
info.attachToProject(project);
try {
service.applyChangesInOpenFiles(/*openFiles*/ undefined, /*changedFiles*/ undefined, [commonFile1.path]);
}
catch (e) {
assert.isTrue(e.message.indexOf("Debug Failure. False expression: Found script Info still attached to project") === 0);
}
});
});
}
@@ -1,6 +1,6 @@
namespace ts.projectSystem {
import validatePackageName = JsTyping.validatePackageName;
import PackageNameValidationResult = JsTyping.PackageNameValidationResult;
import NameValidationResult = JsTyping.NameValidationResult;
interface InstallerParams {
globalTypingsCacheLocation?: string;
@@ -948,7 +948,8 @@ namespace ts.projectSystem {
path: "/a/b/app.js",
content: `
import * as fs from "fs";
import * as commander from "commander";`
import * as commander from "commander";
import * as component from "@ember/component";`
};
const cachePath = "/a/cache";
const node = {
@@ -959,14 +960,19 @@ namespace ts.projectSystem {
path: cachePath + "/node_modules/@types/commander/index.d.ts",
content: "export let y: string"
};
const emberComponentDirectory = "ember__component";
const emberComponent = {
path: `${cachePath}/node_modules/@types/${emberComponentDirectory}/index.d.ts`,
content: "export let x: number"
};
const host = createServerHost([file]);
const installer = new (class extends Installer {
constructor() {
super(host, { globalTypingsCacheLocation: cachePath, typesRegistry: createTypesRegistry("node", "commander") });
}
installWorker(_requestId: number, _args: string[], _cwd: string, cb: TI.RequestCompletedAction) {
const installedTypings = ["@types/node", "@types/commander"];
const typingFiles = [node, commander];
const installedTypings = ["@types/node", "@types/commander", `@types/${emberComponentDirectory}`];
const typingFiles = [node, commander, emberComponent];
executeCommand(this, host, installedTypings, typingFiles, cb);
}
})();
@@ -980,9 +986,10 @@ namespace ts.projectSystem {
assert.isTrue(host.fileExists(node.path), "typings for 'node' should be created");
assert.isTrue(host.fileExists(commander.path), "typings for 'commander' should be created");
assert.isTrue(host.fileExists(emberComponent.path), "typings for 'commander' should be created");
host.checkTimeoutQueueLengthAndRun(2);
checkProjectActualFiles(service.inferredProjects[0], [file.path, node.path, commander.path]);
checkProjectActualFiles(service.inferredProjects[0], [file.path, node.path, commander.path, emberComponent.path]);
});
it("should redo resolution that resolved to '.js' file after typings are installed", () => {
@@ -1263,21 +1270,44 @@ namespace ts.projectSystem {
for (let i = 0; i < 8; i++) {
packageName += packageName;
}
assert.equal(validatePackageName(packageName), PackageNameValidationResult.NameTooLong);
assert.equal(validatePackageName(packageName), NameValidationResult.NameTooLong);
});
it("name cannot start with dot", () => {
assert.equal(validatePackageName(".foo"), PackageNameValidationResult.NameStartsWithDot);
it("package name cannot start with dot", () => {
assert.equal(validatePackageName(".foo"), NameValidationResult.NameStartsWithDot);
});
it("name cannot start with underscore", () => {
assert.equal(validatePackageName("_foo"), PackageNameValidationResult.NameStartsWithUnderscore);
it("package name cannot start with underscore", () => {
assert.equal(validatePackageName("_foo"), NameValidationResult.NameStartsWithUnderscore);
});
it("scoped packages not supported", () => {
assert.equal(validatePackageName("@scope/bar"), PackageNameValidationResult.ScopedPackagesNotSupported);
it("package non URI safe characters are not supported", () => {
assert.equal(validatePackageName(" scope "), NameValidationResult.NameContainsNonURISafeCharacters);
assert.equal(validatePackageName("; say Hello from TypeScript! #"), NameValidationResult.NameContainsNonURISafeCharacters);
assert.equal(validatePackageName("a/b/c"), NameValidationResult.NameContainsNonURISafeCharacters);
});
it("non URI safe characters are not supported", () => {
assert.equal(validatePackageName(" scope "), PackageNameValidationResult.NameContainsNonURISafeCharacters);
assert.equal(validatePackageName("; say Hello from TypeScript! #"), PackageNameValidationResult.NameContainsNonURISafeCharacters);
assert.equal(validatePackageName("a/b/c"), PackageNameValidationResult.NameContainsNonURISafeCharacters);
it("scoped package name is supported", () => {
assert.equal(validatePackageName("@scope/bar"), NameValidationResult.Ok);
});
it("scoped name in scoped package name cannot start with dot", () => {
assert.deepEqual(validatePackageName("@.scope/bar"), { name: ".scope", isScopeName: true, result: NameValidationResult.NameStartsWithDot });
assert.deepEqual(validatePackageName("@.scope/.bar"), { name: ".scope", isScopeName: true, result: NameValidationResult.NameStartsWithDot });
});
it("scope name in scoped package name cannot start with underscore", () => {
assert.deepEqual(validatePackageName("@_scope/bar"), { name: "_scope", isScopeName: true, result: NameValidationResult.NameStartsWithUnderscore });
assert.deepEqual(validatePackageName("@_scope/_bar"), { name: "_scope", isScopeName: true, result: NameValidationResult.NameStartsWithUnderscore });
});
it("scope name in scoped package name with non URI safe characters are not supported", () => {
assert.deepEqual(validatePackageName("@ scope /bar"), { name: " scope ", isScopeName: true, result: NameValidationResult.NameContainsNonURISafeCharacters });
assert.deepEqual(validatePackageName("@; say Hello from TypeScript! #/bar"), { name: "; say Hello from TypeScript! #", isScopeName: true, result: NameValidationResult.NameContainsNonURISafeCharacters });
assert.deepEqual(validatePackageName("@ scope / bar "), { name: " scope ", isScopeName: true, result: NameValidationResult.NameContainsNonURISafeCharacters });
});
it("package name in scoped package name cannot start with dot", () => {
assert.deepEqual(validatePackageName("@scope/.bar"), { name: ".bar", isScopeName: false, result: NameValidationResult.NameStartsWithDot });
});
it("package name in scoped package name cannot start with underscore", () => {
assert.deepEqual(validatePackageName("@scope/_bar"), { name: "_bar", isScopeName: false, result: NameValidationResult.NameStartsWithUnderscore });
});
it("package name in scoped package name with non URI safe characters are not supported", () => {
assert.deepEqual(validatePackageName("@scope/ bar "), { name: " bar ", isScopeName: false, result: NameValidationResult.NameContainsNonURISafeCharacters });
assert.deepEqual(validatePackageName("@scope/; say Hello from TypeScript! #"), { name: "; say Hello from TypeScript! #", isScopeName: false, result: NameValidationResult.NameContainsNonURISafeCharacters });
});
});
@@ -1309,7 +1339,7 @@ namespace ts.projectSystem {
projectService.openClientFile(f1.path);
installer.checkPendingCommands(/*expectedCount*/ 0);
assert.isTrue(messages.indexOf("Package name '; say Hello from TypeScript! #' contains non URI safe characters") > 0, "should find package with invalid name");
assert.isTrue(messages.indexOf("'; say Hello from TypeScript! #':: Package name '; say Hello from TypeScript! #' contains non URI safe characters") > 0, "should find package with invalid name");
});
});
+1 -1
View File
@@ -248,7 +248,7 @@ namespace ts.server {
isKnownTypesPackageName(name: string): boolean {
// We want to avoid looking this up in the registry as that is expensive. So first check that it's actually an NPM package.
const validationResult = JsTyping.validatePackageName(name);
if (validationResult !== JsTyping.PackageNameValidationResult.Ok) {
if (validationResult !== JsTyping.NameValidationResult.Ok) {
return false;
}
+15 -14
View File
@@ -268,27 +268,28 @@ namespace ts.server.typingsInstaller {
}
private filterTypings(typingsToInstall: ReadonlyArray<string>): ReadonlyArray<string> {
return typingsToInstall.filter(typing => {
if (this.missingTypingsSet.get(typing)) {
if (this.log.isEnabled()) this.log.writeLine(`'${typing}' is in missingTypingsSet - skipping...`);
return false;
return mapDefined(typingsToInstall, typing => {
const typingKey = mangleScopedPackageName(typing);
if (this.missingTypingsSet.get(typingKey)) {
if (this.log.isEnabled()) this.log.writeLine(`'${typing}':: '${typingKey}' is in missingTypingsSet - skipping...`);
return undefined;
}
const validationResult = JsTyping.validatePackageName(typing);
if (validationResult !== JsTyping.PackageNameValidationResult.Ok) {
if (validationResult !== JsTyping.NameValidationResult.Ok) {
// add typing name to missing set so we won't process it again
this.missingTypingsSet.set(typing, true);
this.missingTypingsSet.set(typingKey, true);
if (this.log.isEnabled()) this.log.writeLine(JsTyping.renderPackageNameValidationFailure(validationResult, typing));
return false;
return undefined;
}
if (!this.typesRegistry.has(typing)) {
if (this.log.isEnabled()) this.log.writeLine(`Entry for package '${typing}' does not exist in local types registry - skipping...`);
return false;
if (!this.typesRegistry.has(typingKey)) {
if (this.log.isEnabled()) this.log.writeLine(`'${typing}':: Entry for package '${typingKey}' does not exist in local types registry - skipping...`);
return undefined;
}
if (this.packageNameToTypingLocation.get(typing) && JsTyping.isTypingUpToDate(this.packageNameToTypingLocation.get(typing)!, this.typesRegistry.get(typing)!)) {
if (this.log.isEnabled()) this.log.writeLine(`'${typing}' already has an up-to-date typing - skipping...`);
return false;
if (this.packageNameToTypingLocation.get(typingKey) && JsTyping.isTypingUpToDate(this.packageNameToTypingLocation.get(typingKey)!, this.typesRegistry.get(typingKey)!)) {
if (this.log.isEnabled()) this.log.writeLine(`'${typing}':: '${typingKey}' already has an up-to-date typing - skipping...`);
return undefined;
}
return true;
return typingKey;
});
}
+5 -4
View File
@@ -1155,6 +1155,7 @@ declare namespace ts {
expression: JsxTagNameExpression;
}
interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
kind: SyntaxKind.JsxAttributes;
parent: JsxOpeningLikeElement;
}
interface JsxOpeningElement extends Expression {
@@ -2600,7 +2601,7 @@ declare namespace ts {
UMD = 3,
System = 4,
ES2015 = 5,
ESNext = 6
ESNext = 99
}
enum JsxEmit {
None = 0,
@@ -2640,9 +2641,9 @@ declare namespace ts {
ES2018 = 5,
ES2019 = 6,
ES2020 = 7,
ESNext = 8,
ESNext = 99,
JSON = 100,
Latest = 8
Latest = 99
}
enum LanguageVariant {
Standard = 0,
@@ -5404,7 +5405,7 @@ declare namespace ts {
argumentCount: number;
}
interface CompletionInfo {
/** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
/** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
isGlobalCompletion: boolean;
isMemberCompletion: boolean;
/**
+5 -4
View File
@@ -1155,6 +1155,7 @@ declare namespace ts {
expression: JsxTagNameExpression;
}
interface JsxAttributes extends ObjectLiteralExpressionBase<JsxAttributeLike> {
kind: SyntaxKind.JsxAttributes;
parent: JsxOpeningLikeElement;
}
interface JsxOpeningElement extends Expression {
@@ -2600,7 +2601,7 @@ declare namespace ts {
UMD = 3,
System = 4,
ES2015 = 5,
ESNext = 6
ESNext = 99
}
enum JsxEmit {
None = 0,
@@ -2640,9 +2641,9 @@ declare namespace ts {
ES2018 = 5,
ES2019 = 6,
ES2020 = 7,
ESNext = 8,
ESNext = 99,
JSON = 100,
Latest = 8
Latest = 99
}
enum LanguageVariant {
Standard = 0,
@@ -5404,7 +5405,7 @@ declare namespace ts {
argumentCount: number;
}
interface CompletionInfo {
/** Not true for all glboal completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
/** Not true for all global completions. This will be true if the enclosing scope matches a few syntax kinds. See `isSnippetScope`. */
isGlobalCompletion: boolean;
isMemberCompletion: boolean;
/**
@@ -9,10 +9,11 @@ class A {
//// [asyncArrowFunction11_es5.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -42,10 +42,11 @@ module M {
//// [asyncAwaitIsolatedModules_es5.js]
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -41,10 +41,11 @@ module M {
//// [asyncAwaitIsolatedModules_es6.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
+2 -1
View File
@@ -48,10 +48,11 @@ async function f14() {
//// [asyncAwait_es5.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
+2 -1
View File
@@ -48,10 +48,11 @@ async function f14() {
//// [asyncAwait_es6.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -7,10 +7,11 @@ async () => {
//// [asyncFunctionNoReturnType.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -23,10 +23,11 @@ async function asyncFoo(): Promise<Foo> {
//// [asyncFunctionReturnExpressionErrorSpans.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -77,10 +77,11 @@ async function fGenericIndexedTypeForExplicitPromiseOfKProp<TObj extends Obj, K
//// [asyncFunctionReturnType.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -6,10 +6,11 @@ async ({ foo, bar, ...rest }) => bar(await foo);
//// [asyncFunctionTempVariableScoping.js]
// https://github.com/Microsoft/TypeScript/issues/19187
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -26,10 +26,11 @@ async function test4() {
//// [asyncFunctionWithForStatementNoInitializer.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -17,10 +17,11 @@ export const b = {
//// [b.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -32,10 +33,11 @@ export const b = {
};
//// [a.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -27,10 +27,11 @@ async function sample2(x?: number) {
//// [asyncFunctionsAndStrictNullChecks.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
+2 -1
View File
@@ -11,10 +11,11 @@ function f1() {
//// [asyncIIFE.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -36,10 +36,11 @@ exports.Task = Task;
//// [test.js]
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -18,10 +18,11 @@ exports.Task = Task;
//// [test.js]
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -61,10 +61,11 @@ class B extends A {
//// [asyncMethodWithSuperConflict_es6.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -7,10 +7,11 @@ function g() { }
//// [a.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -7,10 +7,11 @@ function g() { }
//// [a.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -23,10 +23,11 @@ async function main() {
/// @target: es2015
// https://github.com/Microsoft/TypeScript/issues/18186
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -17,10 +17,11 @@ async function bar4() {
//// [await_unaryExpression_es6.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -21,10 +21,11 @@ async function bar4() {
//// [await_unaryExpression_es6_1.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -13,10 +13,11 @@ async function bar3() {
//// [await_unaryExpression_es6_2.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -19,10 +19,11 @@ async function bar4() {
//// [await_unaryExpression_es6_3.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -42,10 +42,11 @@ function foo9(y = {[z]() { return z; }}, z = 1) {
//// [capturedParametersInInitializers1.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
+2 -1
View File
@@ -10,10 +10,11 @@ async function f() {
//// [castOfAwait.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -1,8 +1,8 @@
error TS2318: Cannot find global type 'Generator'.
error TS2318: Cannot find global type 'IterableIterator'.
tests/cases/compiler/castOfYield.ts(4,14): error TS1109: Expression expected.
!!! error TS2318: Cannot find global type 'Generator'.
!!! error TS2318: Cannot find global type 'IterableIterator'.
==== tests/cases/compiler/castOfYield.ts (1 errors) ====
function* f() {
<number> (yield 0);
@@ -40,10 +40,11 @@ var __extends = (this && this.__extends) || (function () {
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -21,10 +21,11 @@
//// [circularInferredTypeOfVariable.js]
// Repro from #14428
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -0,0 +1,25 @@
//// [controlFlowElementAccess2.ts]
declare const config: {
[key: string]: boolean | { prop: string };
};
if (typeof config['works'] !== 'boolean') {
config.works.prop = 'test'; // ok
config['works'].prop = 'test'; // error, config['works']: boolean | { 'prop': string }
}
if (typeof config.works !== 'boolean') {
config['works'].prop = 'test'; // error, config['works']: boolean | { 'prop': string }
config.works.prop = 'test'; // ok
}
//// [controlFlowElementAccess2.js]
"use strict";
if (typeof config['works'] !== 'boolean') {
config.works.prop = 'test'; // ok
config['works'].prop = 'test'; // error, config['works']: boolean | { 'prop': string }
}
if (typeof config.works !== 'boolean') {
config['works'].prop = 'test'; // error, config['works']: boolean | { 'prop': string }
config.works.prop = 'test'; // ok
}
@@ -0,0 +1,37 @@
=== tests/cases/conformance/controlFlow/controlFlowElementAccess2.ts ===
declare const config: {
>config : Symbol(config, Decl(controlFlowElementAccess2.ts, 0, 13))
[key: string]: boolean | { prop: string };
>key : Symbol(key, Decl(controlFlowElementAccess2.ts, 1, 5))
>prop : Symbol(prop, Decl(controlFlowElementAccess2.ts, 1, 30))
};
if (typeof config['works'] !== 'boolean') {
>config : Symbol(config, Decl(controlFlowElementAccess2.ts, 0, 13))
config.works.prop = 'test'; // ok
>config.works.prop : Symbol(prop, Decl(controlFlowElementAccess2.ts, 1, 30))
>config : Symbol(config, Decl(controlFlowElementAccess2.ts, 0, 13))
>prop : Symbol(prop, Decl(controlFlowElementAccess2.ts, 1, 30))
config['works'].prop = 'test'; // error, config['works']: boolean | { 'prop': string }
>config['works'].prop : Symbol(prop, Decl(controlFlowElementAccess2.ts, 1, 30))
>config : Symbol(config, Decl(controlFlowElementAccess2.ts, 0, 13))
>prop : Symbol(prop, Decl(controlFlowElementAccess2.ts, 1, 30))
}
if (typeof config.works !== 'boolean') {
>config : Symbol(config, Decl(controlFlowElementAccess2.ts, 0, 13))
config['works'].prop = 'test'; // error, config['works']: boolean | { 'prop': string }
>config['works'].prop : Symbol(prop, Decl(controlFlowElementAccess2.ts, 1, 30))
>config : Symbol(config, Decl(controlFlowElementAccess2.ts, 0, 13))
>prop : Symbol(prop, Decl(controlFlowElementAccess2.ts, 1, 30))
config.works.prop = 'test'; // ok
>config.works.prop : Symbol(prop, Decl(controlFlowElementAccess2.ts, 1, 30))
>config : Symbol(config, Decl(controlFlowElementAccess2.ts, 0, 13))
>prop : Symbol(prop, Decl(controlFlowElementAccess2.ts, 1, 30))
}
@@ -0,0 +1,63 @@
=== tests/cases/conformance/controlFlow/controlFlowElementAccess2.ts ===
declare const config: {
>config : { [key: string]: boolean | { prop: string; }; }
[key: string]: boolean | { prop: string };
>key : string
>prop : string
};
if (typeof config['works'] !== 'boolean') {
>typeof config['works'] !== 'boolean' : boolean
>typeof config['works'] : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"
>config['works'] : boolean | { prop: string; }
>config : { [key: string]: boolean | { prop: string; }; }
>'works' : "works"
>'boolean' : "boolean"
config.works.prop = 'test'; // ok
>config.works.prop = 'test' : "test"
>config.works.prop : string
>config.works : { prop: string; }
>config : { [key: string]: boolean | { prop: string; }; }
>works : { prop: string; }
>prop : string
>'test' : "test"
config['works'].prop = 'test'; // error, config['works']: boolean | { 'prop': string }
>config['works'].prop = 'test' : "test"
>config['works'].prop : string
>config['works'] : { prop: string; }
>config : { [key: string]: boolean | { prop: string; }; }
>'works' : "works"
>prop : string
>'test' : "test"
}
if (typeof config.works !== 'boolean') {
>typeof config.works !== 'boolean' : boolean
>typeof config.works : "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function"
>config.works : boolean | { prop: string; }
>config : { [key: string]: boolean | { prop: string; }; }
>works : boolean | { prop: string; }
>'boolean' : "boolean"
config['works'].prop = 'test'; // error, config['works']: boolean | { 'prop': string }
>config['works'].prop = 'test' : "test"
>config['works'].prop : string
>config['works'] : { prop: string; }
>config : { [key: string]: boolean | { prop: string; }; }
>'works' : "works"
>prop : string
>'test' : "test"
config.works.prop = 'test'; // ok
>config.works.prop = 'test' : "test"
>config.works.prop : string
>config.works : { prop: string; }
>config : { [key: string]: boolean | { prop: string; }; }
>works : { prop: string; }
>prop : string
>'test' : "test"
}
@@ -43,10 +43,11 @@ class Foo {
//// [controlFlowForCatchAndFinally.js]
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -27,10 +27,11 @@ async function countEverything(): Promise<number> {
//// [correctOrderOfPromiseMethod.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -8,10 +8,11 @@ export class Foo {
//// [declarationEmitPrivateAsync.js]
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -24,10 +24,11 @@ export async function runSampleBreaks<A, B, C, D, E>(
//// [declarationEmitPromise.js]
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -73,7 +73,7 @@ exports.testRecFun = function (parent) {
return {
result: parent,
deeper: function (child) {
return exports.testRecFun(__assign({}, parent, child));
return exports.testRecFun(__assign(__assign({}, parent), child));
}
};
};
@@ -22,10 +22,11 @@ var __metadata = (this && this.__metadata) || function (k, v) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -29,10 +29,11 @@ import x from './a';
});
//// [b.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -20,10 +20,11 @@ exports.default = x;
//// [b.js]
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
+55 -108
View File
@@ -1,143 +1,93 @@
Exit Code: 1
Standard output:
Rush Multi-Project Build Tool 5.7.3 - https://rushjs.io
Rush Multi-Project Build Tool 5.X.X - https://rushjs.io
Starting "rush rebuild"
Executing a maximum of 1 simultaneous processes...
[@azure/cosmos] started
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/cosmos@X.X.X compile: `echo Using TypeScript && tsc --version && tsc -p tsconfig.prod.json --pretty`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @azure/cosmos@X.X.X compile script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-07-10T13_39_33_862Z-debug.log
[@azure/service-bus] started
[@azure/storage-blob] started
XX of XX: [@azure/storage-blob] completed successfully in ? seconds
[@azure/storage-datalake] started
XX of XX: [@azure/storage-datalake] completed successfully in ? seconds
[@azure/storage-file] started
XX of XX: [@azure/storage-file] completed successfully in ? seconds
[@azure/storage-queue] started
XX of XX: [@azure/storage-queue] completed successfully in ? seconds
[@azure/template] started
XX of XX: [@azure/template] completed successfully in ? seconds
[@azure/abort-controller] started
Executing a maximum of ?simultaneous processes...
XX of XX: [@azure/abort-controller] completed successfully in ? seconds
[@azure/core-asynciterator-polyfill] started
XX of XX: [@azure/core-asynciterator-polyfill] completed successfully in ? seconds
[@azure/core-auth] started
XX of XX: [@azure/core-auth] completed successfully in ? seconds
[@azure/core-http] started
XX of XX: [@azure/core-http] completed successfully in ? seconds
[@azure/core-arm] started
XX of XX: [@azure/core-arm] completed successfully in ? seconds
[@azure/core-paging] started
XX of XX: [@azure/core-paging] completed successfully in ? seconds
[@azure/event-processor-host] started
XX of XX: [@azure/cosmos] completed successfully in ? seconds
XX of XX: [@azure/event-processor-host] completed successfully in ? seconds
[testhub] started
Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md
XX of XX: [@azure/storage-blob] completed successfully in ? seconds
XX of XX: [@azure/storage-file] completed successfully in ? seconds
XX of XX: [@azure/storage-queue] completed successfully in ? seconds
XX of XX: [@azure/template] completed successfully in ? seconds
XX of XX: [testhub] completed successfully in ? seconds
[@azure/identity] started
XX of XX: [@azure/identity] completed successfully in ? seconds
[@azure/keyvault-certificates] started
[@azure/keyvault-keys] started
XX of XX: [@azure/core-auth] completed successfully in ? seconds
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/keyvault-keys@X.X.X-preview.2 extract-api: `tsc -p . && api-extractor run --local`
npm ERR! @azure/core-http@X.X.X-preview.2 build:tsc: `tsc -p tsconfig.es.json`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @azure/keyvault-keys@X.X.X-preview.2 extract-api script.
npm ERR! Failed at the @azure/core-http@X.X.X-preview.2 build:tsc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-07-10T13_41_42_464Z-debug.log
[@azure/keyvault-secrets] started
npm ERR! /root/.npm/_logs/XXXX-XX-XXXXXXXXX-debug.log
ERROR: "build:tsc" exited with 2.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/keyvault-secrets@X.X.X-preview.2 extract-api: `tsc -p . && api-extractor run --local`
npm ERR! Exit status 2
npm ERR! errno 1
npm ERR! @azure/core-http@X.X.X-preview.2 build:lib: `run-s build:tsc build:rollup build:minify-browser`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @azure/keyvault-secrets@X.X.X-preview.2 extract-api script.
npm ERR! Failed at the @azure/core-http@X.X.X-preview.2 build:lib script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-07-10T13_41_46_371Z-debug.log
[@azure/core-amqp] started
SUCCESS (14)
npm ERR! /root/.npm/_logs/XXXX-XX-XXXXXXXXX-debug.log
ERROR: "build:lib" exited with 1.
SUCCESS (11)
================================
@azure/abort-controller (? seconds)
@azure/core-arm (? seconds)
@azure/core-asynciterator-polyfill (? seconds)
@azure/core-auth (? seconds)
@azure/core-http (? seconds)
@azure/core-paging (? seconds)
@azure/cosmos (? seconds)
@azure/event-processor-host (? seconds)
@azure/identity (? seconds)
@azure/storage-blob (? seconds)
@azure/storage-datalake (? seconds)
@azure/storage-file (? seconds)
@azure/storage-queue (? seconds)
@azure/template (? seconds)
testhub (? seconds)
================================
BLOCKED (1)
SUCCESS WITH WARNINGS (1)
================================
@azure/service-bus (? seconds)
Warning: You have changed the public API signature for this project. Updating review/service-bus.api.md
================================
BLOCKED (7)
================================
@azure/core-amqp
@azure/core-arm
@azure/event-hubs
@azure/identity
@azure/keyvault-certificates
@azure/keyvault-keys
@azure/keyvault-secrets
================================
FAILURE (6)
FAILURE (1)
================================
@azure/core-amqp (? seconds)
>>> @azure/core-amqp
tsc -p . && rollup -c 2>&1
src/errors.ts(586,20): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'typeof ConditionErrorNameMapper'.
src/errors.ts(607,34): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'typeof SystemErrorConditionMapper'.
src/errors.ts(608,20): error TS7053: Element implicitly has an 'any' type because expression of type 'any' can't be used to index type 'typeof ConditionErrorNameMapper'.
@azure/cosmos ( ? seconds)
@azure/core-http (? seconds)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/cosmos@X.X.X compile: `echo Using TypeScript && tsc --version && tsc -p tsconfig.prod.json --pretty`
npm ERR! @azure/core-http@X.X.X-preview.2 build:tsc: `tsc -p tsconfig.es.json`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @azure/cosmos@X.X.X compile script.
npm ERR! Failed at the @azure/core-http@X.X.X-preview.2 build:tsc script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-07-10T13_39_33_862Z-debug.log
@azure/keyvault-certificates (? seconds)
>>> @azure/keyvault-certificates
tsc && rollup -c rollup.config.js 2>&1
error TS2318: Cannot find global type 'AsyncGenerator'.
src/index.ts(154,60): error TS2739: Type '{}' is missing the following properties from type 'AsyncIterableIterator<CertificateAttributes>': [Symbol.asyncIterator], next
src/index.ts(180,128): error TS2322: Type '{}' is not assignable to type 'AsyncIterableIterator<CertificateAttributes>'.
src/index.ts(232,101): error TS2739: Type '{}' is missing the following properties from type 'AsyncIterableIterator<CertificateIssuer>': [Symbol.asyncIterator], next
src/index.ts(381,103): error TS2739: Type '{}' is missing the following properties from type 'AsyncIterableIterator<DeletedCertificate>': [Symbol.asyncIterator], next
@azure/keyvault-keys (? seconds)
npm ERR! /root/.npm/_logs/XXXX-XX-XXXXXXXXX-debug.log
ERROR: "build:tsc" exited with 2.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/keyvault-keys@X.X.X-preview.2 extract-api: `tsc -p . && api-extractor run --local`
npm ERR! Exit status 2
npm ERR! errno 1
npm ERR! @azure/core-http@X.X.X-preview.2 build:lib: `run-s build:tsc build:rollup build:minify-browser`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @azure/keyvault-keys@X.X.X-preview.2 extract-api script.
npm ERR! Failed at the @azure/core-http@X.X.X-preview.2 build:lib script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-07-10T13_41_42_464Z-debug.log
@azure/keyvault-secrets (? seconds)
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! @azure/keyvault-secrets@X.X.X-preview.2 extract-api: `tsc -p . && api-extractor run --local`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @azure/keyvault-secrets@X.X.X-preview.2 extract-api script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-07-10T13_41_46_371Z-debug.log
@azure/service-bus ( ? seconds)
>>> @azure/service-bus
tsc -p . && rollup -c 2>&1 && npm run extract-api
error TS2318: Cannot find global type 'AsyncGenerator'.
src/receiver.ts(193,32): error TS2739: Type '{}' is missing the following properties from type 'AsyncIterableIterator<ServiceBusMessage>': [Symbol.asyncIterator], next
src/receiver.ts(742,32): error TS2322: Type '{}' is not assignable to type 'AsyncIterableIterator<ServiceBusMessage>'.
npm ERR! /root/.npm/_logs/XXXX-XX-XXXXXXXXX-debug.log
ERROR: "build:lib" exited with 1.
================================
Error: Project(s) failed to build
rush rebuild - Errors! ( ? seconds)
@@ -146,16 +96,13 @@ rush rebuild - Errors! ( ? seconds)
Standard error:
Your version of Node.js (X.X.X) has not been tested with this release of Rush. The Rush team will not accept issue reports for it. Please consider upgrading Rush or downgrading Node.js.
XX of XX: [@azure/cosmos] failed to build!
XX of XX: [@azure/service-bus] failed to build!
XX of XX: [@azure/keyvault-certificates] failed to build!
XX of XX: [@azure/keyvault-keys] failed to build!
XX of XX: [@azure/keyvault-secrets] failed to build!
XX of XX: [@azure/core-amqp] failed to build!
XX of XX: [@azure/event-hubs] blocked by [@azure/core-amqp]!
[@azure/core-amqp] Returned error code: 2
[@azure/cosmos] Returned error code: 2
[@azure/keyvault-certificates] Returned error code: 2
[@azure/keyvault-keys] Returned error code: 2
[@azure/keyvault-secrets] Returned error code: 2
[@azure/service-bus] Returned error code: 2
XX of XX: [@azure/service-bus] completed with warnings in ? seconds
XX of XX: [@azure/core-http] failed to build!
XX of XX: [@azure/core-arm] blocked by [@azure/core-http]!
XX of XX: [@azure/keyvault-certificates] blocked by [@azure/core-http]!
XX of XX: [@azure/keyvault-keys] blocked by [@azure/core-http]!
XX of XX: [@azure/keyvault-secrets] blocked by [@azure/core-http]!
XX of XX: [@azure/identity] blocked by [@azure/core-http]!
XX of XX: [@azure/core-amqp] blocked by [@azure/core-http]!
XX of XX: [@azure/event-hubs] blocked by [@azure/core-http]!
[@azure/core-http] Returned error code: 1
@@ -1,349 +1,436 @@
Exit Code: 1
Standard output:
Rush Multi-Project Build Tool 5.6.0 - https://rushjs.io
Starting "rush rebuild"
Executing a maximum of 1 simultaneous processes...
[@uifabric/prettier-rules] started
XX of XX: [@uifabric/prettier-rules] completed successfully in ? seconds
[@uifabric/tslint-rules] started
XX of XX: [@uifabric/tslint-rules] completed successfully in ? seconds
[@uifabric/codepen-loader] started
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
[@uifabric/build] started
XX of XX: [@uifabric/build] completed successfully in ? seconds
[@uifabric/migration] started
XX of XX: [@uifabric/migration] completed successfully in ? seconds
[@uifabric/set-version] started
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
[@uifabric/merge-styles] started
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
[@uifabric/jest-serializer-merge-styles] started
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
[@uifabric/test-utilities] started
XX of XX: [@uifabric/test-utilities] completed successfully in ? seconds
[@uifabric/utilities] started
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
[@uifabric/styling] started
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
[@uifabric/file-type-icons] started
XX of XX: [@uifabric/file-type-icons] completed successfully in ? seconds
[@uifabric/foundation] started
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
● createFactory passes componentProps without userProps
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:205:73)
● createFactory passes userProp string as child
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:210:76)
● createFactory passes userProp integer as child
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:220:76)
● createFactory passes userProp string as defaultProp
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:225:92)
● createFactory passes userProp integer as defaultProp
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:235:92)
● createFactory merges userProps over componentProps
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:245:84)
● createFactory renders div and userProp integer as children
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:255:86)
● createFactory renders div and userProp string as children
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:266:86)
● createFactory renders userProp span function without component props
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:288:61)
● createFactory renders userProp span function with component props
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:301:61)
● createFactory renders userProp span component with component props
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:314:61)
● createFactory passes props and type arguments to userProp function
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at Object.<anonymous> (src/slots.test.tsx:334:43)
● getSlots creates slots and passes merged props to them
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at _renderSlot (src/slots.tsx:221:100)
at Object.slot [as testSlot1] (src/slots.tsx:142:16)
at Object.<anonymous> (src/slots.test.tsx:399:24)
[XX:XX:XX XM] x Error detected while running 'jest'
[XX:XX:XX XM] x ------------------------------------
[XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node /office-ui-fabric-react/common/temp/node_modules/jest/bin/jest.js --config /office-ui-fabric-react/packages/foundation/jest.config.js --passWithNoTests --colors
at ChildProcess.<anonymous> (/office-ui-fabric-react/common/temp/node_modules/.registry.npmjs.org/just-scripts-utils/0.8.1/node_modules/just-scripts-utils/lib/exec.js:70:31)
at ChildProcess.emit (events.js:203:13)
at ChildProcess.EventEmitter.emit (domain.js:494:23)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
[XX:XX:XX XM] x ------------------------------------
[XX:XX:XX XM] x finished 'validate' in ?s with errors
[XX:XX:XX XM] x finished 'build' in ?s with errors
[XX:XX:XX XM] x Error previously detected. See above for error messages.
[@uifabric/icons] started
XX of XX: [@uifabric/icons] completed successfully in ? seconds
[@uifabric/webpack-utils] started
XX of XX: [@uifabric/webpack-utils] completed successfully in ? seconds
SUCCESS (8)
================================
@uifabric/build (? seconds)
@uifabric/file-type-icons (? seconds)
@uifabric/icons (? seconds)
@uifabric/migration (? seconds)
@uifabric/prettier-rules (? seconds)
@uifabric/test-utilities (? seconds)
@uifabric/tslint-rules (? seconds)
@uifabric/webpack-utils (? seconds)
================================
SUCCESS WITH WARNINGS (6)
================================
@uifabric/codepen-loader (? seconds)
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
@uifabric/jest-serializer-merge-styles (? seconds)
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
@uifabric/merge-styles (? seconds)
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
@uifabric/set-version (? seconds)
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
@uifabric/styling (? seconds)
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
@uifabric/utilities (? seconds)
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
================================
BLOCKED (27)
================================
@uifabric/api-docs
@uifabric/azure-themes
@uifabric/charting
@uifabric/date-time
@uifabric/example-app-base
@uifabric/experiments
@uifabric/fabric-website
@uifabric/fabric-website-resources
@uifabric/fluent-theme
@uifabric/foundation-scenarios
@uifabric/lists
@uifabric/mdl2-theme
@uifabric/pr-deploy-site
@uifabric/react-cards
@uifabric/theme-samples
@uifabric/tsx-editor
@uifabric/variants
a11y-tests
dom-tests
office-ui-fabric-react
perf-test
server-rendered-app
ssr-tests
test-bundles
theming-designer
todo-app
vr-tests
================================
FAILURE (1)
================================
@uifabric/foundation (? seconds)
ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
● createFactory passes componentProps without userProps
RangeError: Invalid array length
189 | for (const props of allProps) {
190 | classNames.push(props && props.className);
> 191 | assign(finalProps, ...(props as any));
| ^
192 | }
193 |
[...179 lines omitted...]
193 |
194 | finalProps.className = mergeStyles(defaultStyles, classNames);
at Object.__spreadArrays (../../common/temp/node_modules/.registry.npmjs.org/tslib/1.10.0/node_modules/tslib/tslib.js:182:22)
at _constructFinalProps (src/slots.tsx:191:11)
at result (src/slots.tsx:88:24)
at _renderSlot (src/slots.tsx:221:100)
at Object.slot [as testSlot1] (src/slots.tsx:142:16)
at Object.<anonymous> (src/slots.test.tsx:399:24)
[XX:XX:XX XM] x Error detected while running 'jest'
[XX:XX:XX XM] x ------------------------------------
[XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node /office-ui-fabric-react/common/temp/node_modules/jest/bin/jest.js --config /office-ui-fabric-react/packages/foundation/jest.config.js --passWithNoTests --colors
at ChildProcess.<anonymous> (/office-ui-fabric-react/common/temp/node_modules/.registry.npmjs.org/just-scripts-utils/0.8.1/node_modules/just-scripts-utils/lib/exec.js:70:31)
at ChildProcess.emit (events.js:203:13)
at ChildProcess.EventEmitter.emit (domain.js:494:23)
at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
[XX:XX:XX XM] x ------------------------------------
[XX:XX:XX XM] x finished 'validate' in ?s with errors
[XX:XX:XX XM] x finished 'build' in ?s with errors
[XX:XX:XX XM] x Error previously detected. See above for error messages.
================================
Error: Project(s) failed to build
rush rebuild - Errors! ( ? seconds)
@uifabric/codepen-loader: yarn run vX.X.X
@uifabric/codepen-loader: $ just-scripts build --production --lint
@uifabric/codepen-loader: [XX:XX:XX XM] ■ Removing [lib, temp, dist, coverage, lib-commonjs]
@uifabric/codepen-loader: [XX:XX:XX XM] ■ Copying [../office-ui-fabric-react/src/utilities/exampleData.ts, ../office-ui-fabric-react/src/components/ExtendedPicker/examples/PeopleExampleData.ts, ../office-ui-fabric-react/src/common/TestImages.ts] to 'lib'
@uifabric/codepen-loader: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/codepen-loader/tsconfig.json
@uifabric/codepen-loader: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --module commonjs --outDir "./lib" --project "/office-ui-fabric-react/packages/codepen-loader/tsconfig.json"
@uifabric/codepen-loader: [XX:XX:XX XM] ■ Running Jest
@uifabric/codepen-loader: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/codepen-loader/jest.config.js" --passWithNoTests --colors
@uifabric/codepen-loader: PASS src/__tests__/codepenTransform.test.ts
@uifabric/codepen-loader: Done in ?s.
@uifabric/build: yarn run vX.X.X
@uifabric/build: $ node ./just-scripts.js no-op --production --lint
@uifabric/build: Done in ?s.
@uifabric/migration: yarn run vX.X.X
@uifabric/migration: $ just-scripts build --production --lint
@uifabric/migration: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts]
@uifabric/migration: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/migration/tsconfig.json
@uifabric/migration: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module commonjs --project "/office-ui-fabric-react/packages/migration/tsconfig.json"
@uifabric/migration: Done in ?s.
@uifabric/set-version: yarn run vX.X.X
@uifabric/set-version: $ just-scripts build --production --lint
@uifabric/set-version: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts]
@uifabric/set-version: [XX:XX:XX XM] ■ Running tslint
@uifabric/set-version: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/tslint/lib/tslintCli.js" --project "/office-ui-fabric-react/packages/set-version/tsconfig.json" -t stylish -r /office-ui-fabric-react/node_modules/tslint-microsoft-contrib
@uifabric/set-version: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/set-version/tsconfig.json
@uifabric/set-version: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/set-version/tsconfig.json"
@uifabric/set-version: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/set-version/tsconfig.json
@uifabric/set-version: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/set-version/tsconfig.json"
@uifabric/set-version: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/set-version/tsconfig.json
@uifabric/set-version: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/set-version/tsconfig.json"
@uifabric/set-version: [XX:XX:XX XM] ■ Running Webpack
@uifabric/set-version: [XX:XX:XX XM] ■ Webpack Config Path: null
@uifabric/set-version: [XX:XX:XX XM] ■ webpack.config.js not found, skipping webpack
@uifabric/set-version: Done in ?s.
@uifabric/webpack-utils: yarn run vX.X.X
@uifabric/webpack-utils: $ just-scripts build --production --lint
@uifabric/webpack-utils: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts]
@uifabric/webpack-utils: [XX:XX:XX XM] ■ Running tslint
@uifabric/webpack-utils: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/tslint/lib/tslintCli.js" --project "/office-ui-fabric-react/packages/webpack-utils/tsconfig.json" -t stylish -r /office-ui-fabric-react/node_modules/tslint-microsoft-contrib
@uifabric/webpack-utils: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/webpack-utils/tsconfig.json
@uifabric/webpack-utils: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module commonjs --project "/office-ui-fabric-react/packages/webpack-utils/tsconfig.json"
@uifabric/webpack-utils: Done in ?s.
@uifabric/merge-styles: yarn run vX.X.X
@uifabric/merge-styles: $ just-scripts build --production --lint
@uifabric/merge-styles: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts]
@uifabric/merge-styles: [XX:XX:XX XM] ■ Running tslint
@uifabric/merge-styles: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/tslint/lib/tslintCli.js" --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json" -t stylish -r /office-ui-fabric-react/node_modules/tslint-microsoft-contrib
@uifabric/merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/merge-styles/tsconfig.json
@uifabric/merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json"
@uifabric/merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/merge-styles/tsconfig.json
@uifabric/merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json"
@uifabric/merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/merge-styles/tsconfig.json
@uifabric/merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/merge-styles/tsconfig.json"
@uifabric/merge-styles: [XX:XX:XX XM] ■ Running Jest
@uifabric/merge-styles: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/merge-styles/jest.config.js" --passWithNoTests --colors
@uifabric/merge-styles: [XX:XX:XX XM] ■ Running Webpack
@uifabric/merge-styles: [XX:XX:XX XM] ■ Webpack Config Path: /office-ui-fabric-react/packages/merge-styles/webpack.config.js
@uifabric/merge-styles: Webpack version: 4.29.5
@uifabric/merge-styles: PASS src/styleToClassName.test.ts
@uifabric/merge-styles: PASS src/mergeStyleSets.test.ts
@uifabric/merge-styles: PASS src/concatStyleSets.test.ts
@uifabric/merge-styles: PASS src/mergeStyles.test.ts
@uifabric/merge-styles: PASS src/transforms/rtlifyRules.test.ts
@uifabric/merge-styles: PASS src/transforms/prefixRules.test.ts
@uifabric/merge-styles: PASS src/transforms/provideUnits.test.ts
@uifabric/merge-styles: PASS src/keyframes.test.ts
@uifabric/merge-styles: PASS src/Stylesheet.test.ts
@uifabric/merge-styles: PASS src/extractStyleParts.test.ts
@uifabric/merge-styles: PASS src/server.test.ts
@uifabric/merge-styles: PASS src/fontFace.test.ts
@uifabric/merge-styles: PASS src/transforms/kebabRules.test.ts
@uifabric/merge-styles: [XX:XX:XX XM] ■ Extracting Public API surface from '/office-ui-fabric-react/packages/merge-styles/lib/index.d.ts'
@uifabric/merge-styles: Done in ?s.
@uifabric/jest-serializer-merge-styles: yarn run vX.X.X
@uifabric/jest-serializer-merge-styles: $ just-scripts build --production --lint
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json"
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json"
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/jest-serializer-merge-styles/tsconfig.json"
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ Running Jest
@uifabric/jest-serializer-merge-styles: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/jest-serializer-merge-styles/jest.config.js" --passWithNoTests --colors
@uifabric/jest-serializer-merge-styles: PASS src/index.test.tsx
@uifabric/jest-serializer-merge-styles: Done in ?s.
@uifabric/test-utilities: yarn run vX.X.X
@uifabric/test-utilities: $ just-scripts build --production --lint
@uifabric/test-utilities: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts]
@uifabric/test-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/test-utilities/tsconfig.json
@uifabric/test-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/test-utilities/tsconfig.json"
@uifabric/test-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/test-utilities/tsconfig.json
@uifabric/test-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/test-utilities/tsconfig.json"
@uifabric/test-utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/test-utilities/tsconfig.json
@uifabric/test-utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/test-utilities/tsconfig.json"
@uifabric/test-utilities: Done in ?s.
@uifabric/utilities: yarn run vX.X.X
@uifabric/utilities: $ just-scripts build --production --lint
@uifabric/utilities: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts]
@uifabric/utilities: [XX:XX:XX XM] ■ Running tslint
@uifabric/utilities: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/tslint/lib/tslintCli.js" --project "/office-ui-fabric-react/packages/utilities/tsconfig.json" -t stylish -r /office-ui-fabric-react/node_modules/tslint-microsoft-contrib
@uifabric/utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/utilities/tsconfig.json
@uifabric/utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/utilities/tsconfig.json"
@uifabric/utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/utilities/tsconfig.json
@uifabric/utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/utilities/tsconfig.json"
@uifabric/utilities: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/utilities/tsconfig.json
@uifabric/utilities: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/utilities/tsconfig.json"
@uifabric/utilities: [XX:XX:XX XM] ■ Running Jest
@uifabric/utilities: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/utilities/jest.config.js" --passWithNoTests --colors
@uifabric/utilities: [XX:XX:XX XM] ■ Running Webpack
@uifabric/utilities: [XX:XX:XX XM] ■ Webpack Config Path: null
@uifabric/utilities: [XX:XX:XX XM] ■ webpack.config.js not found, skipping webpack
@uifabric/utilities: PASS src/warn/warnControlledUsage.test.ts
@uifabric/utilities: PASS src/focus.test.tsx
@uifabric/utilities: PASS src/styled.test.tsx
@uifabric/utilities: PASS src/EventGroup.test.ts
@uifabric/utilities: PASS src/array.test.ts
@uifabric/utilities: PASS src/customizations/Customizer.test.tsx
@uifabric/utilities: PASS src/math.test.ts
@uifabric/utilities: PASS src/warn/warn.test.ts
@uifabric/utilities: PASS src/dom/dom.test.ts
@uifabric/utilities: PASS src/customizations/customizable.test.tsx
@uifabric/utilities: PASS src/initials.test.ts
@uifabric/utilities: PASS src/selection/Selection.test.ts
@uifabric/utilities: PASS src/initializeFocusRects.test.ts
@uifabric/utilities: PASS src/memoize.test.ts
@uifabric/utilities: PASS src/osDetector.test.ts
@uifabric/utilities: PASS src/mobileDetector.test.ts
@uifabric/utilities: PASS src/aria.test.ts
@uifabric/utilities: PASS src/rtl.test.ts
@uifabric/utilities: PASS src/setFocusVisibility.test.ts
@uifabric/utilities: PASS src/properties.test.ts
@uifabric/utilities: PASS src/asAsync.test.tsx
@uifabric/utilities: PASS src/object.test.ts
@uifabric/utilities: PASS src/classNamesFunction.test.ts
@uifabric/utilities: PASS src/merge.test.ts
@uifabric/utilities: PASS src/customizations/Customizations.test.ts
@uifabric/utilities: PASS src/safeSetTimeout.test.tsx
@uifabric/utilities: PASS src/safeRequestAnimationFrame.test.tsx
@uifabric/utilities: PASS src/overflow.test.ts
@uifabric/utilities: PASS src/appendFunction.test.ts
@uifabric/utilities: PASS src/controlled.test.ts
@uifabric/utilities: PASS src/extendComponent.test.tsx
@uifabric/utilities: PASS src/initializeComponentRef.test.tsx
@uifabric/utilities: PASS src/BaseComponent.test.tsx
@uifabric/utilities: PASS src/keyboard.test.ts
@uifabric/utilities: PASS src/css.test.ts
@uifabric/utilities: [XX:XX:XX XM] ■ Extracting Public API surface from '/office-ui-fabric-react/packages/utilities/lib/index.d.ts'
@uifabric/utilities: Done in ?s.
@uifabric/styling: yarn run vX.X.X
@uifabric/styling: $ just-scripts build --production --lint
@uifabric/styling: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts]
@uifabric/styling: [XX:XX:XX XM] ■ Running tslint
@uifabric/styling: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/tslint/lib/tslintCli.js" --project "/office-ui-fabric-react/packages/styling/tsconfig.json" -t stylish -r /office-ui-fabric-react/node_modules/tslint-microsoft-contrib
@uifabric/styling: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/styling/tsconfig.json
@uifabric/styling: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/styling/tsconfig.json"
@uifabric/styling: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/styling/tsconfig.json
@uifabric/styling: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/styling/tsconfig.json"
@uifabric/styling: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/styling/tsconfig.json
@uifabric/styling: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/styling/tsconfig.json"
@uifabric/styling: [XX:XX:XX XM] ■ Running Jest
@uifabric/styling: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/styling/jest.config.js" --passWithNoTests --colors
@uifabric/styling: [XX:XX:XX XM] ■ Running Webpack
@uifabric/styling: [XX:XX:XX XM] ■ Webpack Config Path: null
@uifabric/styling: [XX:XX:XX XM] ■ webpack.config.js not found, skipping webpack
@uifabric/styling: PASS src/styles/theme.test.ts
@uifabric/styling: PASS src/styles/scheme.test.ts
@uifabric/styling: PASS src/styles/getGlobalClassNames.test.ts
@uifabric/styling: PASS src/utilities/icons.test.ts
@uifabric/styling: PASS src/styles/fonts.test.ts
@uifabric/styling: [XX:XX:XX XM] ■ Extracting Public API surface from '/office-ui-fabric-react/packages/styling/lib/index.d.ts'
@uifabric/styling: Done in ?s.
@uifabric/file-type-icons: yarn run vX.X.X
@uifabric/file-type-icons: $ just-scripts build --production --lint
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts]
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Running tslint
@uifabric/file-type-icons: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/tslint/lib/tslintCli.js" --project "/office-ui-fabric-react/packages/file-type-icons/tsconfig.json" -t stylish -r /office-ui-fabric-react/node_modules/tslint-microsoft-contrib
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/file-type-icons/tsconfig.json
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/file-type-icons/tsconfig.json"
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/file-type-icons/tsconfig.json
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/file-type-icons/tsconfig.json"
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/file-type-icons/tsconfig.json
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/file-type-icons/tsconfig.json"
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Running Webpack
@uifabric/file-type-icons: [XX:XX:XX XM] ■ Webpack Config Path: null
@uifabric/file-type-icons: [XX:XX:XX XM] ■ webpack.config.js not found, skipping webpack
@uifabric/file-type-icons: Done in ?s.
@uifabric/foundation: yarn run vX.X.X
@uifabric/foundation: $ just-scripts build --production --lint
@uifabric/foundation: [XX:XX:XX XM] ■ Removing [lib, temp, dist, lib-amd, lib-commonjs, lib-es2015, coverage, src/**/*.scss.ts]
@uifabric/foundation: [XX:XX:XX XM] ■ Running tslint
@uifabric/foundation: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/tslint/lib/tslintCli.js" --project "/office-ui-fabric-react/packages/foundation/tsconfig.json" -t stylish -r /office-ui-fabric-react/node_modules/tslint-microsoft-contrib
@uifabric/foundation: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/foundation/tsconfig.json
@uifabric/foundation: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-commonjs --module commonjs --project "/office-ui-fabric-react/packages/foundation/tsconfig.json"
@uifabric/foundation: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/foundation/tsconfig.json
@uifabric/foundation: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib --module es2015 --project "/office-ui-fabric-react/packages/foundation/tsconfig.json"
@uifabric/foundation: [XX:XX:XX XM] ■ Running /office-ui-fabric-react/node_modules/typescript/lib/tsc.js with /office-ui-fabric-react/packages/foundation/tsconfig.json
@uifabric/foundation: [XX:XX:XX XM] ■ Executing: /usr/local/bin/node "/office-ui-fabric-react/node_modules/typescript/lib/tsc.js" --pretty --target es5 --inlineSources --sourceRoot "../src" --outDir lib-amd --module amd --project "/office-ui-fabric-react/packages/foundation/tsconfig.json"
@uifabric/foundation: [XX:XX:XX XM] ■ Running Jest
@uifabric/foundation: [XX:XX:XX XM] ■ /usr/local/bin/node "/office-ui-fabric-react/node_modules/jest/bin/jest.js" --config "/office-ui-fabric-react/packages/foundation/jest.config.js" --passWithNoTests --colors
@uifabric/foundation: [XX:XX:XX XM] ■ Running Webpack
@uifabric/foundation: [XX:XX:XX XM] ■ Webpack Config Path: /office-ui-fabric-react/packages/foundation/webpack.config.js
@uifabric/foundation: Webpack version: 4.29.5
@uifabric/foundation: FAIL src/slots.test.tsx
@uifabric/foundation: PASS src/hooks/controlled.test.tsx
@uifabric/foundation: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Standard error:
Your version of Node.js (X.X.X) has not been tested with this release of Rush. The Rush team will not accept issue reports for it. Please consider upgrading Rush or downgrading Node.js.
XX of XX: [@uifabric/codepen-loader] completed with warnings in ? seconds
XX of XX: [@uifabric/set-version] completed with warnings in ? seconds
XX of XX: [@uifabric/merge-styles] completed with warnings in ? seconds
XX of XX: [@uifabric/jest-serializer-merge-styles] completed with warnings in ? seconds
XX of XX: [@uifabric/utilities] completed with warnings in ? seconds
XX of XX: [@uifabric/styling] completed with warnings in ? seconds
XX of XX: [@uifabric/foundation] failed to build!
XX of XX: [@uifabric/experiments] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/fabric-website] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/pr-deploy-site] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/react-cards] blocked by [@uifabric/foundation]!
XX of XX: [theming-designer] blocked by [@uifabric/foundation]!
XX of XX: [vr-tests] blocked by [@uifabric/foundation]!
XX of XX: [dom-tests] blocked by [@uifabric/foundation]!
XX of XX: [perf-test] blocked by [@uifabric/foundation]!
XX of XX: [test-bundles] blocked by [@uifabric/foundation]!
XX of XX: [office-ui-fabric-react] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/api-docs] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/fabric-website-resources] blocked by [@uifabric/foundation]!
XX of XX: [a11y-tests] blocked by [@uifabric/foundation]!
XX of XX: [ssr-tests] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/azure-themes] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/charting] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/date-time] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/example-app-base] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/foundation-scenarios] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/lists] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/fluent-theme] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/tsx-editor] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/mdl2-theme] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/theme-samples] blocked by [@uifabric/foundation]!
XX of XX: [@uifabric/variants] blocked by [@uifabric/foundation]!
XX of XX: [server-rendered-app] blocked by [@uifabric/foundation]!
XX of XX: [todo-app] blocked by [@uifabric/foundation]!
[@uifabric/foundation] Returned error code: 1
info cli using local version of lerna
lerna notice cli vX.X.X
lerna info Executing command in 40 packages: "yarn run build --production --lint"
@uifabric/codepen-loader: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
@uifabric/set-version: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect
@uifabric/merge-styles: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect
@uifabric/merge-styles: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
@uifabric/jest-serializer-merge-styles: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
@uifabric/utilities: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect
@uifabric/utilities: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
@uifabric/styling: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect
@uifabric/styling: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
@uifabric/file-type-icons: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect
@uifabric/foundation: [XX:XX:XX XM] ▲ One of these [node-sass, postcss, autoprefixer] is not installed, so this task has no effect
@uifabric/foundation: ts-jest[versions] (WARN) Version X.X.X-insiders.xxxxxxxx of typescript installed has not been tested with ts-jest. If you're experiencing issues, consider using a supported version (>=2.7.0 <4.0.0). Please do not report issues in ts-jest if you are using unsupported versions.
@uifabric/foundation: ● createFactory passes componentProps without userProps
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:205:73)
@uifabric/foundation: ● createFactory passes userProp string as child
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:210:76)
@uifabric/foundation: ● createFactory passes userProp integer as child
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:220:76)
@uifabric/foundation: ● createFactory passes userProp string as defaultProp
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:225:92)
@uifabric/foundation: ● createFactory passes userProp integer as defaultProp
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:235:92)
@uifabric/foundation: ● createFactory merges userProps over componentProps
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:245:84)
@uifabric/foundation: ● createFactory renders div and userProp integer as children
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:255:86)
@uifabric/foundation: ● createFactory renders div and userProp string as children
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:266:86)
@uifabric/foundation: ● createFactory renders userProp span function without component props
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:288:61)
@uifabric/foundation: ● createFactory renders userProp span function with component props
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:301:61)
@uifabric/foundation: ● createFactory renders userProp span component with component props
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:314:61)
@uifabric/foundation: ● createFactory passes props and type arguments to userProp function
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:334:43)
@uifabric/foundation: ● getSlots creates slots and passes merged props to them
@uifabric/foundation: RangeError: Invalid array length
@uifabric/foundation:
@uifabric/foundation: 189 | for (const props of allProps) {
@uifabric/foundation: 190 | classNames.push(props && props.className);
@uifabric/foundation: > 191 | assign(finalProps, ...(props as any));
@uifabric/foundation: | ^
@uifabric/foundation: 192 | }
@uifabric/foundation: 193 |
@uifabric/foundation: 194 | finalProps.className = mergeStyles(defaultStyles, classNames);
@uifabric/foundation:
@uifabric/foundation: at Object.__spreadArrays (../../node_modules/tslib/tslib.js:182:22)
@uifabric/foundation: at _constructFinalProps (src/slots.tsx:191:11)
@uifabric/foundation: at result (src/slots.tsx:88:24)
@uifabric/foundation: at _renderSlot (src/slots.tsx:221:100)
@uifabric/foundation: at Object.slot [as testSlot1] (src/slots.tsx:142:16)
@uifabric/foundation: at Object.<anonymous> (src/slots.test.tsx:399:24)
@uifabric/foundation: [XX:XX:XX XM] x Error detected while running 'jest'
@uifabric/foundation: [XX:XX:XX XM] x ------------------------------------
@uifabric/foundation: [XX:XX:XX XM] x Error: Command failed: /usr/local/bin/node /office-ui-fabric-react/node_modules/jest/bin/jest.js --config /office-ui-fabric-react/packages/foundation/jest.config.js --passWithNoTests --colors
@uifabric/foundation: at ChildProcess.<anonymous> (/office-ui-fabric-react/node_modules/just-scripts-utils/lib/exec.js:70:31)
@uifabric/foundation: at ChildProcess.emit (events.js:203:13)
@uifabric/foundation: at ChildProcess.EventEmitter.emit (domain.js:494:23)
@uifabric/foundation: at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
@uifabric/foundation: [XX:XX:XX XM] x ------------------------------------
@uifabric/foundation: [XX:XX:XX XM] x Error previously detected. See above for error messages.
@uifabric/foundation: [XX:XX:XX XM] x Other tasks that did not complete: [webpack]
@uifabric/foundation: error Command failed with exit code 1.
lerna ERR! yarn run build --production --lint exited 1 in '@uifabric/foundation'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
+12 -19
View File
@@ -4,31 +4,24 @@ yarn run vX.X.X
$ gulp compile --max_old_space_size=4095
[XX:XX:XX] Node flags detected: --max_old_space_size=4095
[XX:XX:XX] Using gulpfile /vscode/gulpfile.js
[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts(560,5): Type 'null' is not assignable to type 'string'.
[XX:XX:XX] Error: /vscode/src/vs/base/browser/ui/menu/menubar.ts(742,7): Type '"underline" | null' is not assignable to type 'string'.
Type 'null' is not assignable to type 'string'.
[XX:XX:XX] Error: /vscode/src/vs/editor/browser/controller/textAreaInput.ts(208,33): Property 'locale' does not exist on type 'CompositionEvent'.
[XX:XX:XX] Error: /vscode/src/vs/editor/browser/controller/textAreaInput.ts(225,33): Property 'locale' does not exist on type 'CompositionEvent'.
[XX:XX:XX] Error: /vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts(560,5): Type 'null' is not assignable to type 'string'.
[XX:XX:XX] Error: /vscode/src/vs/base/browser/ui/menu/menubar.ts(742,7): Type '"underline" | null' is not assignable to type 'string'.
Type 'null' is not assignable to type 'string'.
[XX:XX:XX] Error: /vscode/src/vs/editor/browser/controller/textAreaInput.ts(208,33): Property 'locale' does not exist on type 'CompositionEvent'.
[XX:XX:XX] Error: /vscode/src/vs/editor/browser/controller/textAreaInput.ts(225,33): Property 'locale' does not exist on type 'CompositionEvent'.
[XX:XX:XX] Error: /vscode/node_modules/@types/node/index.d.ts(179,11): Duplicate identifier 'IteratorResult'.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Standard error:
[XX:XX:XX] 'compile' errored after
[XX:XX:XX] Error: Found 4 errors
{"type":"warning","data":"package.json: No license field"}
{"type":"warning","data":"../package.json: No license field"}
{"type":"warning","data":"vscode-web@X.X.X: No license field"}
[XX:XX:XX] 'compile' errored after ?s
[XX:XX:XX] Error: Found 1 errors
at Stream.<anonymous> (/vscode/build/lib/reporter.js:74:29)
at _end (/vscode/node_modules/through/index.js:65:9)
at Stream.stream.end (/vscode/node_modules/through/index.js:74:5)
at Stream.onend (internal/streams/legacy.js:42:10)
at Stream.emit (events.js:203:15)
at Stream.EventEmitter.emit (domain.js:466:23)
at drain (/vscode/node_modules/through/index.js:34:23)
at Stream.stream.queue.stream.push (/vscode/node_modules/through/index.js:45:5)
at Stream.end (/vscode/node_modules/through/index.js:15:35)
at _end (/vscode/node_modules/through/index.js:65:9)
at StreamFilter.onend (/vscode/node_modules/readable-stream/lib/_stream_readable.js:570:10)
at Object.onceWrapper (events.js:286:20)
at StreamFilter.emit (events.js:203:15)
at StreamFilter.EventEmitter.emit (domain.js:466:23)
at endReadableNT (/vscode/node_modules/readable-stream/lib/_stream_readable.js:992:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.
@@ -43,10 +43,11 @@ async function* f6() {
//// [file1.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -77,10 +78,11 @@ function f1() {
}
//// [file2.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -187,10 +189,11 @@ function f4() {
}
//// [file5.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -43,10 +43,11 @@ async function* f6() {
//// [file1.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -124,10 +125,11 @@ function f1() {
}
//// [file2.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -375,10 +377,11 @@ function f4() {
}
//// [file5.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -10,10 +10,11 @@ async function singleAwait() {
//// [es5-asyncFunction.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -31,10 +31,11 @@ function foo() {
exports.foo = foo;
//// [script.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -30,4 +30,4 @@ var __assign = (this && this.__assign) || function () {
return __assign.apply(this, arguments);
};
f(__assign({ a: 1 }, i));
f(__assign({ a: 1 }, l, r));
f(__assign(__assign({ a: 1 }, l), r));
@@ -5,10 +5,11 @@ foo();
//// [exportDefaultAsyncFunction.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -35,10 +35,11 @@ import { async, await } from 'asyncawait';
export default async(() => await(Promise.resolve(1)));
//// [b.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -10,10 +10,11 @@ namespace ns_async_function {
//// [exportDefaultFunctionInNamespace.js]
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
@@ -9,10 +9,11 @@ export function* foo2({ foo = yield "a" }) {
//// [bar.js]
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};

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