mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into walk_symbol
This commit is contained in:
commit
e0fd0e8861
2221 files changed
+21595
-14448
No files matched your search
@@ -126,6 +126,7 @@ var servicesSources = [
|
||||
"classifier.ts",
|
||||
"completions.ts",
|
||||
"documentHighlights.ts",
|
||||
"documentRegistry.ts",
|
||||
"findAllReferences.ts",
|
||||
"goToDefinition.ts",
|
||||
"jsDoc.ts",
|
||||
|
||||
Vendored
+2
-2
@@ -20,7 +20,7 @@ interface Map<K, V> {
|
||||
forEach(callbackfn: (value: V, index: K, map: Map<K, V>) => void, thisArg?: any): void;
|
||||
get(key: K): V | undefined;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): this;
|
||||
set(key: K, value: V): this;
|
||||
readonly size: number;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ interface WeakMap<K, V> {
|
||||
delete(key: K): boolean;
|
||||
get(key: K): V | undefined;
|
||||
has(key: K): boolean;
|
||||
set(key: K, value?: V): this;
|
||||
set(key: K, value: V): this;
|
||||
}
|
||||
|
||||
interface WeakMapConstructor {
|
||||
|
||||
@@ -591,6 +591,9 @@ namespace ts {
|
||||
case SyntaxKind.PrefixUnaryExpression:
|
||||
bindPrefixUnaryExpressionFlow(<PrefixUnaryExpression>node);
|
||||
break;
|
||||
case SyntaxKind.PostfixUnaryExpression:
|
||||
bindPostfixUnaryExpressionFlow(<PostfixUnaryExpression>node);
|
||||
break;
|
||||
case SyntaxKind.BinaryExpression:
|
||||
bindBinaryExpressionFlow(<BinaryExpression>node);
|
||||
break;
|
||||
@@ -1106,6 +1109,16 @@ namespace ts {
|
||||
}
|
||||
else {
|
||||
forEachChild(node, bind);
|
||||
if (node.operator === SyntaxKind.PlusEqualsToken || node.operator === SyntaxKind.MinusMinusToken) {
|
||||
bindAssignmentTargetFlow(node.operand);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bindPostfixUnaryExpressionFlow(node: PostfixUnaryExpression) {
|
||||
forEachChild(node, bind);
|
||||
if (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken) {
|
||||
bindAssignmentTargetFlow(node.operand);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+123
-133
@@ -2919,7 +2919,7 @@ namespace ts {
|
||||
// undefined or any type of the parent.
|
||||
if (!parentType || isTypeAny(parentType)) {
|
||||
if (declaration.initializer) {
|
||||
return checkExpressionCached(declaration.initializer);
|
||||
return getBaseTypeOfLiteralType(checkExpressionCached(declaration.initializer));
|
||||
}
|
||||
return parentType;
|
||||
}
|
||||
@@ -3090,7 +3090,9 @@ namespace ts {
|
||||
|
||||
// Use the type of the initializer expression if one is present
|
||||
if (declaration.initializer) {
|
||||
return addOptionality(checkExpressionCached(declaration.initializer), /*optional*/ declaration.questionToken && includeOptionality);
|
||||
const exprType = checkExpressionCached(declaration.initializer);
|
||||
const type = getCombinedNodeFlags(declaration) & NodeFlags.Const || getCombinedModifierFlags(declaration) & ModifierFlags.Readonly ? exprType : getBaseTypeOfLiteralType(exprType);
|
||||
return addOptionality(type, /*optional*/ declaration.questionToken && includeOptionality);
|
||||
}
|
||||
|
||||
// If it is a short-hand property assignment, use the type of the identifier
|
||||
@@ -3112,7 +3114,8 @@ namespace ts {
|
||||
// pattern. Otherwise, it is the type any.
|
||||
function getTypeFromBindingElement(element: BindingElement, includePatternInType?: boolean, reportErrors?: boolean): Type {
|
||||
if (element.initializer) {
|
||||
return checkExpressionCached(element.initializer);
|
||||
const exprType = checkExpressionCached(element.initializer);
|
||||
return getCombinedNodeFlags(element) & NodeFlags.Const ? exprType : getBaseTypeOfLiteralType(exprType);
|
||||
}
|
||||
if (isBindingPattern(element.name)) {
|
||||
return getTypeFromBindingPattern(<BindingPattern>element.name, includePatternInType, reportErrors);
|
||||
@@ -3396,7 +3399,7 @@ namespace ts {
|
||||
function getTypeOfEnumMember(symbol: Symbol): Type {
|
||||
const links = getSymbolLinks(symbol);
|
||||
if (!links.type) {
|
||||
links.type = getDeclaredTypeOfEnum(getParentOfSymbol(symbol));
|
||||
links.type = getDeclaredTypeOfEnumMember(symbol);
|
||||
}
|
||||
return links.type;
|
||||
}
|
||||
@@ -5711,7 +5714,7 @@ namespace ts {
|
||||
function getInferenceMapper(context: InferenceContext): TypeMapper {
|
||||
if (!context.mapper) {
|
||||
const mapper: TypeMapper = t => {
|
||||
const typeParameters = context.typeParameters;
|
||||
const typeParameters = context.signature.typeParameters;
|
||||
for (let i = 0; i < typeParameters.length; i++) {
|
||||
if (t === typeParameters[i]) {
|
||||
context.inferences[i].isFixed = true;
|
||||
@@ -5720,7 +5723,7 @@ namespace ts {
|
||||
}
|
||||
return t;
|
||||
};
|
||||
mapper.mappedTypes = context.typeParameters;
|
||||
mapper.mappedTypes = context.signature.typeParameters;
|
||||
mapper.context = context;
|
||||
context.mapper = mapper;
|
||||
}
|
||||
@@ -7145,15 +7148,36 @@ namespace ts {
|
||||
return true;
|
||||
}
|
||||
|
||||
function literalTypesWithSameBaseType(types: Type[]): boolean {
|
||||
let commonBaseType: Type;
|
||||
for (const t of types) {
|
||||
const baseType = getBaseTypeOfLiteralType(t);
|
||||
if (!commonBaseType) {
|
||||
commonBaseType = baseType;
|
||||
}
|
||||
if (baseType === t || baseType !== commonBaseType) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// When the candidate types are all literal types with the same base type, the common
|
||||
// supertype is a union of those literal types. Otherwise, the common supertype is the
|
||||
// first type that is a supertype of each of the other types.
|
||||
function getSupertypeOrUnion(types: Type[]): Type {
|
||||
return literalTypesWithSameBaseType(types) ? getUnionType(types) : forEach(types, t => isSupertypeOfEach(t, types) ? t : undefined);
|
||||
}
|
||||
|
||||
function getCommonSupertype(types: Type[]): Type {
|
||||
if (!strictNullChecks) {
|
||||
return forEach(types, t => isSupertypeOfEach(t, types) ? t : undefined);
|
||||
return getSupertypeOrUnion(types);
|
||||
}
|
||||
const primaryTypes = filter(types, t => !(t.flags & TypeFlags.Nullable));
|
||||
if (!primaryTypes.length) {
|
||||
return getUnionType(types, /*subtypeReduction*/ true);
|
||||
}
|
||||
const supertype = forEach(primaryTypes, t => isSupertypeOfEach(t, primaryTypes) ? t : undefined);
|
||||
const supertype = getSupertypeOrUnion(primaryTypes);
|
||||
return supertype && includeFalsyTypes(supertype, getFalsyFlagsOfTypes(types) & TypeFlags.Nullable);
|
||||
}
|
||||
|
||||
@@ -7217,18 +7241,18 @@ namespace ts {
|
||||
return (type.flags & (TypeFlags.Literal | TypeFlags.Undefined | TypeFlags.Null)) !== 0;
|
||||
}
|
||||
|
||||
function isUnitUnionType(type: Type): boolean {
|
||||
function isLiteralType(type: Type): boolean {
|
||||
return type.flags & TypeFlags.Boolean ? true :
|
||||
type.flags & TypeFlags.Union ? type.flags & TypeFlags.Enum ? true : !forEach((<UnionType>type).types, t => !isUnitType(t)) :
|
||||
isUnitType(type);
|
||||
}
|
||||
|
||||
function getBaseTypeOfUnitType(type: Type): Type {
|
||||
function getBaseTypeOfLiteralType(type: Type): Type {
|
||||
return type.flags & TypeFlags.StringLiteral ? stringType :
|
||||
type.flags & TypeFlags.NumberLiteral ? numberType :
|
||||
type.flags & TypeFlags.BooleanLiteral ? booleanType :
|
||||
type.flags & TypeFlags.EnumLiteral ? (<EnumLiteralType>type).baseType :
|
||||
type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Enum) ? getUnionType(map((<UnionType>type).types, getBaseTypeOfUnitType)) :
|
||||
type.flags & TypeFlags.Union && !(type.flags & TypeFlags.Enum) ? getUnionType(map((<UnionType>type).types, getBaseTypeOfLiteralType)) :
|
||||
type;
|
||||
}
|
||||
|
||||
@@ -7482,14 +7506,13 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function createInferenceContext(typeParameters: TypeParameter[], inferUnionTypes: boolean): InferenceContext {
|
||||
const inferences = map(typeParameters, createTypeInferencesObject);
|
||||
|
||||
function createInferenceContext(signature: Signature, inferUnionTypes: boolean): InferenceContext {
|
||||
const inferences = map(signature.typeParameters, createTypeInferencesObject);
|
||||
return {
|
||||
typeParameters,
|
||||
signature,
|
||||
inferUnionTypes,
|
||||
inferences,
|
||||
inferredTypes: new Array(typeParameters.length),
|
||||
inferredTypes: new Array(signature.typeParameters.length),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7497,6 +7520,7 @@ namespace ts {
|
||||
return {
|
||||
primary: undefined,
|
||||
secondary: undefined,
|
||||
topLevel: true,
|
||||
isFixed: false,
|
||||
};
|
||||
}
|
||||
@@ -7518,13 +7542,18 @@ namespace ts {
|
||||
return type.couldContainTypeParameters;
|
||||
}
|
||||
|
||||
function inferTypes(context: InferenceContext, source: Type, target: Type) {
|
||||
function isTypeParameterAtTopLevel(type: Type, typeParameter: TypeParameter): boolean {
|
||||
return type === typeParameter || type.flags & TypeFlags.UnionOrIntersection && forEach((<UnionOrIntersectionType>type).types, t => isTypeParameterAtTopLevel(t, typeParameter));
|
||||
}
|
||||
|
||||
function inferTypes(context: InferenceContext, originalSource: Type, originalTarget: Type) {
|
||||
const typeParameters = context.signature.typeParameters;
|
||||
let sourceStack: Type[];
|
||||
let targetStack: Type[];
|
||||
let depth = 0;
|
||||
let inferiority = 0;
|
||||
const visited = createMap<boolean>();
|
||||
inferFromTypes(source, target);
|
||||
inferFromTypes(originalSource, originalTarget);
|
||||
|
||||
function isInProcess(source: Type, target: Type) {
|
||||
for (let i = 0; i < depth; i++) {
|
||||
@@ -7578,7 +7607,6 @@ namespace ts {
|
||||
if (source.flags & TypeFlags.ContainsAnyFunctionType) {
|
||||
return;
|
||||
}
|
||||
const typeParameters = context.typeParameters;
|
||||
for (let i = 0; i < typeParameters.length; i++) {
|
||||
if (target === typeParameters[i]) {
|
||||
const inferences = context.inferences[i];
|
||||
@@ -7595,6 +7623,9 @@ namespace ts {
|
||||
if (!contains(candidates, source)) {
|
||||
candidates.push(source);
|
||||
}
|
||||
if (!isTypeParameterAtTopLevel(originalTarget, <TypeParameter>target)) {
|
||||
inferences.topLevel = false;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -7615,7 +7646,7 @@ namespace ts {
|
||||
let typeParameter: TypeParameter;
|
||||
// First infer to each type in union or intersection that isn't a type parameter
|
||||
for (const t of targetTypes) {
|
||||
if (t.flags & TypeFlags.TypeParameter && contains(context.typeParameters, t)) {
|
||||
if (t.flags & TypeFlags.TypeParameter && contains(typeParameters, t)) {
|
||||
typeParameter = <TypeParameter>t;
|
||||
typeParameterCount++;
|
||||
}
|
||||
@@ -7690,8 +7721,12 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function inferFromParameterTypes(source: Type, target: Type) {
|
||||
return inferFromTypes(source, target);
|
||||
}
|
||||
|
||||
function inferFromSignature(source: Signature, target: Signature) {
|
||||
forEachMatchingParameterType(source, target, inferFromTypes);
|
||||
forEachMatchingParameterType(source, target, inferFromParameterTypes);
|
||||
|
||||
if (source.typePredicate && target.typePredicate && source.typePredicate.kind === target.typePredicate.kind) {
|
||||
inferFromTypes(source.typePredicate.type, target.typePredicate.type);
|
||||
@@ -7750,14 +7785,28 @@ namespace ts {
|
||||
return inferences.primary || inferences.secondary || emptyArray;
|
||||
}
|
||||
|
||||
function hasPrimitiveConstraint(type: TypeParameter): boolean {
|
||||
const constraint = getConstraintOfTypeParameter(type);
|
||||
return constraint && maybeTypeOfKind(constraint, TypeFlags.Primitive);
|
||||
}
|
||||
|
||||
function getInferredType(context: InferenceContext, index: number): Type {
|
||||
let inferredType = context.inferredTypes[index];
|
||||
let inferenceSucceeded: boolean;
|
||||
if (!inferredType) {
|
||||
const inferences = getInferenceCandidates(context, index);
|
||||
if (inferences.length) {
|
||||
// We widen inferred literal types if
|
||||
// all inferences were made to top-level ocurrences of the type parameter, and
|
||||
// the type parameter has no constraint or its constraint includes no primitive or literal types, and
|
||||
// the type parameter was fixed during inference or does not occur at top-level in the return type.
|
||||
const signature = context.signature;
|
||||
const widenLiteralTypes = context.inferences[index].topLevel &&
|
||||
!hasPrimitiveConstraint(signature.typeParameters[index]) &&
|
||||
(context.inferences[index].isFixed || !isTypeParameterAtTopLevel(getReturnTypeOfSignature(signature), signature.typeParameters[index]));
|
||||
const baseInferences = widenLiteralTypes ? map(inferences, getBaseTypeOfLiteralType) : inferences;
|
||||
// Infer widened union or supertype, or the unknown type for no common supertype
|
||||
const unionOrSuperType = context.inferUnionTypes ? getUnionType(inferences, /*subtypeReduction*/ true) : getCommonSupertype(inferences);
|
||||
const unionOrSuperType = context.inferUnionTypes ? getUnionType(baseInferences, /*subtypeReduction*/ true) : getCommonSupertype(baseInferences);
|
||||
inferredType = unionOrSuperType ? getWidenedType(unionOrSuperType) : unknownType;
|
||||
inferenceSucceeded = !!unionOrSuperType;
|
||||
}
|
||||
@@ -7773,7 +7822,7 @@ namespace ts {
|
||||
|
||||
// Only do the constraint check if inference succeeded (to prevent cascading errors)
|
||||
if (inferenceSucceeded) {
|
||||
const constraint = getConstraintOfTypeParameter(context.typeParameters[index]);
|
||||
const constraint = getConstraintOfTypeParameter(context.signature.typeParameters[index]);
|
||||
if (constraint) {
|
||||
const instantiatedConstraint = instantiateType(constraint, getInferenceMapper(context));
|
||||
if (!isTypeAssignableTo(inferredType, getTypeWithThisArgument(instantiatedConstraint, inferredType))) {
|
||||
@@ -7920,7 +7969,7 @@ namespace ts {
|
||||
if (prop && prop.flags & SymbolFlags.SyntheticProperty) {
|
||||
if ((<TransientSymbol>prop).isDiscriminantProperty === undefined) {
|
||||
(<TransientSymbol>prop).isDiscriminantProperty = !(<TransientSymbol>prop).hasCommonType &&
|
||||
isUnitUnionType(getTypeOfSymbol(prop));
|
||||
isLiteralType(getTypeOfSymbol(prop));
|
||||
}
|
||||
return (<TransientSymbol>prop).isDiscriminantProperty;
|
||||
}
|
||||
@@ -8323,7 +8372,8 @@ namespace ts {
|
||||
// Assignments only narrow the computed type if the declared type is a union type. Thus, we
|
||||
// only need to evaluate the assigned type if the declared type is a union type.
|
||||
if (isMatchingReference(reference, node)) {
|
||||
return declaredType.flags & TypeFlags.Union ?
|
||||
const isIncrementOrDecrement = node.parent.kind === SyntaxKind.PrefixUnaryExpression || node.parent.kind === SyntaxKind.PostfixUnaryExpression;
|
||||
return declaredType.flags & TypeFlags.Union && !isIncrementOrDecrement ?
|
||||
getAssignmentReducedType(<UnionType>declaredType, getInitialOrAssignedType(node)) :
|
||||
declaredType;
|
||||
}
|
||||
@@ -9439,14 +9489,14 @@ namespace ts {
|
||||
if (parameter.dotDotDotToken) {
|
||||
const restTypes: Type[] = [];
|
||||
for (let i = indexOfParameter; i < iife.arguments.length; i++) {
|
||||
restTypes.push(getTypeOfExpression(iife.arguments[i]));
|
||||
restTypes.push(getBaseTypeOfLiteralType(checkExpression(iife.arguments[i])));
|
||||
}
|
||||
return createArrayType(getUnionType(restTypes));
|
||||
}
|
||||
const links = getNodeLinks(iife);
|
||||
const cached = links.resolvedSignature;
|
||||
links.resolvedSignature = anySignature;
|
||||
const type = checkExpression(iife.arguments[indexOfParameter]);
|
||||
const type = getBaseTypeOfLiteralType(checkExpression(iife.arguments[indexOfParameter]));
|
||||
links.resolvedSignature = cached;
|
||||
return type;
|
||||
}
|
||||
@@ -9797,6 +9847,7 @@ namespace ts {
|
||||
case SyntaxKind.BinaryExpression:
|
||||
return getContextualTypeForBinaryOperand(node);
|
||||
case SyntaxKind.PropertyAssignment:
|
||||
case SyntaxKind.ShorthandPropertyAssignment:
|
||||
return getContextualTypeForObjectLiteralElement(<ObjectLiteralElement>parent);
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
return getContextualTypeForElementExpression(node);
|
||||
@@ -9816,31 +9867,6 @@ namespace ts {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function isLiteralTypeLocation(node: Node): boolean {
|
||||
const parent = node.parent;
|
||||
switch (parent.kind) {
|
||||
case SyntaxKind.BinaryExpression:
|
||||
switch ((<BinaryExpression>parent).operatorToken.kind) {
|
||||
case SyntaxKind.EqualsEqualsEqualsToken:
|
||||
case SyntaxKind.ExclamationEqualsEqualsToken:
|
||||
case SyntaxKind.EqualsEqualsToken:
|
||||
case SyntaxKind.ExclamationEqualsToken:
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.ConditionalExpression:
|
||||
return (node === (<ConditionalExpression>parent).whenTrue ||
|
||||
node === (<ConditionalExpression>parent).whenFalse) &&
|
||||
isLiteralTypeLocation(parent);
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
return isLiteralTypeLocation(parent);
|
||||
case SyntaxKind.CaseClause:
|
||||
case SyntaxKind.LiteralType:
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// If the given type is an object or union type, if that type has a single signature, and if
|
||||
// that signature is non-generic, return the signature. Otherwise return undefined.
|
||||
function getNonGenericSignature(type: Type): Signature {
|
||||
@@ -9977,7 +10003,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
else {
|
||||
const type = checkExpression(e, contextualMapper);
|
||||
const type = checkExpressionForMutableLocation(e, contextualMapper);
|
||||
elementTypes.push(type);
|
||||
}
|
||||
hasSpreadElement = hasSpreadElement || e.kind === SyntaxKind.SpreadElementExpression;
|
||||
@@ -10121,7 +10147,7 @@ namespace ts {
|
||||
}
|
||||
else {
|
||||
Debug.assert(memberDecl.kind === SyntaxKind.ShorthandPropertyAssignment);
|
||||
type = checkExpression((<ShorthandPropertyAssignment>memberDecl).name, contextualMapper);
|
||||
type = checkExpressionForMutableLocation((<ShorthandPropertyAssignment>memberDecl).name, contextualMapper);
|
||||
}
|
||||
typeFlags |= type.flags;
|
||||
const prop = <TransientSymbol>createSymbol(SymbolFlags.Property | SymbolFlags.Transient | member.flags, member.name);
|
||||
@@ -10846,10 +10872,7 @@ namespace ts {
|
||||
checkClassPropertyAccess(node, left, apparentType, prop);
|
||||
}
|
||||
|
||||
let propType = getTypeOfSymbol(prop);
|
||||
if (prop.flags & SymbolFlags.EnumMember && isLiteralContextForType(<Expression>node, propType)) {
|
||||
propType = getDeclaredTypeOfSymbol(prop);
|
||||
}
|
||||
const propType = getTypeOfSymbol(prop);
|
||||
|
||||
// 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,
|
||||
@@ -11267,7 +11290,7 @@ namespace ts {
|
||||
|
||||
// Instantiate a generic signature in the context of a non-generic signature (section 3.8.5 in TypeScript spec)
|
||||
function instantiateSignatureInContextOf(signature: Signature, contextualSignature: Signature, contextualMapper: TypeMapper): Signature {
|
||||
const context = createInferenceContext(signature.typeParameters, /*inferUnionTypes*/ true);
|
||||
const context = createInferenceContext(signature, /*inferUnionTypes*/ true);
|
||||
forEachMatchingParameterType(contextualSignature, signature, (source, target) => {
|
||||
// Type parameters from outer context referenced by source type are fixed by instantiation of the source type
|
||||
inferTypes(context, instantiateType(source, contextualMapper), target);
|
||||
@@ -11923,7 +11946,7 @@ namespace ts {
|
||||
let candidate: Signature;
|
||||
let typeArgumentsAreValid: boolean;
|
||||
const inferenceContext = originalCandidate.typeParameters
|
||||
? createInferenceContext(originalCandidate.typeParameters, /*inferUnionTypes*/ false)
|
||||
? createInferenceContext(originalCandidate, /*inferUnionTypes*/ false)
|
||||
: undefined;
|
||||
|
||||
while (true) {
|
||||
@@ -12354,7 +12377,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function checkAssertion(node: AssertionExpression) {
|
||||
const exprType = getRegularTypeOfObjectLiteral(checkExpression(node.expression));
|
||||
const exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(checkExpression(node.expression)));
|
||||
|
||||
checkSourceElement(node.type);
|
||||
const targetType = getTypeFromTypeNode(node.type);
|
||||
@@ -12544,20 +12567,8 @@ namespace ts {
|
||||
return isAsync ? createPromiseReturnType(func, voidType) : voidType;
|
||||
}
|
||||
}
|
||||
// When yield/return statements are contextually typed we allow the return type to be a union type.
|
||||
// Otherwise we require the yield/return expressions to have a best common supertype.
|
||||
type = contextualSignature ? getUnionType(types, /*subtypeReduction*/ true) : getCommonSupertype(types);
|
||||
if (!type) {
|
||||
if (funcIsGenerator) {
|
||||
error(func, Diagnostics.No_best_common_type_exists_among_yield_expressions);
|
||||
return createIterableIteratorType(unknownType);
|
||||
}
|
||||
else {
|
||||
error(func, Diagnostics.No_best_common_type_exists_among_return_expressions);
|
||||
// Defer to unioning the return types so we get a) downstream errors earlier and b) better Salsa experience
|
||||
return isAsync ? createPromiseReturnType(func, getUnionType(types, /*subtypeReduction*/ true)) : getUnionType(types, /*subtypeReduction*/ true);
|
||||
}
|
||||
}
|
||||
// Return a union of the return expression types.
|
||||
type = getUnionType(types, /*subtypeReduction*/ true);
|
||||
|
||||
if (funcIsGenerator) {
|
||||
type = createIterableIteratorType(type);
|
||||
@@ -12566,6 +12577,9 @@ namespace ts {
|
||||
if (!contextualSignature) {
|
||||
reportErrorsFromWidening(func, type);
|
||||
}
|
||||
if (isUnitType(type) && !(contextualSignature && isLiteralContextualType(getReturnTypeOfSignature(contextualSignature)))) {
|
||||
type = getBaseTypeOfLiteralType(type);
|
||||
}
|
||||
|
||||
const widenedType = getWidenedType(type);
|
||||
// From within an async function you can return either a non-promise value or a promise. Any
|
||||
@@ -12601,7 +12615,7 @@ namespace ts {
|
||||
return false;
|
||||
}
|
||||
const type = checkExpression(node.expression);
|
||||
if (!isUnitUnionType(type)) {
|
||||
if (!isLiteralType(type)) {
|
||||
return false;
|
||||
}
|
||||
const switchTypes = getSwitchClauseTypes(node);
|
||||
@@ -12944,7 +12958,7 @@ namespace ts {
|
||||
|
||||
function checkPrefixUnaryExpression(node: PrefixUnaryExpression): Type {
|
||||
const operandType = checkExpression(node.operand);
|
||||
if (node.operator === SyntaxKind.MinusToken && node.operand.kind === SyntaxKind.NumericLiteral && isLiteralContextForType(node, numberType)) {
|
||||
if (node.operator === SyntaxKind.MinusToken && node.operand.kind === SyntaxKind.NumericLiteral) {
|
||||
return getLiteralTypeForText(TypeFlags.NumberLiteral, "" + -(<LiteralExpression>node.operand).text);
|
||||
}
|
||||
switch (node.operator) {
|
||||
@@ -13344,11 +13358,11 @@ namespace ts {
|
||||
case SyntaxKind.ExclamationEqualsToken:
|
||||
case SyntaxKind.EqualsEqualsEqualsToken:
|
||||
case SyntaxKind.ExclamationEqualsEqualsToken:
|
||||
const leftIsUnit = isUnitUnionType(leftType);
|
||||
const rightIsUnit = isUnitUnionType(rightType);
|
||||
if (!leftIsUnit || !rightIsUnit) {
|
||||
leftType = leftIsUnit ? getBaseTypeOfUnitType(leftType) : leftType;
|
||||
rightType = rightIsUnit ? getBaseTypeOfUnitType(rightType) : rightType;
|
||||
const leftIsLiteral = isLiteralType(leftType);
|
||||
const rightIsLiteral = isLiteralType(rightType);
|
||||
if (!leftIsLiteral || !rightIsLiteral) {
|
||||
leftType = leftIsLiteral ? getBaseTypeOfLiteralType(leftType) : leftType;
|
||||
rightType = rightIsLiteral ? getBaseTypeOfLiteralType(rightType) : rightType;
|
||||
}
|
||||
if (!isTypeEqualityComparableTo(leftType, rightType) && !isTypeEqualityComparableTo(rightType, leftType)) {
|
||||
reportOperatorError();
|
||||
@@ -13360,7 +13374,7 @@ namespace ts {
|
||||
return checkInExpression(left, right, leftType, rightType);
|
||||
case SyntaxKind.AmpersandAmpersandToken:
|
||||
return getTypeFacts(leftType) & TypeFacts.Truthy ?
|
||||
includeFalsyTypes(rightType, getFalsyFlags(strictNullChecks ? leftType : getBaseTypeOfUnitType(rightType))) :
|
||||
includeFalsyTypes(rightType, getFalsyFlags(strictNullChecks ? leftType : getBaseTypeOfLiteralType(rightType))) :
|
||||
leftType;
|
||||
case SyntaxKind.BarBarToken:
|
||||
return getTypeFacts(leftType) & TypeFacts.Falsy ?
|
||||
@@ -13494,64 +13508,18 @@ namespace ts {
|
||||
return getBestChoiceType(type1, type2);
|
||||
}
|
||||
|
||||
function typeContainsLiteralFromEnum(type: Type, enumType: EnumType) {
|
||||
if (type.flags & TypeFlags.Union) {
|
||||
for (const t of (<UnionType>type).types) {
|
||||
if (t.flags & TypeFlags.EnumLiteral && (<EnumLiteralType>t).baseType === enumType) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (type.flags & TypeFlags.EnumLiteral) {
|
||||
return (<EnumLiteralType>type).baseType === enumType;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isLiteralContextForType(node: Expression, type: Type) {
|
||||
if (isLiteralTypeLocation(node)) {
|
||||
return true;
|
||||
}
|
||||
let contextualType = getContextualType(node);
|
||||
if (contextualType) {
|
||||
if (contextualType.flags & TypeFlags.TypeParameter) {
|
||||
const apparentType = getApparentTypeOfTypeParameter(<TypeParameter>contextualType);
|
||||
// If the type parameter is constrained to the base primitive type we're checking for,
|
||||
// consider this a literal context. For example, given a type parameter 'T extends string',
|
||||
// this causes us to infer string literal types for T.
|
||||
if (type === apparentType) {
|
||||
return true;
|
||||
}
|
||||
contextualType = apparentType;
|
||||
}
|
||||
if (type.flags & TypeFlags.String) {
|
||||
return maybeTypeOfKind(contextualType, TypeFlags.StringLiteral);
|
||||
}
|
||||
if (type.flags & TypeFlags.Number) {
|
||||
return maybeTypeOfKind(contextualType, (TypeFlags.NumberLiteral | TypeFlags.EnumLiteral));
|
||||
}
|
||||
if (type.flags & TypeFlags.Boolean) {
|
||||
return maybeTypeOfKind(contextualType, TypeFlags.BooleanLiteral);
|
||||
}
|
||||
if (type.flags & TypeFlags.Enum) {
|
||||
return typeContainsLiteralFromEnum(contextualType, <EnumType>type);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkLiteralExpression(node: Expression): Type {
|
||||
if (node.kind === SyntaxKind.NumericLiteral) {
|
||||
checkGrammarNumericLiteral(<NumericLiteral>node);
|
||||
}
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.StringLiteral:
|
||||
return isLiteralContextForType(node, stringType) ? getLiteralTypeForText(TypeFlags.StringLiteral, (<LiteralExpression>node).text) : stringType;
|
||||
return getLiteralTypeForText(TypeFlags.StringLiteral, (<LiteralExpression>node).text);
|
||||
case SyntaxKind.NumericLiteral:
|
||||
return isLiteralContextForType(node, numberType) ? getLiteralTypeForText(TypeFlags.NumberLiteral, (<LiteralExpression>node).text) : numberType;
|
||||
return getLiteralTypeForText(TypeFlags.NumberLiteral, (<LiteralExpression>node).text);
|
||||
case SyntaxKind.TrueKeyword:
|
||||
case SyntaxKind.FalseKeyword:
|
||||
return isLiteralContextForType(node, booleanType) ? node.kind === SyntaxKind.TrueKeyword ? trueType : falseType : booleanType;
|
||||
return node.kind === SyntaxKind.TrueKeyword ? trueType : falseType;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13590,6 +13558,28 @@ namespace ts {
|
||||
return links.resolvedType;
|
||||
}
|
||||
|
||||
function isLiteralContextualType(contextualType: Type) {
|
||||
if (contextualType) {
|
||||
if (contextualType.flags & TypeFlags.TypeParameter) {
|
||||
const apparentType = getApparentTypeOfTypeParameter(<TypeParameter>contextualType);
|
||||
// If the type parameter is constrained to the base primitive type we're checking for,
|
||||
// consider this a literal context. For example, given a type parameter 'T extends string',
|
||||
// this causes us to infer string literal types for T.
|
||||
if (apparentType.flags & (TypeFlags.String | TypeFlags.Number | TypeFlags.Boolean | TypeFlags.Enum)) {
|
||||
return true;
|
||||
}
|
||||
contextualType = apparentType;
|
||||
}
|
||||
return maybeTypeOfKind(contextualType, TypeFlags.Literal);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function checkExpressionForMutableLocation(node: Expression, contextualMapper?: TypeMapper): Type {
|
||||
const type = checkExpression(node, contextualMapper);
|
||||
return isLiteralContextualType(getContextualType(node)) ? type : getBaseTypeOfLiteralType(type);
|
||||
}
|
||||
|
||||
function checkPropertyAssignment(node: PropertyAssignment, contextualMapper?: TypeMapper): Type {
|
||||
// Do not use hasDynamicName here, because that returns false for well known symbols.
|
||||
// We want to perform checkComputedPropertyName for all computed properties, including
|
||||
@@ -13598,7 +13588,7 @@ namespace ts {
|
||||
checkComputedPropertyName(<ComputedPropertyName>node.name);
|
||||
}
|
||||
|
||||
return checkExpression((<PropertyAssignment>node).initializer, contextualMapper);
|
||||
return checkExpressionForMutableLocation((<PropertyAssignment>node).initializer, contextualMapper);
|
||||
}
|
||||
|
||||
function checkObjectLiteralMethod(node: MethodDeclaration, contextualMapper?: TypeMapper): Type {
|
||||
|
||||
@@ -1063,10 +1063,6 @@
|
||||
"category": "Error",
|
||||
"code": 2353
|
||||
},
|
||||
"No best common type exists among return expressions.": {
|
||||
"category": "Error",
|
||||
"code": 2354
|
||||
},
|
||||
"A function whose declared type is neither 'void' nor 'any' must return a value.": {
|
||||
"category": "Error",
|
||||
"code": 2355
|
||||
@@ -1631,10 +1627,6 @@
|
||||
"category": "Error",
|
||||
"code": 2503
|
||||
},
|
||||
"No best common type exists among yield expressions.": {
|
||||
"category": "Error",
|
||||
"code": 2504
|
||||
},
|
||||
"A generator cannot have a 'void' type annotation.": {
|
||||
"category": "Error",
|
||||
"code": 2505
|
||||
|
||||
@@ -2593,13 +2593,14 @@ namespace ts {
|
||||
export interface TypeInferences {
|
||||
primary: Type[]; // Inferences made directly to a type parameter
|
||||
secondary: Type[]; // Inferences made to a type parameter in a union type
|
||||
topLevel: boolean; // True if all inferences were made from top-level (not nested in object type) locations
|
||||
isFixed: boolean; // Whether the type parameter is fixed, as defined in section 4.12.2 of the TypeScript spec
|
||||
// If a type parameter is fixed, no more inferences can be made for the type parameter
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export interface InferenceContext {
|
||||
typeParameters: TypeParameter[]; // Type parameters for which inferences are made
|
||||
signature: Signature; // Generic signature for which inferences are made
|
||||
inferUnionTypes: boolean; // Infer union types for disjoint candidates (otherwise undefinedType)
|
||||
inferences: TypeInferences[]; // Inferences made for each type parameter
|
||||
inferredTypes: Type[]; // Inferred type for each type parameter
|
||||
|
||||
@@ -954,26 +954,20 @@ namespace FourSlash {
|
||||
assert.equal(actual, expected);
|
||||
}
|
||||
|
||||
public verifyQuickInfoString(negative: boolean, expectedText?: string, expectedDocumentation?: string) {
|
||||
public verifyQuickInfoString(negative: boolean, expectedText: string, expectedDocumentation?: string) {
|
||||
const actualQuickInfo = this.languageService.getQuickInfoAtPosition(this.activeFile.fileName, this.currentCaretPosition);
|
||||
const actualQuickInfoText = actualQuickInfo ? ts.displayPartsToString(actualQuickInfo.displayParts) : "";
|
||||
const actualQuickInfoDocumentation = actualQuickInfo ? ts.displayPartsToString(actualQuickInfo.documentation) : "";
|
||||
|
||||
if (negative) {
|
||||
if (expectedText !== undefined) {
|
||||
assert.notEqual(actualQuickInfoText, expectedText, this.messageAtLastKnownMarker("quick info text"));
|
||||
}
|
||||
// TODO: should be '==='?
|
||||
if (expectedDocumentation != undefined) {
|
||||
assert.notEqual(actualQuickInfoText, expectedText, this.messageAtLastKnownMarker("quick info text"));
|
||||
if (expectedDocumentation !== undefined) {
|
||||
assert.notEqual(actualQuickInfoDocumentation, expectedDocumentation, this.messageAtLastKnownMarker("quick info doc comment"));
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (expectedText !== undefined) {
|
||||
assert.equal(actualQuickInfoText, expectedText, this.messageAtLastKnownMarker("quick info text"));
|
||||
}
|
||||
// TODO: should be '==='?
|
||||
if (expectedDocumentation != undefined) {
|
||||
assert.equal(actualQuickInfoText, expectedText, this.messageAtLastKnownMarker("quick info text"));
|
||||
if (expectedDocumentation !== undefined) {
|
||||
assert.equal(actualQuickInfoDocumentation, expectedDocumentation, this.assertionMessageAtLastKnownMarker("quick info doc"));
|
||||
}
|
||||
}
|
||||
@@ -2969,7 +2963,7 @@ namespace FourSlashInterface {
|
||||
this.state.verifyErrorExistsAfterMarker(markerName, !this.negative, /*after*/ false);
|
||||
}
|
||||
|
||||
public quickInfoIs(expectedText?: string, expectedDocumentation?: string) {
|
||||
public quickInfoIs(expectedText: string, expectedDocumentation?: string) {
|
||||
this.state.verifyQuickInfoString(this.negative, expectedText, expectedDocumentation);
|
||||
}
|
||||
|
||||
|
||||
@@ -408,6 +408,9 @@ namespace Harness.LanguageService {
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string): ts.CompletionEntryDetails {
|
||||
return unwrapJSONCallResult(this.shim.getCompletionEntryDetails(fileName, position, entryName));
|
||||
}
|
||||
getCompletionEntrySymbol(fileName: string, position: number, entryName: string): ts.Symbol {
|
||||
throw new Error("getCompletionEntrySymbol not implemented across the shim layer.");
|
||||
}
|
||||
getQuickInfoAtPosition(fileName: string, position: number): ts.QuickInfo {
|
||||
return unwrapJSONCallResult(this.shim.getQuickInfoAtPosition(fileName, position));
|
||||
}
|
||||
|
||||
@@ -246,6 +246,10 @@ namespace ts.server {
|
||||
return response.body[0];
|
||||
}
|
||||
|
||||
getCompletionEntrySymbol(fileName: string, position: number, entryName: string): Symbol {
|
||||
throw new Error("Not Implemented Yet.");
|
||||
}
|
||||
|
||||
getNavigateToItems(searchValue: string): NavigateToItem[] {
|
||||
const args: protocol.NavtoRequestArgs = {
|
||||
searchValue,
|
||||
|
||||
@@ -736,6 +736,22 @@ namespace ts.Completions {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
export function getCompletionEntrySymbol(typeChecker: TypeChecker, log: (message: string) => void, compilerOptions: CompilerOptions, sourceFile: SourceFile, position: number, entryName: string): Symbol {
|
||||
// Compute all the completion symbols again.
|
||||
const completionData = getCompletionData(typeChecker, log, sourceFile, position);
|
||||
if (completionData) {
|
||||
const { symbols, location } = completionData;
|
||||
|
||||
// Find the symbol with the matching entry name.
|
||||
// We don't need to perform character checks here because we're only comparing the
|
||||
// name against 'entryName' (which is known to be good), not building a new
|
||||
// completion entry.
|
||||
return forEach(symbols, s => getCompletionEntryDisplayNameForSymbol(typeChecker, s, compilerOptions.target, /*performCharacterChecks*/ false, location) === entryName ? s : undefined);
|
||||
}
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
function getCompletionData(typeChecker: TypeChecker, log: (message: string) => void, sourceFile: SourceFile, position: number) {
|
||||
const isJavaScriptFile = isSourceFileJavaScript(sourceFile);
|
||||
|
||||
|
||||
@@ -0,0 +1,240 @@
|
||||
namespace ts {
|
||||
/**
|
||||
* The document registry represents a store of SourceFile objects that can be shared between
|
||||
* multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST)
|
||||
* of files in the context.
|
||||
* SourceFile objects account for most of the memory usage by the language service. Sharing
|
||||
* the same DocumentRegistry instance between different instances of LanguageService allow
|
||||
* for more efficient memory utilization since all projects will share at least the library
|
||||
* file (lib.d.ts).
|
||||
*
|
||||
* A more advanced use of the document registry is to serialize sourceFile objects to disk
|
||||
* and re-hydrate them when needed.
|
||||
*
|
||||
* To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it
|
||||
* to all subsequent createLanguageService calls.
|
||||
*/
|
||||
export interface DocumentRegistry {
|
||||
/**
|
||||
* Request a stored SourceFile with a given fileName and compilationSettings.
|
||||
* The first call to acquire will call createLanguageServiceSourceFile to generate
|
||||
* the SourceFile if was not found in the registry.
|
||||
*
|
||||
* @param fileName The name of the file requested
|
||||
* @param compilationSettings Some compilation settings like target affects the
|
||||
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
|
||||
* multiple copies of the same file for different compilation settings.
|
||||
* @parm scriptSnapshot Text of the file. Only used if the file was not found
|
||||
* in the registry and a new one was created.
|
||||
* @parm version Current version of the file. Only used if the file was not found
|
||||
* in the registry and a new one was created.
|
||||
*/
|
||||
acquireDocument(
|
||||
fileName: string,
|
||||
compilationSettings: CompilerOptions,
|
||||
scriptSnapshot: IScriptSnapshot,
|
||||
version: string,
|
||||
scriptKind?: ScriptKind): SourceFile;
|
||||
|
||||
acquireDocumentWithKey(
|
||||
fileName: string,
|
||||
path: Path,
|
||||
compilationSettings: CompilerOptions,
|
||||
key: DocumentRegistryBucketKey,
|
||||
scriptSnapshot: IScriptSnapshot,
|
||||
version: string,
|
||||
scriptKind?: ScriptKind): SourceFile;
|
||||
|
||||
/**
|
||||
* Request an updated version of an already existing SourceFile with a given fileName
|
||||
* and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile
|
||||
* to get an updated SourceFile.
|
||||
*
|
||||
* @param fileName The name of the file requested
|
||||
* @param compilationSettings Some compilation settings like target affects the
|
||||
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
|
||||
* multiple copies of the same file for different compilation settings.
|
||||
* @param scriptSnapshot Text of the file.
|
||||
* @param version Current version of the file.
|
||||
*/
|
||||
updateDocument(
|
||||
fileName: string,
|
||||
compilationSettings: CompilerOptions,
|
||||
scriptSnapshot: IScriptSnapshot,
|
||||
version: string,
|
||||
scriptKind?: ScriptKind): SourceFile;
|
||||
|
||||
updateDocumentWithKey(
|
||||
fileName: string,
|
||||
path: Path,
|
||||
compilationSettings: CompilerOptions,
|
||||
key: DocumentRegistryBucketKey,
|
||||
scriptSnapshot: IScriptSnapshot,
|
||||
version: string,
|
||||
scriptKind?: ScriptKind): SourceFile;
|
||||
|
||||
getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey;
|
||||
/**
|
||||
* Informs the DocumentRegistry that a file is not needed any longer.
|
||||
*
|
||||
* Note: It is not allowed to call release on a SourceFile that was not acquired from
|
||||
* this registry originally.
|
||||
*
|
||||
* @param fileName The name of the file to be released
|
||||
* @param compilationSettings The compilation settings used to acquire the file
|
||||
*/
|
||||
releaseDocument(fileName: string, compilationSettings: CompilerOptions): void;
|
||||
|
||||
releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void;
|
||||
|
||||
reportStats(): string;
|
||||
}
|
||||
|
||||
export type DocumentRegistryBucketKey = string & { __bucketKey: any };
|
||||
|
||||
interface DocumentRegistryEntry {
|
||||
sourceFile: SourceFile;
|
||||
|
||||
// The number of language services that this source file is referenced in. When no more
|
||||
// language services are referencing the file, then the file can be removed from the
|
||||
// registry.
|
||||
languageServiceRefCount: number;
|
||||
owners: string[];
|
||||
}
|
||||
|
||||
export function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory = ""): DocumentRegistry {
|
||||
// Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have
|
||||
// for those settings.
|
||||
const buckets = createMap<FileMap<DocumentRegistryEntry>>();
|
||||
const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames);
|
||||
|
||||
function getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey {
|
||||
return <DocumentRegistryBucketKey>`_${settings.target}|${settings.module}|${settings.noResolve}|${settings.jsx}|${settings.allowJs}|${settings.baseUrl}|${JSON.stringify(settings.typeRoots)}|${JSON.stringify(settings.rootDirs)}|${JSON.stringify(settings.paths)}`;
|
||||
}
|
||||
|
||||
function getBucketForCompilationSettings(key: DocumentRegistryBucketKey, createIfMissing: boolean): FileMap<DocumentRegistryEntry> {
|
||||
let bucket = buckets[key];
|
||||
if (!bucket && createIfMissing) {
|
||||
buckets[key] = bucket = createFileMap<DocumentRegistryEntry>();
|
||||
}
|
||||
return bucket;
|
||||
}
|
||||
|
||||
function reportStats() {
|
||||
const bucketInfoArray = Object.keys(buckets).filter(name => name && name.charAt(0) === "_").map(name => {
|
||||
const entries = buckets[name];
|
||||
const sourceFiles: { name: string; refCount: number; references: string[]; }[] = [];
|
||||
entries.forEachValue((key, entry) => {
|
||||
sourceFiles.push({
|
||||
name: key,
|
||||
refCount: entry.languageServiceRefCount,
|
||||
references: entry.owners.slice(0)
|
||||
});
|
||||
});
|
||||
sourceFiles.sort((x, y) => y.refCount - x.refCount);
|
||||
return {
|
||||
bucket: name,
|
||||
sourceFiles
|
||||
};
|
||||
});
|
||||
return JSON.stringify(bucketInfoArray, undefined, 2);
|
||||
}
|
||||
|
||||
function acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile {
|
||||
const path = toPath(fileName, currentDirectory, getCanonicalFileName);
|
||||
const key = getKeyForCompilationSettings(compilationSettings);
|
||||
return acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind);
|
||||
}
|
||||
|
||||
function acquireDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile {
|
||||
return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ true, scriptKind);
|
||||
}
|
||||
|
||||
function updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile {
|
||||
const path = toPath(fileName, currentDirectory, getCanonicalFileName);
|
||||
const key = getKeyForCompilationSettings(compilationSettings);
|
||||
return updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind);
|
||||
}
|
||||
|
||||
function updateDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile {
|
||||
return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ false, scriptKind);
|
||||
}
|
||||
|
||||
function acquireOrUpdateDocument(
|
||||
fileName: string,
|
||||
path: Path,
|
||||
compilationSettings: CompilerOptions,
|
||||
key: DocumentRegistryBucketKey,
|
||||
scriptSnapshot: IScriptSnapshot,
|
||||
version: string,
|
||||
acquiring: boolean,
|
||||
scriptKind?: ScriptKind): SourceFile {
|
||||
|
||||
const bucket = getBucketForCompilationSettings(key, /*createIfMissing*/ true);
|
||||
let entry = bucket.get(path);
|
||||
if (!entry) {
|
||||
Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?");
|
||||
|
||||
// Have never seen this file with these settings. Create a new source file for it.
|
||||
const sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents*/ false, scriptKind);
|
||||
|
||||
entry = {
|
||||
sourceFile: sourceFile,
|
||||
languageServiceRefCount: 0,
|
||||
owners: []
|
||||
};
|
||||
bucket.set(path, entry);
|
||||
}
|
||||
else {
|
||||
// We have an entry for this file. However, it may be for a different version of
|
||||
// the script snapshot. If so, update it appropriately. Otherwise, we can just
|
||||
// return it as is.
|
||||
if (entry.sourceFile.version !== version) {
|
||||
entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version,
|
||||
scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot));
|
||||
}
|
||||
}
|
||||
|
||||
// If we're acquiring, then this is the first time this LS is asking for this document.
|
||||
// Increase our ref count so we know there's another LS using the document. If we're
|
||||
// not acquiring, then that means the LS is 'updating' the file instead, and that means
|
||||
// it has already acquired the document previously. As such, we do not need to increase
|
||||
// the ref count.
|
||||
if (acquiring) {
|
||||
entry.languageServiceRefCount++;
|
||||
}
|
||||
|
||||
return entry.sourceFile;
|
||||
}
|
||||
|
||||
function releaseDocument(fileName: string, compilationSettings: CompilerOptions): void {
|
||||
const path = toPath(fileName, currentDirectory, getCanonicalFileName);
|
||||
const key = getKeyForCompilationSettings(compilationSettings);
|
||||
return releaseDocumentWithKey(path, key);
|
||||
}
|
||||
|
||||
function releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void {
|
||||
const bucket = getBucketForCompilationSettings(key, /*createIfMissing*/false);
|
||||
Debug.assert(bucket !== undefined);
|
||||
|
||||
const entry = bucket.get(path);
|
||||
entry.languageServiceRefCount--;
|
||||
|
||||
Debug.assert(entry.languageServiceRefCount >= 0);
|
||||
if (entry.languageServiceRefCount === 0) {
|
||||
bucket.remove(path);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
acquireDocument,
|
||||
acquireDocumentWithKey,
|
||||
updateDocument,
|
||||
updateDocumentWithKey,
|
||||
releaseDocument,
|
||||
releaseDocumentWithKey,
|
||||
reportStats,
|
||||
getKeyForCompilationSettings
|
||||
};
|
||||
}
|
||||
}
|
||||
+7
-146
@@ -7,6 +7,7 @@
|
||||
/// <reference path='classifier.ts' />
|
||||
/// <reference path='completions.ts' />
|
||||
/// <reference path='documentHighlights.ts' />
|
||||
/// <reference path='documentRegistry.ts' />
|
||||
/// <reference path='findAllReferences.ts' />
|
||||
/// <reference path='goToDefinition.ts' />
|
||||
/// <reference path='jsDoc.ts' />
|
||||
@@ -668,16 +669,6 @@ namespace ts {
|
||||
scriptKind: ScriptKind;
|
||||
}
|
||||
|
||||
interface DocumentRegistryEntry {
|
||||
sourceFile: SourceFile;
|
||||
|
||||
// The number of language services that this source file is referenced in. When no more
|
||||
// language services are referencing the file, then the file can be removed from the
|
||||
// registry.
|
||||
languageServiceRefCount: number;
|
||||
owners: string[];
|
||||
}
|
||||
|
||||
export interface DisplayPartsSymbolWriter extends SymbolWriter {
|
||||
displayParts(): SymbolDisplayPart[];
|
||||
}
|
||||
@@ -899,142 +890,6 @@ namespace ts {
|
||||
return createLanguageServiceSourceFile(sourceFile.fileName, scriptSnapshot, sourceFile.languageVersion, version, /*setNodeParents*/ true, sourceFile.scriptKind);
|
||||
}
|
||||
|
||||
export function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory = ""): DocumentRegistry {
|
||||
// Maps from compiler setting target (ES3, ES5, etc.) to all the cached documents we have
|
||||
// for those settings.
|
||||
const buckets = createMap<FileMap<DocumentRegistryEntry>>();
|
||||
const getCanonicalFileName = createGetCanonicalFileName(!!useCaseSensitiveFileNames);
|
||||
|
||||
function getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey {
|
||||
return <DocumentRegistryBucketKey>`_${settings.target}|${settings.module}|${settings.noResolve}|${settings.jsx}|${settings.allowJs}|${settings.baseUrl}|${JSON.stringify(settings.typeRoots)}|${JSON.stringify(settings.rootDirs)}|${JSON.stringify(settings.paths)}`;
|
||||
}
|
||||
|
||||
function getBucketForCompilationSettings(key: DocumentRegistryBucketKey, createIfMissing: boolean): FileMap<DocumentRegistryEntry> {
|
||||
let bucket = buckets[key];
|
||||
if (!bucket && createIfMissing) {
|
||||
buckets[key] = bucket = createFileMap<DocumentRegistryEntry>();
|
||||
}
|
||||
return bucket;
|
||||
}
|
||||
|
||||
function reportStats() {
|
||||
const bucketInfoArray = Object.keys(buckets).filter(name => name && name.charAt(0) === "_").map(name => {
|
||||
const entries = buckets[name];
|
||||
const sourceFiles: { name: string; refCount: number; references: string[]; }[] = [];
|
||||
entries.forEachValue((key, entry) => {
|
||||
sourceFiles.push({
|
||||
name: key,
|
||||
refCount: entry.languageServiceRefCount,
|
||||
references: entry.owners.slice(0)
|
||||
});
|
||||
});
|
||||
sourceFiles.sort((x, y) => y.refCount - x.refCount);
|
||||
return {
|
||||
bucket: name,
|
||||
sourceFiles
|
||||
};
|
||||
});
|
||||
return JSON.stringify(bucketInfoArray, undefined, 2);
|
||||
}
|
||||
|
||||
function acquireDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile {
|
||||
const path = toPath(fileName, currentDirectory, getCanonicalFileName);
|
||||
const key = getKeyForCompilationSettings(compilationSettings);
|
||||
return acquireDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind);
|
||||
}
|
||||
|
||||
function acquireDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile {
|
||||
return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ true, scriptKind);
|
||||
}
|
||||
|
||||
function updateDocument(fileName: string, compilationSettings: CompilerOptions, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile {
|
||||
const path = toPath(fileName, currentDirectory, getCanonicalFileName);
|
||||
const key = getKeyForCompilationSettings(compilationSettings);
|
||||
return updateDocumentWithKey(fileName, path, compilationSettings, key, scriptSnapshot, version, scriptKind);
|
||||
}
|
||||
|
||||
function updateDocumentWithKey(fileName: string, path: Path, compilationSettings: CompilerOptions, key: DocumentRegistryBucketKey, scriptSnapshot: IScriptSnapshot, version: string, scriptKind?: ScriptKind): SourceFile {
|
||||
return acquireOrUpdateDocument(fileName, path, compilationSettings, key, scriptSnapshot, version, /*acquiring*/ false, scriptKind);
|
||||
}
|
||||
|
||||
function acquireOrUpdateDocument(
|
||||
fileName: string,
|
||||
path: Path,
|
||||
compilationSettings: CompilerOptions,
|
||||
key: DocumentRegistryBucketKey,
|
||||
scriptSnapshot: IScriptSnapshot,
|
||||
version: string,
|
||||
acquiring: boolean,
|
||||
scriptKind?: ScriptKind): SourceFile {
|
||||
|
||||
const bucket = getBucketForCompilationSettings(key, /*createIfMissing*/ true);
|
||||
let entry = bucket.get(path);
|
||||
if (!entry) {
|
||||
Debug.assert(acquiring, "How could we be trying to update a document that the registry doesn't have?");
|
||||
|
||||
// Have never seen this file with these settings. Create a new source file for it.
|
||||
const sourceFile = createLanguageServiceSourceFile(fileName, scriptSnapshot, compilationSettings.target, version, /*setNodeParents*/ false, scriptKind);
|
||||
|
||||
entry = {
|
||||
sourceFile: sourceFile,
|
||||
languageServiceRefCount: 0,
|
||||
owners: []
|
||||
};
|
||||
bucket.set(path, entry);
|
||||
}
|
||||
else {
|
||||
// We have an entry for this file. However, it may be for a different version of
|
||||
// the script snapshot. If so, update it appropriately. Otherwise, we can just
|
||||
// return it as is.
|
||||
if (entry.sourceFile.version !== version) {
|
||||
entry.sourceFile = updateLanguageServiceSourceFile(entry.sourceFile, scriptSnapshot, version,
|
||||
scriptSnapshot.getChangeRange(entry.sourceFile.scriptSnapshot));
|
||||
}
|
||||
}
|
||||
|
||||
// If we're acquiring, then this is the first time this LS is asking for this document.
|
||||
// Increase our ref count so we know there's another LS using the document. If we're
|
||||
// not acquiring, then that means the LS is 'updating' the file instead, and that means
|
||||
// it has already acquired the document previously. As such, we do not need to increase
|
||||
// the ref count.
|
||||
if (acquiring) {
|
||||
entry.languageServiceRefCount++;
|
||||
}
|
||||
|
||||
return entry.sourceFile;
|
||||
}
|
||||
|
||||
function releaseDocument(fileName: string, compilationSettings: CompilerOptions): void {
|
||||
const path = toPath(fileName, currentDirectory, getCanonicalFileName);
|
||||
const key = getKeyForCompilationSettings(compilationSettings);
|
||||
return releaseDocumentWithKey(path, key);
|
||||
}
|
||||
|
||||
function releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void {
|
||||
const bucket = getBucketForCompilationSettings(key, /*createIfMissing*/false);
|
||||
Debug.assert(bucket !== undefined);
|
||||
|
||||
const entry = bucket.get(path);
|
||||
entry.languageServiceRefCount--;
|
||||
|
||||
Debug.assert(entry.languageServiceRefCount >= 0);
|
||||
if (entry.languageServiceRefCount === 0) {
|
||||
bucket.remove(path);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
acquireDocument,
|
||||
acquireDocumentWithKey,
|
||||
updateDocument,
|
||||
updateDocumentWithKey,
|
||||
releaseDocument,
|
||||
releaseDocumentWithKey,
|
||||
reportStats,
|
||||
getKeyForCompilationSettings
|
||||
};
|
||||
}
|
||||
|
||||
class CancellationTokenObject implements CancellationToken {
|
||||
constructor(private cancellationToken: HostCancellationToken) {
|
||||
}
|
||||
@@ -1351,6 +1206,11 @@ namespace ts {
|
||||
return Completions.getCompletionEntryDetails(program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, entryName);
|
||||
}
|
||||
|
||||
function getCompletionEntrySymbol(fileName: string, position: number, entryName: string): Symbol {
|
||||
synchronizeHostData();
|
||||
return Completions.getCompletionEntrySymbol(program.getTypeChecker(), log, program.getCompilerOptions(), getValidSourceFile(fileName), position, entryName);
|
||||
}
|
||||
|
||||
function getQuickInfoAtPosition(fileName: string, position: number): QuickInfo {
|
||||
synchronizeHostData();
|
||||
|
||||
@@ -1913,6 +1773,7 @@ namespace ts {
|
||||
getEncodedSemanticClassifications,
|
||||
getCompletionsAtPosition,
|
||||
getCompletionEntryDetails,
|
||||
getCompletionEntrySymbol,
|
||||
getSignatureHelpItems,
|
||||
getQuickInfoAtPosition,
|
||||
getDefinitionAtPosition,
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
"classifier.ts",
|
||||
"completions.ts",
|
||||
"documentHighlights.ts",
|
||||
"documentRegistry.ts",
|
||||
"findAllReferences.ts",
|
||||
"goToDefinition.ts",
|
||||
"jsDoc.ts",
|
||||
|
||||
+1
-93
@@ -194,6 +194,7 @@ namespace ts {
|
||||
|
||||
getCompletionsAtPosition(fileName: string, position: number): CompletionInfo;
|
||||
getCompletionEntryDetails(fileName: string, position: number, entryName: string): CompletionEntryDetails;
|
||||
getCompletionEntrySymbol(fileName: string, position: number, entryName: string): Symbol;
|
||||
|
||||
getQuickInfoAtPosition(fileName: string, position: number): QuickInfo;
|
||||
|
||||
@@ -575,99 +576,6 @@ namespace ts {
|
||||
getEncodedLexicalClassifications(text: string, endOfLineState: EndOfLineState, syntacticClassifierAbsent: boolean): Classifications;
|
||||
}
|
||||
|
||||
/**
|
||||
* The document registry represents a store of SourceFile objects that can be shared between
|
||||
* multiple LanguageService instances. A LanguageService instance holds on the SourceFile (AST)
|
||||
* of files in the context.
|
||||
* SourceFile objects account for most of the memory usage by the language service. Sharing
|
||||
* the same DocumentRegistry instance between different instances of LanguageService allow
|
||||
* for more efficient memory utilization since all projects will share at least the library
|
||||
* file (lib.d.ts).
|
||||
*
|
||||
* A more advanced use of the document registry is to serialize sourceFile objects to disk
|
||||
* and re-hydrate them when needed.
|
||||
*
|
||||
* To create a default DocumentRegistry, use createDocumentRegistry to create one, and pass it
|
||||
* to all subsequent createLanguageService calls.
|
||||
*/
|
||||
export interface DocumentRegistry {
|
||||
/**
|
||||
* Request a stored SourceFile with a given fileName and compilationSettings.
|
||||
* The first call to acquire will call createLanguageServiceSourceFile to generate
|
||||
* the SourceFile if was not found in the registry.
|
||||
*
|
||||
* @param fileName The name of the file requested
|
||||
* @param compilationSettings Some compilation settings like target affects the
|
||||
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
|
||||
* multiple copies of the same file for different compilation settings.
|
||||
* @parm scriptSnapshot Text of the file. Only used if the file was not found
|
||||
* in the registry and a new one was created.
|
||||
* @parm version Current version of the file. Only used if the file was not found
|
||||
* in the registry and a new one was created.
|
||||
*/
|
||||
acquireDocument(
|
||||
fileName: string,
|
||||
compilationSettings: CompilerOptions,
|
||||
scriptSnapshot: IScriptSnapshot,
|
||||
version: string,
|
||||
scriptKind?: ScriptKind): SourceFile;
|
||||
|
||||
acquireDocumentWithKey(
|
||||
fileName: string,
|
||||
path: Path,
|
||||
compilationSettings: CompilerOptions,
|
||||
key: DocumentRegistryBucketKey,
|
||||
scriptSnapshot: IScriptSnapshot,
|
||||
version: string,
|
||||
scriptKind?: ScriptKind): SourceFile;
|
||||
|
||||
/**
|
||||
* Request an updated version of an already existing SourceFile with a given fileName
|
||||
* and compilationSettings. The update will in-turn call updateLanguageServiceSourceFile
|
||||
* to get an updated SourceFile.
|
||||
*
|
||||
* @param fileName The name of the file requested
|
||||
* @param compilationSettings Some compilation settings like target affects the
|
||||
* shape of a the resulting SourceFile. This allows the DocumentRegistry to store
|
||||
* multiple copies of the same file for different compilation settings.
|
||||
* @param scriptSnapshot Text of the file.
|
||||
* @param version Current version of the file.
|
||||
*/
|
||||
updateDocument(
|
||||
fileName: string,
|
||||
compilationSettings: CompilerOptions,
|
||||
scriptSnapshot: IScriptSnapshot,
|
||||
version: string,
|
||||
scriptKind?: ScriptKind): SourceFile;
|
||||
|
||||
updateDocumentWithKey(
|
||||
fileName: string,
|
||||
path: Path,
|
||||
compilationSettings: CompilerOptions,
|
||||
key: DocumentRegistryBucketKey,
|
||||
scriptSnapshot: IScriptSnapshot,
|
||||
version: string,
|
||||
scriptKind?: ScriptKind): SourceFile;
|
||||
|
||||
getKeyForCompilationSettings(settings: CompilerOptions): DocumentRegistryBucketKey;
|
||||
/**
|
||||
* Informs the DocumentRegistry that a file is not needed any longer.
|
||||
*
|
||||
* Note: It is not allowed to call release on a SourceFile that was not acquired from
|
||||
* this registry originally.
|
||||
*
|
||||
* @param fileName The name of the file to be released
|
||||
* @param compilationSettings The compilation settings used to acquire the file
|
||||
*/
|
||||
releaseDocument(fileName: string, compilationSettings: CompilerOptions): void;
|
||||
|
||||
releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void;
|
||||
|
||||
reportStats(): string;
|
||||
}
|
||||
|
||||
export type DocumentRegistryBucketKey = string & { __bucketKey: any };
|
||||
|
||||
// TODO: move these to enums
|
||||
export namespace ScriptElementKind {
|
||||
export const unknown = "";
|
||||
|
||||
@@ -56,6 +56,6 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000
|
||||
>A.Point : typeof A.Point
|
||||
>A : typeof A
|
||||
>Point : typeof A.Point
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
+2
-2
@@ -50,6 +50,6 @@ var p = new A.Point(0, 0); // unexpected error here, bug 840000
|
||||
>A.Point : typeof A.Point
|
||||
>A : typeof A
|
||||
>Point : typeof A.Point
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
+2
-2
@@ -15,9 +15,9 @@ function Point() {
|
||||
return { x: 0, y: 0 };
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/test.ts ===
|
||||
|
||||
+6
-6
@@ -11,9 +11,9 @@ class Point {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
module Point {
|
||||
@@ -21,7 +21,7 @@ module Point {
|
||||
|
||||
function Origin() { return ""; }// not an error, since not exported
|
||||
>Origin : () => string
|
||||
>"" : string
|
||||
>"" : ""
|
||||
}
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ module A {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
export module Point {
|
||||
@@ -50,6 +50,6 @@ module A {
|
||||
|
||||
function Origin() { return ""; }// not an error since not exported
|
||||
>Origin : () => string
|
||||
>"" : string
|
||||
>"" : ""
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -11,9 +11,9 @@ class Point {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
module Point {
|
||||
@@ -21,7 +21,7 @@ module Point {
|
||||
|
||||
var Origin = ""; // not an error, since not exported
|
||||
>Origin : string
|
||||
>"" : string
|
||||
>"" : ""
|
||||
}
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ module A {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
export module Point {
|
||||
@@ -50,6 +50,6 @@ module A {
|
||||
|
||||
var Origin = ""; // not an error since not exported
|
||||
>Origin : string
|
||||
>"" : string
|
||||
>"" : ""
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -7,5 +7,5 @@ class C {
|
||||
|
||||
x = 10;
|
||||
>x : number
|
||||
>10 : number
|
||||
>10 : 10
|
||||
}
|
||||
@@ -2,5 +2,5 @@
|
||||
for (var v of [true]) { }
|
||||
>v : boolean
|
||||
>[true] : boolean[]
|
||||
>true : boolean
|
||||
>true : true
|
||||
|
||||
@@ -5,7 +5,7 @@ function foo() {
|
||||
return { x: 0 };
|
||||
>{ x: 0 } : { x: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
for (foo().x of []) {
|
||||
>foo().x : number
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
for (let v of ['a', 'b', 'c']) {
|
||||
>v : string
|
||||
>['a', 'b', 'c'] : string[]
|
||||
>'a' : string
|
||||
>'b' : string
|
||||
>'c' : string
|
||||
>'a' : "a"
|
||||
>'b' : "b"
|
||||
>'c' : "c"
|
||||
|
||||
var x = v;
|
||||
>x : string
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
var a = [1, 2, 3];
|
||||
>a : number[]
|
||||
>[1, 2, 3] : number[]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>3 : number
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
|
||||
for (var v of a) {
|
||||
>v : number
|
||||
@@ -12,5 +12,5 @@ for (var v of a) {
|
||||
|
||||
let a = 0;
|
||||
>a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
@@ -2,9 +2,9 @@
|
||||
var a = [1, 2, 3];
|
||||
>a : number[]
|
||||
>[1, 2, 3] : number[]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>3 : number
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
|
||||
for (var v of a) {
|
||||
>v : number
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
for (var v of ['a', 'b', 'c'])
|
||||
>v : string
|
||||
>['a', 'b', 'c'] : string[]
|
||||
>'a' : string
|
||||
>'b' : string
|
||||
>'c' : string
|
||||
>'a' : "a"
|
||||
>'b' : "b"
|
||||
>'c' : "c"
|
||||
|
||||
var x = v;
|
||||
>x : string
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,6): error TS2461: Type 'string | number' is not an array type.
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,7): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,7): error TS2322: Type '1' is not assignable to type 'string'.
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error TS2322: Type '""' is not assignable to type 'number'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts (3 errors) ====
|
||||
@@ -10,9 +10,9 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of30.ts(3,14): error
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2461: Type 'string | number' is not an array type.
|
||||
~
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2322: Type '1' is not assignable to type 'string'.
|
||||
~
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type '""' is not assignable to type 'number'.
|
||||
a;
|
||||
b;
|
||||
}
|
||||
@@ -5,7 +5,7 @@ function foo() {
|
||||
return { x: 0 };
|
||||
>{ x: 0 } : { x: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
for (foo().x of []) {
|
||||
>foo().x : number
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
=== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck1.ts ===
|
||||
for (var v of "") { }
|
||||
>v : string
|
||||
>"" : string
|
||||
>"" : ""
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2495: Type 'number' is not an array type or a string type.
|
||||
tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts(1,17): error TS2495: Type '0' is not an array type or a string type.
|
||||
|
||||
|
||||
==== tests/cases/conformance/statements/for-ofStatements/ES5For-ofTypeCheck12.ts (1 errors) ====
|
||||
for (const v of 0) { }
|
||||
~
|
||||
!!! error TS2495: Type 'number' is not an array type or a string type.
|
||||
!!! error TS2495: Type '0' is not an array type or a string type.
|
||||
@@ -2,5 +2,5 @@
|
||||
for (var v of [true]) { }
|
||||
>v : boolean
|
||||
>[true] : boolean[]
|
||||
>true : boolean
|
||||
>true : true
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
var tuple: [string, number] = ["", 0];
|
||||
>tuple : [string, number]
|
||||
>["", 0] : [string, number]
|
||||
>"" : string
|
||||
>0 : number
|
||||
>"" : ""
|
||||
>0 : 0
|
||||
|
||||
for (var v of tuple) { }
|
||||
>v : string | number
|
||||
|
||||
@@ -3,13 +3,13 @@
|
||||
var array = [1,2,3];
|
||||
>array : number[]
|
||||
>[1,2,3] : number[]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>3 : number
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
|
||||
var sum = 0;
|
||||
>sum : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
for (let num of array) {
|
||||
>num : number
|
||||
@@ -24,9 +24,9 @@ for (let num of array) {
|
||||
>array = [4,5,6] : number[]
|
||||
>array : number[]
|
||||
>[4,5,6] : number[]
|
||||
>4 : number
|
||||
>5 : number
|
||||
>6 : number
|
||||
>4 : 4
|
||||
>5 : 5
|
||||
>6 : 6
|
||||
}
|
||||
|
||||
sum += num;
|
||||
|
||||
@@ -3,8 +3,8 @@ enum enumdule {
|
||||
>enumdule : enumdule
|
||||
|
||||
Red, Blue
|
||||
>Red : enumdule
|
||||
>Blue : enumdule
|
||||
>Red : enumdule.Red
|
||||
>Blue : enumdule.Blue
|
||||
}
|
||||
|
||||
module enumdule {
|
||||
@@ -25,9 +25,9 @@ var x: enumdule;
|
||||
|
||||
var x = enumdule.Red;
|
||||
>x : enumdule
|
||||
>enumdule.Red : enumdule
|
||||
>enumdule.Red : enumdule.Red
|
||||
>enumdule : typeof enumdule
|
||||
>Red : enumdule
|
||||
>Red : enumdule.Red
|
||||
|
||||
var y: { x: number; y: number };
|
||||
>y : { x: number; y: number; }
|
||||
@@ -40,6 +40,6 @@ var y = new enumdule.Point(0, 0);
|
||||
>enumdule.Point : typeof enumdule.Point
|
||||
>enumdule : typeof enumdule
|
||||
>Point : typeof enumdule.Point
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ module A {
|
||||
>Point : Point
|
||||
|
||||
return 1;
|
||||
>1 : number
|
||||
>1 : 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -17,9 +17,9 @@ module A {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
export class Point3d extends Point {
|
||||
>Point3d : Point3d
|
||||
@@ -34,11 +34,11 @@ module A {
|
||||
>Point3d : Point3d
|
||||
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>z : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
export class Line<TPoint extends Point>{
|
||||
>Line : Line<TPoint>
|
||||
|
||||
+5
-5
@@ -17,9 +17,9 @@ module A {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
export class Point3d extends Point {
|
||||
>Point3d : Point3d
|
||||
@@ -34,11 +34,11 @@ module A {
|
||||
>Point3d : Point3d
|
||||
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>z : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
export class Line<TPoint extends Point>{
|
||||
>Line : Line<TPoint>
|
||||
|
||||
+2
-2
@@ -33,9 +33,9 @@ module A {
|
||||
>Line : typeof Line
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>p : Point
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -33,9 +33,9 @@ module A {
|
||||
>Line : typeof Line
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>p : Point
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -33,9 +33,9 @@ module A {
|
||||
>Line : typeof Line
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>p : Point
|
||||
}
|
||||
}
|
||||
+5
-5
@@ -17,9 +17,9 @@ module A {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
export interface Point3d extends Point {
|
||||
>Point3d : Point3d
|
||||
@@ -34,11 +34,11 @@ module A {
|
||||
>Point3d : Point3d
|
||||
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>z : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
export interface Line<TPoint extends Point>{
|
||||
>Line : Line<TPoint>
|
||||
|
||||
+5
-5
@@ -17,9 +17,9 @@ module A {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
export interface Point3d extends Point {
|
||||
>Point3d : Point3d
|
||||
@@ -34,11 +34,11 @@ module A {
|
||||
>Point3d : Point3d
|
||||
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>z : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
export interface Line<TPoint extends Point>{
|
||||
>Line : Line<TPoint>
|
||||
|
||||
@@ -18,8 +18,8 @@ module A {
|
||||
>Point : Point
|
||||
>new Point(0, 0) : Point
|
||||
>Point : typeof Point
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
export class Line {
|
||||
>Line : Line
|
||||
@@ -42,9 +42,9 @@ module A {
|
||||
>Line : typeof Line
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>p : Point
|
||||
}
|
||||
}
|
||||
|
||||
+6
-6
@@ -15,9 +15,9 @@ module A {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
export var Unity = { start: new Point(0, 0), end: new Point(1, 0) };
|
||||
>Unity : { start: Point; end: Point; }
|
||||
@@ -25,12 +25,12 @@ module A {
|
||||
>start : Point
|
||||
>new Point(0, 0) : Point
|
||||
>Point : typeof Point
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
>end : Point
|
||||
>new Point(1, 0) : Point
|
||||
>Point : typeof Point
|
||||
>1 : number
|
||||
>0 : number
|
||||
>1 : 1
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
@@ -18,8 +18,8 @@ module A {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
@@ -18,9 +18,9 @@ module A {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
interface Point3d extends Point {
|
||||
>Point3d : Point3d
|
||||
@@ -36,10 +36,10 @@ module A {
|
||||
>Point3d : Point3d
|
||||
>{ x: 0, y: 0, z: 0 } : { x: number; y: number; z: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>z : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
@@ -8,9 +8,9 @@ module A {
|
||||
return { x: 0, y: 0 };
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,9 +25,9 @@ module B {
|
||||
>Origin : { x: number; y: number; }
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@ enum enumdule {
|
||||
>enumdule : enumdule
|
||||
|
||||
Red, Blue
|
||||
>Red : enumdule
|
||||
>Blue : enumdule
|
||||
>Red : enumdule.Red
|
||||
>Blue : enumdule.Blue
|
||||
}
|
||||
|
||||
var x: enumdule;
|
||||
@@ -25,9 +25,9 @@ var x: enumdule;
|
||||
|
||||
var x = enumdule.Red;
|
||||
>x : enumdule
|
||||
>enumdule.Red : enumdule
|
||||
>enumdule.Red : enumdule.Red
|
||||
>enumdule : typeof enumdule
|
||||
>Red : enumdule
|
||||
>Red : enumdule.Red
|
||||
|
||||
var y: { x: number; y: number };
|
||||
>y : { x: number; y: number; }
|
||||
@@ -40,6 +40,6 @@ var y = new enumdule.Point(0, 0);
|
||||
>enumdule.Point : typeof enumdule.Point
|
||||
>enumdule : typeof enumdule
|
||||
>Point : typeof enumdule.Point
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
+5
-5
@@ -39,9 +39,9 @@ module A {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/internalModules/DeclarationMerging/part2.ts ===
|
||||
@@ -51,7 +51,7 @@ module A {
|
||||
// not a collision, since we don't export
|
||||
var Origin: string = "0,0";
|
||||
>Origin : string
|
||||
>"0,0" : string
|
||||
>"0,0" : "0,0"
|
||||
|
||||
export module Utils {
|
||||
>Utils : typeof Utils
|
||||
@@ -123,8 +123,8 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 });
|
||||
>o : { x: number; y: number; }
|
||||
>{ x: 1, y: 1 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
|
||||
+2
-2
@@ -55,9 +55,9 @@ module otherRoot {
|
||||
>Point : Root.A.Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
export module Utils {
|
||||
>Utils : typeof Utils
|
||||
|
||||
@@ -45,9 +45,9 @@ module A {
|
||||
>Point : Point
|
||||
>{ x: 0, y: 0 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>y : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
export module Utils {
|
||||
>Utils : typeof Utils
|
||||
@@ -119,8 +119,8 @@ var p = new A.Utils.Plane(o, { x: 1, y: 1 });
|
||||
>o : { x: number; y: number; }
|
||||
>{ x: 1, y: 1 } : { x: number; y: number; }
|
||||
>x : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>y : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
=== tests/cases/conformance/expressions/typeGuards/TypeGuardWithEnumUnion.ts ===
|
||||
enum Color { R, G, B }
|
||||
>Color : Color
|
||||
>R : Color
|
||||
>G : Color
|
||||
>B : Color
|
||||
>R : Color.R
|
||||
>G : Color.G
|
||||
>B : Color.B
|
||||
|
||||
function f1(x: Color | string) {
|
||||
>f1 : (x: string | Color) => void
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration10_es6.ts ===
|
||||
let a: number = 1
|
||||
>a : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration3_es6.ts ===
|
||||
const a = 1
|
||||
>a : number
|
||||
>1 : number
|
||||
>a : 1
|
||||
>1 : 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration5_es6.ts ===
|
||||
const a: number = 1
|
||||
>a : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
=== tests/cases/conformance/es6/variableDeclarations/VariableDeclaration8_es6.ts ===
|
||||
let a = 1
|
||||
>a : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
=== tests/cases/compiler/abstractIdentifierNameStrict.ts ===
|
||||
var abstract = true;
|
||||
>abstract : boolean
|
||||
>true : boolean
|
||||
>true : true
|
||||
|
||||
function foo() {
|
||||
>foo : () => void
|
||||
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
>"use strict" : "use strict"
|
||||
|
||||
var abstract = true;
|
||||
>abstract : boolean
|
||||
>true : boolean
|
||||
>true : true
|
||||
}
|
||||
@@ -40,7 +40,7 @@ class C extends B {
|
||||
|
||||
get prop() { return "foo"; }
|
||||
>prop : string
|
||||
>"foo" : string
|
||||
>"foo" : "foo"
|
||||
|
||||
set prop(v) { }
|
||||
>prop : string
|
||||
@@ -48,11 +48,11 @@ class C extends B {
|
||||
|
||||
raw = "edge";
|
||||
>raw : string
|
||||
>"edge" : string
|
||||
>"edge" : "edge"
|
||||
|
||||
readonly ro = "readonly please";
|
||||
>ro : string
|
||||
>"readonly please" : string
|
||||
>ro : "readonly please"
|
||||
>"readonly please" : "readonly please"
|
||||
|
||||
readonlyProp: string; // don't have to give a value, in fact
|
||||
>readonlyProp : string
|
||||
|
||||
@@ -13,11 +13,11 @@ class Point {
|
||||
>"x=" + this.x + " y=" + this.y : string
|
||||
>"x=" + this.x + " y=" : string
|
||||
>"x=" + this.x : string
|
||||
>"x=" : string
|
||||
>"x=" : "x="
|
||||
>this.x : number
|
||||
>this : this
|
||||
>x : number
|
||||
>" y=" : string
|
||||
>" y=" : " y="
|
||||
>this.y : number
|
||||
>this : this
|
||||
>y : number
|
||||
@@ -48,7 +48,7 @@ class ColoredPoint extends Point {
|
||||
>super.toString : () => string
|
||||
>super : Point
|
||||
>toString : () => string
|
||||
>" color=" : string
|
||||
>" color=" : " color="
|
||||
>this.color : string
|
||||
>this : this
|
||||
>color : string
|
||||
|
||||
@@ -7,7 +7,7 @@ class C {
|
||||
>x : number
|
||||
|
||||
return 1;
|
||||
>1 : number
|
||||
>1 : 1
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ var x = {
|
||||
|
||||
get a() { return 1 }
|
||||
>a : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
}
|
||||
|
||||
var y = {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(2,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(3,55): error TS2322: Type '""' is not assignable to type 'number'.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(5,54): error TS2322: Type '""' is not assignable to type 'number'.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(6,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(9,52): error TS2322: Type '0' is not assignable to type 'string'.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(11,51): error TS2322: Type '0' is not assignable to type 'string'.
|
||||
tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
|
||||
@@ -21,13 +21,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type '""' is not assignable to type 'number'.
|
||||
|
||||
public get AnnotatedSetter_SetterLast() { return ""; }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~
|
||||
!!! error TS2322: Type 'string' is not assignable to type 'number'.
|
||||
!!! error TS2322: Type '""' is not assignable to type 'number'.
|
||||
public set AnnotatedSetter_SetterLast(a: number) { }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
@@ -39,13 +39,13 @@ tests/cases/compiler/accessors_spec_section-4.5_error-cases.ts(12,16): error TS1
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~~~
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2322: Type '0' is not assignable to type 'string'.
|
||||
|
||||
public set AnnotatedGetter_GetterLast(aStr) { aStr = 0; }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
~~~~
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'string'.
|
||||
!!! error TS2322: Type '0' is not assignable to type 'string'.
|
||||
public get AnnotatedGetter_GetterLast(): string { return ""; }
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
|
||||
@@ -22,5 +22,5 @@ var kitty = a(1);
|
||||
>kitty : string
|
||||
>a(1) : string
|
||||
>a : Bar
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
@@ -13,9 +13,9 @@ class C {
|
||||
}
|
||||
enum E { a, b, c }
|
||||
>E : E
|
||||
>a : E
|
||||
>b : E
|
||||
>c : E
|
||||
>a : E.a
|
||||
>b : E.b
|
||||
>c : E.c
|
||||
|
||||
module M { export var a }
|
||||
>M : typeof M
|
||||
@@ -130,9 +130,9 @@ var r15 = a + E.a;
|
||||
>r15 : any
|
||||
>a + E.a : any
|
||||
>a : any
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var r16 = a + M;
|
||||
>r16 : any
|
||||
@@ -144,13 +144,13 @@ var r17 = a + '';
|
||||
>r17 : string
|
||||
>a + '' : string
|
||||
>a : any
|
||||
>'' : string
|
||||
>'' : ""
|
||||
|
||||
var r18 = a + 123;
|
||||
>r18 : any
|
||||
>a + 123 : any
|
||||
>a : any
|
||||
>123 : number
|
||||
>123 : 123
|
||||
|
||||
var r19 = a + { a: '' };
|
||||
>r19 : any
|
||||
@@ -158,7 +158,7 @@ var r19 = a + { a: '' };
|
||||
>a : any
|
||||
>{ a: '' } : { a: string; }
|
||||
>a : string
|
||||
>'' : string
|
||||
>'' : ""
|
||||
|
||||
var r20 = a + ((a: string) => { return a });
|
||||
>r20 : any
|
||||
|
||||
@@ -6,17 +6,17 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(25,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'boolean'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(26,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'number'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(27,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(30,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(31,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(32,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(30,11): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'true'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(31,11): error TS2365: Operator '+' cannot be applied to types 'true' and 'false'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(32,11): error TS2365: Operator '+' cannot be applied to types 'true' and '123'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(33,11): error TS2365: Operator '+' cannot be applied to types '{}' and '{}'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(34,11): error TS2365: Operator '+' cannot be applied to types 'number' and 'Number'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(35,11): error TS2365: Operator '+' cannot be applied to types 'number' and '() => void'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(36,11): error TS2365: Operator '+' cannot be applied to types 'number' and 'void'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(37,11): error TS2365: Operator '+' cannot be applied to types 'number' and 'typeof C'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(38,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'C'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(39,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'void'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(40,11): error TS2365: Operator '+' cannot be applied to types 'E' and 'typeof M'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(38,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'C'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(39,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'void'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts(40,11): error TS2365: Operator '+' cannot be applied to types 'E.a' and 'typeof M'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithInvalidOperands.ts (19 errors) ====
|
||||
@@ -67,13 +67,13 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe
|
||||
// other cases
|
||||
var r10 = a + true;
|
||||
~~~~~~~~
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'true'.
|
||||
var r11 = true + false;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'true' and 'false'.
|
||||
var r12 = true + 123;
|
||||
~~~~~~~~~~
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'number'.
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'true' and '123'.
|
||||
var r13 = {} + {};
|
||||
~~~~~~~
|
||||
!!! error TS2365: Operator '+' cannot be applied to types '{}' and '{}'.
|
||||
@@ -91,10 +91,10 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'number' and 'typeof C'.
|
||||
var r18 = E.a + new C();
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'C'.
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'C'.
|
||||
var r19 = E.a + C.foo();
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'void'.
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'void'.
|
||||
var r20 = E.a + M;
|
||||
~~~~~~~
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'E' and 'typeof M'.
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'E.a' and 'typeof M'.
|
||||
+2
-2
@@ -5,7 +5,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'true' and 'true'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(21,10): error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNullValueAndInvalidOperator.ts(23,11): error TS2365: Operator '+' cannot be applied to types '() => void' and '() => void'.
|
||||
@@ -47,7 +47,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'.
|
||||
var r8 = null + true;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'true' and 'true'.
|
||||
var r9 = null + { a: '' };
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'.
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
enum E { a, b, c }
|
||||
>E : E
|
||||
>a : E
|
||||
>b : E
|
||||
>c : E
|
||||
>a : E.a
|
||||
>b : E.b
|
||||
>c : E.c
|
||||
|
||||
var a: any;
|
||||
>a : any
|
||||
@@ -44,7 +44,7 @@ var r4 = null + 1;
|
||||
>r4 : number
|
||||
>null + 1 : number
|
||||
>null : null
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var r5 = null + c;
|
||||
>r5 : number
|
||||
@@ -56,17 +56,17 @@ var r6 = null + E.a;
|
||||
>r6 : number
|
||||
>null + E.a : number
|
||||
>null : null
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var r7 = null + E['a'];
|
||||
>r7 : number
|
||||
>null + E['a'] : number
|
||||
>null : null
|
||||
>E['a'] : E
|
||||
>E['a'] : E.a
|
||||
>E : typeof E
|
||||
>'a' : string
|
||||
>'a' : "a"
|
||||
|
||||
var r8 = b + null;
|
||||
>r8 : number
|
||||
@@ -77,7 +77,7 @@ var r8 = b + null;
|
||||
var r9 = 1 + null;
|
||||
>r9 : number
|
||||
>1 + null : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>null : null
|
||||
|
||||
var r10 = c + null
|
||||
@@ -89,17 +89,17 @@ var r10 = c + null
|
||||
var r11 = E.a + null;
|
||||
>r11 : number
|
||||
>E.a + null : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>null : null
|
||||
|
||||
var r12 = E['a'] + null;
|
||||
>r12 : number
|
||||
>E['a'] + null : number
|
||||
>E['a'] : E
|
||||
>E['a'] : E.a
|
||||
>E : typeof E
|
||||
>'a' : string
|
||||
>'a' : "a"
|
||||
>null : null
|
||||
|
||||
// null + string
|
||||
@@ -113,7 +113,7 @@ var r14 = null + '';
|
||||
>r14 : string
|
||||
>null + '' : string
|
||||
>null : null
|
||||
>'' : string
|
||||
>'' : ""
|
||||
|
||||
var r15 = d + null;
|
||||
>r15 : string
|
||||
@@ -124,6 +124,6 @@ var r15 = d + null;
|
||||
var r16 = '' + null;
|
||||
>r16 : string
|
||||
>'' + null : string
|
||||
>'' : string
|
||||
>'' : ""
|
||||
>null : null
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithNumberAndEnum.ts ===
|
||||
enum E { a, b }
|
||||
>E : E
|
||||
>a : E
|
||||
>b : E
|
||||
>a : E.a
|
||||
>b : E.b
|
||||
|
||||
enum F { c, d }
|
||||
>F : F
|
||||
>c : F
|
||||
>d : F
|
||||
>c : F.c
|
||||
>d : F.d
|
||||
|
||||
var a: number;
|
||||
>a : number
|
||||
@@ -48,46 +48,46 @@ var r4 = b + b;
|
||||
var r5 = 0 + a;
|
||||
>r5 : number
|
||||
>0 + a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>a : number
|
||||
|
||||
var r6 = E.a + 0;
|
||||
>r6 : number
|
||||
>E.a + 0 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>0 : number
|
||||
>a : E.a
|
||||
>0 : 0
|
||||
|
||||
var r7 = E.a + E.b;
|
||||
>r7 : number
|
||||
>E.a + E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var r8 = E['a'] + E['b'];
|
||||
>r8 : number
|
||||
>E['a'] + E['b'] : number
|
||||
>E['a'] : E
|
||||
>E['a'] : E.a
|
||||
>E : typeof E
|
||||
>'a' : string
|
||||
>E['b'] : E
|
||||
>'a' : "a"
|
||||
>E['b'] : E.b
|
||||
>E : typeof E
|
||||
>'b' : string
|
||||
>'b' : "b"
|
||||
|
||||
var r9 = E['a'] + F['c'];
|
||||
>r9 : number
|
||||
>E['a'] + F['c'] : number
|
||||
>E['a'] : E
|
||||
>E['a'] : E.a
|
||||
>E : typeof E
|
||||
>'a' : string
|
||||
>F['c'] : F
|
||||
>'a' : "a"
|
||||
>F['c'] : F.c
|
||||
>F : typeof F
|
||||
>'c' : string
|
||||
>'c' : "c"
|
||||
|
||||
var r10 = a + c;
|
||||
>r10 : number
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
=== tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithStringAndEveryType.ts ===
|
||||
enum E { a, b, c }
|
||||
>E : E
|
||||
>a : E
|
||||
>b : E
|
||||
>c : E
|
||||
>a : E.a
|
||||
>b : E.b
|
||||
>c : E.c
|
||||
|
||||
var a: any;
|
||||
>a : any
|
||||
@@ -129,21 +129,21 @@ var r16 = x + E.a;
|
||||
>r16 : string
|
||||
>x + E.a : string
|
||||
>x : string
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var r17 = x + '';
|
||||
>r17 : string
|
||||
>x + '' : string
|
||||
>x : string
|
||||
>'' : string
|
||||
>'' : ""
|
||||
|
||||
var r18 = x + 0;
|
||||
>r18 : string
|
||||
>x + 0 : string
|
||||
>x : string
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var r19 = x + { a: '' };
|
||||
>r19 : string
|
||||
@@ -151,7 +151,7 @@ var r19 = x + { a: '' };
|
||||
>x : string
|
||||
>{ a: '' } : { a: string; }
|
||||
>a : string
|
||||
>'' : string
|
||||
>'' : ""
|
||||
|
||||
var r20 = x + [];
|
||||
>r20 : string
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(15,10): error TS2365: Operator '+' cannot be applied to types 'Object' and 'Object'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(16,10): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(19,10): error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(20,10): error TS2365: Operator '+' cannot be applied to types 'true' and 'true'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(21,10): error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(22,11): error TS2365: Operator '+' cannot be applied to types 'void' and 'void'.
|
||||
tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOperatorWithUndefinedValueAndInvalidOperands.ts(23,11): error TS2365: Operator '+' cannot be applied to types '() => void' and '() => void'.
|
||||
@@ -47,7 +47,7 @@ tests/cases/conformance/expressions/binaryOperators/additionOperator/additionOpe
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'Number' and 'Number'.
|
||||
var r8 = undefined + true;
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'boolean' and 'boolean'.
|
||||
!!! error TS2365: Operator '+' cannot be applied to types 'true' and 'true'.
|
||||
var r9 = undefined + { a: '' };
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2365: Operator '+' cannot be applied to types '{ a: string; }' and '{ a: string; }'.
|
||||
|
||||
+15
-15
@@ -3,9 +3,9 @@
|
||||
|
||||
enum E { a, b, c }
|
||||
>E : E
|
||||
>a : E
|
||||
>b : E
|
||||
>c : E
|
||||
>a : E.a
|
||||
>b : E.b
|
||||
>c : E.c
|
||||
|
||||
var a: any;
|
||||
>a : any
|
||||
@@ -44,7 +44,7 @@ var r4 = undefined + 1;
|
||||
>r4 : number
|
||||
>undefined + 1 : number
|
||||
>undefined : undefined
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var r5 = undefined + c;
|
||||
>r5 : number
|
||||
@@ -56,17 +56,17 @@ var r6 = undefined + E.a;
|
||||
>r6 : number
|
||||
>undefined + E.a : number
|
||||
>undefined : undefined
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var r7 = undefined + E['a'];
|
||||
>r7 : number
|
||||
>undefined + E['a'] : number
|
||||
>undefined : undefined
|
||||
>E['a'] : E
|
||||
>E['a'] : E.a
|
||||
>E : typeof E
|
||||
>'a' : string
|
||||
>'a' : "a"
|
||||
|
||||
var r8 = b + undefined;
|
||||
>r8 : number
|
||||
@@ -77,7 +77,7 @@ var r8 = b + undefined;
|
||||
var r9 = 1 + undefined;
|
||||
>r9 : number
|
||||
>1 + undefined : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
>undefined : undefined
|
||||
|
||||
var r10 = c + undefined
|
||||
@@ -89,17 +89,17 @@ var r10 = c + undefined
|
||||
var r11 = E.a + undefined;
|
||||
>r11 : number
|
||||
>E.a + undefined : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>undefined : undefined
|
||||
|
||||
var r12 = E['a'] + undefined;
|
||||
>r12 : number
|
||||
>E['a'] + undefined : number
|
||||
>E['a'] : E
|
||||
>E['a'] : E.a
|
||||
>E : typeof E
|
||||
>'a' : string
|
||||
>'a' : "a"
|
||||
>undefined : undefined
|
||||
|
||||
// undefined + string
|
||||
@@ -113,7 +113,7 @@ var r14 = undefined + '';
|
||||
>r14 : string
|
||||
>undefined + '' : string
|
||||
>undefined : undefined
|
||||
>'' : string
|
||||
>'' : ""
|
||||
|
||||
var r15 = d + undefined;
|
||||
>r15 : string
|
||||
@@ -124,6 +124,6 @@ var r15 = d + undefined;
|
||||
var r16 = '' + undefined;
|
||||
>r16 : string
|
||||
>'' + undefined : string
|
||||
>'' : string
|
||||
>'' : ""
|
||||
>undefined : undefined
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
|
||||
tests/cases/compiler/aliasAssignments_1.ts(3,1): error TS2322: Type '1' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
|
||||
tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"' is not assignable to type 'number'.
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ tests/cases/compiler/aliasAssignments_1.ts(5,1): error TS2322: Type 'typeof "tes
|
||||
var x = moduleA;
|
||||
x = 1; // Should be error
|
||||
~
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
|
||||
!!! error TS2322: Type '1' is not assignable to type 'typeof "tests/cases/compiler/aliasAssignments_moduleA"'.
|
||||
var y = 1;
|
||||
y = moduleA; // should be error
|
||||
~
|
||||
|
||||
@@ -103,14 +103,14 @@ declare enum E2 {
|
||||
|
||||
a = 1,
|
||||
>a : E2
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
b,
|
||||
>b : E2
|
||||
|
||||
c = 2,
|
||||
>c : E2
|
||||
>2 : number
|
||||
>2 : 2
|
||||
|
||||
d
|
||||
>d : E2
|
||||
|
||||
@@ -6,13 +6,13 @@ declare enum E {
|
||||
|
||||
a = 10,
|
||||
>a : E
|
||||
>10 : number
|
||||
>10 : 10
|
||||
|
||||
b = 10 + 1,
|
||||
>b : E
|
||||
>10 + 1 : number
|
||||
>10 : number
|
||||
>1 : number
|
||||
>10 : 10
|
||||
>1 : 1
|
||||
|
||||
c = b,
|
||||
>c : E
|
||||
@@ -23,13 +23,13 @@ declare enum E {
|
||||
>(c) + 1 : number
|
||||
>(c) : E
|
||||
>c : E
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
e = 10 << 2 * 8,
|
||||
>e : E
|
||||
>10 << 2 * 8 : number
|
||||
>10 : number
|
||||
>10 : 10
|
||||
>2 * 8 : number
|
||||
>2 : number
|
||||
>8 : number
|
||||
>2 : 2
|
||||
>8 : 8
|
||||
}
|
||||
@@ -4,5 +4,5 @@ declare enum E {
|
||||
|
||||
e = 3
|
||||
>e : E
|
||||
>3 : number
|
||||
>3 : 3
|
||||
}
|
||||
@@ -4,6 +4,6 @@ declare enum E {
|
||||
|
||||
e = -3 // Negative
|
||||
>e : E
|
||||
>-3 : number
|
||||
>3 : number
|
||||
>-3 : -3
|
||||
>3 : 3
|
||||
}
|
||||
@@ -4,5 +4,5 @@ declare enum E {
|
||||
|
||||
e = 3.3 // Decimal
|
||||
>e : E
|
||||
>3.3 : number
|
||||
>3.3 : 3.3
|
||||
}
|
||||
@@ -4,5 +4,5 @@ declare enum E {
|
||||
|
||||
e = 0xA
|
||||
>e : E
|
||||
>0xA : number
|
||||
>0xA : 10
|
||||
}
|
||||
@@ -4,6 +4,6 @@ declare enum E {
|
||||
|
||||
e = -0xA
|
||||
>e : E
|
||||
>-0xA : number
|
||||
>0xA : number
|
||||
>-0xA : -10
|
||||
>0xA : 10
|
||||
}
|
||||
@@ -7,6 +7,6 @@ declare module M {
|
||||
|
||||
e = 3
|
||||
>e : E
|
||||
>3 : number
|
||||
>3 : 3
|
||||
}
|
||||
}
|
||||
@@ -5,11 +5,11 @@ declare module Foo.Bar { export var foo; };
|
||||
>foo : any
|
||||
|
||||
Foo.Bar.foo = 5;
|
||||
>Foo.Bar.foo = 5 : number
|
||||
>Foo.Bar.foo = 5 : 5
|
||||
>Foo.Bar.foo : any
|
||||
>Foo.Bar : typeof Foo.Bar
|
||||
>Foo : typeof Foo
|
||||
>Bar : typeof Foo.Bar
|
||||
>foo : any
|
||||
>5 : number
|
||||
>5 : 5
|
||||
|
||||
@@ -53,7 +53,7 @@ class TestClass2 {
|
||||
>x : any
|
||||
|
||||
return 0;
|
||||
>0 : number
|
||||
>0 : 0
|
||||
}
|
||||
|
||||
public foo(x: string): number;
|
||||
|
||||
@@ -19,8 +19,8 @@ export enum E1 {
|
||||
>E1 : E1
|
||||
|
||||
A,B,C
|
||||
>A : E1
|
||||
>B : E1
|
||||
>C : E1
|
||||
>A : E1.A
|
||||
>B : E1.B
|
||||
>C : E1.C
|
||||
}
|
||||
|
||||
@@ -49,11 +49,11 @@ export class C1 {
|
||||
|
||||
m1 = 42;
|
||||
>m1 : number
|
||||
>42 : number
|
||||
>42 : 42
|
||||
|
||||
static s1 = true;
|
||||
>s1 : boolean
|
||||
>true : boolean
|
||||
>true : true
|
||||
}
|
||||
|
||||
export interface I1 {
|
||||
@@ -81,8 +81,8 @@ export enum E1 {
|
||||
>E1 : E1
|
||||
|
||||
A,B,C
|
||||
>A : E1
|
||||
>B : E1
|
||||
>C : E1
|
||||
>A : E1.A
|
||||
>B : E1.B
|
||||
>C : E1.C
|
||||
}
|
||||
|
||||
@@ -8,11 +8,11 @@ class Foo {
|
||||
|
||||
constructor() {
|
||||
this.x = 5;
|
||||
>this.x = 5 : number
|
||||
>this.x = 5 : 5
|
||||
>this.x : number
|
||||
>this : this
|
||||
>x : number
|
||||
>5 : number
|
||||
>5 : 5
|
||||
}
|
||||
}
|
||||
export = Foo;
|
||||
|
||||
@@ -34,9 +34,9 @@ c.m(function(n) { return "hello: "+n; },18);
|
||||
>function(n) { return "hello: "+n; } : (n: number) => string
|
||||
>n : number
|
||||
>"hello: "+n : string
|
||||
>"hello: " : string
|
||||
>"hello: " : "hello: "
|
||||
>n : number
|
||||
>18 : number
|
||||
>18 : 18
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ var b = x('hello');
|
||||
>b : any
|
||||
>x('hello') : any
|
||||
>x : any
|
||||
>'hello' : string
|
||||
>'hello' : "hello"
|
||||
|
||||
var c = x(x);
|
||||
>c : any
|
||||
|
||||
@@ -24,8 +24,8 @@ var o = new Point(3, 4);
|
||||
>o : any
|
||||
>new Point(3, 4) : any
|
||||
>Point : (x: any, y: any) => void
|
||||
>3 : number
|
||||
>4 : number
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
var xx = o.x;
|
||||
>xx : any
|
||||
|
||||
@@ -246,7 +246,7 @@ module f {
|
||||
|
||||
export var bar = 1;
|
||||
>bar : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
}
|
||||
declare function foo15(x: typeof f): typeof f;
|
||||
>foo15 : { (x: typeof f): typeof f; (x: any): any; }
|
||||
@@ -273,7 +273,7 @@ module CC {
|
||||
|
||||
export var bar = 1;
|
||||
>bar : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
}
|
||||
declare function foo16(x: CC): CC;
|
||||
>foo16 : { (x: CC): CC; (x: any): any; }
|
||||
|
||||
@@ -187,7 +187,7 @@ module f {
|
||||
|
||||
export var bar = 1;
|
||||
>bar : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
}
|
||||
interface I15 {
|
||||
>I15 : I15
|
||||
@@ -210,7 +210,7 @@ module c {
|
||||
|
||||
export var bar = 1;
|
||||
>bar : number
|
||||
>1 : number
|
||||
>1 : 1
|
||||
}
|
||||
interface I16 {
|
||||
>I16 : I16
|
||||
|
||||
@@ -3,11 +3,11 @@ var x;
|
||||
>x : any
|
||||
|
||||
x.name = "hello";
|
||||
>x.name = "hello" : string
|
||||
>x.name = "hello" : "hello"
|
||||
>x.name : any
|
||||
>x : any
|
||||
>name : any
|
||||
>"hello" : string
|
||||
>"hello" : "hello"
|
||||
|
||||
var z = x + x;
|
||||
>z : any
|
||||
|
||||
@@ -12,14 +12,14 @@ var b = x['foo'];
|
||||
>b : any
|
||||
>x['foo'] : any
|
||||
>x : any
|
||||
>'foo' : string
|
||||
>'foo' : "foo"
|
||||
|
||||
var c = x['fn']();
|
||||
>c : any
|
||||
>x['fn']() : any
|
||||
>x['fn'] : any
|
||||
>x : any
|
||||
>'fn' : string
|
||||
>'fn' : "fn"
|
||||
|
||||
var d = x.bar.baz;
|
||||
>d : any
|
||||
@@ -34,7 +34,7 @@ var e = x[0].foo;
|
||||
>x[0].foo : any
|
||||
>x[0] : any
|
||||
>x : any
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>foo : any
|
||||
|
||||
var f = x['0'].bar;
|
||||
@@ -42,6 +42,6 @@ var f = x['0'].bar;
|
||||
>x['0'].bar : any
|
||||
>x['0'] : any
|
||||
>x : any
|
||||
>'0' : string
|
||||
>'0' : "0"
|
||||
>bar : any
|
||||
|
||||
@@ -10,7 +10,7 @@ class C {
|
||||
|
||||
for (var i = 0; i < arguments.length; i++) {
|
||||
>i : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>i < arguments.length : boolean
|
||||
>i : number
|
||||
>arguments.length : number
|
||||
@@ -34,7 +34,7 @@ c.P(1,2,3);
|
||||
>c.P : (ii: number, j: number, k: number) => void
|
||||
>c : C
|
||||
>P : (ii: number, j: number, k: number) => void
|
||||
>1 : number
|
||||
>2 : number
|
||||
>3 : number
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
|
||||
@@ -6,5 +6,5 @@ function f() {
|
||||
>x : any
|
||||
>arguments[12] : any
|
||||
>arguments : IArguments
|
||||
>12 : number
|
||||
>12 : 12
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type 'number' is not assignable to type 'IArguments'.
|
||||
tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS2322: Type '10' is not assignable to type 'IArguments'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts (1 errors) ====
|
||||
@@ -6,5 +6,5 @@ tests/cases/compiler/argumentsBindsToFunctionScopeArgumentList.ts(3,5): error TS
|
||||
function foo(a) {
|
||||
arguments = 10; /// This shouldnt be of type number and result in error.
|
||||
~~~~~~~~~
|
||||
!!! error TS2322: Type 'number' is not assignable to type 'IArguments'.
|
||||
!!! error TS2322: Type '10' is not assignable to type 'IArguments'.
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/arithAssignTyping.ts(3,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/compiler/arithAssignTyping.ts(4,1): error TS2365: Operator '+=' cannot be applied to types 'typeof f' and 'number'.
|
||||
tests/cases/compiler/arithAssignTyping.ts(4,1): error TS2365: Operator '+=' cannot be applied to types 'typeof f' and '1'.
|
||||
tests/cases/compiler/arithAssignTyping.ts(5,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/arithAssignTyping.ts(6,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/compiler/arithAssignTyping.ts(7,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
@@ -20,7 +20,7 @@ tests/cases/compiler/arithAssignTyping.ts(14,1): error TS2362: The left-hand sid
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
f += 1; // error
|
||||
~~~~~~
|
||||
!!! error TS2365: Operator '+=' cannot be applied to types 'typeof f' and 'number'.
|
||||
!!! error TS2365: Operator '+=' cannot be applied to types 'typeof f' and '1'.
|
||||
f -= 1; // error
|
||||
~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
|
||||
@@ -22,30 +22,30 @@ var ra3 = a * 0;
|
||||
>ra3 : number
|
||||
>a * 0 : number
|
||||
>a : any
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var ra4 = 0 * a;
|
||||
>ra4 : number
|
||||
>0 * a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>a : any
|
||||
|
||||
var ra5 = 0 * 0;
|
||||
>ra5 : number
|
||||
>0 * 0 : number
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
var ra6 = b * 0;
|
||||
>ra6 : number
|
||||
>b * 0 : number
|
||||
>b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var ra7 = 0 * b;
|
||||
>ra7 : number
|
||||
>0 * b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>b : number
|
||||
|
||||
var ra8 = b * b;
|
||||
@@ -71,30 +71,30 @@ var rb3 = a / 0;
|
||||
>rb3 : number
|
||||
>a / 0 : number
|
||||
>a : any
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rb4 = 0 / a;
|
||||
>rb4 : number
|
||||
>0 / a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>a : any
|
||||
|
||||
var rb5 = 0 / 0;
|
||||
>rb5 : number
|
||||
>0 / 0 : number
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
var rb6 = b / 0;
|
||||
>rb6 : number
|
||||
>b / 0 : number
|
||||
>b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rb7 = 0 / b;
|
||||
>rb7 : number
|
||||
>0 / b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>b : number
|
||||
|
||||
var rb8 = b / b;
|
||||
@@ -120,30 +120,30 @@ var rc3 = a % 0;
|
||||
>rc3 : number
|
||||
>a % 0 : number
|
||||
>a : any
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rc4 = 0 % a;
|
||||
>rc4 : number
|
||||
>0 % a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>a : any
|
||||
|
||||
var rc5 = 0 % 0;
|
||||
>rc5 : number
|
||||
>0 % 0 : number
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
var rc6 = b % 0;
|
||||
>rc6 : number
|
||||
>b % 0 : number
|
||||
>b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rc7 = 0 % b;
|
||||
>rc7 : number
|
||||
>0 % b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>b : number
|
||||
|
||||
var rc8 = b % b;
|
||||
@@ -169,30 +169,30 @@ var rd3 = a - 0;
|
||||
>rd3 : number
|
||||
>a - 0 : number
|
||||
>a : any
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rd4 = 0 - a;
|
||||
>rd4 : number
|
||||
>0 - a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>a : any
|
||||
|
||||
var rd5 = 0 - 0;
|
||||
>rd5 : number
|
||||
>0 - 0 : number
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
var rd6 = b - 0;
|
||||
>rd6 : number
|
||||
>b - 0 : number
|
||||
>b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rd7 = 0 - b;
|
||||
>rd7 : number
|
||||
>0 - b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>b : number
|
||||
|
||||
var rd8 = b - b;
|
||||
@@ -218,30 +218,30 @@ var re3 = a << 0;
|
||||
>re3 : number
|
||||
>a << 0 : number
|
||||
>a : any
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var re4 = 0 << a;
|
||||
>re4 : number
|
||||
>0 << a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>a : any
|
||||
|
||||
var re5 = 0 << 0;
|
||||
>re5 : number
|
||||
>0 << 0 : number
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
var re6 = b << 0;
|
||||
>re6 : number
|
||||
>b << 0 : number
|
||||
>b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var re7 = 0 << b;
|
||||
>re7 : number
|
||||
>0 << b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>b : number
|
||||
|
||||
var re8 = b << b;
|
||||
@@ -267,30 +267,30 @@ var rf3 = a >> 0;
|
||||
>rf3 : number
|
||||
>a >> 0 : number
|
||||
>a : any
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rf4 = 0 >> a;
|
||||
>rf4 : number
|
||||
>0 >> a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>a : any
|
||||
|
||||
var rf5 = 0 >> 0;
|
||||
>rf5 : number
|
||||
>0 >> 0 : number
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
var rf6 = b >> 0;
|
||||
>rf6 : number
|
||||
>b >> 0 : number
|
||||
>b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rf7 = 0 >> b;
|
||||
>rf7 : number
|
||||
>0 >> b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>b : number
|
||||
|
||||
var rf8 = b >> b;
|
||||
@@ -316,30 +316,30 @@ var rg3 = a >>> 0;
|
||||
>rg3 : number
|
||||
>a >>> 0 : number
|
||||
>a : any
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rg4 = 0 >>> a;
|
||||
>rg4 : number
|
||||
>0 >>> a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>a : any
|
||||
|
||||
var rg5 = 0 >>> 0;
|
||||
>rg5 : number
|
||||
>0 >>> 0 : number
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
var rg6 = b >>> 0;
|
||||
>rg6 : number
|
||||
>b >>> 0 : number
|
||||
>b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rg7 = 0 >>> b;
|
||||
>rg7 : number
|
||||
>0 >>> b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>b : number
|
||||
|
||||
var rg8 = b >>> b;
|
||||
@@ -365,30 +365,30 @@ var rh3 = a & 0;
|
||||
>rh3 : number
|
||||
>a & 0 : number
|
||||
>a : any
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rh4 = 0 & a;
|
||||
>rh4 : number
|
||||
>0 & a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>a : any
|
||||
|
||||
var rh5 = 0 & 0;
|
||||
>rh5 : number
|
||||
>0 & 0 : number
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
var rh6 = b & 0;
|
||||
>rh6 : number
|
||||
>b & 0 : number
|
||||
>b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rh7 = 0 & b;
|
||||
>rh7 : number
|
||||
>0 & b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>b : number
|
||||
|
||||
var rh8 = b & b;
|
||||
@@ -414,30 +414,30 @@ var ri3 = a ^ 0;
|
||||
>ri3 : number
|
||||
>a ^ 0 : number
|
||||
>a : any
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var ri4 = 0 ^ a;
|
||||
>ri4 : number
|
||||
>0 ^ a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>a : any
|
||||
|
||||
var ri5 = 0 ^ 0;
|
||||
>ri5 : number
|
||||
>0 ^ 0 : number
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
var ri6 = b ^ 0;
|
||||
>ri6 : number
|
||||
>b ^ 0 : number
|
||||
>b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var ri7 = 0 ^ b;
|
||||
>ri7 : number
|
||||
>0 ^ b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>b : number
|
||||
|
||||
var ri8 = b ^ b;
|
||||
@@ -463,30 +463,30 @@ var rj3 = a | 0;
|
||||
>rj3 : number
|
||||
>a | 0 : number
|
||||
>a : any
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rj4 = 0 | a;
|
||||
>rj4 : number
|
||||
>0 | a : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>a : any
|
||||
|
||||
var rj5 = 0 | 0;
|
||||
>rj5 : number
|
||||
>0 | 0 : number
|
||||
>0 : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>0 : 0
|
||||
|
||||
var rj6 = b | 0;
|
||||
>rj6 : number
|
||||
>b | 0 : number
|
||||
>b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
|
||||
var rj7 = 0 | b;
|
||||
>rj7 : number
|
||||
>0 | b : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>b : number
|
||||
|
||||
var rj8 = b | b;
|
||||
|
||||
@@ -5,10 +5,10 @@ enum E {
|
||||
>E : E
|
||||
|
||||
a,
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
b
|
||||
>b : E
|
||||
>b : E.b
|
||||
}
|
||||
|
||||
var a: any;
|
||||
@@ -55,60 +55,60 @@ var ra5 = b * c;
|
||||
var ra6 = E.a * a;
|
||||
>ra6 : number
|
||||
>E.a * a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var ra7 = E.a * b;
|
||||
>ra7 : number
|
||||
>E.a * b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var ra8 = E.a * E.b;
|
||||
>ra8 : number
|
||||
>E.a * E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ra9 = E.a * 1;
|
||||
>ra9 : number
|
||||
>E.a * 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var ra10 = a * E.b;
|
||||
>ra10 : number
|
||||
>a * E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ra11 = b * E.b;
|
||||
>ra11 : number
|
||||
>b * E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ra12 = 1 * E.b;
|
||||
>ra12 : number
|
||||
>1 * E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator /
|
||||
var rb1 = c / a;
|
||||
@@ -144,60 +144,60 @@ var rb5 = b / c;
|
||||
var rb6 = E.a / a;
|
||||
>rb6 : number
|
||||
>E.a / a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rb7 = E.a / b;
|
||||
>rb7 : number
|
||||
>E.a / b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rb8 = E.a / E.b;
|
||||
>rb8 : number
|
||||
>E.a / E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rb9 = E.a / 1;
|
||||
>rb9 : number
|
||||
>E.a / 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rb10 = a / E.b;
|
||||
>rb10 : number
|
||||
>a / E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rb11 = b / E.b;
|
||||
>rb11 : number
|
||||
>b / E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rb12 = 1 / E.b;
|
||||
>rb12 : number
|
||||
>1 / E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator %
|
||||
var rc1 = c % a;
|
||||
@@ -233,60 +233,60 @@ var rc5 = b % c;
|
||||
var rc6 = E.a % a;
|
||||
>rc6 : number
|
||||
>E.a % a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rc7 = E.a % b;
|
||||
>rc7 : number
|
||||
>E.a % b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rc8 = E.a % E.b;
|
||||
>rc8 : number
|
||||
>E.a % E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rc9 = E.a % 1;
|
||||
>rc9 : number
|
||||
>E.a % 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rc10 = a % E.b;
|
||||
>rc10 : number
|
||||
>a % E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rc11 = b % E.b;
|
||||
>rc11 : number
|
||||
>b % E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rc12 = 1 % E.b;
|
||||
>rc12 : number
|
||||
>1 % E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator -
|
||||
var rd1 = c - a;
|
||||
@@ -322,60 +322,60 @@ var rd5 = b - c;
|
||||
var rd6 = E.a - a;
|
||||
>rd6 : number
|
||||
>E.a - a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rd7 = E.a - b;
|
||||
>rd7 : number
|
||||
>E.a - b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rd8 = E.a - E.b;
|
||||
>rd8 : number
|
||||
>E.a - E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rd9 = E.a - 1;
|
||||
>rd9 : number
|
||||
>E.a - 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rd10 = a - E.b;
|
||||
>rd10 : number
|
||||
>a - E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rd11 = b - E.b;
|
||||
>rd11 : number
|
||||
>b - E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rd12 = 1 - E.b;
|
||||
>rd12 : number
|
||||
>1 - E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator <<
|
||||
var re1 = c << a;
|
||||
@@ -411,60 +411,60 @@ var re5 = b << c;
|
||||
var re6 = E.a << a;
|
||||
>re6 : number
|
||||
>E.a << a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var re7 = E.a << b;
|
||||
>re7 : number
|
||||
>E.a << b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var re8 = E.a << E.b;
|
||||
>re8 : number
|
||||
>E.a << E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var re9 = E.a << 1;
|
||||
>re9 : number
|
||||
>E.a << 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var re10 = a << E.b;
|
||||
>re10 : number
|
||||
>a << E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var re11 = b << E.b;
|
||||
>re11 : number
|
||||
>b << E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var re12 = 1 << E.b;
|
||||
>re12 : number
|
||||
>1 << E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator >>
|
||||
var rf1 = c >> a;
|
||||
@@ -500,60 +500,60 @@ var rf5 = b >> c;
|
||||
var rf6 = E.a >> a;
|
||||
>rf6 : number
|
||||
>E.a >> a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rf7 = E.a >> b;
|
||||
>rf7 : number
|
||||
>E.a >> b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rf8 = E.a >> E.b;
|
||||
>rf8 : number
|
||||
>E.a >> E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rf9 = E.a >> 1;
|
||||
>rf9 : number
|
||||
>E.a >> 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rf10 = a >> E.b;
|
||||
>rf10 : number
|
||||
>a >> E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rf11 = b >> E.b;
|
||||
>rf11 : number
|
||||
>b >> E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rf12 = 1 >> E.b;
|
||||
>rf12 : number
|
||||
>1 >> E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator >>>
|
||||
var rg1 = c >>> a;
|
||||
@@ -589,60 +589,60 @@ var rg5 = b >>> c;
|
||||
var rg6 = E.a >>> a;
|
||||
>rg6 : number
|
||||
>E.a >>> a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rg7 = E.a >>> b;
|
||||
>rg7 : number
|
||||
>E.a >>> b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rg8 = E.a >>> E.b;
|
||||
>rg8 : number
|
||||
>E.a >>> E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rg9 = E.a >>> 1;
|
||||
>rg9 : number
|
||||
>E.a >>> 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rg10 = a >>> E.b;
|
||||
>rg10 : number
|
||||
>a >>> E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rg11 = b >>> E.b;
|
||||
>rg11 : number
|
||||
>b >>> E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rg12 = 1 >>> E.b;
|
||||
>rg12 : number
|
||||
>1 >>> E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator &
|
||||
var rh1 = c & a;
|
||||
@@ -678,60 +678,60 @@ var rh5 = b & c;
|
||||
var rh6 = E.a & a;
|
||||
>rh6 : number
|
||||
>E.a & a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rh7 = E.a & b;
|
||||
>rh7 : number
|
||||
>E.a & b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rh8 = E.a & E.b;
|
||||
>rh8 : number
|
||||
>E.a & E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rh9 = E.a & 1;
|
||||
>rh9 : number
|
||||
>E.a & 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rh10 = a & E.b;
|
||||
>rh10 : number
|
||||
>a & E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rh11 = b & E.b;
|
||||
>rh11 : number
|
||||
>b & E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rh12 = 1 & E.b;
|
||||
>rh12 : number
|
||||
>1 & E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator ^
|
||||
var ri1 = c ^ a;
|
||||
@@ -767,60 +767,60 @@ var ri5 = b ^ c;
|
||||
var ri6 = E.a ^ a;
|
||||
>ri6 : number
|
||||
>E.a ^ a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var ri7 = E.a ^ b;
|
||||
>ri7 : number
|
||||
>E.a ^ b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var ri8 = E.a ^ E.b;
|
||||
>ri8 : number
|
||||
>E.a ^ E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ri9 = E.a ^ 1;
|
||||
>ri9 : number
|
||||
>E.a ^ 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var ri10 = a ^ E.b;
|
||||
>ri10 : number
|
||||
>a ^ E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ri11 = b ^ E.b;
|
||||
>ri11 : number
|
||||
>b ^ E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ri12 = 1 ^ E.b;
|
||||
>ri12 : number
|
||||
>1 ^ E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator |
|
||||
var rj1 = c | a;
|
||||
@@ -856,58 +856,58 @@ var rj5 = b | c;
|
||||
var rj6 = E.a | a;
|
||||
>rj6 : number
|
||||
>E.a | a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rj7 = E.a | b;
|
||||
>rj7 : number
|
||||
>E.a | b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rj8 = E.a | E.b;
|
||||
>rj8 : number
|
||||
>E.a | E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rj9 = E.a | 1;
|
||||
>rj9 : number
|
||||
>E.a | 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rj10 = a | E.b;
|
||||
>rj10 : number
|
||||
>a | E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rj11 = b | E.b;
|
||||
>rj11 : number
|
||||
>b | E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rj12 = 1 | E.b;
|
||||
>rj12 : number
|
||||
>1 | E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
@@ -5,19 +5,19 @@ enum E {
|
||||
>E : E
|
||||
|
||||
a,
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
b
|
||||
>b : E
|
||||
>b : E.b
|
||||
}
|
||||
enum F {
|
||||
>F : F
|
||||
|
||||
c,
|
||||
>c : F
|
||||
>c : F.c
|
||||
|
||||
d
|
||||
>d : F
|
||||
>d : F.d
|
||||
}
|
||||
|
||||
var a: any;
|
||||
@@ -65,60 +65,60 @@ var ra5 = b * c;
|
||||
var ra6 = E.a * a;
|
||||
>ra6 : number
|
||||
>E.a * a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var ra7 = E.a * b;
|
||||
>ra7 : number
|
||||
>E.a * b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var ra8 = E.a * E.b;
|
||||
>ra8 : number
|
||||
>E.a * E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ra9 = E.a * 1;
|
||||
>ra9 : number
|
||||
>E.a * 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var ra10 = a * E.b;
|
||||
>ra10 : number
|
||||
>a * E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ra11 = b * E.b;
|
||||
>ra11 : number
|
||||
>b * E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ra12 = 1 * E.b;
|
||||
>ra12 : number
|
||||
>1 * E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator /
|
||||
var rb1 = c / a;
|
||||
@@ -154,60 +154,60 @@ var rb5 = b / c;
|
||||
var rb6 = E.a / a;
|
||||
>rb6 : number
|
||||
>E.a / a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rb7 = E.a / b;
|
||||
>rb7 : number
|
||||
>E.a / b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rb8 = E.a / E.b;
|
||||
>rb8 : number
|
||||
>E.a / E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rb9 = E.a / 1;
|
||||
>rb9 : number
|
||||
>E.a / 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rb10 = a / E.b;
|
||||
>rb10 : number
|
||||
>a / E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rb11 = b / E.b;
|
||||
>rb11 : number
|
||||
>b / E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rb12 = 1 / E.b;
|
||||
>rb12 : number
|
||||
>1 / E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator %
|
||||
var rc1 = c % a;
|
||||
@@ -243,60 +243,60 @@ var rc5 = b % c;
|
||||
var rc6 = E.a % a;
|
||||
>rc6 : number
|
||||
>E.a % a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rc7 = E.a % b;
|
||||
>rc7 : number
|
||||
>E.a % b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rc8 = E.a % E.b;
|
||||
>rc8 : number
|
||||
>E.a % E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rc9 = E.a % 1;
|
||||
>rc9 : number
|
||||
>E.a % 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rc10 = a % E.b;
|
||||
>rc10 : number
|
||||
>a % E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rc11 = b % E.b;
|
||||
>rc11 : number
|
||||
>b % E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rc12 = 1 % E.b;
|
||||
>rc12 : number
|
||||
>1 % E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator -
|
||||
var rd1 = c - a;
|
||||
@@ -332,60 +332,60 @@ var rd5 = b - c;
|
||||
var rd6 = E.a - a;
|
||||
>rd6 : number
|
||||
>E.a - a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rd7 = E.a - b;
|
||||
>rd7 : number
|
||||
>E.a - b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rd8 = E.a - E.b;
|
||||
>rd8 : number
|
||||
>E.a - E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rd9 = E.a - 1;
|
||||
>rd9 : number
|
||||
>E.a - 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rd10 = a - E.b;
|
||||
>rd10 : number
|
||||
>a - E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rd11 = b - E.b;
|
||||
>rd11 : number
|
||||
>b - E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rd12 = 1 - E.b;
|
||||
>rd12 : number
|
||||
>1 - E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator <<
|
||||
var re1 = c << a;
|
||||
@@ -421,60 +421,60 @@ var re5 = b << c;
|
||||
var re6 = E.a << a;
|
||||
>re6 : number
|
||||
>E.a << a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var re7 = E.a << b;
|
||||
>re7 : number
|
||||
>E.a << b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var re8 = E.a << E.b;
|
||||
>re8 : number
|
||||
>E.a << E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var re9 = E.a << 1;
|
||||
>re9 : number
|
||||
>E.a << 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var re10 = a << E.b;
|
||||
>re10 : number
|
||||
>a << E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var re11 = b << E.b;
|
||||
>re11 : number
|
||||
>b << E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var re12 = 1 << E.b;
|
||||
>re12 : number
|
||||
>1 << E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator >>
|
||||
var rf1 = c >> a;
|
||||
@@ -510,60 +510,60 @@ var rf5 = b >> c;
|
||||
var rf6 = E.a >> a;
|
||||
>rf6 : number
|
||||
>E.a >> a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rf7 = E.a >> b;
|
||||
>rf7 : number
|
||||
>E.a >> b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rf8 = E.a >> E.b;
|
||||
>rf8 : number
|
||||
>E.a >> E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rf9 = E.a >> 1;
|
||||
>rf9 : number
|
||||
>E.a >> 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rf10 = a >> E.b;
|
||||
>rf10 : number
|
||||
>a >> E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rf11 = b >> E.b;
|
||||
>rf11 : number
|
||||
>b >> E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rf12 = 1 >> E.b;
|
||||
>rf12 : number
|
||||
>1 >> E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator >>>
|
||||
var rg1 = c >>> a;
|
||||
@@ -599,60 +599,60 @@ var rg5 = b >>> c;
|
||||
var rg6 = E.a >>> a;
|
||||
>rg6 : number
|
||||
>E.a >>> a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rg7 = E.a >>> b;
|
||||
>rg7 : number
|
||||
>E.a >>> b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rg8 = E.a >>> E.b;
|
||||
>rg8 : number
|
||||
>E.a >>> E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rg9 = E.a >>> 1;
|
||||
>rg9 : number
|
||||
>E.a >>> 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rg10 = a >>> E.b;
|
||||
>rg10 : number
|
||||
>a >>> E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rg11 = b >>> E.b;
|
||||
>rg11 : number
|
||||
>b >>> E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rg12 = 1 >>> E.b;
|
||||
>rg12 : number
|
||||
>1 >>> E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator &
|
||||
var rh1 = c & a;
|
||||
@@ -688,60 +688,60 @@ var rh5 = b & c;
|
||||
var rh6 = E.a & a;
|
||||
>rh6 : number
|
||||
>E.a & a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rh7 = E.a & b;
|
||||
>rh7 : number
|
||||
>E.a & b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rh8 = E.a & E.b;
|
||||
>rh8 : number
|
||||
>E.a & E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rh9 = E.a & 1;
|
||||
>rh9 : number
|
||||
>E.a & 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rh10 = a & E.b;
|
||||
>rh10 : number
|
||||
>a & E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rh11 = b & E.b;
|
||||
>rh11 : number
|
||||
>b & E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rh12 = 1 & E.b;
|
||||
>rh12 : number
|
||||
>1 & E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator ^
|
||||
var ri1 = c ^ a;
|
||||
@@ -777,60 +777,60 @@ var ri5 = b ^ c;
|
||||
var ri6 = E.a ^ a;
|
||||
>ri6 : number
|
||||
>E.a ^ a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var ri7 = E.a ^ b;
|
||||
>ri7 : number
|
||||
>E.a ^ b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var ri8 = E.a ^ E.b;
|
||||
>ri8 : number
|
||||
>E.a ^ E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ri9 = E.a ^ 1;
|
||||
>ri9 : number
|
||||
>E.a ^ 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var ri10 = a ^ E.b;
|
||||
>ri10 : number
|
||||
>a ^ E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ri11 = b ^ E.b;
|
||||
>ri11 : number
|
||||
>b ^ E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var ri12 = 1 ^ E.b;
|
||||
>ri12 : number
|
||||
>1 ^ E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
// operator |
|
||||
var rj1 = c | a;
|
||||
@@ -866,58 +866,58 @@ var rj5 = b | c;
|
||||
var rj6 = E.a | a;
|
||||
>rj6 : number
|
||||
>E.a | a : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>a : any
|
||||
|
||||
var rj7 = E.a | b;
|
||||
>rj7 : number
|
||||
>E.a | b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
>b : number
|
||||
|
||||
var rj8 = E.a | E.b;
|
||||
>rj8 : number
|
||||
>E.a | E.b : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>E.b : E
|
||||
>a : E.a
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rj9 = E.a | 1;
|
||||
>rj9 : number
|
||||
>E.a | 1 : number
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>1 : number
|
||||
>a : E.a
|
||||
>1 : 1
|
||||
|
||||
var rj10 = a | E.b;
|
||||
>rj10 : number
|
||||
>a | E.b : number
|
||||
>a : any
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rj11 = b | E.b;
|
||||
>rj11 : number
|
||||
>b | E.b : number
|
||||
>b : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
var rj12 = 1 | E.b;
|
||||
>rj12 : number
|
||||
>1 | E.b : number
|
||||
>1 : number
|
||||
>E.b : E
|
||||
>1 : 1
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
|
||||
@@ -6,10 +6,10 @@ enum E {
|
||||
>E : E
|
||||
|
||||
a,
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
b
|
||||
>b : E
|
||||
>b : E.b
|
||||
}
|
||||
|
||||
var a: any;
|
||||
@@ -35,15 +35,15 @@ var ra3 = null * 1;
|
||||
>ra3 : number
|
||||
>null * 1 : number
|
||||
>null : null
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var ra4 = null * E.a;
|
||||
>ra4 : number
|
||||
>null * E.a : number
|
||||
>null : null
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var ra5 = a * null;
|
||||
>ra5 : number
|
||||
@@ -60,15 +60,15 @@ var ra6 = b * null;
|
||||
var ra7 = 0 * null;
|
||||
>ra7 : number
|
||||
>0 * null : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>null : null
|
||||
|
||||
var ra8 = E.b * null;
|
||||
>ra8 : number
|
||||
>E.b * null : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>null : null
|
||||
|
||||
// operator /
|
||||
@@ -88,15 +88,15 @@ var rb3 = null / 1;
|
||||
>rb3 : number
|
||||
>null / 1 : number
|
||||
>null : null
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rb4 = null / E.a;
|
||||
>rb4 : number
|
||||
>null / E.a : number
|
||||
>null : null
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rb5 = a / null;
|
||||
>rb5 : number
|
||||
@@ -113,15 +113,15 @@ var rb6 = b / null;
|
||||
var rb7 = 0 / null;
|
||||
>rb7 : number
|
||||
>0 / null : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>null : null
|
||||
|
||||
var rb8 = E.b / null;
|
||||
>rb8 : number
|
||||
>E.b / null : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>null : null
|
||||
|
||||
// operator %
|
||||
@@ -141,15 +141,15 @@ var rc3 = null % 1;
|
||||
>rc3 : number
|
||||
>null % 1 : number
|
||||
>null : null
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rc4 = null % E.a;
|
||||
>rc4 : number
|
||||
>null % E.a : number
|
||||
>null : null
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rc5 = a % null;
|
||||
>rc5 : number
|
||||
@@ -166,15 +166,15 @@ var rc6 = b % null;
|
||||
var rc7 = 0 % null;
|
||||
>rc7 : number
|
||||
>0 % null : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>null : null
|
||||
|
||||
var rc8 = E.b % null;
|
||||
>rc8 : number
|
||||
>E.b % null : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>null : null
|
||||
|
||||
// operator -
|
||||
@@ -194,15 +194,15 @@ var rd3 = null - 1;
|
||||
>rd3 : number
|
||||
>null - 1 : number
|
||||
>null : null
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rd4 = null - E.a;
|
||||
>rd4 : number
|
||||
>null - E.a : number
|
||||
>null : null
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rd5 = a - null;
|
||||
>rd5 : number
|
||||
@@ -219,15 +219,15 @@ var rd6 = b - null;
|
||||
var rd7 = 0 - null;
|
||||
>rd7 : number
|
||||
>0 - null : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>null : null
|
||||
|
||||
var rd8 = E.b - null;
|
||||
>rd8 : number
|
||||
>E.b - null : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>null : null
|
||||
|
||||
// operator <<
|
||||
@@ -247,15 +247,15 @@ var re3 = null << 1;
|
||||
>re3 : number
|
||||
>null << 1 : number
|
||||
>null : null
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var re4 = null << E.a;
|
||||
>re4 : number
|
||||
>null << E.a : number
|
||||
>null : null
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var re5 = a << null;
|
||||
>re5 : number
|
||||
@@ -272,15 +272,15 @@ var re6 = b << null;
|
||||
var re7 = 0 << null;
|
||||
>re7 : number
|
||||
>0 << null : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>null : null
|
||||
|
||||
var re8 = E.b << null;
|
||||
>re8 : number
|
||||
>E.b << null : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>null : null
|
||||
|
||||
// operator >>
|
||||
@@ -300,15 +300,15 @@ var rf3 = null >> 1;
|
||||
>rf3 : number
|
||||
>null >> 1 : number
|
||||
>null : null
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rf4 = null >> E.a;
|
||||
>rf4 : number
|
||||
>null >> E.a : number
|
||||
>null : null
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rf5 = a >> null;
|
||||
>rf5 : number
|
||||
@@ -325,15 +325,15 @@ var rf6 = b >> null;
|
||||
var rf7 = 0 >> null;
|
||||
>rf7 : number
|
||||
>0 >> null : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>null : null
|
||||
|
||||
var rf8 = E.b >> null;
|
||||
>rf8 : number
|
||||
>E.b >> null : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>null : null
|
||||
|
||||
// operator >>>
|
||||
@@ -353,15 +353,15 @@ var rg3 = null >>> 1;
|
||||
>rg3 : number
|
||||
>null >>> 1 : number
|
||||
>null : null
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rg4 = null >>> E.a;
|
||||
>rg4 : number
|
||||
>null >>> E.a : number
|
||||
>null : null
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rg5 = a >>> null;
|
||||
>rg5 : number
|
||||
@@ -378,15 +378,15 @@ var rg6 = b >>> null;
|
||||
var rg7 = 0 >>> null;
|
||||
>rg7 : number
|
||||
>0 >>> null : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>null : null
|
||||
|
||||
var rg8 = E.b >>> null;
|
||||
>rg8 : number
|
||||
>E.b >>> null : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>null : null
|
||||
|
||||
// operator &
|
||||
@@ -406,15 +406,15 @@ var rh3 = null & 1;
|
||||
>rh3 : number
|
||||
>null & 1 : number
|
||||
>null : null
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rh4 = null & E.a;
|
||||
>rh4 : number
|
||||
>null & E.a : number
|
||||
>null : null
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rh5 = a & null;
|
||||
>rh5 : number
|
||||
@@ -431,15 +431,15 @@ var rh6 = b & null;
|
||||
var rh7 = 0 & null;
|
||||
>rh7 : number
|
||||
>0 & null : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>null : null
|
||||
|
||||
var rh8 = E.b & null;
|
||||
>rh8 : number
|
||||
>E.b & null : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>null : null
|
||||
|
||||
// operator ^
|
||||
@@ -459,15 +459,15 @@ var ri3 = null ^ 1;
|
||||
>ri3 : number
|
||||
>null ^ 1 : number
|
||||
>null : null
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var ri4 = null ^ E.a;
|
||||
>ri4 : number
|
||||
>null ^ E.a : number
|
||||
>null : null
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var ri5 = a ^ null;
|
||||
>ri5 : number
|
||||
@@ -484,15 +484,15 @@ var ri6 = b ^ null;
|
||||
var ri7 = 0 ^ null;
|
||||
>ri7 : number
|
||||
>0 ^ null : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>null : null
|
||||
|
||||
var ri8 = E.b ^ null;
|
||||
>ri8 : number
|
||||
>E.b ^ null : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>null : null
|
||||
|
||||
// operator |
|
||||
@@ -512,15 +512,15 @@ var rj3 = null | 1;
|
||||
>rj3 : number
|
||||
>null | 1 : number
|
||||
>null : null
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rj4 = null | E.a;
|
||||
>rj4 : number
|
||||
>null | E.a : number
|
||||
>null : null
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rj5 = a | null;
|
||||
>rj5 : number
|
||||
@@ -537,14 +537,14 @@ var rj6 = b | null;
|
||||
var rj7 = 0 | null;
|
||||
>rj7 : number
|
||||
>0 | null : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>null : null
|
||||
|
||||
var rj8 = E.b | null;
|
||||
>rj8 : number
|
||||
>E.b | null : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>null : null
|
||||
|
||||
+62
-62
@@ -6,10 +6,10 @@ enum E {
|
||||
>E : E
|
||||
|
||||
a,
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
b
|
||||
>b : E
|
||||
>b : E.b
|
||||
}
|
||||
|
||||
var a: any;
|
||||
@@ -35,15 +35,15 @@ var ra3 = undefined * 1;
|
||||
>ra3 : number
|
||||
>undefined * 1 : number
|
||||
>undefined : undefined
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var ra4 = undefined * E.a;
|
||||
>ra4 : number
|
||||
>undefined * E.a : number
|
||||
>undefined : undefined
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var ra5 = a * undefined;
|
||||
>ra5 : number
|
||||
@@ -60,15 +60,15 @@ var ra6 = b * undefined;
|
||||
var ra7 = 0 * undefined;
|
||||
>ra7 : number
|
||||
>0 * undefined : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>undefined : undefined
|
||||
|
||||
var ra8 = E.b * undefined;
|
||||
>ra8 : number
|
||||
>E.b * undefined : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>undefined : undefined
|
||||
|
||||
// operator /
|
||||
@@ -88,15 +88,15 @@ var rb3 = undefined / 1;
|
||||
>rb3 : number
|
||||
>undefined / 1 : number
|
||||
>undefined : undefined
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rb4 = undefined / E.a;
|
||||
>rb4 : number
|
||||
>undefined / E.a : number
|
||||
>undefined : undefined
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rb5 = a / undefined;
|
||||
>rb5 : number
|
||||
@@ -113,15 +113,15 @@ var rb6 = b / undefined;
|
||||
var rb7 = 0 / undefined;
|
||||
>rb7 : number
|
||||
>0 / undefined : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>undefined : undefined
|
||||
|
||||
var rb8 = E.b / undefined;
|
||||
>rb8 : number
|
||||
>E.b / undefined : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>undefined : undefined
|
||||
|
||||
// operator %
|
||||
@@ -141,15 +141,15 @@ var rc3 = undefined % 1;
|
||||
>rc3 : number
|
||||
>undefined % 1 : number
|
||||
>undefined : undefined
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rc4 = undefined % E.a;
|
||||
>rc4 : number
|
||||
>undefined % E.a : number
|
||||
>undefined : undefined
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rc5 = a % undefined;
|
||||
>rc5 : number
|
||||
@@ -166,15 +166,15 @@ var rc6 = b % undefined;
|
||||
var rc7 = 0 % undefined;
|
||||
>rc7 : number
|
||||
>0 % undefined : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>undefined : undefined
|
||||
|
||||
var rc8 = E.b % undefined;
|
||||
>rc8 : number
|
||||
>E.b % undefined : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>undefined : undefined
|
||||
|
||||
// operator -
|
||||
@@ -194,15 +194,15 @@ var rd3 = undefined - 1;
|
||||
>rd3 : number
|
||||
>undefined - 1 : number
|
||||
>undefined : undefined
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rd4 = undefined - E.a;
|
||||
>rd4 : number
|
||||
>undefined - E.a : number
|
||||
>undefined : undefined
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rd5 = a - undefined;
|
||||
>rd5 : number
|
||||
@@ -219,15 +219,15 @@ var rd6 = b - undefined;
|
||||
var rd7 = 0 - undefined;
|
||||
>rd7 : number
|
||||
>0 - undefined : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>undefined : undefined
|
||||
|
||||
var rd8 = E.b - undefined;
|
||||
>rd8 : number
|
||||
>E.b - undefined : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>undefined : undefined
|
||||
|
||||
// operator <<
|
||||
@@ -247,15 +247,15 @@ var re3 = undefined << 1;
|
||||
>re3 : number
|
||||
>undefined << 1 : number
|
||||
>undefined : undefined
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var re4 = undefined << E.a;
|
||||
>re4 : number
|
||||
>undefined << E.a : number
|
||||
>undefined : undefined
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var re5 = a << undefined;
|
||||
>re5 : number
|
||||
@@ -272,15 +272,15 @@ var re6 = b << undefined;
|
||||
var re7 = 0 << undefined;
|
||||
>re7 : number
|
||||
>0 << undefined : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>undefined : undefined
|
||||
|
||||
var re8 = E.b << undefined;
|
||||
>re8 : number
|
||||
>E.b << undefined : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>undefined : undefined
|
||||
|
||||
// operator >>
|
||||
@@ -300,15 +300,15 @@ var rf3 = undefined >> 1;
|
||||
>rf3 : number
|
||||
>undefined >> 1 : number
|
||||
>undefined : undefined
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rf4 = undefined >> E.a;
|
||||
>rf4 : number
|
||||
>undefined >> E.a : number
|
||||
>undefined : undefined
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rf5 = a >> undefined;
|
||||
>rf5 : number
|
||||
@@ -325,15 +325,15 @@ var rf6 = b >> undefined;
|
||||
var rf7 = 0 >> undefined;
|
||||
>rf7 : number
|
||||
>0 >> undefined : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>undefined : undefined
|
||||
|
||||
var rf8 = E.b >> undefined;
|
||||
>rf8 : number
|
||||
>E.b >> undefined : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>undefined : undefined
|
||||
|
||||
// operator >>>
|
||||
@@ -353,15 +353,15 @@ var rg3 = undefined >>> 1;
|
||||
>rg3 : number
|
||||
>undefined >>> 1 : number
|
||||
>undefined : undefined
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rg4 = undefined >>> E.a;
|
||||
>rg4 : number
|
||||
>undefined >>> E.a : number
|
||||
>undefined : undefined
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rg5 = a >>> undefined;
|
||||
>rg5 : number
|
||||
@@ -378,15 +378,15 @@ var rg6 = b >>> undefined;
|
||||
var rg7 = 0 >>> undefined;
|
||||
>rg7 : number
|
||||
>0 >>> undefined : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>undefined : undefined
|
||||
|
||||
var rg8 = E.b >>> undefined;
|
||||
>rg8 : number
|
||||
>E.b >>> undefined : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>undefined : undefined
|
||||
|
||||
// operator &
|
||||
@@ -406,15 +406,15 @@ var rh3 = undefined & 1;
|
||||
>rh3 : number
|
||||
>undefined & 1 : number
|
||||
>undefined : undefined
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rh4 = undefined & E.a;
|
||||
>rh4 : number
|
||||
>undefined & E.a : number
|
||||
>undefined : undefined
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rh5 = a & undefined;
|
||||
>rh5 : number
|
||||
@@ -431,15 +431,15 @@ var rh6 = b & undefined;
|
||||
var rh7 = 0 & undefined;
|
||||
>rh7 : number
|
||||
>0 & undefined : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>undefined : undefined
|
||||
|
||||
var rh8 = E.b & undefined;
|
||||
>rh8 : number
|
||||
>E.b & undefined : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>undefined : undefined
|
||||
|
||||
// operator ^
|
||||
@@ -459,15 +459,15 @@ var ri3 = undefined ^ 1;
|
||||
>ri3 : number
|
||||
>undefined ^ 1 : number
|
||||
>undefined : undefined
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var ri4 = undefined ^ E.a;
|
||||
>ri4 : number
|
||||
>undefined ^ E.a : number
|
||||
>undefined : undefined
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var ri5 = a ^ undefined;
|
||||
>ri5 : number
|
||||
@@ -484,15 +484,15 @@ var ri6 = b ^ undefined;
|
||||
var ri7 = 0 ^ undefined;
|
||||
>ri7 : number
|
||||
>0 ^ undefined : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>undefined : undefined
|
||||
|
||||
var ri8 = E.b ^ undefined;
|
||||
>ri8 : number
|
||||
>E.b ^ undefined : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>undefined : undefined
|
||||
|
||||
// operator |
|
||||
@@ -512,15 +512,15 @@ var rj3 = undefined | 1;
|
||||
>rj3 : number
|
||||
>undefined | 1 : number
|
||||
>undefined : undefined
|
||||
>1 : number
|
||||
>1 : 1
|
||||
|
||||
var rj4 = undefined | E.a;
|
||||
>rj4 : number
|
||||
>undefined | E.a : number
|
||||
>undefined : undefined
|
||||
>E.a : E
|
||||
>E.a : E.a
|
||||
>E : typeof E
|
||||
>a : E
|
||||
>a : E.a
|
||||
|
||||
var rj5 = a | undefined;
|
||||
>rj5 : number
|
||||
@@ -537,14 +537,14 @@ var rj6 = b | undefined;
|
||||
var rj7 = 0 | undefined;
|
||||
>rj7 : number
|
||||
>0 | undefined : number
|
||||
>0 : number
|
||||
>0 : 0
|
||||
>undefined : undefined
|
||||
|
||||
var rj8 = E.b | undefined;
|
||||
>rj8 : number
|
||||
>E.b | undefined : number
|
||||
>E.b : E
|
||||
>E.b : E.b
|
||||
>E : typeof E
|
||||
>b : E
|
||||
>b : E.b
|
||||
>undefined : undefined
|
||||
|
||||
Loaded 100 of 2221 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user