mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #1308 from Microsoft/expressionCleanup
Expression parsing comments.
This commit is contained in:
+10
-10
@@ -66,9 +66,9 @@ module ts {
|
||||
export function bindSourceFile(file: SourceFile) {
|
||||
|
||||
var parent: Node;
|
||||
var container: Declaration;
|
||||
var container: Node;
|
||||
var blockScopeContainer: Node;
|
||||
var lastContainer: Declaration;
|
||||
var lastContainer: Node;
|
||||
var symbolCount = 0;
|
||||
var Symbol = objectAllocator.getSymbolConstructor();
|
||||
|
||||
@@ -222,7 +222,7 @@ module ts {
|
||||
|
||||
// All container nodes are kept on a linked list in declaration order. This list is used by the getLocalNameOfContainer function
|
||||
// in the type checker to validate that the local name used for a container is unique.
|
||||
function bindChildren(node: Declaration, symbolKind: SymbolFlags, isBlockScopeContainer: boolean) {
|
||||
function bindChildren(node: Node, symbolKind: SymbolFlags, isBlockScopeContainer: boolean) {
|
||||
if (symbolKind & SymbolFlags.HasLocals) {
|
||||
node.locals = {};
|
||||
}
|
||||
@@ -279,7 +279,7 @@ module ts {
|
||||
break;
|
||||
}
|
||||
case SyntaxKind.TypeLiteral:
|
||||
case SyntaxKind.ObjectLiteral:
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
declareSymbol(container.symbol.members, container.symbol, node, symbolKind, symbolExcludes);
|
||||
break;
|
||||
@@ -341,7 +341,7 @@ module ts {
|
||||
typeLiteralSymbol.members[node.kind === SyntaxKind.FunctionType ? "__call" : "__new"] = symbol
|
||||
}
|
||||
|
||||
function bindAnonymousDeclaration(node: Node, symbolKind: SymbolFlags, name: string, isBlockScopeContainer: boolean) {
|
||||
function bindAnonymousDeclaration(node: Declaration, symbolKind: SymbolFlags, name: string, isBlockScopeContainer: boolean) {
|
||||
var symbol = createSymbol(symbolKind, name);
|
||||
addDeclarationToSymbol(symbol, node, symbolKind);
|
||||
bindChildren(node, symbolKind, isBlockScopeContainer);
|
||||
@@ -434,14 +434,14 @@ module ts {
|
||||
break;
|
||||
|
||||
case SyntaxKind.TypeLiteral:
|
||||
bindAnonymousDeclaration(node, SymbolFlags.TypeLiteral, "__type", /*isBlockScopeContainer*/ false);
|
||||
bindAnonymousDeclaration(<TypeLiteralNode>node, SymbolFlags.TypeLiteral, "__type", /*isBlockScopeContainer*/ false);
|
||||
break;
|
||||
case SyntaxKind.ObjectLiteral:
|
||||
bindAnonymousDeclaration(node, SymbolFlags.ObjectLiteral, "__object", /*isBlockScopeContainer*/ false);
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
bindAnonymousDeclaration(<ObjectLiteralExpression>node, SymbolFlags.ObjectLiteral, "__object", /*isBlockScopeContainer*/ false);
|
||||
break;
|
||||
case SyntaxKind.FunctionExpression:
|
||||
case SyntaxKind.ArrowFunction:
|
||||
bindAnonymousDeclaration(node, SymbolFlags.Function, "__function", /*isBlockScopeContainer*/ true);
|
||||
bindAnonymousDeclaration(<FunctionExpression>node, SymbolFlags.Function, "__function", /*isBlockScopeContainer*/ true);
|
||||
break;
|
||||
case SyntaxKind.CatchBlock:
|
||||
bindCatchVariableDeclaration(<CatchBlock>node);
|
||||
@@ -471,7 +471,7 @@ module ts {
|
||||
break;
|
||||
case SyntaxKind.SourceFile:
|
||||
if (isExternalModule(<SourceFile>node)) {
|
||||
bindAnonymousDeclaration(node, SymbolFlags.ValueModule, '"' + removeFileExtension((<SourceFile>node).filename) + '"', /*isBlockScopeContainer*/ true);
|
||||
bindAnonymousDeclaration(<SourceFile>node, SymbolFlags.ValueModule, '"' + removeFileExtension((<SourceFile>node).filename) + '"', /*isBlockScopeContainer*/ true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+257
-185
File diff suppressed because it is too large
Load Diff
@@ -134,6 +134,11 @@ module ts {
|
||||
Computed_property_names_are_not_allowed_in_interfaces: { code: 1169, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in interfaces." },
|
||||
Computed_property_names_are_not_allowed_in_type_literals: { code: 1170, category: DiagnosticCategory.Error, key: "Computed property names are not allowed in type literals." },
|
||||
A_comma_expression_is_not_allowed_in_a_computed_property_name: { code: 1171, category: DiagnosticCategory.Error, key: "A comma expression is not allowed in a computed property name." },
|
||||
extends_clause_already_seen: { code: 1172, category: DiagnosticCategory.Error, key: "'extends' clause already seen." },
|
||||
extends_clause_must_precede_implements_clause: { code: 1173, category: DiagnosticCategory.Error, key: "'extends' clause must precede 'implements' clause." },
|
||||
Classes_can_only_extend_a_single_class: { code: 1174, category: DiagnosticCategory.Error, key: "Classes can only extend a single class." },
|
||||
implements_clause_already_seen: { code: 1175, category: DiagnosticCategory.Error, key: "'implements' clause already seen." },
|
||||
Interface_declaration_cannot_have_implements_clause: { code: 1176, category: DiagnosticCategory.Error, key: "Interface declaration cannot have 'implements' clause." },
|
||||
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
|
||||
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: DiagnosticCategory.Error, key: "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor." },
|
||||
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
|
||||
|
||||
@@ -527,6 +527,26 @@
|
||||
"category": "Error",
|
||||
"code": 1171
|
||||
},
|
||||
"'extends' clause already seen.": {
|
||||
"category": "Error",
|
||||
"code": 1172
|
||||
},
|
||||
"'extends' clause must precede 'implements' clause.": {
|
||||
"category": "Error",
|
||||
"code": 1173
|
||||
},
|
||||
"Classes can only extend a single class.": {
|
||||
"category": "Error",
|
||||
"code": 1174
|
||||
},
|
||||
"'implements' clause already seen.": {
|
||||
"category": "Error",
|
||||
"code": 1175
|
||||
},
|
||||
"Interface declaration cannot have 'implements' clause.": {
|
||||
"category": "Error",
|
||||
"code": 1176
|
||||
},
|
||||
|
||||
"Duplicate identifier '{0}'.": {
|
||||
"category": "Error",
|
||||
|
||||
+115
-79
@@ -357,7 +357,7 @@ module ts {
|
||||
var currentSourceFile: SourceFile;
|
||||
var reportedDeclarationError = false;
|
||||
|
||||
var emitJsDocComments = compilerOptions.removeComments ? function (declaration: Declaration) { } : writeJsDocComments;
|
||||
var emitJsDocComments = compilerOptions.removeComments ? function (declaration: Node) { } : writeJsDocComments;
|
||||
|
||||
var aliasDeclarationEmitInfo: AliasDeclarationEmitInfo[] = [];
|
||||
|
||||
@@ -485,7 +485,7 @@ module ts {
|
||||
emitSeparatedList(nodes, ", ", eachNodeEmitFn);
|
||||
}
|
||||
|
||||
function writeJsDocComments(declaration: Declaration) {
|
||||
function writeJsDocComments(declaration: Node) {
|
||||
if (declaration) {
|
||||
var jsDocComments = getJsDocComments(declaration, currentSourceFile);
|
||||
emitNewLineBeforeLeadingComments(currentSourceFile, writer, declaration, jsDocComments);
|
||||
@@ -518,8 +518,8 @@ module ts {
|
||||
return emitTupleType(<TupleTypeNode>type);
|
||||
case SyntaxKind.UnionType:
|
||||
return emitUnionType(<UnionTypeNode>type);
|
||||
case SyntaxKind.ParenType:
|
||||
return emitParenType(<ParenTypeNode>type);
|
||||
case SyntaxKind.ParenthesizedType:
|
||||
return emitParenType(<ParenthesizedTypeNode>type);
|
||||
case SyntaxKind.FunctionType:
|
||||
case SyntaxKind.ConstructorType:
|
||||
return emitSignatureDeclarationWithJsDocComments(<SignatureDeclaration>type);
|
||||
@@ -583,7 +583,7 @@ module ts {
|
||||
emitSeparatedList(type.types, " | ", emitType);
|
||||
}
|
||||
|
||||
function emitParenType(type: ParenTypeNode) {
|
||||
function emitParenType(type: ParenthesizedTypeNode) {
|
||||
write("(");
|
||||
emitType(type.type);
|
||||
write(")");
|
||||
@@ -615,7 +615,7 @@ module ts {
|
||||
writeLine();
|
||||
}
|
||||
|
||||
function emitModuleElementDeclarationFlags(node: Declaration) {
|
||||
function emitModuleElementDeclarationFlags(node: Node) {
|
||||
// If the node is parented in the current source file we need to emit export declare or just export
|
||||
if (node.parent === currentSourceFile) {
|
||||
// If the node is exported
|
||||
@@ -701,7 +701,7 @@ module ts {
|
||||
write(" {");
|
||||
writeLine();
|
||||
increaseIndent();
|
||||
emitLines((<Block>node.body).statements);
|
||||
emitLines((<ModuleBlock>node.body).statements);
|
||||
decreaseIndent();
|
||||
write("}");
|
||||
writeLine();
|
||||
@@ -851,11 +851,11 @@ module ts {
|
||||
function getHeritageClauseVisibilityError(symbolAccesibilityResult: SymbolAccessiblityResult): SymbolAccessibilityDiagnostic {
|
||||
var diagnosticMessage: DiagnosticMessage;
|
||||
// Heritage clause is written by user so it can always be named
|
||||
if (node.parent.kind === SyntaxKind.ClassDeclaration) {
|
||||
if (node.parent.parent.kind === SyntaxKind.ClassDeclaration) {
|
||||
// Class or Interface implemented/extended is inaccessible
|
||||
diagnosticMessage = isImplementsList ?
|
||||
Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 :
|
||||
Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1;
|
||||
Diagnostics.Implements_clause_of_exported_class_0_has_or_is_using_private_name_1 :
|
||||
Diagnostics.Extends_clause_of_exported_class_0_has_or_is_using_private_name_1;
|
||||
}
|
||||
else {
|
||||
// interface is inaccessible
|
||||
@@ -865,7 +865,7 @@ module ts {
|
||||
return {
|
||||
diagnosticMessage,
|
||||
errorNode: node,
|
||||
typeName: (<Declaration>node.parent).name
|
||||
typeName: (<Declaration>node.parent.parent).name
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -890,10 +890,11 @@ module ts {
|
||||
var prevEnclosingDeclaration = enclosingDeclaration;
|
||||
enclosingDeclaration = node;
|
||||
emitTypeParameters(node.typeParameters);
|
||||
if (node.baseType) {
|
||||
emitHeritageClause([node.baseType], /*isImplementsList*/ false);
|
||||
var baseTypeNode = getClassBaseTypeNode(node);
|
||||
if (baseTypeNode) {
|
||||
emitHeritageClause([baseTypeNode], /*isImplementsList*/ false);
|
||||
}
|
||||
emitHeritageClause(node.implementedTypes, /*isImplementsList*/ true);
|
||||
emitHeritageClause(getClassImplementedTypeNodes(node), /*isImplementsList*/ true);
|
||||
write(" {");
|
||||
writeLine();
|
||||
increaseIndent();
|
||||
@@ -915,7 +916,7 @@ module ts {
|
||||
var prevEnclosingDeclaration = enclosingDeclaration;
|
||||
enclosingDeclaration = node;
|
||||
emitTypeParameters(node.typeParameters);
|
||||
emitHeritageClause(node.baseTypes, /*isImplementsList*/ false);
|
||||
emitHeritageClause(getInterfaceBaseTypeNodes(node), /*isImplementsList*/ false);
|
||||
write(" {");
|
||||
writeLine();
|
||||
increaseIndent();
|
||||
@@ -927,7 +928,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitPropertyDeclaration(node: PropertyDeclaration) {
|
||||
function emitPropertyDeclaration(node: Declaration) {
|
||||
emitJsDocComments(node);
|
||||
emitClassMemberDeclarationFlags(node);
|
||||
emitVariableDeclaration(<VariableDeclaration>node);
|
||||
@@ -1996,7 +1997,7 @@ module ts {
|
||||
// ("abc" + 1) << (2 + "")
|
||||
// rather than
|
||||
// "abc" + (1 << 2) + ""
|
||||
var needsParens = templateSpan.expression.kind !== SyntaxKind.ParenExpression
|
||||
var needsParens = templateSpan.expression.kind !== SyntaxKind.ParenthesizedExpression
|
||||
&& comparePrecedenceToBinaryPlus(templateSpan.expression) !== Comparison.GreaterThan;
|
||||
|
||||
write(" + ");
|
||||
@@ -2027,8 +2028,8 @@ module ts {
|
||||
switch (parent.kind) {
|
||||
case SyntaxKind.CallExpression:
|
||||
case SyntaxKind.NewExpression:
|
||||
return (<CallExpression>parent).func === template;
|
||||
case SyntaxKind.ParenExpression:
|
||||
return (<CallExpression>parent).expression === template;
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
return false;
|
||||
case SyntaxKind.TaggedTemplateExpression:
|
||||
Debug.fail("Path should be unreachable; tagged templates not supported pre-ES6.");
|
||||
@@ -2170,7 +2171,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitArrayLiteral(node: ArrayLiteral) {
|
||||
function emitArrayLiteral(node: ArrayLiteralExpression) {
|
||||
if (node.flags & NodeFlags.MultiLine) {
|
||||
write("[");
|
||||
increaseIndent();
|
||||
@@ -2186,7 +2187,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitObjectLiteral(node: ObjectLiteral) {
|
||||
function emitObjectLiteral(node: ObjectLiteralExpression) {
|
||||
if (!node.properties.length) {
|
||||
write("{}");
|
||||
}
|
||||
@@ -2249,48 +2250,54 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function tryEmitConstantValue(node: PropertyAccess | IndexedAccess): boolean {
|
||||
function tryEmitConstantValue(node: PropertyAccessExpression | ElementAccessExpression): boolean {
|
||||
var constantValue = resolver.getConstantValue(node);
|
||||
if (constantValue !== undefined) {
|
||||
var propertyName = node.kind === SyntaxKind.PropertyAccess ? declarationNameToString((<PropertyAccess>node).right) : getTextOfNode((<IndexedAccess>node).index);
|
||||
var propertyName = node.kind === SyntaxKind.PropertyAccessExpression ? declarationNameToString((<PropertyAccessExpression>node).name) : getTextOfNode((<ElementAccessExpression>node).argumentExpression);
|
||||
write(constantValue.toString() + " /* " + propertyName + " */");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function emitPropertyAccess(node: PropertyAccess) {
|
||||
function emitPropertyAccess(node: PropertyAccessExpression) {
|
||||
if (tryEmitConstantValue(node)) {
|
||||
return;
|
||||
}
|
||||
emit(node.expression);
|
||||
write(".");
|
||||
emit(node.name);
|
||||
}
|
||||
|
||||
function emitQualifiedName(node: QualifiedName) {
|
||||
emit(node.left);
|
||||
write(".");
|
||||
emit(node.right);
|
||||
}
|
||||
|
||||
function emitIndexedAccess(node: IndexedAccess) {
|
||||
function emitIndexedAccess(node: ElementAccessExpression) {
|
||||
if (tryEmitConstantValue(node)) {
|
||||
return;
|
||||
}
|
||||
emit(node.object);
|
||||
emit(node.expression);
|
||||
write("[");
|
||||
emit(node.index);
|
||||
emit(node.argumentExpression);
|
||||
write("]");
|
||||
}
|
||||
|
||||
function emitCallExpression(node: CallExpression) {
|
||||
var superCall = false;
|
||||
if (node.func.kind === SyntaxKind.SuperKeyword) {
|
||||
if (node.expression.kind === SyntaxKind.SuperKeyword) {
|
||||
write("_super");
|
||||
superCall = true;
|
||||
}
|
||||
else {
|
||||
emit(node.func);
|
||||
superCall = node.func.kind === SyntaxKind.PropertyAccess && (<PropertyAccess>node.func).left.kind === SyntaxKind.SuperKeyword;
|
||||
emit(node.expression);
|
||||
superCall = node.expression.kind === SyntaxKind.PropertyAccessExpression && (<PropertyAccessExpression>node.expression).expression.kind === SyntaxKind.SuperKeyword;
|
||||
}
|
||||
if (superCall) {
|
||||
write(".call(");
|
||||
emitThis(node.func);
|
||||
emitThis(node.expression);
|
||||
if (node.arguments.length) {
|
||||
write(", ");
|
||||
emitCommaList(node.arguments, /*includeTrailingComma*/ false);
|
||||
@@ -2306,7 +2313,7 @@ module ts {
|
||||
|
||||
function emitNewExpression(node: NewExpression) {
|
||||
write("new ");
|
||||
emit(node.func);
|
||||
emit(node.expression);
|
||||
if (node.arguments) {
|
||||
write("(");
|
||||
emitCommaList(node.arguments, /*includeTrailingComma*/ false);
|
||||
@@ -2321,14 +2328,14 @@ module ts {
|
||||
emit(node.template);
|
||||
}
|
||||
|
||||
function emitParenExpression(node: ParenExpression) {
|
||||
if (node.expression.kind === SyntaxKind.TypeAssertion) {
|
||||
var operand = (<TypeAssertion>node.expression).operand;
|
||||
function emitParenExpression(node: ParenthesizedExpression) {
|
||||
if (node.expression.kind === SyntaxKind.TypeAssertionExpression) {
|
||||
var operand = (<TypeAssertion>node.expression).expression;
|
||||
|
||||
// Make sure we consider all nested cast expressions, e.g.:
|
||||
// (<any><number><any>-A).x;
|
||||
while (operand.kind == SyntaxKind.TypeAssertion) {
|
||||
operand = (<TypeAssertion>operand).operand;
|
||||
while (operand.kind == SyntaxKind.TypeAssertionExpression) {
|
||||
operand = (<TypeAssertion>operand).expression;
|
||||
}
|
||||
|
||||
// We have an expression of the form: (<Type>SubExpr)
|
||||
@@ -2339,7 +2346,12 @@ module ts {
|
||||
// (<any>typeof A).toString() should be emitted as (typeof A).toString() and not typeof A.toString()
|
||||
// new (<any>A()) should be emitted as new (A()) and not new A()
|
||||
// (<any>function foo() { })() should be emitted as an IIF (function foo(){})() and not declaration function foo(){} ()
|
||||
if (operand.kind !== SyntaxKind.PrefixOperator && operand.kind !== SyntaxKind.PostfixOperator && operand.kind !== SyntaxKind.NewExpression &&
|
||||
if (operand.kind !== SyntaxKind.PrefixUnaryExpression &&
|
||||
operand.kind !== SyntaxKind.VoidExpression &&
|
||||
operand.kind !== SyntaxKind.TypeOfExpression &&
|
||||
operand.kind !== SyntaxKind.DeleteExpression &&
|
||||
operand.kind !== SyntaxKind.PostfixUnaryExpression &&
|
||||
operand.kind !== SyntaxKind.NewExpression &&
|
||||
!(operand.kind === SyntaxKind.CallExpression && node.parent.kind === SyntaxKind.NewExpression) &&
|
||||
!(operand.kind === SyntaxKind.FunctionExpression && node.parent.kind === SyntaxKind.CallExpression)) {
|
||||
emit(operand);
|
||||
@@ -2351,10 +2363,26 @@ module ts {
|
||||
write(")");
|
||||
}
|
||||
|
||||
function emitUnaryExpression(node: UnaryExpression) {
|
||||
if (node.kind === SyntaxKind.PrefixOperator) {
|
||||
write(tokenToString(node.operator));
|
||||
}
|
||||
function emitDeleteExpression(node: DeleteExpression) {
|
||||
write(tokenToString(SyntaxKind.DeleteKeyword));
|
||||
write(" ");
|
||||
emit(node.expression);
|
||||
}
|
||||
|
||||
function emitVoidExpression(node: VoidExpression) {
|
||||
write(tokenToString(SyntaxKind.VoidKeyword));
|
||||
write(" ");
|
||||
emit(node.expression);
|
||||
}
|
||||
|
||||
function emitTypeOfExpression(node: TypeOfExpression) {
|
||||
write(tokenToString(SyntaxKind.TypeOfKeyword));
|
||||
write(" ");
|
||||
emit(node.expression);
|
||||
}
|
||||
|
||||
function emitPrefixUnaryExpression(node: PrefixUnaryExpression) {
|
||||
write(tokenToString(node.operator));
|
||||
// In some cases, we need to emit a space between the operator and the operand. One obvious case
|
||||
// is when the operator is an identifier, like delete or typeof. We also need to do this for plus
|
||||
// and minus expressions in certain cases. Specifically, consider the following two cases (parens
|
||||
@@ -2367,11 +2395,8 @@ module ts {
|
||||
// the resulting expression a prefix increment operation. And in the second, it will make the resulting
|
||||
// expression a prefix increment whose operand is a plus expression - (++(+x))
|
||||
// The same is true of minus of course.
|
||||
if (node.operator >= SyntaxKind.Identifier) {
|
||||
write(" ");
|
||||
}
|
||||
else if (node.kind === SyntaxKind.PrefixOperator && node.operand.kind === SyntaxKind.PrefixOperator) {
|
||||
var operand = <UnaryExpression>node.operand;
|
||||
if (node.operand.kind === SyntaxKind.PrefixUnaryExpression) {
|
||||
var operand = <PrefixUnaryExpression>node.operand;
|
||||
if (node.operator === SyntaxKind.PlusToken && (operand.operator === SyntaxKind.PlusToken || operand.operator === SyntaxKind.PlusPlusToken)) {
|
||||
write(" ");
|
||||
}
|
||||
@@ -2380,11 +2405,14 @@ module ts {
|
||||
}
|
||||
}
|
||||
emit(node.operand);
|
||||
if (node.kind === SyntaxKind.PostfixOperator) {
|
||||
write(tokenToString(node.operator));
|
||||
}
|
||||
}
|
||||
|
||||
function emitPostfixUnaryExpression(node: PostfixUnaryExpression) {
|
||||
emit(node.operand);
|
||||
write(tokenToString(node.operator));
|
||||
}
|
||||
|
||||
|
||||
function emitBinaryExpression(node: BinaryExpression) {
|
||||
emit(node.left);
|
||||
if (node.operator !== SyntaxKind.CommaToken) write(" ");
|
||||
@@ -2860,7 +2888,7 @@ module ts {
|
||||
if (statement && statement.kind === SyntaxKind.ExpressionStatement) {
|
||||
var expr = (<ExpressionStatement>statement).expression;
|
||||
if (expr && expr.kind === SyntaxKind.CallExpression) {
|
||||
var func = (<CallExpression>expr).func;
|
||||
var func = (<CallExpression>expr).expression;
|
||||
if (func && func.kind === SyntaxKind.SuperKeyword) {
|
||||
return <ExpressionStatement>statement;
|
||||
}
|
||||
@@ -3006,19 +3034,20 @@ module ts {
|
||||
write("var ");
|
||||
emit(node.name);
|
||||
write(" = (function (");
|
||||
if (node.baseType) {
|
||||
var baseTypeNode = getClassBaseTypeNode(node);
|
||||
if (baseTypeNode) {
|
||||
write("_super");
|
||||
}
|
||||
write(") {");
|
||||
increaseIndent();
|
||||
scopeEmitStart(node);
|
||||
if (node.baseType) {
|
||||
if (baseTypeNode) {
|
||||
writeLine();
|
||||
emitStart(node.baseType);
|
||||
emitStart(baseTypeNode);
|
||||
write("__extends(");
|
||||
emit(node.name);
|
||||
write(", _super);");
|
||||
emitEnd(node.baseType);
|
||||
emitEnd(baseTypeNode);
|
||||
}
|
||||
writeLine();
|
||||
emitConstructorOfClass();
|
||||
@@ -3037,8 +3066,8 @@ module ts {
|
||||
scopeEmitEnd();
|
||||
emitStart(node);
|
||||
write(")(");
|
||||
if (node.baseType) {
|
||||
emit(node.baseType.typeName);
|
||||
if (baseTypeNode) {
|
||||
emit(baseTypeNode.typeName);
|
||||
}
|
||||
write(");");
|
||||
emitEnd(node);
|
||||
@@ -3079,7 +3108,7 @@ module ts {
|
||||
if (ctor) {
|
||||
emitDefaultValueAssignments(ctor);
|
||||
emitRestParameter(ctor);
|
||||
if (node.baseType) {
|
||||
if (baseTypeNode) {
|
||||
var superCall = findInitialSuperCall(ctor);
|
||||
if (superCall) {
|
||||
writeLine();
|
||||
@@ -3089,11 +3118,11 @@ module ts {
|
||||
emitParameterPropertyAssignments(ctor);
|
||||
}
|
||||
else {
|
||||
if (node.baseType) {
|
||||
if (baseTypeNode) {
|
||||
writeLine();
|
||||
emitStart(node.baseType);
|
||||
emitStart(baseTypeNode);
|
||||
write("_super.apply(this, arguments);");
|
||||
emitEnd(node.baseType);
|
||||
emitEnd(baseTypeNode);
|
||||
}
|
||||
}
|
||||
emitMemberAssignments(node, /*nonstatic*/0);
|
||||
@@ -3231,7 +3260,7 @@ module ts {
|
||||
emit(node.body);
|
||||
decreaseIndent();
|
||||
writeLine();
|
||||
var moduleBlock = <Block>getInnerMostModuleDeclarationFromDottedModule(node).body;
|
||||
var moduleBlock = <ModuleBlock>getInnerMostModuleDeclarationFromDottedModule(node).body;
|
||||
emitToken(SyntaxKind.CloseBraceToken, moduleBlock.statements.end);
|
||||
scopeEmitEnd();
|
||||
}
|
||||
@@ -3377,7 +3406,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitDirectivePrologues(statements: Statement[], startWithNewLine: boolean): number {
|
||||
function emitDirectivePrologues(statements: Node[], startWithNewLine: boolean): number {
|
||||
for (var i = 0; i < statements.length; ++i) {
|
||||
if (isPrologueDirective(statements[i])) {
|
||||
if (startWithNewLine || i > 0) {
|
||||
@@ -3471,38 +3500,45 @@ module ts {
|
||||
case SyntaxKind.TemplateSpan:
|
||||
return emitTemplateSpan(<TemplateSpan>node);
|
||||
case SyntaxKind.QualifiedName:
|
||||
return emitPropertyAccess(<QualifiedName>node);
|
||||
case SyntaxKind.ArrayLiteral:
|
||||
return emitArrayLiteral(<ArrayLiteral>node);
|
||||
case SyntaxKind.ObjectLiteral:
|
||||
return emitObjectLiteral(<ObjectLiteral>node);
|
||||
return emitQualifiedName(<QualifiedName>node);
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
return emitArrayLiteral(<ArrayLiteralExpression>node);
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
return emitObjectLiteral(<ObjectLiteralExpression>node);
|
||||
case SyntaxKind.PropertyAssignment:
|
||||
return emitPropertyAssignment(<PropertyDeclaration>node);
|
||||
case SyntaxKind.ShorthandPropertyAssignment:
|
||||
return emitShortHandPropertyAssignment(<ShortHandPropertyDeclaration>node);
|
||||
case SyntaxKind.ComputedPropertyName:
|
||||
return emitComputedPropertyName(<ComputedPropertyName>node);
|
||||
case SyntaxKind.PropertyAccess:
|
||||
return emitPropertyAccess(<PropertyAccess>node);
|
||||
case SyntaxKind.IndexedAccess:
|
||||
return emitIndexedAccess(<IndexedAccess>node);
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
return emitPropertyAccess(<PropertyAccessExpression>node);
|
||||
case SyntaxKind.ElementAccessExpression:
|
||||
return emitIndexedAccess(<ElementAccessExpression>node);
|
||||
case SyntaxKind.CallExpression:
|
||||
return emitCallExpression(<CallExpression>node);
|
||||
case SyntaxKind.NewExpression:
|
||||
return emitNewExpression(<NewExpression>node);
|
||||
case SyntaxKind.TaggedTemplateExpression:
|
||||
return emitTaggedTemplateExpression(<TaggedTemplateExpression>node);
|
||||
case SyntaxKind.TypeAssertion:
|
||||
return emit((<TypeAssertion>node).operand);
|
||||
case SyntaxKind.ParenExpression:
|
||||
return emitParenExpression(<ParenExpression>node);
|
||||
case SyntaxKind.TypeAssertionExpression:
|
||||
return emit((<TypeAssertion>node).expression);
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
return emitParenExpression(<ParenthesizedExpression>node);
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.FunctionExpression:
|
||||
case SyntaxKind.ArrowFunction:
|
||||
return emitFunctionDeclaration(<FunctionLikeDeclaration>node);
|
||||
case SyntaxKind.PrefixOperator:
|
||||
case SyntaxKind.PostfixOperator:
|
||||
return emitUnaryExpression(<UnaryExpression>node);
|
||||
case SyntaxKind.DeleteExpression:
|
||||
return emitDeleteExpression(<DeleteExpression>node);
|
||||
case SyntaxKind.TypeOfExpression:
|
||||
return emitTypeOfExpression(<TypeOfExpression>node);
|
||||
case SyntaxKind.VoidExpression:
|
||||
return emitVoidExpression(<VoidExpression>node);
|
||||
case SyntaxKind.PrefixUnaryExpression:
|
||||
return emitPrefixUnaryExpression(<PrefixUnaryExpression>node);
|
||||
case SyntaxKind.PostfixUnaryExpression:
|
||||
return emitPostfixUnaryExpression(<PostfixUnaryExpression>node);
|
||||
case SyntaxKind.BinaryExpression:
|
||||
return emitBinaryExpression(<BinaryExpression>node);
|
||||
case SyntaxKind.ConditionalExpression:
|
||||
|
||||
+610
-282
File diff suppressed because it is too large
Load Diff
+146
-65
@@ -163,29 +163,31 @@ module ts {
|
||||
ArrayType,
|
||||
TupleType,
|
||||
UnionType,
|
||||
ParenType,
|
||||
ParenthesizedType,
|
||||
// Expression
|
||||
ArrayLiteral,
|
||||
ObjectLiteral,
|
||||
PropertyAssignment,
|
||||
ShorthandPropertyAssignment,
|
||||
PropertyAccess,
|
||||
IndexedAccess,
|
||||
ArrayLiteralExpression,
|
||||
ObjectLiteralExpression,
|
||||
PropertyAccessExpression,
|
||||
ElementAccessExpression,
|
||||
CallExpression,
|
||||
NewExpression,
|
||||
TaggedTemplateExpression,
|
||||
TypeAssertion,
|
||||
ParenExpression,
|
||||
TypeAssertionExpression,
|
||||
ParenthesizedExpression,
|
||||
FunctionExpression,
|
||||
ArrowFunction,
|
||||
PrefixOperator,
|
||||
PostfixOperator,
|
||||
DeleteExpression,
|
||||
TypeOfExpression,
|
||||
VoidExpression,
|
||||
PrefixUnaryExpression,
|
||||
PostfixUnaryExpression,
|
||||
BinaryExpression,
|
||||
ConditionalExpression,
|
||||
TemplateExpression,
|
||||
TemplateSpan,
|
||||
YieldExpression,
|
||||
OmittedExpression,
|
||||
// Misc
|
||||
TemplateSpan,
|
||||
// Element
|
||||
Block,
|
||||
VariableStatement,
|
||||
@@ -201,8 +203,6 @@ module ts {
|
||||
ReturnStatement,
|
||||
WithStatement,
|
||||
SwitchStatement,
|
||||
CaseClause,
|
||||
DefaultClause,
|
||||
LabeledStatement,
|
||||
ThrowStatement,
|
||||
TryStatement,
|
||||
@@ -221,6 +221,13 @@ module ts {
|
||||
ModuleBlock,
|
||||
ImportDeclaration,
|
||||
ExportAssignment,
|
||||
// Clauses
|
||||
CaseClause,
|
||||
DefaultClause,
|
||||
HeritageClause,
|
||||
// Property assignments
|
||||
PropertyAssignment,
|
||||
ShorthandPropertyAssignment,
|
||||
// Enum
|
||||
EnumMember,
|
||||
// Top-level nodes
|
||||
@@ -240,7 +247,7 @@ module ts {
|
||||
FirstFutureReservedWord = ImplementsKeyword,
|
||||
LastFutureReservedWord = YieldKeyword,
|
||||
FirstTypeNode = TypeReference,
|
||||
LastTypeNode = ParenType,
|
||||
LastTypeNode = ParenthesizedType,
|
||||
FirstPunctuation = OpenBraceToken,
|
||||
LastPunctuation = CaretEqualsToken,
|
||||
FirstToken = EndOfFileToken,
|
||||
@@ -310,7 +317,7 @@ module ts {
|
||||
flags: number;
|
||||
}
|
||||
|
||||
export interface Identifier extends Node {
|
||||
export interface Identifier extends PrimaryExpression {
|
||||
text: string; // Text of identifier (with escapes converted to characters)
|
||||
}
|
||||
|
||||
@@ -331,6 +338,7 @@ module ts {
|
||||
export type DeclarationName = Identifier | LiteralExpression | ComputedPropertyName;
|
||||
|
||||
export interface Declaration extends Node {
|
||||
_declarationBrand: any;
|
||||
name?: DeclarationName;
|
||||
}
|
||||
|
||||
@@ -346,7 +354,8 @@ module ts {
|
||||
expression?: Expression;
|
||||
}
|
||||
|
||||
export interface SignatureDeclaration extends Declaration, ParsedSignature { }
|
||||
export interface SignatureDeclaration extends Declaration, ParsedSignature {
|
||||
}
|
||||
|
||||
export interface VariableDeclaration extends Declaration {
|
||||
name: Identifier;
|
||||
@@ -354,7 +363,7 @@ module ts {
|
||||
initializer?: Expression;
|
||||
}
|
||||
|
||||
export interface PropertyDeclaration extends Declaration {
|
||||
export interface PropertyDeclaration extends Declaration, ClassElement {
|
||||
type?: TypeNode;
|
||||
initializer?: Expression;
|
||||
}
|
||||
@@ -374,27 +383,33 @@ module ts {
|
||||
* AccessorDeclaration
|
||||
*/
|
||||
export interface FunctionLikeDeclaration extends SignatureDeclaration {
|
||||
_functionLikeDeclarationBrand: any;
|
||||
|
||||
asteriskToken?: Node;
|
||||
body?: Block | Expression;
|
||||
}
|
||||
|
||||
export interface FunctionDeclaration extends FunctionLikeDeclaration {
|
||||
export interface FunctionDeclaration extends FunctionLikeDeclaration, Statement {
|
||||
name: Identifier;
|
||||
body?: Block;
|
||||
}
|
||||
|
||||
export interface MethodDeclaration extends FunctionLikeDeclaration {
|
||||
export interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement {
|
||||
body?: Block;
|
||||
}
|
||||
|
||||
export interface ConstructorDeclaration extends Node, ParsedSignature {
|
||||
export interface ConstructorDeclaration extends FunctionLikeDeclaration, ClassElement {
|
||||
body?: Block;
|
||||
}
|
||||
|
||||
export interface AccessorDeclaration extends FunctionLikeDeclaration {
|
||||
export interface AccessorDeclaration extends FunctionLikeDeclaration, ClassElement {
|
||||
body?: Block;
|
||||
}
|
||||
|
||||
export interface IndexSignatureDeclaration extends SignatureDeclaration, ClassElement {
|
||||
_indexSignatureDeclarationBrand: any;
|
||||
}
|
||||
|
||||
export interface TypeNode extends Node { }
|
||||
|
||||
export interface TypeReferenceNode extends TypeNode {
|
||||
@@ -406,7 +421,7 @@ module ts {
|
||||
exprName: EntityName;
|
||||
}
|
||||
|
||||
export interface TypeLiteralNode extends TypeNode {
|
||||
export interface TypeLiteralNode extends TypeNode, Declaration {
|
||||
members: NodeArray<Node>;
|
||||
}
|
||||
|
||||
@@ -422,7 +437,7 @@ module ts {
|
||||
types: NodeArray<TypeNode>;
|
||||
}
|
||||
|
||||
export interface ParenTypeNode extends TypeNode {
|
||||
export interface ParenthesizedTypeNode extends TypeNode {
|
||||
type: TypeNode;
|
||||
}
|
||||
|
||||
@@ -430,13 +445,58 @@ module ts {
|
||||
text: string;
|
||||
}
|
||||
|
||||
// Note: 'brands' in our syntax nodes serve to give us a small amount of nominal typing.
|
||||
// Consider 'Expression'. Without the brand, 'Expression' is actually no different
|
||||
// (structurally) than 'Node'. Because of this you can pass any Node to a function that
|
||||
// takes an Expression without any error. By using the 'brands' we ensure that the type
|
||||
// checker actually thinks you have something of the right type. Note: the brands are
|
||||
// never actually given values. At runtime they have zero cost.
|
||||
|
||||
export interface Expression extends Node {
|
||||
_expressionBrand: any;
|
||||
contextualType?: Type; // Used to temporarily assign a contextual type during overload resolution
|
||||
}
|
||||
|
||||
export interface UnaryExpression extends Expression {
|
||||
_unaryExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface PrefixUnaryExpression extends UnaryExpression {
|
||||
operator: SyntaxKind;
|
||||
operand: Expression;
|
||||
operand: UnaryExpression;
|
||||
}
|
||||
|
||||
export interface PostfixUnaryExpression extends PostfixExpression {
|
||||
operand: LeftHandSideExpression;
|
||||
operator: SyntaxKind;
|
||||
}
|
||||
|
||||
export interface PostfixExpression extends UnaryExpression {
|
||||
_postfixExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface LeftHandSideExpression extends PostfixExpression {
|
||||
_leftHandSideExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface MemberExpression extends LeftHandSideExpression {
|
||||
_memberExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface PrimaryExpression extends MemberExpression {
|
||||
_primaryExpressionBrand: any;
|
||||
}
|
||||
|
||||
export interface DeleteExpression extends UnaryExpression {
|
||||
expression: UnaryExpression;
|
||||
}
|
||||
|
||||
export interface TypeOfExpression extends UnaryExpression {
|
||||
expression: UnaryExpression;
|
||||
}
|
||||
|
||||
export interface VoidExpression extends UnaryExpression {
|
||||
expression: UnaryExpression;
|
||||
}
|
||||
|
||||
export interface YieldExpression extends Expression {
|
||||
@@ -456,7 +516,7 @@ module ts {
|
||||
whenFalse: Expression;
|
||||
}
|
||||
|
||||
export interface FunctionExpression extends Expression, FunctionLikeDeclaration {
|
||||
export interface FunctionExpression extends PrimaryExpression, FunctionLikeDeclaration {
|
||||
name?: Identifier;
|
||||
body: Block | Expression; // Required, whereas the member inherited from FunctionDeclaration is optional
|
||||
}
|
||||
@@ -464,11 +524,11 @@ module ts {
|
||||
// The text property of a LiteralExpression stores the interpreted value of the literal in text form. For a StringLiteral,
|
||||
// or any literal of a template, this means quotes have been removed and escapes have been converted to actual characters.
|
||||
// For a NumericLiteral, the stored value is the toString() representation of the number. For example 1, 1.00, and 1e0 are all stored as just "1".
|
||||
export interface LiteralExpression extends Expression {
|
||||
export interface LiteralExpression extends PrimaryExpression {
|
||||
text: string;
|
||||
}
|
||||
|
||||
export interface TemplateExpression extends Expression {
|
||||
export interface TemplateExpression extends PrimaryExpression {
|
||||
head: LiteralExpression;
|
||||
templateSpans: NodeArray<TemplateSpan>;
|
||||
}
|
||||
@@ -480,49 +540,51 @@ module ts {
|
||||
literal: LiteralExpression;
|
||||
}
|
||||
|
||||
export interface ParenExpression extends Expression {
|
||||
export interface ParenthesizedExpression extends PrimaryExpression {
|
||||
expression: Expression;
|
||||
}
|
||||
|
||||
export interface ArrayLiteral extends Expression {
|
||||
export interface ArrayLiteralExpression extends PrimaryExpression {
|
||||
elements: NodeArray<Expression>;
|
||||
}
|
||||
|
||||
export interface ObjectLiteral extends Expression {
|
||||
properties: NodeArray<Node>;
|
||||
export interface ObjectLiteralExpression extends PrimaryExpression, Declaration {
|
||||
properties: NodeArray<Declaration>;
|
||||
}
|
||||
|
||||
export interface PropertyAccess extends Expression {
|
||||
left: Expression;
|
||||
right: Identifier;
|
||||
export interface PropertyAccessExpression extends MemberExpression {
|
||||
expression: LeftHandSideExpression;
|
||||
name: Identifier;
|
||||
}
|
||||
|
||||
export interface IndexedAccess extends Expression {
|
||||
object: Expression;
|
||||
index: Expression;
|
||||
export interface ElementAccessExpression extends MemberExpression {
|
||||
expression: LeftHandSideExpression;
|
||||
argumentExpression: Expression;
|
||||
}
|
||||
|
||||
export interface CallExpression extends Expression {
|
||||
func: Expression;
|
||||
export interface CallExpression extends LeftHandSideExpression {
|
||||
expression: LeftHandSideExpression;
|
||||
typeArguments?: NodeArray<TypeNode>;
|
||||
arguments: NodeArray<Expression>;
|
||||
}
|
||||
|
||||
export interface NewExpression extends CallExpression { }
|
||||
export interface NewExpression extends CallExpression, PrimaryExpression { }
|
||||
|
||||
export interface TaggedTemplateExpression extends Expression {
|
||||
tag: Expression;
|
||||
export interface TaggedTemplateExpression extends MemberExpression {
|
||||
tag: LeftHandSideExpression;
|
||||
template: LiteralExpression | TemplateExpression;
|
||||
}
|
||||
|
||||
export type CallLikeExpression = CallExpression | NewExpression | TaggedTemplateExpression;
|
||||
|
||||
export interface TypeAssertion extends Expression {
|
||||
export interface TypeAssertion extends UnaryExpression {
|
||||
type: TypeNode;
|
||||
operand: Expression;
|
||||
expression: UnaryExpression;
|
||||
}
|
||||
|
||||
export interface Statement extends Node { }
|
||||
export interface Statement extends Node, ModuleElement {
|
||||
_statementBrand: any;
|
||||
}
|
||||
|
||||
export interface Block extends Statement {
|
||||
statements: NodeArray<Statement>;
|
||||
@@ -605,27 +667,39 @@ module ts {
|
||||
finallyBlock?: Block;
|
||||
}
|
||||
|
||||
export interface CatchBlock extends Block {
|
||||
export interface CatchBlock extends Block, Declaration {
|
||||
variable: Identifier;
|
||||
type?: TypeNode;
|
||||
}
|
||||
|
||||
export interface ClassDeclaration extends Declaration {
|
||||
name: Identifier;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
baseType?: TypeReferenceNode;
|
||||
implementedTypes?: NodeArray<TypeReferenceNode>;
|
||||
members: NodeArray<Node>;
|
||||
export interface ModuleElement extends Node {
|
||||
_moduleElementBrand: any;
|
||||
}
|
||||
|
||||
export interface InterfaceDeclaration extends Declaration {
|
||||
export interface ClassDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
baseTypes?: NodeArray<TypeReferenceNode>;
|
||||
members: NodeArray<Node>;
|
||||
heritageClauses?: NodeArray<HeritageClause>;
|
||||
members: NodeArray<ClassElement>;
|
||||
}
|
||||
|
||||
export interface TypeAliasDeclaration extends Declaration {
|
||||
export interface ClassElement extends Declaration {
|
||||
_classElementBrand: any;
|
||||
}
|
||||
|
||||
export interface InterfaceDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier;
|
||||
typeParameters?: NodeArray<TypeParameterDeclaration>;
|
||||
heritageClauses?: NodeArray<HeritageClause>;
|
||||
members: NodeArray<Declaration>;
|
||||
}
|
||||
|
||||
export interface HeritageClause extends Node {
|
||||
token: SyntaxKind;
|
||||
types?: NodeArray<TypeReferenceNode>;
|
||||
}
|
||||
|
||||
export interface TypeAliasDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier;
|
||||
type: TypeNode;
|
||||
}
|
||||
@@ -637,23 +711,27 @@ module ts {
|
||||
initializer?: Expression;
|
||||
}
|
||||
|
||||
export interface EnumDeclaration extends Declaration {
|
||||
export interface EnumDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier;
|
||||
members: NodeArray<EnumMember>;
|
||||
}
|
||||
|
||||
export interface ModuleDeclaration extends Declaration {
|
||||
export interface ModuleDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier | LiteralExpression;
|
||||
body: Block | ModuleDeclaration;
|
||||
body: ModuleBlock | ModuleDeclaration;
|
||||
}
|
||||
|
||||
export interface ImportDeclaration extends Declaration {
|
||||
export interface ModuleBlock extends Node, ModuleElement {
|
||||
statements: NodeArray<ModuleElement>
|
||||
}
|
||||
|
||||
export interface ImportDeclaration extends Declaration, ModuleElement {
|
||||
name: Identifier;
|
||||
entityName?: EntityName;
|
||||
externalModuleName?: LiteralExpression;
|
||||
}
|
||||
|
||||
export interface ExportAssignment extends Statement {
|
||||
export interface ExportAssignment extends Statement, ModuleElement {
|
||||
exportName: Identifier;
|
||||
}
|
||||
|
||||
@@ -665,7 +743,10 @@ module ts {
|
||||
hasTrailingNewLine?: boolean;
|
||||
}
|
||||
|
||||
export interface SourceFile extends Block {
|
||||
// Source files are declarations when they are external modules.
|
||||
export interface SourceFile extends Declaration {
|
||||
statements: NodeArray<ModuleElement>;
|
||||
|
||||
filename: string;
|
||||
text: string;
|
||||
getLineAndCharacterFromPosition(position: number): LineAndCharacter;
|
||||
@@ -782,7 +863,7 @@ module ts {
|
||||
isEmitBlocked(sourceFile?: SourceFile): boolean;
|
||||
// Returns the constant value of this enum member, or 'undefined' if the enum member has a computed value.
|
||||
getEnumMemberValue(node: EnumMember): number;
|
||||
isValidPropertyAccess(node: PropertyAccess, propertyName: string): boolean;
|
||||
isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName, propertyName: string): boolean;
|
||||
getAliasedSymbol(symbol: Symbol): Symbol;
|
||||
}
|
||||
|
||||
@@ -873,7 +954,7 @@ module ts {
|
||||
isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node, meaning: SymbolFlags): SymbolAccessiblityResult;
|
||||
isEntityNameVisible(entityName: EntityName, enclosingDeclaration: Node): SymbolVisibilityResult;
|
||||
// Returns the constant value this property access resolves to, or 'undefined' for a non-constant
|
||||
getConstantValue(node: PropertyAccess | IndexedAccess): number;
|
||||
getConstantValue(node: PropertyAccessExpression | ElementAccessExpression): number;
|
||||
isEmitBlocked(sourceFile?: SourceFile): boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,18 +29,21 @@ class TypeWriterWalker {
|
||||
// old typeWriter baselines, suppress tokens
|
||||
case ts.SyntaxKind.ThisKeyword:
|
||||
case ts.SyntaxKind.SuperKeyword:
|
||||
case ts.SyntaxKind.ArrayLiteral:
|
||||
case ts.SyntaxKind.ObjectLiteral:
|
||||
case ts.SyntaxKind.PropertyAccess:
|
||||
case ts.SyntaxKind.IndexedAccess:
|
||||
case ts.SyntaxKind.ArrayLiteralExpression:
|
||||
case ts.SyntaxKind.ObjectLiteralExpression:
|
||||
case ts.SyntaxKind.PropertyAccessExpression:
|
||||
case ts.SyntaxKind.ElementAccessExpression:
|
||||
case ts.SyntaxKind.CallExpression:
|
||||
case ts.SyntaxKind.NewExpression:
|
||||
case ts.SyntaxKind.TypeAssertion:
|
||||
case ts.SyntaxKind.ParenExpression:
|
||||
case ts.SyntaxKind.TypeAssertionExpression:
|
||||
case ts.SyntaxKind.ParenthesizedExpression:
|
||||
case ts.SyntaxKind.FunctionExpression:
|
||||
case ts.SyntaxKind.ArrowFunction:
|
||||
case ts.SyntaxKind.PrefixOperator:
|
||||
case ts.SyntaxKind.PostfixOperator:
|
||||
case ts.SyntaxKind.TypeOfExpression:
|
||||
case ts.SyntaxKind.VoidExpression:
|
||||
case ts.SyntaxKind.DeleteExpression:
|
||||
case ts.SyntaxKind.PrefixUnaryExpression:
|
||||
case ts.SyntaxKind.PostfixUnaryExpression:
|
||||
case ts.SyntaxKind.BinaryExpression:
|
||||
case ts.SyntaxKind.ConditionalExpression:
|
||||
this.log(node, this.getTypeOfNode(node));
|
||||
|
||||
@@ -242,8 +242,8 @@ module ts.BreakpointResolver {
|
||||
}
|
||||
|
||||
// Breakpoint in type assertion goes to its operand
|
||||
if (node.parent.kind === SyntaxKind.TypeAssertion && (<TypeAssertion>node.parent).type === node) {
|
||||
return spanInNode((<TypeAssertion>node.parent).operand);
|
||||
if (node.parent.kind === SyntaxKind.TypeAssertionExpression && (<TypeAssertion>node.parent).type === node) {
|
||||
return spanInNode((<TypeAssertion>node.parent).expression);
|
||||
}
|
||||
|
||||
// return type of function go to previous token
|
||||
@@ -483,8 +483,8 @@ module ts.BreakpointResolver {
|
||||
}
|
||||
|
||||
function spanInGreaterThanOrLessThanToken(node: Node): TextSpan {
|
||||
if (node.parent.kind === SyntaxKind.TypeAssertion) {
|
||||
return spanInNode((<TypeAssertion>node.parent).operand);
|
||||
if (node.parent.kind === SyntaxKind.TypeAssertionExpression) {
|
||||
return spanInNode((<TypeAssertion>node.parent).expression);
|
||||
}
|
||||
|
||||
return spanInNode(node.parent);
|
||||
|
||||
@@ -523,7 +523,7 @@ module ts.formatting {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Block:
|
||||
case SyntaxKind.SwitchStatement:
|
||||
case SyntaxKind.ObjectLiteral:
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
case SyntaxKind.TryBlock:
|
||||
case SyntaxKind.CatchBlock:
|
||||
case SyntaxKind.FinallyBlock:
|
||||
@@ -613,7 +613,7 @@ module ts.formatting {
|
||||
}
|
||||
|
||||
static IsObjectContext(context: FormattingContext): boolean {
|
||||
return context.contextNode.kind === SyntaxKind.ObjectLiteral;
|
||||
return context.contextNode.kind === SyntaxKind.ObjectLiteralExpression;
|
||||
}
|
||||
|
||||
static IsFunctionCallContext(context: FormattingContext): boolean {
|
||||
@@ -673,7 +673,7 @@ module ts.formatting {
|
||||
}
|
||||
|
||||
static IsVoidOpContext(context: FormattingContext): boolean {
|
||||
return context.currentTokenSpan.kind === SyntaxKind.VoidKeyword && context.currentTokenParent.kind === SyntaxKind.PrefixOperator;
|
||||
return context.currentTokenSpan.kind === SyntaxKind.VoidKeyword && context.currentTokenParent.kind === SyntaxKind.VoidExpression;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -109,13 +109,13 @@ module ts {
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
case SyntaxKind.ObjectLiteral:
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
case SyntaxKind.SwitchStatement:
|
||||
var openBrace = findChildOfKind(n, SyntaxKind.OpenBraceToken, sourceFile);
|
||||
var closeBrace = findChildOfKind(n, SyntaxKind.CloseBraceToken, sourceFile);
|
||||
addOutliningSpan(n, openBrace, closeBrace, autoCollapse(n));
|
||||
break;
|
||||
case SyntaxKind.ArrayLiteral:
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
var openBracket = findChildOfKind(n, SyntaxKind.OpenBracketToken, sourceFile);
|
||||
var closeBracket = findChildOfKind(n, SyntaxKind.CloseBracketToken, sourceFile);
|
||||
addOutliningSpan(n, openBracket, closeBracket, autoCollapse(n));
|
||||
|
||||
+34
-30
@@ -349,7 +349,7 @@ module ts {
|
||||
|
||||
// If this is dotted module name, get the doc comments from the parent
|
||||
while (declaration.kind === SyntaxKind.ModuleDeclaration && declaration.parent.kind === SyntaxKind.ModuleDeclaration) {
|
||||
declaration = declaration.parent;
|
||||
declaration = <ModuleDeclaration>declaration.parent;
|
||||
}
|
||||
|
||||
// Get the cleaned js doc comment text from the declaration
|
||||
@@ -712,6 +712,7 @@ module ts {
|
||||
}
|
||||
|
||||
class SourceFileObject extends NodeObject implements SourceFile {
|
||||
public _declarationBrand: any;
|
||||
public filename: string;
|
||||
public text: string;
|
||||
|
||||
@@ -771,7 +772,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
else {
|
||||
namedDeclarations.push(node);
|
||||
namedDeclarations.push(functionDeclaration);
|
||||
}
|
||||
|
||||
forEachChild(node, visit);
|
||||
@@ -1927,21 +1928,21 @@ module ts {
|
||||
}
|
||||
|
||||
function isRightSideOfPropertyAccess(node: Node) {
|
||||
return node && node.parent && node.parent.kind === SyntaxKind.PropertyAccess && (<PropertyAccess>node.parent).right === node;
|
||||
return node && node.parent && node.parent.kind === SyntaxKind.PropertyAccessExpression && (<PropertyAccessExpression>node.parent).name === node;
|
||||
}
|
||||
|
||||
function isCallExpressionTarget(node: Node): boolean {
|
||||
if (isRightSideOfPropertyAccess(node)) {
|
||||
node = node.parent;
|
||||
}
|
||||
return node && node.parent && node.parent.kind === SyntaxKind.CallExpression && (<CallExpression>node.parent).func === node;
|
||||
return node && node.parent && node.parent.kind === SyntaxKind.CallExpression && (<CallExpression>node.parent).expression === node;
|
||||
}
|
||||
|
||||
function isNewExpressionTarget(node: Node): boolean {
|
||||
if (isRightSideOfPropertyAccess(node)) {
|
||||
node = node.parent;
|
||||
}
|
||||
return node && node.parent && node.parent.kind === SyntaxKind.NewExpression && (<CallExpression>node.parent).func === node;
|
||||
return node && node.parent && node.parent.kind === SyntaxKind.NewExpression && (<CallExpression>node.parent).expression === node;
|
||||
}
|
||||
|
||||
function isNameOfModuleDeclaration(node: Node) {
|
||||
@@ -1970,8 +1971,8 @@ module ts {
|
||||
case SyntaxKind.SetAccessor:
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
return (<Declaration>node.parent).name === node;
|
||||
case SyntaxKind.IndexedAccess:
|
||||
return (<IndexedAccess>node.parent).index === node;
|
||||
case SyntaxKind.ElementAccessExpression:
|
||||
return (<ElementAccessExpression>node.parent).argumentExpression === node;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2373,9 +2374,12 @@ module ts {
|
||||
// other wise, it is a request for all visible symbols in the scope, and the node is the current location
|
||||
var node: Node;
|
||||
var isRightOfDot: boolean;
|
||||
if (previousToken && previousToken.kind === SyntaxKind.DotToken &&
|
||||
(previousToken.parent.kind === SyntaxKind.PropertyAccess || previousToken.parent.kind === SyntaxKind.QualifiedName)) {
|
||||
node = (<PropertyAccess>previousToken.parent).left;
|
||||
if (previousToken && previousToken.kind === SyntaxKind.DotToken && previousToken.parent.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
node = (<PropertyAccessExpression>previousToken.parent).expression;
|
||||
isRightOfDot = true;
|
||||
}
|
||||
else if (previousToken && previousToken.kind === SyntaxKind.DotToken && previousToken.parent.kind === SyntaxKind.QualifiedName) {
|
||||
node = (<QualifiedName>previousToken.parent).left;
|
||||
isRightOfDot = true;
|
||||
}
|
||||
else {
|
||||
@@ -2401,7 +2405,7 @@ module ts {
|
||||
var symbols: Symbol[] = [];
|
||||
isMemberCompletion = true;
|
||||
|
||||
if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccess) {
|
||||
if (node.kind === SyntaxKind.Identifier || node.kind === SyntaxKind.QualifiedName || node.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
var symbol = typeInfoResolver.getSymbolInfo(node);
|
||||
|
||||
// This is an alias, follow what it aliases
|
||||
@@ -2412,7 +2416,7 @@ module ts {
|
||||
if (symbol && symbol.flags & SymbolFlags.HasExports) {
|
||||
// Extract module or enum members
|
||||
forEachValue(symbol.exports, symbol => {
|
||||
if (typeInfoResolver.isValidPropertyAccess(<PropertyAccess>(node.parent), symbol.name)) {
|
||||
if (typeInfoResolver.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name)) {
|
||||
symbols.push(symbol);
|
||||
}
|
||||
});
|
||||
@@ -2423,7 +2427,7 @@ module ts {
|
||||
if (type) {
|
||||
// Filter private properties
|
||||
forEach(type.getApparentProperties(), symbol => {
|
||||
if (typeInfoResolver.isValidPropertyAccess(<PropertyAccess>(node.parent), symbol.name)) {
|
||||
if (typeInfoResolver.isValidPropertyAccess(<PropertyAccessExpression>(node.parent), symbol.name)) {
|
||||
symbols.push(symbol);
|
||||
}
|
||||
});
|
||||
@@ -2542,7 +2546,7 @@ module ts {
|
||||
return false;
|
||||
}
|
||||
|
||||
function getContainingObjectLiteralApplicableForCompletion(previousToken: Node): ObjectLiteral {
|
||||
function getContainingObjectLiteralApplicableForCompletion(previousToken: Node): ObjectLiteralExpression {
|
||||
// The locations in an object literal expression that are applicable for completion are property name definition locations.
|
||||
|
||||
if (previousToken) {
|
||||
@@ -2551,8 +2555,8 @@ module ts {
|
||||
switch (previousToken.kind) {
|
||||
case SyntaxKind.OpenBraceToken: // var x = { |
|
||||
case SyntaxKind.CommaToken: // var x = { a: 0, |
|
||||
if (parent && parent.kind === SyntaxKind.ObjectLiteral) {
|
||||
return <ObjectLiteral>parent;
|
||||
if (parent && parent.kind === SyntaxKind.ObjectLiteralExpression) {
|
||||
return <ObjectLiteralExpression>parent;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2878,8 +2882,8 @@ module ts {
|
||||
|
||||
var type = typeResolver.getNarrowedTypeOfSymbol(symbol, location);
|
||||
if (type) {
|
||||
if (location.parent && location.parent.kind === SyntaxKind.PropertyAccess) {
|
||||
var right = (<PropertyAccess>location.parent).right;
|
||||
if (location.parent && location.parent.kind === SyntaxKind.PropertyAccessExpression) {
|
||||
var right = (<PropertyAccessExpression>location.parent).name;
|
||||
// Either the location is on the right of a property access, or on the left and the right is missing
|
||||
if (right === location || (right && right.kind === SyntaxKind.Missing)){
|
||||
location = location.parent;
|
||||
@@ -2903,7 +2907,7 @@ module ts {
|
||||
signature = candidateSignatures[0];
|
||||
}
|
||||
|
||||
var useConstructSignatures = callExpression.kind === SyntaxKind.NewExpression || callExpression.func.kind === SyntaxKind.SuperKeyword;
|
||||
var useConstructSignatures = callExpression.kind === SyntaxKind.NewExpression || callExpression.expression.kind === SyntaxKind.SuperKeyword;
|
||||
var allSignatures = useConstructSignatures ? type.getConstructSignatures() : type.getCallSignatures();
|
||||
|
||||
if (!contains(allSignatures, signature.target || signature)) {
|
||||
@@ -3201,7 +3205,7 @@ module ts {
|
||||
// Try getting just type at this position and show
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Identifier:
|
||||
case SyntaxKind.PropertyAccess:
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
case SyntaxKind.QualifiedName:
|
||||
case SyntaxKind.ThisKeyword:
|
||||
case SyntaxKind.SuperKeyword:
|
||||
@@ -3721,7 +3725,7 @@ module ts {
|
||||
|
||||
function aggregate(node: Node): void {
|
||||
if (node.kind === SyntaxKind.BreakStatement || node.kind === SyntaxKind.ContinueStatement) {
|
||||
statementAccumulator.push(node);
|
||||
statementAccumulator.push(<BreakOrContinueStatement>node);
|
||||
}
|
||||
// Do not cross function boundaries.
|
||||
else if (!isAnyFunction(node)) {
|
||||
@@ -3795,7 +3799,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function getModifierOccurrences(modifier: SyntaxKind, declaration: Declaration) {
|
||||
function getModifierOccurrences(modifier: SyntaxKind, declaration: Node) {
|
||||
var container = declaration.parent;
|
||||
|
||||
// Make sure we only highlight the keyword when it makes sense to do so.
|
||||
@@ -4424,11 +4428,11 @@ module ts {
|
||||
if (symbol && symbol.flags & (SymbolFlags.Class | SymbolFlags.Interface)) {
|
||||
forEach(symbol.getDeclarations(), declaration => {
|
||||
if (declaration.kind === SyntaxKind.ClassDeclaration) {
|
||||
getPropertySymbolFromTypeReference((<ClassDeclaration>declaration).baseType);
|
||||
forEach((<ClassDeclaration>declaration).implementedTypes, getPropertySymbolFromTypeReference);
|
||||
getPropertySymbolFromTypeReference(getClassBaseTypeNode(<ClassDeclaration>declaration));
|
||||
forEach(getClassImplementedTypeNodes(<ClassDeclaration>declaration), getPropertySymbolFromTypeReference);
|
||||
}
|
||||
else if (declaration.kind === SyntaxKind.InterfaceDeclaration) {
|
||||
forEach((<InterfaceDeclaration>declaration).baseTypes, getPropertySymbolFromTypeReference);
|
||||
forEach(getInterfaceBaseTypeNodes(<InterfaceDeclaration>declaration), getPropertySymbolFromTypeReference);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -4574,7 +4578,7 @@ module ts {
|
||||
|
||||
var parent = node.parent;
|
||||
if (parent) {
|
||||
if (parent.kind === SyntaxKind.PostfixOperator || parent.kind === SyntaxKind.PrefixOperator) {
|
||||
if (parent.kind === SyntaxKind.PostfixUnaryExpression || parent.kind === SyntaxKind.PrefixUnaryExpression) {
|
||||
return true;
|
||||
}
|
||||
else if (parent.kind === SyntaxKind.BinaryExpression && (<BinaryExpression>parent).left === node) {
|
||||
@@ -4736,7 +4740,7 @@ module ts {
|
||||
return emitOutput;
|
||||
}
|
||||
|
||||
function getMeaningFromDeclaration(node: Declaration): SemanticMeaning {
|
||||
function getMeaningFromDeclaration(node: Node): SemanticMeaning {
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.Parameter:
|
||||
case SyntaxKind.VariableDeclaration:
|
||||
@@ -4879,7 +4883,7 @@ module ts {
|
||||
}
|
||||
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.PropertyAccess:
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
case SyntaxKind.QualifiedName:
|
||||
case SyntaxKind.StringLiteral:
|
||||
case SyntaxKind.FalseKeyword:
|
||||
@@ -5063,8 +5067,8 @@ module ts {
|
||||
// the '=' in a variable declaration is special cased here.
|
||||
if (token.parent.kind === SyntaxKind.BinaryExpression ||
|
||||
token.parent.kind === SyntaxKind.VariableDeclaration ||
|
||||
token.parent.kind === SyntaxKind.PrefixOperator ||
|
||||
token.parent.kind === SyntaxKind.PostfixOperator ||
|
||||
token.parent.kind === SyntaxKind.PrefixUnaryExpression ||
|
||||
token.parent.kind === SyntaxKind.PostfixUnaryExpression ||
|
||||
token.parent.kind === SyntaxKind.ConditionalExpression) {
|
||||
return ClassificationTypeNames.operator;
|
||||
}
|
||||
|
||||
@@ -227,10 +227,10 @@ module ts.formatting {
|
||||
return (<TypeReferenceNode>node.parent).typeArguments;
|
||||
}
|
||||
break;
|
||||
case SyntaxKind.ObjectLiteral:
|
||||
return (<ObjectLiteral>node.parent).properties;
|
||||
case SyntaxKind.ArrayLiteral:
|
||||
return (<ArrayLiteral>node.parent).elements;
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
return (<ObjectLiteralExpression>node.parent).properties;
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
return (<ArrayLiteralExpression>node.parent).elements;
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.FunctionExpression:
|
||||
case SyntaxKind.ArrowFunction:
|
||||
@@ -323,19 +323,19 @@ module ts.formatting {
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
case SyntaxKind.ArrayLiteral:
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
case SyntaxKind.Block:
|
||||
case SyntaxKind.FunctionBlock:
|
||||
case SyntaxKind.TryBlock:
|
||||
case SyntaxKind.CatchBlock:
|
||||
case SyntaxKind.FinallyBlock:
|
||||
case SyntaxKind.ModuleBlock:
|
||||
case SyntaxKind.ObjectLiteral:
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
case SyntaxKind.TypeLiteral:
|
||||
case SyntaxKind.SwitchStatement:
|
||||
case SyntaxKind.DefaultClause:
|
||||
case SyntaxKind.CaseClause:
|
||||
case SyntaxKind.ParenExpression:
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
case SyntaxKind.CallExpression:
|
||||
case SyntaxKind.NewExpression:
|
||||
case SyntaxKind.VariableStatement:
|
||||
@@ -397,7 +397,7 @@ module ts.formatting {
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.InterfaceDeclaration:
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
case SyntaxKind.ObjectLiteral:
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
case SyntaxKind.Block:
|
||||
case SyntaxKind.CatchBlock:
|
||||
case SyntaxKind.FinallyBlock:
|
||||
@@ -405,7 +405,7 @@ module ts.formatting {
|
||||
case SyntaxKind.ModuleBlock:
|
||||
case SyntaxKind.SwitchStatement:
|
||||
return nodeEndsWith(n, SyntaxKind.CloseBraceToken, sourceFile);
|
||||
case SyntaxKind.ParenExpression:
|
||||
case SyntaxKind.ParenthesizedExpression:
|
||||
case SyntaxKind.CallSignature:
|
||||
case SyntaxKind.CallExpression:
|
||||
case SyntaxKind.ConstructSignature:
|
||||
@@ -424,7 +424,7 @@ module ts.formatting {
|
||||
return isCompletedNode((<IfStatement>n).thenStatement, sourceFile);
|
||||
case SyntaxKind.ExpressionStatement:
|
||||
return isCompletedNode((<ExpressionStatement>n).expression, sourceFile);
|
||||
case SyntaxKind.ArrayLiteral:
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
return nodeEndsWith(n, SyntaxKind.CloseBracketToken, sourceFile);
|
||||
case SyntaxKind.Missing:
|
||||
return false;
|
||||
|
||||
@@ -20,9 +20,6 @@ tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(3
|
||||
tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(31,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(32,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(38,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(42,30): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(44,13): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(46,21): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(54,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(57,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(58,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
@@ -40,7 +37,7 @@ tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(6
|
||||
tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(70,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts (40 errors) ====
|
||||
==== tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts (37 errors) ====
|
||||
// expected error for all the LHS of assignments
|
||||
var value;
|
||||
|
||||
@@ -119,20 +116,14 @@ tests/cases/conformance/expressions/assignmentOperator/assignmentLHSIsValue.ts(7
|
||||
constructor() { super(); super = value; }
|
||||
~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
|
||||
foo() { super = value }
|
||||
~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
|
||||
static sfoo() { super = value; }
|
||||
~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
}
|
||||
|
||||
// function expression
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/compiler/badArraySyntax.ts(6,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(7,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(8,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(9,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(10,17): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(6,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(7,15): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(8,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(9,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/badArraySyntax.ts(10,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
|
||||
|
||||
==== tests/cases/compiler/badArraySyntax.ts (5 errors) ====
|
||||
@@ -12,18 +12,18 @@ tests/cases/compiler/badArraySyntax.ts(10,17): error TS1150: 'new T[]' cannot be
|
||||
|
||||
var a1: Z[] = [];
|
||||
var a2 = new Z[];
|
||||
~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
var a3 = new Z[]();
|
||||
~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
var a4: Z[] = new Z[];
|
||||
~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
var a5: Z[] = new Z[]();
|
||||
~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
var a6: Z[][] = new Z [ ] [ ];
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,9): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,21): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,15): error TS2339: Property 'ClassA' does not exist on type 'typeof M'.
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ tests/cases/compiler/cannotInvokeNewOnErrorExpression.ts(5,15): error TS2339: Pr
|
||||
class ClassA {}
|
||||
}
|
||||
var t = new M.ClassA[];
|
||||
~~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2339: Property 'ClassA' does not exist on type 'typeof M'.
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(7,19): error TS1133: Type reference expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,19): error TS1133: Type reference expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(9,24): error TS1005: ';' expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(3,17): error TS2304: Cannot find name 'number'.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive.ts(4,18): error TS2304: Cannot find name 'string'.
|
||||
@@ -28,13 +28,13 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
|
||||
!!! error TS2304: Cannot find name 'Void'.
|
||||
class C4a extends void {}
|
||||
~~~~
|
||||
!!! error TS1003: Identifier expected.
|
||||
!!! error TS1133: Type reference expected.
|
||||
class C5 extends Null { }
|
||||
~~~~
|
||||
!!! error TS2304: Cannot find name 'Null'.
|
||||
class C5a extends null { }
|
||||
~~~~
|
||||
!!! error TS1003: Identifier expected.
|
||||
!!! error TS1133: Type reference expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
class C6 extends undefined { }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(3,19): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(3,19): error TS1133: Type reference expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,19): error TS1133: Type reference expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendingPrimitive2.ts(4,24): error TS1005: ';' expected.
|
||||
|
||||
|
||||
@@ -8,9 +8,9 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
|
||||
|
||||
class C4a extends void {}
|
||||
~~~~
|
||||
!!! error TS1003: Identifier expected.
|
||||
!!! error TS1133: Type reference expected.
|
||||
class C5a extends null { }
|
||||
~~~~
|
||||
!!! error TS1003: Identifier expected.
|
||||
!!! error TS1133: Type reference expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
@@ -1,5 +1,4 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(6,18): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,18): error TS1133: Type reference expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(16,20): error TS1005: ';' expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(4,17): error TS2311: A class may only extend another class.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(8,18): error TS2304: Cannot find name 'x'.
|
||||
@@ -7,7 +6,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts(14,18): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (7 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType.ts (6 errors) ====
|
||||
interface I {
|
||||
foo: string;
|
||||
}
|
||||
@@ -16,8 +15,6 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
|
||||
!!! error TS2311: A class may only extend another class.
|
||||
|
||||
class C2 extends { foo: string; } { } // error
|
||||
~
|
||||
!!! error TS1003: Identifier expected.
|
||||
var x: { foo: string; }
|
||||
class C3 extends x { } // error
|
||||
~
|
||||
@@ -35,6 +32,6 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla
|
||||
|
||||
class C6 extends []{ } // error
|
||||
~
|
||||
!!! error TS1003: Identifier expected.
|
||||
!!! error TS1133: Type reference expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
@@ -1,15 +1,12 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(1,18): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,18): error TS1133: Type reference expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts(3,20): error TS1005: ';' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (3 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsEveryObjectType2.ts (2 errors) ====
|
||||
class C2 extends { foo: string; } { } // error
|
||||
~
|
||||
!!! error TS1003: Identifier expected.
|
||||
|
||||
class C6 extends []{ } // error
|
||||
~
|
||||
!!! error TS1003: Identifier expected.
|
||||
!!! error TS1133: Type reference expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
@@ -1,12 +1,9 @@
|
||||
tests/cases/compiler/classExtendsMultipleBaseClasses.ts(3,18): error TS1005: '{' expected.
|
||||
tests/cases/compiler/classExtendsMultipleBaseClasses.ts(3,21): error TS1005: ';' expected.
|
||||
tests/cases/compiler/classExtendsMultipleBaseClasses.ts(3,19): error TS1174: Classes can only extend a single class.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classExtendsMultipleBaseClasses.ts (2 errors) ====
|
||||
==== tests/cases/compiler/classExtendsMultipleBaseClasses.ts (1 errors) ====
|
||||
class A { }
|
||||
class B { }
|
||||
class C extends A,B { }
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS1174: Classes can only extend a single class.
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/compiler/classHeritageWithTrailingSeparator.ts(2,18): error TS1005: '{' expected.
|
||||
tests/cases/compiler/classHeritageWithTrailingSeparator.ts(2,18): error TS1009: Trailing comma not allowed.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classHeritageWithTrailingSeparator.ts (1 errors) ====
|
||||
class C { foo: number }
|
||||
class D extends C, {
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
!!! error TS1009: Trailing comma not allowed.
|
||||
}
|
||||
@@ -42,12 +42,6 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(55,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(62,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(63,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(69,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(70,9): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(74,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(75,9): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(79,9): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(80,9): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(91,1): error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(92,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(95,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
@@ -80,7 +74,7 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa
|
||||
tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts(122,1): error TS2364: Invalid left-hand side of assignment expression.
|
||||
|
||||
|
||||
==== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts (80 errors) ====
|
||||
==== tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsValue.ts (74 errors) ====
|
||||
// expected error for all the LHS of compound assignments (arithmetic and addition)
|
||||
var value;
|
||||
|
||||
@@ -220,39 +214,27 @@ tests/cases/conformance/expressions/assignmentOperator/compoundAssignmentLHSIsVa
|
||||
super *= value;
|
||||
~~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
super += value;
|
||||
~~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
}
|
||||
|
||||
foo() {
|
||||
super *= value;
|
||||
~~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
super += value;
|
||||
~~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
}
|
||||
|
||||
static sfoo() {
|
||||
super *= value;
|
||||
~~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~
|
||||
!!! error TS2362: The left-hand side of an arithmetic operation must be of type 'any', 'number' or an enum type.
|
||||
super += value;
|
||||
~~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~
|
||||
!!! error TS2364: Invalid left-hand side of assignment expression.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,9): error TS
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,27): error TS1135: Argument expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,33): error TS1005: '(' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,43): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,59): error TS1109: Expression expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,60): error TS1005: ';' expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(257,65): error TS1129: Statement expected.
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,9): error TS1129: Statement expected.
|
||||
@@ -88,7 +87,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,29): error T
|
||||
tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error TS2304: Cannot find name 'string'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (88 errors) ====
|
||||
==== tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts (87 errors) ====
|
||||
declare module "fs" {
|
||||
export class File {
|
||||
constructor(filename: string);
|
||||
@@ -498,8 +497,6 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(259,37): error T
|
||||
~
|
||||
!!! error TS1005: '(' expected.
|
||||
~~~
|
||||
!!! error TS1109: Expression expected.
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
tests/cases/compiler/createArray.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(6,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(7,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(8,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(1,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(6,6): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(7,19): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(8,18): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/createArray.ts(1,12): error TS2304: Cannot find name 'number'.
|
||||
tests/cases/compiler/createArray.ts(7,12): error TS2304: Cannot find name 'boolean'.
|
||||
tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'string'.
|
||||
@@ -9,7 +9,7 @@ tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'strin
|
||||
|
||||
==== tests/cases/compiler/createArray.ts (7 errors) ====
|
||||
var na=new number[];
|
||||
~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'number'.
|
||||
@@ -18,15 +18,15 @@ tests/cases/compiler/createArray.ts(8,12): error TS2304: Cannot find name 'strin
|
||||
}
|
||||
|
||||
new C[];
|
||||
~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
var ba=new boolean[];
|
||||
~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'boolean'.
|
||||
var sa=new string[];
|
||||
~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'string'.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,29): error TS1003: Identifier expected.
|
||||
tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(5,1): error TS1003: Identifier expected.
|
||||
tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'.
|
||||
|
||||
|
||||
@@ -7,9 +7,9 @@ tests/cases/compiler/enumConflictsWithGlobalIdentifier.ts(4,9): error TS2304: Ca
|
||||
IgnoreRulesSpecific = 0,
|
||||
}
|
||||
var x = IgnoreRulesSpecific.
|
||||
|
||||
!!! error TS1003: Identifier expected.
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'IgnoreRulesSpecific'.
|
||||
var y = Position.IgnoreRulesSpecific;
|
||||
|
||||
!!! error TS1003: Identifier expected.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/enumMemberResolution.ts(4,29): error TS1003: Identifier expected.
|
||||
tests/cases/compiler/enumMemberResolution.ts(5,1): error TS1003: Identifier expected.
|
||||
tests/cases/compiler/enumMemberResolution.ts(4,9): error TS2304: Cannot find name 'IgnoreRulesSpecific'.
|
||||
|
||||
|
||||
@@ -7,10 +7,10 @@ tests/cases/compiler/enumMemberResolution.ts(4,9): error TS2304: Cannot find nam
|
||||
IgnoreRulesSpecific = 0
|
||||
}
|
||||
var x = IgnoreRulesSpecific. // error
|
||||
|
||||
!!! error TS1003: Identifier expected.
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'IgnoreRulesSpecific'.
|
||||
var y = 1;
|
||||
|
||||
!!! error TS1003: Identifier expected.
|
||||
var z = Position2.IgnoreRulesSpecific; // no error
|
||||
|
||||
@@ -1,21 +1,12 @@
|
||||
tests/cases/compiler/extendsClauseAlreadySeen.ts(4,19): error TS1005: '{' expected.
|
||||
tests/cases/compiler/extendsClauseAlreadySeen.ts(4,29): error TS1005: ';' expected.
|
||||
tests/cases/compiler/extendsClauseAlreadySeen.ts(5,11): error TS1005: ';' expected.
|
||||
tests/cases/compiler/extendsClauseAlreadySeen.ts(5,5): error TS2304: Cannot find name 'baz'.
|
||||
tests/cases/compiler/extendsClauseAlreadySeen.ts(4,19): error TS1172: 'extends' clause already seen.
|
||||
|
||||
|
||||
==== tests/cases/compiler/extendsClauseAlreadySeen.ts (4 errors) ====
|
||||
==== tests/cases/compiler/extendsClauseAlreadySeen.ts (1 errors) ====
|
||||
class C {
|
||||
|
||||
}
|
||||
class D extends C extends C {
|
||||
~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
!!! error TS1172: 'extends' clause already seen.
|
||||
baz() { }
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'baz'.
|
||||
}
|
||||
@@ -1,20 +1,12 @@
|
||||
tests/cases/compiler/extendsClauseAlreadySeen2.ts(4,30): error TS1005: '{' expected.
|
||||
tests/cases/compiler/extendsClauseAlreadySeen2.ts(4,38): error TS2365: Operator '>' cannot be applied to types 'boolean' and '{ baz: () => void; }'.
|
||||
tests/cases/compiler/extendsClauseAlreadySeen2.ts(4,40): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/compiler/extendsClauseAlreadySeen2.ts(4,30): error TS1172: 'extends' clause already seen.
|
||||
|
||||
|
||||
==== tests/cases/compiler/extendsClauseAlreadySeen2.ts (3 errors) ====
|
||||
==== tests/cases/compiler/extendsClauseAlreadySeen2.ts (1 errors) ====
|
||||
class C<T> {
|
||||
|
||||
}
|
||||
class D<T> extends C<number> extends C<string> {
|
||||
~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~~~~~~~~~~~
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'string'.
|
||||
!!! error TS1172: 'extends' clause already seen.
|
||||
baz() { }
|
||||
~~~~~~~~~~~~~
|
||||
}
|
||||
~
|
||||
!!! error TS2365: Operator '>' cannot be applied to types 'boolean' and '{ baz: () => void; }'.
|
||||
}
|
||||
@@ -1,16 +1,8 @@
|
||||
tests/cases/compiler/implementClausePrecedingExtends.ts(2,22): error TS1005: '{' expected.
|
||||
tests/cases/compiler/implementClausePrecedingExtends.ts(2,32): error TS1005: ';' expected.
|
||||
tests/cases/compiler/implementClausePrecedingExtends.ts(2,7): error TS2420: Class 'D' incorrectly implements interface 'C'.
|
||||
Property 'foo' is missing in type 'D'.
|
||||
tests/cases/compiler/implementClausePrecedingExtends.ts(2,22): error TS1173: 'extends' clause must precede 'implements' clause.
|
||||
|
||||
|
||||
==== tests/cases/compiler/implementClausePrecedingExtends.ts (3 errors) ====
|
||||
==== tests/cases/compiler/implementClausePrecedingExtends.ts (1 errors) ====
|
||||
class C { foo: number }
|
||||
class D implements C extends C { }
|
||||
~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS2420: Class 'D' incorrectly implements interface 'C'.
|
||||
!!! error TS2420: Property 'foo' is missing in type 'D'.
|
||||
!!! error TS1173: 'extends' clause must precede 'implements' clause.
|
||||
@@ -1,27 +1,12 @@
|
||||
tests/cases/compiler/implementsClauseAlreadySeen.ts(4,22): error TS1005: '{' expected.
|
||||
tests/cases/compiler/implementsClauseAlreadySeen.ts(4,33): error TS1005: ';' expected.
|
||||
tests/cases/compiler/implementsClauseAlreadySeen.ts(4,35): error TS1005: ';' expected.
|
||||
tests/cases/compiler/implementsClauseAlreadySeen.ts(5,11): error TS1005: ';' expected.
|
||||
tests/cases/compiler/implementsClauseAlreadySeen.ts(4,22): error TS2304: Cannot find name 'implements'.
|
||||
tests/cases/compiler/implementsClauseAlreadySeen.ts(5,5): error TS2304: Cannot find name 'baz'.
|
||||
tests/cases/compiler/implementsClauseAlreadySeen.ts(4,22): error TS1175: 'implements' clause already seen.
|
||||
|
||||
|
||||
==== tests/cases/compiler/implementsClauseAlreadySeen.ts (6 errors) ====
|
||||
==== tests/cases/compiler/implementsClauseAlreadySeen.ts (1 errors) ====
|
||||
class C {
|
||||
|
||||
}
|
||||
class D implements C implements C {
|
||||
~~~~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'implements'.
|
||||
!!! error TS1175: 'implements' clause already seen.
|
||||
baz() { }
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'baz'.
|
||||
}
|
||||
@@ -1,14 +1,10 @@
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,15): error TS1005: '{' expected.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,26): error TS1005: ';' expected.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,30): error TS1005: ';' expected.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,15): error TS1176: Interface declaration cannot have 'implements' clause.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(1,11): error TS2310: Type 'Foo' recursively references itself as a base type.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(4,11): error TS2310: Type 'Foo2<T>' recursively references itself as a base type.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(7,11): error TS2310: Type 'Foo3<T>' recursively references itself as a base type.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,15): error TS2304: Cannot find name 'implements'.
|
||||
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts(10,26): error TS2304: Cannot find name 'Bar'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts (8 errors) ====
|
||||
==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFromItself.ts (4 errors) ====
|
||||
interface Foo extends Foo { // error
|
||||
~~~
|
||||
!!! error TS2310: Type 'Foo' recursively references itself as a base type.
|
||||
@@ -26,15 +22,7 @@ tests/cases/conformance/interfaces/interfaceDeclarations/interfaceThatInheritsFr
|
||||
|
||||
interface Bar implements Bar { // error
|
||||
~~~~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~~~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'implements'.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Bar'.
|
||||
!!! error TS1176: Interface declaration cannot have 'implements' clause.
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,10 @@
|
||||
tests/cases/compiler/interfaceWithImplements1.ts(3,16): error TS1005: '{' expected.
|
||||
tests/cases/compiler/interfaceWithImplements1.ts(3,27): error TS1005: ';' expected.
|
||||
tests/cases/compiler/interfaceWithImplements1.ts(3,32): error TS1005: ';' expected.
|
||||
tests/cases/compiler/interfaceWithImplements1.ts(3,16): error TS2304: Cannot find name 'implements'.
|
||||
tests/cases/compiler/interfaceWithImplements1.ts(3,27): error TS2304: Cannot find name 'IFoo'.
|
||||
tests/cases/compiler/interfaceWithImplements1.ts(3,16): error TS1176: Interface declaration cannot have 'implements' clause.
|
||||
|
||||
|
||||
==== tests/cases/compiler/interfaceWithImplements1.ts (5 errors) ====
|
||||
==== tests/cases/compiler/interfaceWithImplements1.ts (1 errors) ====
|
||||
interface IFoo { }
|
||||
|
||||
interface IBar implements IFoo {
|
||||
~~~~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~~~~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'implements'.
|
||||
~~~~
|
||||
!!! error TS2304: Cannot find name 'IFoo'.
|
||||
!!! error TS1176: Interface declaration cannot have 'implements' clause.
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/compiler/libMembers.ts(9,11): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/libMembers.ts(9,16): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/libMembers.ts(4,3): error TS2339: Property 'subby' does not exist on type 'string'.
|
||||
tests/cases/compiler/libMembers.ts(12,15): error TS2339: Property 'prototype' does not exist on type 'C'.
|
||||
|
||||
@@ -15,7 +15,7 @@ tests/cases/compiler/libMembers.ts(12,15): error TS2339: Property 'prototype' do
|
||||
export class C {
|
||||
}
|
||||
var a=new C[];
|
||||
~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
a.length;
|
||||
a.push(new C());
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
tests/cases/compiler/multipleInheritance.ts(9,19): error TS1005: '{' expected.
|
||||
tests/cases/compiler/multipleInheritance.ts(9,24): error TS1005: ';' expected.
|
||||
tests/cases/compiler/multipleInheritance.ts(18,19): error TS1005: '{' expected.
|
||||
tests/cases/compiler/multipleInheritance.ts(18,24): error TS1005: ';' expected.
|
||||
tests/cases/compiler/multipleInheritance.ts(9,21): error TS1174: Classes can only extend a single class.
|
||||
tests/cases/compiler/multipleInheritance.ts(18,21): error TS1174: Classes can only extend a single class.
|
||||
tests/cases/compiler/multipleInheritance.ts(34,7): error TS2415: Class 'Baad' incorrectly extends base class 'Good'.
|
||||
Types of property 'g' are incompatible.
|
||||
Type '(n: number) => number' is not assignable to type '() => number'.
|
||||
tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function.
|
||||
|
||||
|
||||
==== tests/cases/compiler/multipleInheritance.ts (6 errors) ====
|
||||
==== tests/cases/compiler/multipleInheritance.ts (4 errors) ====
|
||||
class B1 {
|
||||
public x;
|
||||
}
|
||||
@@ -18,10 +16,8 @@ tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' d
|
||||
}
|
||||
|
||||
class C extends B1, B2 { // duplicate member
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~~
|
||||
!!! error TS1174: Classes can only extend a single class.
|
||||
}
|
||||
|
||||
class D1 extends B1 {
|
||||
@@ -31,10 +27,8 @@ tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' d
|
||||
}
|
||||
|
||||
class E extends D1, D2 { // nope, duplicate member
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~~
|
||||
!!! error TS1174: Classes can only extend a single class.
|
||||
}
|
||||
|
||||
class N {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/newOperator.ts(18,10): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/newOperator.ts(20,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/newOperator.ts(18,20): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/newOperator.ts(22,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/compiler/newOperator.ts(44,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
||||
tests/cases/compiler/newOperator.ts(3,13): error TS2304: Cannot find name 'ifc'.
|
||||
tests/cases/compiler/newOperator.ts(10,10): error TS2351: Cannot use 'new' with an expression whose type lacks a call or construct signature.
|
||||
@@ -38,16 +38,14 @@ tests/cases/compiler/newOperator.ts(31,10): error TS2351: Cannot use 'new' with
|
||||
|
||||
// Various spacing
|
||||
var t3 = new string[]( );
|
||||
~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'string'.
|
||||
var t4 =
|
||||
new
|
||||
~~~
|
||||
string
|
||||
~~~~~~
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'string'.
|
||||
[
|
||||
~
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
tests/cases/compiler/objectLitArrayDeclNoNew.ts(22,20): error TS1109: Expression expected.
|
||||
tests/cases/compiler/objectLitArrayDeclNoNew.ts(27,1): error TS1128: Declaration or statement expected.
|
||||
|
||||
|
||||
==== tests/cases/compiler/objectLitArrayDeclNoNew.ts (2 errors) ====
|
||||
==== tests/cases/compiler/objectLitArrayDeclNoNew.ts (1 errors) ====
|
||||
declare var console;
|
||||
"use strict";
|
||||
module Test {
|
||||
@@ -25,8 +24,6 @@ tests/cases/compiler/objectLitArrayDeclNoNew.ts(27,1): error TS1128: Declaration
|
||||
var state:IState= null;
|
||||
return {
|
||||
tokens: Gar[],//IToken[], // Missing new. Correct syntax is: tokens: new IToken[]
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
endState: state
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration1.ts(1,19): error TS1005: '{' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration1.ts(1,29): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration1.ts(1,19): error TS1172: 'extends' clause already seen.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration1.ts(1,17): error TS2304: Cannot find name 'A'.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration1.ts(1,27): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration1.ts (4 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration1.ts (2 errors) ====
|
||||
class C extends A extends B {
|
||||
~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
!!! error TS1172: 'extends' clause already seen.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'A'.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'B'.
|
||||
}
|
||||
@@ -1,23 +1,11 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration2.ts(1,22): error TS1005: '{' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration2.ts(1,33): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration2.ts(1,35): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration2.ts(1,22): error TS1175: 'implements' clause already seen.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration2.ts(1,20): error TS2304: Cannot find name 'A'.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration2.ts(1,22): error TS2304: Cannot find name 'implements'.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration2.ts(1,33): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration2.ts (6 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration2.ts (2 errors) ====
|
||||
class C implements A implements B {
|
||||
~~~~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
!!! error TS1175: 'implements' clause already seen.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'A'.
|
||||
~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'implements'.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'B'.
|
||||
}
|
||||
@@ -1,15 +1,12 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration3.ts(1,22): error TS1005: '{' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration3.ts(1,32): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration3.ts(1,22): error TS1173: 'extends' clause must precede 'implements' clause.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration3.ts(1,20): error TS2304: Cannot find name 'A'.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration3.ts(1,30): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration3.ts (4 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration3.ts (3 errors) ====
|
||||
class C implements A extends B {
|
||||
~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
!!! error TS1173: 'extends' clause must precede 'implements' clause.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'A'.
|
||||
~
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration4.ts(1,32): error TS1005: '{' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration4.ts(1,42): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration4.ts(1,32): error TS1172: 'extends' clause already seen.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration4.ts(1,17): error TS2304: Cannot find name 'A'.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration4.ts(1,30): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration4.ts (4 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration4.ts (3 errors) ====
|
||||
class C extends A implements B extends C {
|
||||
~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
!!! error TS1172: 'extends' clause already seen.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'A'.
|
||||
~
|
||||
|
||||
@@ -1,23 +1,14 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration5.ts(1,32): error TS1005: '{' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration5.ts(1,43): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration5.ts(1,45): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration5.ts(1,32): error TS1175: 'implements' clause already seen.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration5.ts(1,17): error TS2304: Cannot find name 'A'.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration5.ts(1,30): error TS2304: Cannot find name 'B'.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration5.ts(1,32): error TS2304: Cannot find name 'implements'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration5.ts (6 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration5.ts (3 errors) ====
|
||||
class C extends A implements B implements C {
|
||||
~~~~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
!!! error TS1175: 'implements' clause already seen.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'A'.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'B'.
|
||||
~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'implements'.
|
||||
}
|
||||
@@ -1,17 +1,11 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration6.ts(1,18): error TS1005: '{' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration6.ts(1,22): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration6.ts(1,20): error TS1174: Classes can only extend a single class.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration6.ts(1,17): error TS2304: Cannot find name 'A'.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration6.ts(1,20): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration6.ts (4 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClassDeclaration6.ts (2 errors) ====
|
||||
class C extends A, B {
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS1174: Classes can only extend a single class.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'A'.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'B'.
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause1.ts(1,17): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause1.ts(1,16): error TS1097: 'extends' list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause1.ts (1 errors) ====
|
||||
class C extends {
|
||||
~
|
||||
!!! error TS1003: Identifier expected.
|
||||
|
||||
!!! error TS1097: 'extends' list cannot be empty.
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause2.ts(1,18): error TS1005: '{' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause2.ts(1,18): error TS1009: Trailing comma not allowed.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause2.ts(1,17): error TS2304: Cannot find name 'A'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause2.ts (2 errors) ====
|
||||
class C extends A, {
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
!!! error TS1009: Trailing comma not allowed.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'A'.
|
||||
}
|
||||
+4
-10
@@ -1,17 +1,11 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause3.ts(1,28): error TS1005: '{' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause3.ts(1,30): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause3.ts(1,17): error TS2304: Cannot find name 'implements'.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause3.ts(1,16): error TS1097: 'extends' list cannot be empty.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause3.ts(1,28): error TS2304: Cannot find name 'A'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause3.ts (4 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause3.ts (2 errors) ====
|
||||
class C extends implements A {
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'implements'.
|
||||
|
||||
!!! error TS1097: 'extends' list cannot be empty.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'A'.
|
||||
}
|
||||
@@ -1,20 +1,17 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause5.ts(1,18): error TS1005: '{' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause5.ts(1,31): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause5.ts(1,18): error TS1009: Trailing comma not allowed.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause5.ts(1,32): error TS1009: Trailing comma not allowed.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause5.ts(1,17): error TS2304: Cannot find name 'A'.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause5.ts(1,20): error TS2304: Cannot find name 'implements'.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause5.ts(1,31): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause5.ts (5 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/ExtendsOrImplementsClauses/parserErrorRecovery_ExtendsOrImplementsClause5.ts (4 errors) ====
|
||||
class C extends A, implements B, {
|
||||
~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
!!! error TS1009: Trailing comma not allowed.
|
||||
~
|
||||
!!! error TS1009: Trailing comma not allowed.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'A'.
|
||||
~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'implements'.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'B'.
|
||||
}
|
||||
@@ -1,17 +1,11 @@
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration1.ts(1,23): error TS1005: '{' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration1.ts(1,33): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration1.ts(1,23): error TS1172: 'extends' clause already seen.
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration1.ts(1,21): error TS2304: Cannot find name 'A'.
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration1.ts(1,31): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration1.ts (4 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration1.ts (2 errors) ====
|
||||
interface I extends A extends B {
|
||||
~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
!!! error TS1172: 'extends' clause already seen.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'A'.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'B'.
|
||||
}
|
||||
@@ -1,20 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration2.ts(1,13): error TS1005: '{' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration2.ts(1,24): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration2.ts(1,26): error TS1005: ';' expected.
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration2.ts(1,13): error TS2304: Cannot find name 'implements'.
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration2.ts(1,24): error TS2304: Cannot find name 'A'.
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration2.ts(1,13): error TS1176: Interface declaration cannot have 'implements' clause.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration2.ts (5 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration2.ts (1 errors) ====
|
||||
interface I implements A {
|
||||
~~~~~~~~~~
|
||||
!!! error TS1005: '{' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'implements'.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'A'.
|
||||
!!! error TS1176: Interface declaration cannot have 'implements' clause.
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts(1,5): error TS2304: Cannot find name 'Foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral1.ts (2 errors) ====
|
||||
new Foo[];
|
||||
~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Foo'.
|
||||
@@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,1): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,8): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts(1,5): error TS2304: Cannot find name 'Foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/parserObjectCreationArrayLiteral3.ts (2 errors) ====
|
||||
new Foo[]();
|
||||
~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'Foo'.
|
||||
@@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(127,29): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,32): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,37): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(127,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,47): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,42): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(128,36): error TS2304: Cannot find name 'string'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(129,41): error TS2304: Cannot find name 'number'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(130,35): error TS2304: Cannot find name 'boolean'.
|
||||
@@ -472,20 +472,20 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(356,53): error
|
||||
}
|
||||
|
||||
export var tokenTable = new TokenInfo[];
|
||||
~~~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
export var nodeTypeTable = new string[];
|
||||
~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'string'.
|
||||
export var nodeTypeToTokTable = new number[];
|
||||
~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'number'.
|
||||
export var noRegexTable = new boolean[];
|
||||
~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'boolean'.
|
||||
@@ -1474,7 +1474,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(356,53): error
|
||||
|
||||
// TODO: new with length TokenID.LimFixed
|
||||
export var staticTokens = new Token[];
|
||||
~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
export function initializeStaticTokens() {
|
||||
for (var i = 0; i <= TokenID.LimFixed; i++) {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(193,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(193,40): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(867,29): error TS1015: Parameter cannot have question mark and initializer.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1009,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1024,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1009,45): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(1024,47): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(13,22): error TS2304: Cannot find name 'Type'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(14,24): error TS2304: Cannot find name 'ASTFlags'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(17,38): error TS2304: Cannot find name 'CompilerDiagnostics'.
|
||||
@@ -793,7 +793,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'SymbolScope'.
|
||||
public members: AST[] = new AST[];
|
||||
~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
|
||||
constructor () {
|
||||
@@ -2029,7 +2029,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
|
||||
!!! error TS2304: Cannot find name 'Symbol'.
|
||||
if (this.envids == null) {
|
||||
this.envids = new Identifier[];
|
||||
~~~~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
}
|
||||
this.envids[this.envids.length] = id;
|
||||
@@ -2048,7 +2048,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource11.ts(2356,48): error
|
||||
!!! error TS2304: Cannot find name 'Symbol'.
|
||||
if (this.jumpRefs == null) {
|
||||
this.jumpRefs = new Identifier[];
|
||||
~~~~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
}
|
||||
var id = new Identifier(sym.name);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,24): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,37): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts (2 errors) ====
|
||||
@@ -200,7 +200,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource4.ts(195,24): error T
|
||||
export class HashTable {
|
||||
public itemCount: number = 0;
|
||||
public table = new HashEntry[];
|
||||
~~~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
|
||||
constructor (public size: number, public hashFn: (key) =>number,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,33): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,45): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(12,38): error TS2304: Cannot find name 'ASTList'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(12,62): error TS2304: Cannot find name 'TypeLink'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(16,37): error TS2304: Cannot find name 'TypeLink'.
|
||||
@@ -326,7 +326,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T
|
||||
var len = bases.members.length;
|
||||
if (baseTypeLinks == null) {
|
||||
baseTypeLinks = new TypeLink[];
|
||||
~~~~~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'TypeLink'.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(4,1): error TS6053: File 'tests/cases/conformance/parser/ecmascript5/typescript.ts' not found.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(12,31): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(12,39): error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'.
|
||||
@@ -56,7 +56,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource9.ts(200,48): error T
|
||||
!!! error TS2304: Cannot find name 'Type'.
|
||||
if (typeLinks) {
|
||||
extendsList = new Type[];
|
||||
~~~~~~~~~~
|
||||
~~
|
||||
!!! error TS1150: 'new T[]' cannot be used to create an array. Use 'new Array<T>()' instead.
|
||||
~~~~
|
||||
!!! error TS2304: Cannot find name 'Type'.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/superWithTypeArgument.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/compiler/superWithTypeArgument.ts(7,9): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/superWithTypeArgument.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call.
|
||||
|
||||
|
||||
==== tests/cases/compiler/superWithTypeArgument.ts (2 errors) ====
|
||||
@@ -9,10 +9,12 @@ tests/cases/compiler/superWithTypeArgument.ts(7,9): error TS2346: Supplied param
|
||||
|
||||
class D<T> extends C {
|
||||
constructor() {
|
||||
~~~~~~~~~~~~~~~
|
||||
super<T>();
|
||||
~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~~~~~~
|
||||
!!! error TS2346: Supplied parameters do not match any signature of call target.
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
}
|
||||
~~~~~
|
||||
!!! error TS2377: Constructors for derived classes must contain a 'super' call.
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
tests/cases/compiler/superWithTypeArgument2.ts(7,14): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/compiler/superWithTypeArgument2.ts(7,9): error TS2346: Supplied parameters do not match any signature of call target.
|
||||
tests/cases/compiler/superWithTypeArgument2.ts(6,5): error TS2377: Constructors for derived classes must contain a 'super' call.
|
||||
|
||||
|
||||
==== tests/cases/compiler/superWithTypeArgument2.ts (2 errors) ====
|
||||
@@ -9,10 +9,12 @@ tests/cases/compiler/superWithTypeArgument2.ts(7,9): error TS2346: Supplied para
|
||||
|
||||
class D<T> extends C<T> {
|
||||
constructor(x) {
|
||||
~~~~~~~~~~~~~~~~
|
||||
super<T>(x);
|
||||
~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2346: Supplied parameters do not match any signature of call target.
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
}
|
||||
~~~~~
|
||||
!!! error TS2377: Constructors for derived classes must contain a 'super' call.
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must be followed by an argument list or member access.
|
||||
tests/cases/compiler/superWithTypeArgument3.ts(7,5): error TS2377: Constructors for derived classes must contain a 'super' call.
|
||||
|
||||
|
||||
==== tests/cases/compiler/superWithTypeArgument3.ts (1 errors) ====
|
||||
==== tests/cases/compiler/superWithTypeArgument3.ts (2 errors) ====
|
||||
class C<T> {
|
||||
foo: T;
|
||||
bar<U>(x: U) { }
|
||||
@@ -9,10 +10,14 @@ tests/cases/compiler/superWithTypeArgument3.ts(8,14): error TS1034: 'super' must
|
||||
|
||||
class D<T> extends C<T> {
|
||||
constructor() {
|
||||
~~~~~~~~~~~~~~~
|
||||
super<T>();
|
||||
~
|
||||
!!! error TS1034: 'super' must be followed by an argument list or member access.
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
}
|
||||
~~~~~
|
||||
!!! error TS2377: Constructors for derived classes must contain a 'super' call.
|
||||
bar() {
|
||||
super.bar<T>(null);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,25): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,25): error TS1133: Type reference expected.
|
||||
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(38,30): error TS1005: ';' expected.
|
||||
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(3,16): error TS2334: 'this' cannot be referenced in a static property initializer.
|
||||
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(22,15): error TS2332: 'this' cannot be referenced in current location.
|
||||
@@ -53,7 +53,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContexts.ts(45,9):
|
||||
|
||||
class ErrClass3 extends this {
|
||||
~~~~
|
||||
!!! error TS1003: Identifier expected.
|
||||
!!! error TS1133: Type reference expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,25): error TS1003: Identifier expected.
|
||||
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,25): error TS1133: Type reference expected.
|
||||
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(38,30): error TS1005: ';' expected.
|
||||
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(48,1): error TS1148: Cannot compile external modules unless the '--module' flag is provided.
|
||||
tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalModule.ts(48,10): error TS1003: Identifier expected.
|
||||
@@ -55,7 +55,7 @@ tests/cases/conformance/expressions/thisKeyword/thisInInvalidContextsExternalMod
|
||||
|
||||
class ErrClass3 extends this {
|
||||
~~~~
|
||||
!!! error TS1003: Identifier expected.
|
||||
!!! error TS1133: Type reference expected.
|
||||
~
|
||||
!!! error TS1005: ';' expected.
|
||||
|
||||
|
||||
@@ -27,6 +27,5 @@ verify.completionListIsEmpty();
|
||||
goTo.marker("3");
|
||||
verify.completionListIsEmpty();
|
||||
|
||||
// This needs comletion list filtering based on location to work
|
||||
goTo.marker("4");
|
||||
verify.not.completionListIsEmpty();
|
||||
verify.completionListIsEmpty();
|
||||
Reference in New Issue
Block a user