mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge branch 'master' into isDeclarationVisibleAssert
Conflicts: src/compiler/checker.ts
This commit is contained in:
@@ -135,7 +135,6 @@ function concatenateFiles(destinationFile, sourceFiles) {
|
||||
}
|
||||
|
||||
var useDebugMode = true;
|
||||
var generateDeclarations = false;
|
||||
var host = (process.env.host || process.env.TYPESCRIPT_HOST || "node");
|
||||
var compilerFilename = "tsc.js";
|
||||
/* Compiles a file from a list of sources
|
||||
@@ -146,7 +145,7 @@ var compilerFilename = "tsc.js";
|
||||
* @param useBuiltCompiler: true to use the built compiler, false to use the LKG
|
||||
* @param noOutFile: true to compile without using --out
|
||||
*/
|
||||
function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile) {
|
||||
function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOutFile, generateDeclarations) {
|
||||
file(outFile, prereqs, function() {
|
||||
var dir = useBuiltCompiler ? builtLocalDirectory : LKGDirectory;
|
||||
var options = "-removeComments --module commonjs -noImplicitAny ";
|
||||
@@ -157,7 +156,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
|
||||
if (useDebugMode) {
|
||||
options += "--preserveConstEnums ";
|
||||
}
|
||||
|
||||
|
||||
var cmd = host + " " + dir + compilerFilename + " " + options + " ";
|
||||
cmd = cmd + sources.join(" ") + (!noOutFile ? " -out " + outFile : "");
|
||||
if (useDebugMode) {
|
||||
@@ -184,7 +183,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, noOu
|
||||
fs.unlinkSync(outFile);
|
||||
console.log("Compilation of " + outFile + " unsuccessful");
|
||||
});
|
||||
ex.run();
|
||||
ex.run();
|
||||
}, {async: true});
|
||||
}
|
||||
|
||||
@@ -239,7 +238,7 @@ file(diagnosticInfoMapTs, [processDiagnosticMessagesJs, diagnosticMessagesJson],
|
||||
ex.addListener("cmdEnd", function() {
|
||||
complete();
|
||||
});
|
||||
ex.run();
|
||||
ex.run();
|
||||
}, {async: true})
|
||||
|
||||
|
||||
@@ -252,7 +251,8 @@ var tscFile = path.join(builtLocalDirectory, compilerFilename);
|
||||
compileFile(tscFile, compilerSources, [builtLocalDirectory, copyright].concat(compilerSources), [copyright], /*useBuiltCompiler:*/ false);
|
||||
|
||||
var servicesFile = path.join(builtLocalDirectory, "typescriptServices.js");
|
||||
compileFile(servicesFile, servicesSources, [builtLocalDirectory, copyright].concat(servicesSources), [copyright], /*useBuiltCompiler:*/ true);
|
||||
var servicesDefinitionsFile = path.join(builtLocalDirectory, "typescriptServices.d.ts");
|
||||
compileFile(servicesFile, servicesSources, [builtLocalDirectory, copyright].concat(servicesSources), [copyright], /*useBuiltCompiler:*/ true, /*noOutFile:*/ false, /*generateDeclarations:*/ true);
|
||||
|
||||
// Local target to build the compiler and services
|
||||
desc("Builds the full compiler and services");
|
||||
@@ -275,11 +275,6 @@ task("clean", function() {
|
||||
jake.rmRf(builtDirectory);
|
||||
});
|
||||
|
||||
// generate declarations for compiler and services
|
||||
desc("Generate declarations for compiler and services");
|
||||
task("declaration", function() {
|
||||
generateDeclarations = true;
|
||||
});
|
||||
|
||||
// Generate Markdown spec
|
||||
var word2mdJs = path.join(scriptsDirectory, "word2md.js");
|
||||
@@ -314,7 +309,7 @@ task("generate-spec", [specMd])
|
||||
// Makes a new LKG. This target does not build anything, but errors if not all the outputs are present in the built/local directory
|
||||
desc("Makes a new LKG out of the built js files");
|
||||
task("LKG", ["clean", "release", "local"].concat(libraryTargets), function() {
|
||||
var expectedFiles = [tscFile, servicesFile].concat(libraryTargets);
|
||||
var expectedFiles = [tscFile, servicesFile, servicesDefinitionsFile].concat(libraryTargets);
|
||||
var missingFiles = expectedFiles.filter(function (f) {
|
||||
return !fs.existsSync(f);
|
||||
});
|
||||
@@ -547,7 +542,7 @@ file(loggedIOJsPath, [builtLocalDirectory, loggedIOpath], function() {
|
||||
jake.rmRf(temp);
|
||||
complete();
|
||||
});
|
||||
ex.run();
|
||||
ex.run();
|
||||
}, {async: true});
|
||||
|
||||
var instrumenterPath = harnessDirectory + 'instrumenter.ts';
|
||||
|
||||
Vendored
+1
-1
@@ -1489,7 +1489,7 @@ interface Uint32Array extends ArrayBufferView {
|
||||
set(array: number[], offset?: number): void;
|
||||
|
||||
/**
|
||||
* Gets a new Int8Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray.
|
||||
* Gets a new Uint32Array view of the ArrayBuffer Object store for this array, specifying the first and last members of the subarray.
|
||||
* @param begin The index of the beginning of the array.
|
||||
* @param end The index of the end of the array.
|
||||
*/
|
||||
|
||||
+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;
|
||||
}
|
||||
|
||||
|
||||
+263
-189
File diff suppressed because it is too large
Load Diff
@@ -134,6 +134,13 @@ 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." },
|
||||
Binary_digit_expected: { code: 1177, category: DiagnosticCategory.Error, key: "Binary digit expected." },
|
||||
Octal_digit_expected: { code: 1178, category: DiagnosticCategory.Error, key: "Octal digit expected." },
|
||||
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." },
|
||||
|
||||
@@ -491,7 +491,8 @@
|
||||
"category": "Error",
|
||||
"code": 1162
|
||||
},
|
||||
"'yield' expression must be contained_within a generator declaration.": {
|
||||
"'yield' expression must be contained_within a generator declaration."
|
||||
: {
|
||||
"category": "Error",
|
||||
"code": 1163
|
||||
},
|
||||
@@ -527,7 +528,34 @@
|
||||
"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
|
||||
},
|
||||
"Binary digit expected.": {
|
||||
"category": "Error",
|
||||
"code": 1177
|
||||
},
|
||||
"Octal digit expected.": {
|
||||
"category": "Error",
|
||||
"code": 1178
|
||||
},
|
||||
"Duplicate identifier '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2300
|
||||
|
||||
+131
-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);
|
||||
@@ -1944,12 +1945,28 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function isBinaryOrOctalIntegerLiteral(text: string): boolean {
|
||||
if (text.length <= 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (text.charCodeAt(1) === CharacterCodes.B || text.charCodeAt(1) === CharacterCodes.b ||
|
||||
text.charCodeAt(1) === CharacterCodes.O || text.charCodeAt(1) === CharacterCodes.o) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function emitLiteral(node: LiteralExpression) {
|
||||
var text = getLiteralText();
|
||||
|
||||
if (compilerOptions.sourceMap && (node.kind === SyntaxKind.StringLiteral || isTemplateLiteralKind(node.kind))) {
|
||||
writer.writeLiteral(text);
|
||||
}
|
||||
// For version below ES6, emit binary integer literal and octal integer literal in canonical form
|
||||
else if (compilerOptions.target < ScriptTarget.ES6 && node.kind === SyntaxKind.NumericLiteral && isBinaryOrOctalIntegerLiteral(text)) {
|
||||
write(node.text);
|
||||
}
|
||||
else {
|
||||
write(text);
|
||||
}
|
||||
@@ -1996,7 +2013,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 +2044,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 +2187,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitArrayLiteral(node: ArrayLiteral) {
|
||||
function emitArrayLiteral(node: ArrayLiteralExpression) {
|
||||
if (node.flags & NodeFlags.MultiLine) {
|
||||
write("[");
|
||||
increaseIndent();
|
||||
@@ -2186,7 +2203,7 @@ module ts {
|
||||
}
|
||||
}
|
||||
|
||||
function emitObjectLiteral(node: ObjectLiteral) {
|
||||
function emitObjectLiteral(node: ObjectLiteralExpression) {
|
||||
if (!node.properties.length) {
|
||||
write("{}");
|
||||
}
|
||||
@@ -2249,48 +2266,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 +2329,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 +2344,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 +2362,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 +2379,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 +2411,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 +2421,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 +2904,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 +3050,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 +3082,8 @@ module ts {
|
||||
scopeEmitEnd();
|
||||
emitStart(node);
|
||||
write(")(");
|
||||
if (node.baseType) {
|
||||
emit(node.baseType.typeName);
|
||||
if (baseTypeNode) {
|
||||
emit(baseTypeNode.typeName);
|
||||
}
|
||||
write(");");
|
||||
emitEnd(node);
|
||||
@@ -3079,7 +3124,7 @@ module ts {
|
||||
if (ctor) {
|
||||
emitDefaultValueAssignments(ctor);
|
||||
emitRestParameter(ctor);
|
||||
if (node.baseType) {
|
||||
if (baseTypeNode) {
|
||||
var superCall = findInitialSuperCall(ctor);
|
||||
if (superCall) {
|
||||
writeLine();
|
||||
@@ -3089,11 +3134,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 +3276,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 +3422,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 +3516,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
@@ -753,6 +753,30 @@ module ts {
|
||||
return token = SyntaxKind.Identifier;
|
||||
}
|
||||
|
||||
function scanBinaryOrOctalDigits(base: number): number {
|
||||
Debug.assert(base !== 2 || base !== 8, "Expected either base 2 or base 8");
|
||||
|
||||
var value = 0;
|
||||
// For counting number of digits; Valid binaryIntegerLiteral must have at least one binary digit following B or b.
|
||||
// Similarly valid octalIntegerLiteral must have at least one octal digit following o or O.
|
||||
var numberOfDigits = 0;
|
||||
while (true) {
|
||||
var ch = text.charCodeAt(pos);
|
||||
var valueOfCh = ch - CharacterCodes._0;
|
||||
if (!isDigit(ch) || valueOfCh >= base) {
|
||||
break;
|
||||
}
|
||||
value = value * base + valueOfCh;
|
||||
pos++;
|
||||
numberOfDigits++;
|
||||
}
|
||||
// Invalid binaryIntegerLiteral or octalIntegerLiteral
|
||||
if (numberOfDigits === 0) {
|
||||
return -1;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function scan(): SyntaxKind {
|
||||
startPos = pos;
|
||||
precedingLineBreak = false;
|
||||
@@ -933,6 +957,26 @@ module ts {
|
||||
tokenValue = "" + value;
|
||||
return token = SyntaxKind.NumericLiteral;
|
||||
}
|
||||
else if (pos + 2 < len && (text.charCodeAt(pos + 1) === CharacterCodes.B || text.charCodeAt(pos + 1) === CharacterCodes.b)) {
|
||||
pos += 2;
|
||||
var value = scanBinaryOrOctalDigits(/* base */ 2);
|
||||
if (value < 0) {
|
||||
error(Diagnostics.Binary_digit_expected);
|
||||
value = 0;
|
||||
}
|
||||
tokenValue = "" + value;
|
||||
return SyntaxKind.NumericLiteral;
|
||||
}
|
||||
else if (pos + 2 < len && (text.charCodeAt(pos + 1) === CharacterCodes.O || text.charCodeAt(pos + 1) === CharacterCodes.o)) {
|
||||
pos += 2;
|
||||
var value = scanBinaryOrOctalDigits(/* base */ 8);
|
||||
if (value < 0) {
|
||||
error(Diagnostics.Octal_digit_expected);
|
||||
value = 0;
|
||||
}
|
||||
tokenValue = "" + value;
|
||||
return SyntaxKind.NumericLiteral;
|
||||
}
|
||||
// Try to parse as an octal
|
||||
if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) {
|
||||
tokenValue = "" + scanOctalDigits();
|
||||
|
||||
+149
-66
@@ -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,8 @@ module ts {
|
||||
exprName: EntityName;
|
||||
}
|
||||
|
||||
export interface TypeLiteralNode extends TypeNode {
|
||||
// A TypeLiteral is the declaration node for an anonymous symbol.
|
||||
export interface TypeLiteralNode extends TypeNode, Declaration {
|
||||
members: NodeArray<Node>;
|
||||
}
|
||||
|
||||
@@ -422,7 +438,7 @@ module ts {
|
||||
types: NodeArray<TypeNode>;
|
||||
}
|
||||
|
||||
export interface ParenTypeNode extends TypeNode {
|
||||
export interface ParenthesizedTypeNode extends TypeNode {
|
||||
type: TypeNode;
|
||||
}
|
||||
|
||||
@@ -430,13 +446,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 +517,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 +525,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 +541,52 @@ 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>;
|
||||
|
||||
// An ObjectLiteralExpression is the declaration node for an anonymous symbol.
|
||||
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 +669,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 +713,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 +745,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 +865,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 +956,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;
|
||||
|
||||
@@ -552,8 +552,8 @@ var TypeScript;
|
||||
SyntaxKind[SyntaxKind["EnumDeclaration"] = 140] = "EnumDeclaration";
|
||||
SyntaxKind[SyntaxKind["ImportDeclaration"] = 141] = "ImportDeclaration";
|
||||
SyntaxKind[SyntaxKind["ExportAssignment"] = 142] = "ExportAssignment";
|
||||
SyntaxKind[SyntaxKind["MemberFunctionDeclaration"] = 143] = "MemberFunctionDeclaration";
|
||||
SyntaxKind[SyntaxKind["MemberVariableDeclaration"] = 144] = "MemberVariableDeclaration";
|
||||
SyntaxKind[SyntaxKind["MethodDeclaration"] = 143] = "MethodDeclaration";
|
||||
SyntaxKind[SyntaxKind["PropertyDeclaration"] = 144] = "PropertyDeclaration";
|
||||
SyntaxKind[SyntaxKind["ConstructorDeclaration"] = 145] = "ConstructorDeclaration";
|
||||
SyntaxKind[SyntaxKind["GetAccessor"] = 146] = "GetAccessor";
|
||||
SyntaxKind[SyntaxKind["SetAccessor"] = 147] = "SetAccessor";
|
||||
@@ -587,7 +587,7 @@ var TypeScript;
|
||||
SyntaxKind[SyntaxKind["ConditionalExpression"] = 175] = "ConditionalExpression";
|
||||
SyntaxKind[SyntaxKind["BinaryExpression"] = 176] = "BinaryExpression";
|
||||
SyntaxKind[SyntaxKind["PostfixUnaryExpression"] = 177] = "PostfixUnaryExpression";
|
||||
SyntaxKind[SyntaxKind["MemberAccessExpression"] = 178] = "MemberAccessExpression";
|
||||
SyntaxKind[SyntaxKind["PropertyAccessExpression"] = 178] = "PropertyAccessExpression";
|
||||
SyntaxKind[SyntaxKind["InvocationExpression"] = 179] = "InvocationExpression";
|
||||
SyntaxKind[SyntaxKind["ArrayLiteralExpression"] = 180] = "ArrayLiteralExpression";
|
||||
SyntaxKind[SyntaxKind["ObjectLiteralExpression"] = 181] = "ObjectLiteralExpression";
|
||||
@@ -1297,7 +1297,7 @@ var definitions = [
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'MemberAccessExpressionSyntax',
|
||||
name: 'PropertyAccessExpressionSyntax',
|
||||
baseType: 'ISyntaxNode',
|
||||
interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'],
|
||||
children: [
|
||||
@@ -1530,7 +1530,7 @@ var definitions = [
|
||||
isTypeScriptSpecific: true
|
||||
},
|
||||
{
|
||||
name: 'MemberFunctionDeclarationSyntax',
|
||||
name: 'MethodDeclarationSyntax',
|
||||
baseType: 'ISyntaxNode',
|
||||
interfaces: ['IMemberDeclarationSyntax', 'IPropertyAssignmentSyntax'],
|
||||
children: [
|
||||
@@ -1568,7 +1568,7 @@ var definitions = [
|
||||
isTypeScriptSpecific: true
|
||||
},
|
||||
{
|
||||
name: 'MemberVariableDeclarationSyntax',
|
||||
name: 'PropertyDeclarationSyntax',
|
||||
baseType: 'ISyntaxNode',
|
||||
interfaces: ['IMemberDeclarationSyntax'],
|
||||
children: [
|
||||
@@ -1900,7 +1900,7 @@ var definitions = [
|
||||
interfaces: ['IUnaryExpressionSyntax'],
|
||||
children: [
|
||||
{ name: 'awaitKeyword', isToken: true },
|
||||
{ name: 'expression', type: 'IExpressionSyntax', isOptional: true }
|
||||
{ name: 'expression', type: 'IUnaryExpressionSyntax', isOptional: true }
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -602,7 +602,7 @@ module TypeScript.Parser {
|
||||
return createMissingToken(SyntaxKind.IdentifierName, token, diagnosticCode);
|
||||
}
|
||||
|
||||
function canEatAutomaticSemicolon(allowWithoutNewLine: boolean): boolean {
|
||||
function canEatAutomaticSemicolon(): boolean {
|
||||
var token = currentToken();
|
||||
|
||||
// An automatic semicolon is always allowed if we're at the end of the file.
|
||||
@@ -616,10 +616,6 @@ module TypeScript.Parser {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (allowWithoutNewLine) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// It is also allowed if there is a newline between the last token seen and the next one.
|
||||
if (token.hasLeadingNewLine()) {
|
||||
return true;
|
||||
@@ -628,17 +624,17 @@ module TypeScript.Parser {
|
||||
return false;
|
||||
}
|
||||
|
||||
function canEatExplicitOrAutomaticSemicolon(allowWithoutNewline: boolean): boolean {
|
||||
function canEatExplicitOrAutomaticSemicolon(): boolean {
|
||||
var token = currentToken();
|
||||
|
||||
if (token.kind === SyntaxKind.SemicolonToken) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return canEatAutomaticSemicolon(allowWithoutNewline);
|
||||
return canEatAutomaticSemicolon();
|
||||
}
|
||||
|
||||
function eatExplicitOrAutomaticSemicolon(allowWithoutNewline: boolean): ISyntaxToken {
|
||||
function eatExplicitOrAutomaticSemicolon(): ISyntaxToken {
|
||||
var token = currentToken();
|
||||
|
||||
// If we see a semicolon, then we can definitely eat it.
|
||||
@@ -649,7 +645,7 @@ module TypeScript.Parser {
|
||||
// Check if an automatic semicolon could go here. If so, then there's no problem and
|
||||
// we can proceed without error. Return 'undefined' as there's no actual token for this
|
||||
// position.
|
||||
if (canEatAutomaticSemicolon(allowWithoutNewline)) {
|
||||
if (canEatAutomaticSemicolon()) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
@@ -885,7 +881,12 @@ module TypeScript.Parser {
|
||||
|
||||
function parseImportDeclaration(): ImportDeclarationSyntax {
|
||||
return new ImportDeclarationSyntax(contextFlags,
|
||||
parseModifiers(), eatToken(SyntaxKind.ImportKeyword), eatIdentifierToken(), eatToken(SyntaxKind.EqualsToken), parseModuleReference(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false));
|
||||
parseModifiers(),
|
||||
eatToken(SyntaxKind.ImportKeyword),
|
||||
eatIdentifierToken(),
|
||||
eatToken(SyntaxKind.EqualsToken),
|
||||
parseModuleReference(),
|
||||
eatExplicitOrAutomaticSemicolon());
|
||||
}
|
||||
|
||||
function parseExportAssignment(): ExportAssignmentSyntax {
|
||||
@@ -894,7 +895,7 @@ module TypeScript.Parser {
|
||||
eatToken(SyntaxKind.ExportKeyword),
|
||||
eatToken(SyntaxKind.EqualsToken),
|
||||
eatIdentifierToken(),
|
||||
eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false));
|
||||
eatExplicitOrAutomaticSemicolon());
|
||||
}
|
||||
|
||||
function parseModuleReference(): IModuleReferenceSyntax {
|
||||
@@ -993,24 +994,24 @@ module TypeScript.Parser {
|
||||
return tryParseName(allowIdentifierName) || eatIdentifierToken();
|
||||
}
|
||||
|
||||
function eatRightSideOfName(allowIdentifierNames: boolean): ISyntaxToken {
|
||||
function eatRightSideOfDot(allowIdentifierNames: boolean): ISyntaxToken {
|
||||
var _currentToken = currentToken();
|
||||
|
||||
// Technically a keyword is valid here as all keywords are identifier names.
|
||||
// However, often we'll encounter this in error situations when the keyword
|
||||
// is actually starting another valid construct.
|
||||
|
||||
//
|
||||
// So, we check for the following specific case:
|
||||
|
||||
//
|
||||
// name.
|
||||
// keyword identifierNameOrKeyword
|
||||
|
||||
//
|
||||
// Note: the newlines are important here. For example, if that above code
|
||||
// were rewritten into:
|
||||
|
||||
//
|
||||
// name.keyword
|
||||
// identifierNameOrKeyword
|
||||
|
||||
//
|
||||
// Then we would consider it valid. That's because ASI would take effect and
|
||||
// the code would be implicitly: "name.keyword; identifierNameOrKeyword".
|
||||
// In the first case though, ASI will not take effect because there is not a
|
||||
@@ -1041,7 +1042,7 @@ module TypeScript.Parser {
|
||||
|
||||
while (shouldContinue && currentToken().kind === SyntaxKind.DotToken) {
|
||||
var dotToken = consumeToken(currentToken());
|
||||
var identifierName = eatRightSideOfName(allowIdentifierNames);
|
||||
var identifierName = eatRightSideOfDot(allowIdentifierNames);
|
||||
|
||||
current = new QualifiedNameSyntax(contextFlags, current, dotToken, identifierName);
|
||||
shouldContinue = identifierName.fullWidth() > 0;
|
||||
@@ -1375,10 +1376,10 @@ module TypeScript.Parser {
|
||||
// if we have a call signature. If so, then this is a member function, otherwise
|
||||
// it's a member variable.
|
||||
if (asterixToken || isCallSignature(/*peekIndex:*/ 0)) {
|
||||
return parseMemberFunctionDeclaration(modifiers, asterixToken, propertyName);
|
||||
return parseMethodDeclaration(modifiers, asterixToken, propertyName);
|
||||
}
|
||||
else {
|
||||
return parseMemberVariableDeclaration(modifiers, propertyName);
|
||||
return parsePropertyDeclaration(modifiers, propertyName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1405,13 +1406,13 @@ module TypeScript.Parser {
|
||||
parseFunctionBody(/*isGenerator:*/ false, /*asyncContext:*/ false));
|
||||
}
|
||||
|
||||
function parseMemberFunctionDeclaration(modifiers: ISyntaxToken[], asteriskToken: ISyntaxToken, propertyName: IPropertyNameSyntax): MemberFunctionDeclarationSyntax {
|
||||
function parseMethodDeclaration(modifiers: ISyntaxToken[], asteriskToken: ISyntaxToken, propertyName: IPropertyNameSyntax): MethodDeclarationSyntax {
|
||||
// Note: if we see an arrow after the close paren, then try to parse out a function
|
||||
// block anyways. It's likely the user just though '=> expr' was legal anywhere a
|
||||
// block was legal.
|
||||
var asyncContext = containsAsync(modifiers);
|
||||
var isGenerator = asteriskToken !== undefined;
|
||||
return new MemberFunctionDeclarationSyntax(contextFlags,
|
||||
return new MethodDeclarationSyntax(contextFlags,
|
||||
modifiers,
|
||||
asteriskToken,
|
||||
propertyName,
|
||||
@@ -1429,13 +1430,13 @@ module TypeScript.Parser {
|
||||
return false;
|
||||
}
|
||||
|
||||
function parseMemberVariableDeclaration(modifiers: ISyntaxToken[], propertyName: IPropertyNameSyntax): MemberVariableDeclarationSyntax {
|
||||
return new MemberVariableDeclarationSyntax(contextFlags,
|
||||
function parsePropertyDeclaration(modifiers: ISyntaxToken[], propertyName: IPropertyNameSyntax): PropertyDeclarationSyntax {
|
||||
return new PropertyDeclarationSyntax(contextFlags,
|
||||
modifiers,
|
||||
new VariableDeclaratorSyntax(contextFlags, propertyName,
|
||||
parseOptionalTypeAnnotation(/*allowStringLiteral:*/ false),
|
||||
isEqualsValueClause(/*inParameter*/ false) ? allowInAnd(parseEqualsValueClause) : undefined),
|
||||
eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false));
|
||||
eatExplicitOrAutomaticSemicolon());
|
||||
}
|
||||
|
||||
function isIndexMemberDeclaration(): boolean {
|
||||
@@ -1471,7 +1472,7 @@ module TypeScript.Parser {
|
||||
function parseFunctionBody(isGenerator: boolean, asyncContext: boolean): BlockSyntax | ExpressionBody | ISyntaxToken {
|
||||
return isBlockOrArrow()
|
||||
? parseFunctionBlockOrExpressionBody(/*yieldContext:*/ isGenerator, /*asyncContext:*/ asyncContext)
|
||||
: eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false);
|
||||
: eatExplicitOrAutomaticSemicolon();
|
||||
}
|
||||
|
||||
function parseModuleName(): INameSyntax {
|
||||
@@ -1508,7 +1509,7 @@ module TypeScript.Parser {
|
||||
eatIdentifierToken(),
|
||||
eatToken(SyntaxKind.EqualsToken),
|
||||
parseType(),
|
||||
eatExplicitOrAutomaticSemicolon(/*allowWithoutNewLine:*/ false));
|
||||
eatExplicitOrAutomaticSemicolon());
|
||||
}
|
||||
|
||||
function parseObjectType(): ObjectTypeSyntax {
|
||||
@@ -1902,7 +1903,9 @@ module TypeScript.Parser {
|
||||
}
|
||||
|
||||
function parseDebuggerStatement(debuggerKeyword: ISyntaxToken): DebuggerStatementSyntax {
|
||||
return new DebuggerStatementSyntax(contextFlags, consumeToken(debuggerKeyword), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false));
|
||||
return new DebuggerStatementSyntax(contextFlags,
|
||||
consumeToken(debuggerKeyword),
|
||||
eatExplicitOrAutomaticSemicolon());
|
||||
}
|
||||
|
||||
function parseDoStatement(doKeyword: ISyntaxToken): DoStatementSyntax {
|
||||
@@ -1914,8 +1917,13 @@ module TypeScript.Parser {
|
||||
// spec but allowed in consensus reality. Approved -- this is the de-facto standard whereby
|
||||
// do;while(0)x will have a semicolon inserted before x.
|
||||
return new DoStatementSyntax(contextFlags,
|
||||
consumeToken(doKeyword), parseStatement(/*inErrorRecovery:*/ false), eatToken(SyntaxKind.WhileKeyword), eatToken(SyntaxKind.OpenParenToken),
|
||||
allowInAnd(parseExpression), eatToken(SyntaxKind.CloseParenToken), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ true));
|
||||
consumeToken(doKeyword),
|
||||
parseStatement(/*inErrorRecovery:*/ false),
|
||||
eatToken(SyntaxKind.WhileKeyword),
|
||||
eatToken(SyntaxKind.OpenParenToken),
|
||||
allowInAnd(parseExpression),
|
||||
eatToken(SyntaxKind.CloseParenToken),
|
||||
tryEatToken(SyntaxKind.SemicolonToken));
|
||||
}
|
||||
|
||||
function isLabeledStatement(currentToken: ISyntaxToken): boolean {
|
||||
@@ -2093,7 +2101,7 @@ module TypeScript.Parser {
|
||||
// If there is no newline after the break keyword, then we can consume an optional
|
||||
// identifier.
|
||||
var identifier: ISyntaxToken = undefined;
|
||||
if (!canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false)) {
|
||||
if (!canEatExplicitOrAutomaticSemicolon()) {
|
||||
if (isIdentifier(currentToken())) {
|
||||
return eatIdentifierToken();
|
||||
}
|
||||
@@ -2104,12 +2112,16 @@ module TypeScript.Parser {
|
||||
|
||||
function parseBreakStatement(breakKeyword: ISyntaxToken): BreakStatementSyntax {
|
||||
return new BreakStatementSyntax(contextFlags,
|
||||
consumeToken(breakKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false));
|
||||
consumeToken(breakKeyword),
|
||||
tryEatBreakOrContinueLabel(),
|
||||
eatExplicitOrAutomaticSemicolon());
|
||||
}
|
||||
|
||||
function parseContinueStatement(continueKeyword: ISyntaxToken): ContinueStatementSyntax {
|
||||
return new ContinueStatementSyntax(contextFlags,
|
||||
consumeToken(continueKeyword), tryEatBreakOrContinueLabel(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false));
|
||||
consumeToken(continueKeyword),
|
||||
tryEatBreakOrContinueLabel(),
|
||||
eatExplicitOrAutomaticSemicolon());
|
||||
}
|
||||
|
||||
function parseSwitchExpression(openParenToken: ISyntaxToken) {
|
||||
@@ -2189,7 +2201,9 @@ module TypeScript.Parser {
|
||||
|
||||
function parseThrowStatement(throwKeyword: ISyntaxToken): ThrowStatementSyntax {
|
||||
return new ThrowStatementSyntax(contextFlags,
|
||||
consumeToken(throwKeyword), tryParseThrowStatementExpression(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false));
|
||||
consumeToken(throwKeyword),
|
||||
tryParseThrowStatementExpression(),
|
||||
eatExplicitOrAutomaticSemicolon());
|
||||
}
|
||||
|
||||
function tryParseThrowStatementExpression(): IExpressionSyntax {
|
||||
@@ -2201,19 +2215,21 @@ module TypeScript.Parser {
|
||||
// directly as that might consume an expression on the following line.
|
||||
// We just return 'undefined' in that case. The actual error will be reported in the
|
||||
// grammar walker.
|
||||
return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) ? undefined : allowInAnd(parseExpression);
|
||||
return canEatExplicitOrAutomaticSemicolon() ? undefined : allowInAnd(parseExpression);
|
||||
}
|
||||
|
||||
function parseReturnStatement(returnKeyword: ISyntaxToken): ReturnStatementSyntax {
|
||||
return new ReturnStatementSyntax(contextFlags,
|
||||
consumeToken(returnKeyword), tryParseReturnStatementExpression(), eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false));
|
||||
consumeToken(returnKeyword),
|
||||
tryParseReturnStatementExpression(),
|
||||
eatExplicitOrAutomaticSemicolon());
|
||||
}
|
||||
|
||||
function tryParseReturnStatementExpression(): IExpressionSyntax {
|
||||
// ReturnStatement[Yield] :
|
||||
// return [no LineTerminator here]Expression[In, ?Yield];
|
||||
|
||||
return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false) ? undefined : allowInAnd(parseExpression);
|
||||
return canEatExplicitOrAutomaticSemicolon() ? undefined : allowInAnd(parseExpression);
|
||||
}
|
||||
|
||||
function isExpressionStatement(currentToken: ISyntaxToken): boolean {
|
||||
@@ -2330,7 +2346,7 @@ module TypeScript.Parser {
|
||||
|
||||
return new ExpressionStatementSyntax(contextFlags,
|
||||
allowInAnd(parseExpression),
|
||||
eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false));
|
||||
eatExplicitOrAutomaticSemicolon());
|
||||
}
|
||||
|
||||
function parseIfStatement(ifKeyword: ISyntaxToken): IfStatementSyntax {
|
||||
@@ -2384,7 +2400,7 @@ module TypeScript.Parser {
|
||||
return new VariableStatementSyntax(contextFlags,
|
||||
parseModifiers(),
|
||||
allowInAnd(parseVariableDeclaration),
|
||||
eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false));
|
||||
eatExplicitOrAutomaticSemicolon());
|
||||
}
|
||||
|
||||
function parseVariableDeclaration(): VariableDeclarationSyntax {
|
||||
@@ -2608,7 +2624,7 @@ module TypeScript.Parser {
|
||||
function parseAwaitExpression(awaitKeyword: ISyntaxToken): AwaitExpressionSyntax {
|
||||
return new AwaitExpressionSyntax(contextFlags,
|
||||
consumeToken(awaitKeyword),
|
||||
parseAssignmentExpressionOrHigher());
|
||||
parseUnaryExpressionOrHigher(currentToken()));
|
||||
}
|
||||
|
||||
function isYieldExpression(_currentToken: ISyntaxToken): boolean {
|
||||
@@ -2898,7 +2914,10 @@ module TypeScript.Parser {
|
||||
continue;
|
||||
|
||||
case SyntaxKind.DotToken:
|
||||
expression = new MemberAccessExpressionSyntax(contextFlags, expression, consumeToken(_currentToken), eatIdentifierNameToken());
|
||||
expression = new PropertyAccessExpressionSyntax(contextFlags,
|
||||
expression,
|
||||
consumeToken(_currentToken),
|
||||
eatRightSideOfDot(/*allowIdentifierNames:*/ true));
|
||||
continue;
|
||||
|
||||
case SyntaxKind.NoSubstitutionTemplateToken:
|
||||
@@ -2988,9 +3007,14 @@ module TypeScript.Parser {
|
||||
// If we have seen "super" it must be followed by '(' or '.'.
|
||||
// If it wasn't then just try to parse out a '.' and report an error.
|
||||
var currentTokenKind = currentToken().kind;
|
||||
return currentTokenKind === SyntaxKind.OpenParenToken || currentTokenKind === SyntaxKind.DotToken
|
||||
? expression
|
||||
: new MemberAccessExpressionSyntax(contextFlags, expression, eatToken(SyntaxKind.DotToken), eatIdentifierNameToken());
|
||||
if (currentTokenKind === SyntaxKind.OpenParenToken || currentTokenKind === SyntaxKind.DotToken) {
|
||||
return expression;
|
||||
}
|
||||
|
||||
return new PropertyAccessExpressionSyntax(contextFlags,
|
||||
expression,
|
||||
eatToken(SyntaxKind.DotToken),
|
||||
eatRightSideOfDot(/*allowIdentifierNames:*/ true));
|
||||
}
|
||||
|
||||
function parsePostfixExpressionOrHigher(_currentToken: ISyntaxToken): IPostfixExpressionSyntax {
|
||||
@@ -3664,7 +3688,7 @@ module TypeScript.Parser {
|
||||
var propertyName = parsePropertyName();
|
||||
|
||||
if (modifiers.length > 0 || asterixToken !== undefined || isCallSignature(/*peekIndex:*/ 0)) {
|
||||
return parseMemberFunctionDeclaration(modifiers, asterixToken, propertyName);
|
||||
return parseMethodDeclaration(modifiers, asterixToken, propertyName);
|
||||
}
|
||||
else {
|
||||
// PropertyName[?Yield] : AssignmentExpression[In, ?Yield]
|
||||
@@ -3852,7 +3876,7 @@ module TypeScript.Parser {
|
||||
return consumeToken(_currentToken);
|
||||
}
|
||||
|
||||
return eatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false);
|
||||
return eatExplicitOrAutomaticSemicolon();
|
||||
}
|
||||
|
||||
function tryParseTypeParameterList(requireCompleteTypeParameterList: boolean): TypeParameterListSyntax {
|
||||
@@ -4645,7 +4669,7 @@ module TypeScript.Parser {
|
||||
}
|
||||
|
||||
// We're done when we can eat a semicolon.
|
||||
return canEatExplicitOrAutomaticSemicolon(/*allowWithoutNewline:*/ false);
|
||||
return canEatExplicitOrAutomaticSemicolon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -535,7 +535,7 @@ module TypeScript.PrettyPrinter {
|
||||
this.appendNode(node.equalsValueClause);
|
||||
}
|
||||
|
||||
public visitMemberAccessExpression(node: MemberAccessExpressionSyntax): void {
|
||||
public visitPropertyAccessExpression(node: PropertyAccessExpressionSyntax): void {
|
||||
visitNodeOrToken(this, node.expression);
|
||||
this.appendToken(node.dotToken);
|
||||
this.appendToken(node.name);
|
||||
@@ -693,7 +693,7 @@ module TypeScript.PrettyPrinter {
|
||||
this.appendBody(node.body);
|
||||
}
|
||||
|
||||
public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void {
|
||||
public visitMethodDeclaration(node: MethodDeclarationSyntax): void {
|
||||
this.appendSpaceList(node.modifiers);
|
||||
this.ensureSpace();
|
||||
visitNodeOrToken(this, node.propertyName);
|
||||
@@ -723,7 +723,7 @@ module TypeScript.PrettyPrinter {
|
||||
visitNodeOrToken(this, node.body);
|
||||
}
|
||||
|
||||
public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): void {
|
||||
public visitPropertyDeclaration(node: PropertyDeclarationSyntax): void {
|
||||
this.appendSpaceList(node.modifiers);
|
||||
this.ensureSpace();
|
||||
visitNodeOrToken(this, node.variableDeclarator);
|
||||
|
||||
@@ -436,7 +436,7 @@ var definitions:ITypeDefinition[] = [
|
||||
]
|
||||
},
|
||||
<any>{
|
||||
name: 'MemberAccessExpressionSyntax',
|
||||
name: 'PropertyAccessExpressionSyntax',
|
||||
baseType: 'ISyntaxNode',
|
||||
interfaces: ['IMemberExpressionSyntax', 'ICallExpressionSyntax'],
|
||||
children: [
|
||||
@@ -670,7 +670,7 @@ var definitions:ITypeDefinition[] = [
|
||||
isTypeScriptSpecific: true
|
||||
},
|
||||
<any>{
|
||||
name: 'MemberFunctionDeclarationSyntax',
|
||||
name: 'MethodDeclarationSyntax',
|
||||
baseType: 'ISyntaxNode',
|
||||
interfaces: ['IMemberDeclarationSyntax', 'IPropertyAssignmentSyntax'],
|
||||
children: [
|
||||
@@ -708,7 +708,7 @@ var definitions:ITypeDefinition[] = [
|
||||
isTypeScriptSpecific: true
|
||||
},
|
||||
<any>{
|
||||
name: 'MemberVariableDeclarationSyntax',
|
||||
name: 'PropertyDeclarationSyntax',
|
||||
baseType: 'ISyntaxNode',
|
||||
interfaces: ['IMemberDeclarationSyntax'],
|
||||
children: [
|
||||
@@ -1029,7 +1029,7 @@ var definitions:ITypeDefinition[] = [
|
||||
interfaces: ['IUnaryExpressionSyntax'],
|
||||
children: [
|
||||
<any>{ name: 'awaitKeyword', isToken: true },
|
||||
<any>{ name: 'expression', type: 'IExpressionSyntax', isOptional: true }]
|
||||
<any>{ name: 'expression', type: 'IUnaryExpressionSyntax', isOptional: true }]
|
||||
},
|
||||
<any>{
|
||||
name: 'DebuggerStatementSyntax',
|
||||
|
||||
@@ -150,21 +150,21 @@ module TypeScript {
|
||||
}
|
||||
export interface ExportAssignmentConstructor { new (data: number, modifiers: ISyntaxToken[], exportKeyword: ISyntaxToken, equalsToken: ISyntaxToken, identifier: ISyntaxToken, semicolonToken: ISyntaxToken): ExportAssignmentSyntax }
|
||||
|
||||
export interface MemberFunctionDeclarationSyntax extends ISyntaxNode, IMemberDeclarationSyntax, IPropertyAssignmentSyntax {
|
||||
export interface MethodDeclarationSyntax extends ISyntaxNode, IMemberDeclarationSyntax, IPropertyAssignmentSyntax {
|
||||
modifiers: ISyntaxToken[];
|
||||
asterixToken: ISyntaxToken;
|
||||
propertyName: IPropertyNameSyntax;
|
||||
callSignature: CallSignatureSyntax;
|
||||
body: BlockSyntax | ExpressionBody | ISyntaxToken;
|
||||
}
|
||||
export interface MemberFunctionDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): MemberFunctionDeclarationSyntax }
|
||||
export interface MethodDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken): MethodDeclarationSyntax }
|
||||
|
||||
export interface MemberVariableDeclarationSyntax extends ISyntaxNode, IMemberDeclarationSyntax {
|
||||
export interface PropertyDeclarationSyntax extends ISyntaxNode, IMemberDeclarationSyntax {
|
||||
modifiers: ISyntaxToken[];
|
||||
variableDeclarator: VariableDeclaratorSyntax;
|
||||
semicolonToken: ISyntaxToken;
|
||||
}
|
||||
export interface MemberVariableDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken): MemberVariableDeclarationSyntax }
|
||||
export interface PropertyDeclarationConstructor { new (data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken): PropertyDeclarationSyntax }
|
||||
|
||||
export interface ConstructorDeclarationSyntax extends ISyntaxNode, IClassElementSyntax {
|
||||
modifiers: ISyntaxToken[];
|
||||
@@ -426,12 +426,12 @@ module TypeScript {
|
||||
}
|
||||
export interface PostfixUnaryExpressionConstructor { new (data: number, operand: ILeftHandSideExpressionSyntax, operatorToken: ISyntaxToken): PostfixUnaryExpressionSyntax }
|
||||
|
||||
export interface MemberAccessExpressionSyntax extends ISyntaxNode, IMemberExpressionSyntax, ICallExpressionSyntax {
|
||||
export interface PropertyAccessExpressionSyntax extends ISyntaxNode, IMemberExpressionSyntax, ICallExpressionSyntax {
|
||||
expression: ILeftHandSideExpressionSyntax;
|
||||
dotToken: ISyntaxToken;
|
||||
name: ISyntaxToken;
|
||||
}
|
||||
export interface MemberAccessExpressionConstructor { new (data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken): MemberAccessExpressionSyntax }
|
||||
export interface PropertyAccessExpressionConstructor { new (data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken): PropertyAccessExpressionSyntax }
|
||||
|
||||
export interface InvocationExpressionSyntax extends ISyntaxNode, ICallExpressionSyntax {
|
||||
expression: ILeftHandSideExpressionSyntax;
|
||||
@@ -534,9 +534,9 @@ module TypeScript {
|
||||
|
||||
export interface AwaitExpressionSyntax extends ISyntaxNode, IUnaryExpressionSyntax {
|
||||
awaitKeyword: ISyntaxToken;
|
||||
expression: IExpressionSyntax;
|
||||
expression: IUnaryExpressionSyntax;
|
||||
}
|
||||
export interface AwaitExpressionConstructor { new (data: number, awaitKeyword: ISyntaxToken, expression: IExpressionSyntax): AwaitExpressionSyntax }
|
||||
export interface AwaitExpressionConstructor { new (data: number, awaitKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax): AwaitExpressionSyntax }
|
||||
|
||||
export interface VariableDeclarationSyntax extends ISyntaxNode {
|
||||
varConstOrLetKeyword: ISyntaxToken;
|
||||
|
||||
@@ -179,8 +179,8 @@ module TypeScript {
|
||||
ExportAssignment,
|
||||
|
||||
// ClassElements
|
||||
MemberFunctionDeclaration,
|
||||
MemberVariableDeclaration,
|
||||
MethodDeclaration,
|
||||
PropertyDeclaration,
|
||||
ConstructorDeclaration,
|
||||
|
||||
// ClassElement and PropertyAssignment
|
||||
@@ -222,7 +222,7 @@ module TypeScript {
|
||||
ConditionalExpression,
|
||||
BinaryExpression,
|
||||
PostfixUnaryExpression,
|
||||
MemberAccessExpression,
|
||||
PropertyAccessExpression,
|
||||
InvocationExpression,
|
||||
ArrayLiteralExpression,
|
||||
ObjectLiteralExpression,
|
||||
|
||||
@@ -409,7 +409,7 @@ module TypeScript {
|
||||
}
|
||||
}
|
||||
|
||||
export var MemberFunctionDeclarationSyntax: MemberFunctionDeclarationConstructor = <any>function(data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) {
|
||||
export var MethodDeclarationSyntax: MethodDeclarationConstructor = <any>function(data: number, modifiers: ISyntaxToken[], asterixToken: ISyntaxToken, propertyName: IPropertyNameSyntax, callSignature: CallSignatureSyntax, body: BlockSyntax | ExpressionBody | ISyntaxToken) {
|
||||
if (data) { this.__data = data; }
|
||||
this.modifiers = modifiers,
|
||||
this.asterixToken = asterixToken,
|
||||
@@ -422,9 +422,9 @@ module TypeScript {
|
||||
callSignature.parent = this,
|
||||
body && (body.parent = this);
|
||||
};
|
||||
MemberFunctionDeclarationSyntax.prototype.kind = SyntaxKind.MemberFunctionDeclaration;
|
||||
MemberFunctionDeclarationSyntax.prototype.childCount = 5;
|
||||
MemberFunctionDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement {
|
||||
MethodDeclarationSyntax.prototype.kind = SyntaxKind.MethodDeclaration;
|
||||
MethodDeclarationSyntax.prototype.childCount = 5;
|
||||
MethodDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement {
|
||||
switch (index) {
|
||||
case 0: return this.modifiers;
|
||||
case 1: return this.asterixToken;
|
||||
@@ -434,7 +434,7 @@ module TypeScript {
|
||||
}
|
||||
}
|
||||
|
||||
export var MemberVariableDeclarationSyntax: MemberVariableDeclarationConstructor = <any>function(data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken) {
|
||||
export var PropertyDeclarationSyntax: PropertyDeclarationConstructor = <any>function(data: number, modifiers: ISyntaxToken[], variableDeclarator: VariableDeclaratorSyntax, semicolonToken: ISyntaxToken) {
|
||||
if (data) { this.__data = data; }
|
||||
this.modifiers = modifiers,
|
||||
this.variableDeclarator = variableDeclarator,
|
||||
@@ -443,9 +443,9 @@ module TypeScript {
|
||||
variableDeclarator.parent = this,
|
||||
semicolonToken && (semicolonToken.parent = this);
|
||||
};
|
||||
MemberVariableDeclarationSyntax.prototype.kind = SyntaxKind.MemberVariableDeclaration;
|
||||
MemberVariableDeclarationSyntax.prototype.childCount = 3;
|
||||
MemberVariableDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement {
|
||||
PropertyDeclarationSyntax.prototype.kind = SyntaxKind.PropertyDeclaration;
|
||||
PropertyDeclarationSyntax.prototype.childCount = 3;
|
||||
PropertyDeclarationSyntax.prototype.childAt = function(index: number): ISyntaxElement {
|
||||
switch (index) {
|
||||
case 0: return this.modifiers;
|
||||
case 1: return this.variableDeclarator;
|
||||
@@ -1167,7 +1167,7 @@ module TypeScript {
|
||||
}
|
||||
}
|
||||
|
||||
export var MemberAccessExpressionSyntax: MemberAccessExpressionConstructor = <any>function(data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken) {
|
||||
export var PropertyAccessExpressionSyntax: PropertyAccessExpressionConstructor = <any>function(data: number, expression: ILeftHandSideExpressionSyntax, dotToken: ISyntaxToken, name: ISyntaxToken) {
|
||||
if (data) { this.__data = data; }
|
||||
this.expression = expression,
|
||||
this.dotToken = dotToken,
|
||||
@@ -1176,9 +1176,9 @@ module TypeScript {
|
||||
dotToken.parent = this,
|
||||
name.parent = this;
|
||||
};
|
||||
MemberAccessExpressionSyntax.prototype.kind = SyntaxKind.MemberAccessExpression;
|
||||
MemberAccessExpressionSyntax.prototype.childCount = 3;
|
||||
MemberAccessExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement {
|
||||
PropertyAccessExpressionSyntax.prototype.kind = SyntaxKind.PropertyAccessExpression;
|
||||
PropertyAccessExpressionSyntax.prototype.childCount = 3;
|
||||
PropertyAccessExpressionSyntax.prototype.childAt = function(index: number): ISyntaxElement {
|
||||
switch (index) {
|
||||
case 0: return this.expression;
|
||||
case 1: return this.dotToken;
|
||||
@@ -1454,7 +1454,7 @@ module TypeScript {
|
||||
}
|
||||
}
|
||||
|
||||
export var AwaitExpressionSyntax: AwaitExpressionConstructor = <any>function(data: number, awaitKeyword: ISyntaxToken, expression: IExpressionSyntax) {
|
||||
export var AwaitExpressionSyntax: AwaitExpressionConstructor = <any>function(data: number, awaitKeyword: ISyntaxToken, expression: IUnaryExpressionSyntax) {
|
||||
if (data) { this.__data = data; }
|
||||
this.awaitKeyword = awaitKeyword,
|
||||
this.expression = expression,
|
||||
|
||||
@@ -551,13 +551,13 @@ module TypeScript {
|
||||
return false;
|
||||
}
|
||||
|
||||
public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): void {
|
||||
public visitPropertyDeclaration(node: PropertyDeclarationSyntax): void {
|
||||
if (this.checkClassElementModifiers(node.modifiers) ||
|
||||
this.checkForDisallowedAsyncModifier(node.modifiers)) {
|
||||
return;
|
||||
}
|
||||
|
||||
super.visitMemberVariableDeclaration(node);
|
||||
super.visitPropertyDeclaration(node);
|
||||
}
|
||||
|
||||
public visitMethodSignature(node: MethodSignatureSyntax): void {
|
||||
@@ -579,7 +579,7 @@ module TypeScript {
|
||||
super.visitPropertySignature(node);
|
||||
}
|
||||
|
||||
public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void {
|
||||
public visitMethodDeclaration(node: MethodDeclarationSyntax): void {
|
||||
if (node.parent && node.parent.parent &&
|
||||
node.parent.kind === SyntaxKind.List && node.parent.parent.kind === SyntaxKind.ObjectLiteralExpression) {
|
||||
|
||||
@@ -603,7 +603,7 @@ module TypeScript {
|
||||
return;
|
||||
}
|
||||
|
||||
super.visitMemberFunctionDeclaration(node);
|
||||
super.visitMethodDeclaration(node);
|
||||
}
|
||||
|
||||
private checkForDisallowedObjectLiteralMethod(modifiers: ISyntaxToken[]): boolean {
|
||||
@@ -1556,7 +1556,7 @@ module TypeScript {
|
||||
}
|
||||
|
||||
private checkVariableDeclaratorIdentifier(node: VariableDeclaratorSyntax): boolean {
|
||||
if (node.parent.kind !== SyntaxKind.MemberVariableDeclaration) {
|
||||
if (node.parent.kind !== SyntaxKind.PropertyDeclaration) {
|
||||
Debug.assert(isToken(node.propertyName), "A normal variable declarator must always have a token for a name.");
|
||||
if (this.checkForDisallowedEvalOrArguments(node, <ISyntaxToken>node.propertyName)) {
|
||||
return true;
|
||||
|
||||
@@ -18,7 +18,7 @@ module TypeScript {
|
||||
case SyntaxKind.ParenthesizedArrowFunctionExpression:
|
||||
case SyntaxKind.FunctionExpression:
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.MemberFunctionDeclaration:
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.ConstructorDeclaration:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
@@ -44,7 +44,7 @@ module TypeScript {
|
||||
export function isLeftHandSizeExpression(element: ISyntaxElement) {
|
||||
if (element) {
|
||||
switch (element.kind) {
|
||||
case SyntaxKind.MemberAccessExpression:
|
||||
case SyntaxKind.PropertyAccessExpression:
|
||||
case SyntaxKind.ElementAccessExpression:
|
||||
case SyntaxKind.TemplateAccessExpression:
|
||||
case SyntaxKind.ObjectCreationExpression:
|
||||
@@ -101,11 +101,10 @@ module TypeScript {
|
||||
switch (element.kind) {
|
||||
case SyntaxKind.ConstructorDeclaration:
|
||||
case SyntaxKind.IndexSignature:
|
||||
case SyntaxKind.MemberFunctionDeclaration:
|
||||
case SyntaxKind.MethodDeclaration:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
case SyntaxKind.MemberFunctionDeclaration:
|
||||
case SyntaxKind.MemberVariableDeclaration:
|
||||
case SyntaxKind.PropertyDeclaration:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -227,40 +226,5 @@ module TypeScript {
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export function isAmbientDeclarationSyntax(positionNode: ISyntaxNode): boolean {
|
||||
if (!positionNode) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var node = positionNode;
|
||||
switch (node.kind) {
|
||||
case SyntaxKind.ModuleDeclaration:
|
||||
case SyntaxKind.ClassDeclaration:
|
||||
case SyntaxKind.FunctionDeclaration:
|
||||
case SyntaxKind.VariableStatement:
|
||||
case SyntaxKind.EnumDeclaration:
|
||||
if (SyntaxUtilities.containsToken(<ISyntaxToken[]>(<any>node).modifiers, SyntaxKind.DeclareKeyword)) {
|
||||
return true;
|
||||
}
|
||||
// Fall through to check if syntax container is ambient
|
||||
|
||||
case SyntaxKind.ImportDeclaration:
|
||||
case SyntaxKind.ConstructorDeclaration:
|
||||
case SyntaxKind.MemberFunctionDeclaration:
|
||||
case SyntaxKind.GetAccessor:
|
||||
case SyntaxKind.SetAccessor:
|
||||
case SyntaxKind.MemberVariableDeclaration:
|
||||
if (SyntaxUtilities.isClassElement(node) || SyntaxUtilities.isModuleElement(node)) {
|
||||
return SyntaxUtilities.isAmbientDeclarationSyntax(Syntax.containingNode(positionNode));
|
||||
}
|
||||
|
||||
case SyntaxKind.EnumElement:
|
||||
return SyntaxUtilities.isAmbientDeclarationSyntax(Syntax.containingNode(Syntax.containingNode(positionNode)));
|
||||
|
||||
default:
|
||||
return SyntaxUtilities.isAmbientDeclarationSyntax(Syntax.containingNode(positionNode));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,8 +22,8 @@ module TypeScript {
|
||||
case SyntaxKind.EnumDeclaration: return visitor.visitEnumDeclaration(<EnumDeclarationSyntax>element);
|
||||
case SyntaxKind.ImportDeclaration: return visitor.visitImportDeclaration(<ImportDeclarationSyntax>element);
|
||||
case SyntaxKind.ExportAssignment: return visitor.visitExportAssignment(<ExportAssignmentSyntax>element);
|
||||
case SyntaxKind.MemberFunctionDeclaration: return visitor.visitMemberFunctionDeclaration(<MemberFunctionDeclarationSyntax>element);
|
||||
case SyntaxKind.MemberVariableDeclaration: return visitor.visitMemberVariableDeclaration(<MemberVariableDeclarationSyntax>element);
|
||||
case SyntaxKind.MethodDeclaration: return visitor.visitMethodDeclaration(<MethodDeclarationSyntax>element);
|
||||
case SyntaxKind.PropertyDeclaration: return visitor.visitPropertyDeclaration(<PropertyDeclarationSyntax>element);
|
||||
case SyntaxKind.ConstructorDeclaration: return visitor.visitConstructorDeclaration(<ConstructorDeclarationSyntax>element);
|
||||
case SyntaxKind.GetAccessor: return visitor.visitGetAccessor(<GetAccessorSyntax>element);
|
||||
case SyntaxKind.SetAccessor: return visitor.visitSetAccessor(<SetAccessorSyntax>element);
|
||||
@@ -57,7 +57,7 @@ module TypeScript {
|
||||
case SyntaxKind.ConditionalExpression: return visitor.visitConditionalExpression(<ConditionalExpressionSyntax>element);
|
||||
case SyntaxKind.BinaryExpression: return visitor.visitBinaryExpression(<BinaryExpressionSyntax>element);
|
||||
case SyntaxKind.PostfixUnaryExpression: return visitor.visitPostfixUnaryExpression(<PostfixUnaryExpressionSyntax>element);
|
||||
case SyntaxKind.MemberAccessExpression: return visitor.visitMemberAccessExpression(<MemberAccessExpressionSyntax>element);
|
||||
case SyntaxKind.PropertyAccessExpression: return visitor.visitPropertyAccessExpression(<PropertyAccessExpressionSyntax>element);
|
||||
case SyntaxKind.InvocationExpression: return visitor.visitInvocationExpression(<InvocationExpressionSyntax>element);
|
||||
case SyntaxKind.ArrayLiteralExpression: return visitor.visitArrayLiteralExpression(<ArrayLiteralExpressionSyntax>element);
|
||||
case SyntaxKind.ObjectLiteralExpression: return visitor.visitObjectLiteralExpression(<ObjectLiteralExpressionSyntax>element);
|
||||
@@ -122,8 +122,8 @@ module TypeScript {
|
||||
visitEnumDeclaration(node: EnumDeclarationSyntax): any;
|
||||
visitImportDeclaration(node: ImportDeclarationSyntax): any;
|
||||
visitExportAssignment(node: ExportAssignmentSyntax): any;
|
||||
visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): any;
|
||||
visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): any;
|
||||
visitMethodDeclaration(node: MethodDeclarationSyntax): any;
|
||||
visitPropertyDeclaration(node: PropertyDeclarationSyntax): any;
|
||||
visitConstructorDeclaration(node: ConstructorDeclarationSyntax): any;
|
||||
visitGetAccessor(node: GetAccessorSyntax): any;
|
||||
visitSetAccessor(node: SetAccessorSyntax): any;
|
||||
@@ -157,7 +157,7 @@ module TypeScript {
|
||||
visitConditionalExpression(node: ConditionalExpressionSyntax): any;
|
||||
visitBinaryExpression(node: BinaryExpressionSyntax): any;
|
||||
visitPostfixUnaryExpression(node: PostfixUnaryExpressionSyntax): any;
|
||||
visitMemberAccessExpression(node: MemberAccessExpressionSyntax): any;
|
||||
visitPropertyAccessExpression(node: PropertyAccessExpressionSyntax): any;
|
||||
visitInvocationExpression(node: InvocationExpressionSyntax): any;
|
||||
visitArrayLiteralExpression(node: ArrayLiteralExpressionSyntax): any;
|
||||
visitObjectLiteralExpression(node: ObjectLiteralExpressionSyntax): any;
|
||||
|
||||
@@ -149,7 +149,7 @@ module TypeScript {
|
||||
this.visitOptionalToken(node.semicolonToken);
|
||||
}
|
||||
|
||||
public visitMemberFunctionDeclaration(node: MemberFunctionDeclarationSyntax): void {
|
||||
public visitMethodDeclaration(node: MethodDeclarationSyntax): void {
|
||||
this.visitList(node.modifiers);
|
||||
this.visitOptionalToken(node.asterixToken);
|
||||
visitNodeOrToken(this, node.propertyName);
|
||||
@@ -157,7 +157,7 @@ module TypeScript {
|
||||
visitNodeOrToken(this, node.body);
|
||||
}
|
||||
|
||||
public visitMemberVariableDeclaration(node: MemberVariableDeclarationSyntax): void {
|
||||
public visitPropertyDeclaration(node: PropertyDeclarationSyntax): void {
|
||||
this.visitList(node.modifiers);
|
||||
visitNodeOrToken(this, node.variableDeclarator);
|
||||
this.visitOptionalToken(node.semicolonToken);
|
||||
@@ -390,7 +390,7 @@ module TypeScript {
|
||||
this.visitToken(node.operatorToken);
|
||||
}
|
||||
|
||||
public visitMemberAccessExpression(node: MemberAccessExpressionSyntax): void {
|
||||
public visitPropertyAccessExpression(node: PropertyAccessExpressionSyntax): void {
|
||||
visitNodeOrToken(this, node.expression);
|
||||
this.visitToken(node.dotToken);
|
||||
this.visitToken(node.name);
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
//// [binaryIntegerLiteral.ts]
|
||||
var bin1 = 0b11010;
|
||||
var bin2 = 0B11010;
|
||||
var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
|
||||
var obj1 = {
|
||||
0b11010: "Hello",
|
||||
a: bin1,
|
||||
bin1,
|
||||
b: 0b11010,
|
||||
0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0B11010: "World",
|
||||
a: bin2,
|
||||
bin2,
|
||||
b: 0B11010,
|
||||
0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,
|
||||
}
|
||||
|
||||
obj1[0b11010]; // string
|
||||
obj1[26]; // string
|
||||
obj1["26"]; // string
|
||||
obj1["0b11010"]; // any
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["bin1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0B11010]; // string
|
||||
obj2[26]; // string
|
||||
obj2["26"]; // string
|
||||
obj2["0B11010"]; // any
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["bin2"]; // number
|
||||
obj2[9.671406556917009e+24]; // boolean
|
||||
obj2["9.671406556917009e+24"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
|
||||
|
||||
|
||||
//// [binaryIntegerLiteral.js]
|
||||
var bin1 = 26;
|
||||
var bin2 = 26;
|
||||
var bin3 = 9.671406556917009e+24;
|
||||
var bin4 = Infinity;
|
||||
var obj1 = {
|
||||
26: "Hello",
|
||||
a: bin1,
|
||||
bin1: bin1,
|
||||
b: 26,
|
||||
Infinity: true,
|
||||
};
|
||||
var obj2 = {
|
||||
26: "World",
|
||||
a: bin2,
|
||||
bin2: bin2,
|
||||
b: 26,
|
||||
9.671406556917009e+24: false,
|
||||
};
|
||||
obj1[26]; // string
|
||||
obj1[26]; // string
|
||||
obj1["26"]; // string
|
||||
obj1["0b11010"]; // any
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["bin1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
obj2[26]; // string
|
||||
obj2[26]; // string
|
||||
obj2["26"]; // string
|
||||
obj2["0B11010"]; // any
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["bin2"]; // number
|
||||
obj2[9.671406556917009e+24]; // boolean
|
||||
obj2["9.671406556917009e+24"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,82 @@
|
||||
//// [binaryIntegerLiteralES6.ts]
|
||||
var bin1 = 0b11010;
|
||||
var bin2 = 0B11010;
|
||||
var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
|
||||
var obj1 = {
|
||||
0b11010: "Hello",
|
||||
a: bin1,
|
||||
bin1,
|
||||
b: 0b11010,
|
||||
0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0B11010: "World",
|
||||
a: bin2,
|
||||
bin2,
|
||||
b: 0B11010,
|
||||
0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,
|
||||
}
|
||||
|
||||
obj1[0b11010]; // string
|
||||
obj1[26]; // string
|
||||
obj1["26"]; // string
|
||||
obj1["0b11010"]; // any
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["bin1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0B11010]; // string
|
||||
obj2[26]; // string
|
||||
obj2["26"]; // string
|
||||
obj2["0B11010"]; // any
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["bin2"]; // number
|
||||
obj2[9.671406556917009e+24]; // boolean
|
||||
obj2["9.671406556917009e+24"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
|
||||
|
||||
|
||||
|
||||
//// [binaryIntegerLiteralES6.js]
|
||||
var bin1 = 0b11010;
|
||||
var bin2 = 0B11010;
|
||||
var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
var obj1 = {
|
||||
0b11010: "Hello",
|
||||
a: bin1,
|
||||
bin1,
|
||||
b: 0b11010,
|
||||
0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,
|
||||
};
|
||||
var obj2 = {
|
||||
0B11010: "World",
|
||||
a: bin2,
|
||||
bin2,
|
||||
b: 0B11010,
|
||||
0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,
|
||||
};
|
||||
obj1[0b11010]; // string
|
||||
obj1[26]; // string
|
||||
obj1["26"]; // string
|
||||
obj1["0b11010"]; // any
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["bin1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
obj2[0B11010]; // string
|
||||
obj2[26]; // string
|
||||
obj2["26"]; // string
|
||||
obj2["0B11010"]; // any
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["bin2"]; // number
|
||||
obj2[9.671406556917009e+24]; // boolean
|
||||
obj2["9.671406556917009e+24"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,28 @@
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts(2,17): error TS1005: ',' expected.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts(3,17): error TS1005: ',' expected.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts(6,5): error TS2300: Duplicate identifier '0b11010'.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts(7,5): error TS2300: Duplicate identifier '26'.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts(8,5): error TS2300: Duplicate identifier '"26"'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/binaryIntegerLiteralError.ts (5 errors) ====
|
||||
// error
|
||||
var bin1 = 0B1102110;
|
||||
~~~~
|
||||
!!! error TS1005: ',' expected.
|
||||
var bin1 = 0b11023410;
|
||||
~~~~~
|
||||
!!! error TS1005: ',' expected.
|
||||
|
||||
var obj1 = {
|
||||
0b11010: "hi",
|
||||
~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '0b11010'.
|
||||
26: "Hello",
|
||||
~~
|
||||
!!! error TS2300: Duplicate identifier '26'.
|
||||
"26": "world",
|
||||
~~~~
|
||||
!!! error TS2300: Duplicate identifier '"26"'.
|
||||
};
|
||||
|
||||
@@ -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.
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/invalidBinaryIntegerLiteralAndOctalIntegerLiteral.ts(2,16): error TS1177: Binary digit expected.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/invalidBinaryIntegerLiteralAndOctalIntegerLiteral.ts(3,17): error TS1177: Binary digit expected.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/invalidBinaryIntegerLiteralAndOctalIntegerLiteral.ts(4,15): error TS1178: Octal digit expected.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/invalidBinaryIntegerLiteralAndOctalIntegerLiteral.ts(5,15): error TS1178: Octal digit expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/invalidBinaryIntegerLiteralAndOctalIntegerLiteral.ts (4 errors) ====
|
||||
// Error
|
||||
var binary = 0b21010;
|
||||
|
||||
!!! error TS1177: Binary digit expected.
|
||||
var binary1 = 0B21010;
|
||||
|
||||
!!! error TS1177: Binary digit expected.
|
||||
var octal = 0o81010;
|
||||
|
||||
!!! error TS1178: Octal digit expected.
|
||||
var octal = 0O91010;
|
||||
|
||||
!!! error TS1178: Octal digit expected.
|
||||
@@ -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
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
//// [octalIntegerLiteral.ts]
|
||||
var oct1 = 0o45436;
|
||||
var oct2 = 0O45436;
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
|
||||
var obj1 = {
|
||||
0o45436: "Hello",
|
||||
a: 0o45436,
|
||||
b: oct1,
|
||||
oct1,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0O45436: "hi",
|
||||
a: 0O45436,
|
||||
b: oct2,
|
||||
oct2,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,
|
||||
}
|
||||
|
||||
obj1[0o45436]; // string
|
||||
obj1["0o45436"]; // any
|
||||
obj1["19230"]; // string
|
||||
obj1[19230]; // string
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["oct1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0O45436]; // string
|
||||
obj2["0O45436"]; // any
|
||||
obj2["19230"]; // string
|
||||
obj2[19230]; // string
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["oct2"]; // number
|
||||
obj2[5.462437423415177e+244]; // boolean
|
||||
obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
|
||||
//// [octalIntegerLiteral.js]
|
||||
var oct1 = 19230;
|
||||
var oct2 = 19230;
|
||||
var oct3 = Infinity;
|
||||
var oct4 = 5.462437423415177e+244;
|
||||
var obj1 = {
|
||||
19230: "Hello",
|
||||
a: 19230,
|
||||
b: oct1,
|
||||
oct1: oct1,
|
||||
Infinity: true
|
||||
};
|
||||
var obj2 = {
|
||||
19230: "hi",
|
||||
a: 19230,
|
||||
b: oct2,
|
||||
oct2: oct2,
|
||||
5.462437423415177e+244: false,
|
||||
};
|
||||
obj1[19230]; // string
|
||||
obj1["0o45436"]; // any
|
||||
obj1["19230"]; // string
|
||||
obj1[19230]; // string
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["oct1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
obj2[19230]; // string
|
||||
obj2["0O45436"]; // any
|
||||
obj2["19230"]; // string
|
||||
obj2[19230]; // string
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["oct2"]; // number
|
||||
obj2[5.462437423415177e+244]; // boolean
|
||||
obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
@@ -0,0 +1,121 @@
|
||||
=== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteral.ts ===
|
||||
var oct1 = 0o45436;
|
||||
>oct1 : number
|
||||
|
||||
var oct2 = 0O45436;
|
||||
>oct2 : number
|
||||
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
>oct3 : number
|
||||
|
||||
var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
>oct4 : number
|
||||
|
||||
var obj1 = {
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
>{ 0o45436: "Hello", a: 0o45436, b: oct1, oct1, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true} : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
0o45436: "Hello",
|
||||
a: 0o45436,
|
||||
>a : number
|
||||
|
||||
b: oct1,
|
||||
>b : number
|
||||
>oct1 : number
|
||||
|
||||
oct1,
|
||||
>oct1 : number
|
||||
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
>{ 0O45436: "hi", a: 0O45436, b: oct2, oct2, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,} : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
0O45436: "hi",
|
||||
a: 0O45436,
|
||||
>a : number
|
||||
|
||||
b: oct2,
|
||||
>b : number
|
||||
>oct2 : number
|
||||
|
||||
oct2,
|
||||
>oct2 : number
|
||||
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,
|
||||
}
|
||||
|
||||
obj1[0o45436]; // string
|
||||
>obj1[0o45436] : string
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["0o45436"]; // any
|
||||
>obj1["0o45436"] : any
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["19230"]; // string
|
||||
>obj1["19230"] : string
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1[19230]; // string
|
||||
>obj1[19230] : string
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["a"]; // number
|
||||
>obj1["a"] : number
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["b"]; // number
|
||||
>obj1["b"] : number
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["oct1"]; // number
|
||||
>obj1["oct1"] : number
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["Infinity"]; // boolean
|
||||
>obj1["Infinity"] : boolean
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2[0O45436]; // string
|
||||
>obj2[0O45436] : string
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["0O45436"]; // any
|
||||
>obj2["0O45436"] : any
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["19230"]; // string
|
||||
>obj2["19230"] : string
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2[19230]; // string
|
||||
>obj2[19230] : string
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["a"]; // number
|
||||
>obj2["a"] : number
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["b"]; // number
|
||||
>obj2["b"] : number
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["oct2"]; // number
|
||||
>obj2["oct2"] : number
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2[5.462437423415177e+244]; // boolean
|
||||
>obj2[5.462437423415177e+244] : boolean
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["5.462437423415177e+244"]; // boolean
|
||||
>obj2["5.462437423415177e+244"] : boolean
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["Infinity"]; // any
|
||||
>obj2["Infinity"] : any
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
//// [octalIntegerLiteralES6.ts]
|
||||
var oct1 = 0o45436;
|
||||
var oct2 = 0O45436;
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
|
||||
var obj1 = {
|
||||
0o45436: "Hello",
|
||||
a: 0o45436,
|
||||
b: oct1,
|
||||
oct1,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0O45436: "hi",
|
||||
a: 0O45436,
|
||||
b: oct2,
|
||||
oct2,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,
|
||||
}
|
||||
|
||||
obj1[0o45436]; // string
|
||||
obj1["0o45436"]; // any
|
||||
obj1["19230"]; // string
|
||||
obj1[19230]; // string
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["oct1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0O45436]; // string
|
||||
obj2["0O45436"]; // any
|
||||
obj2["19230"]; // string
|
||||
obj2[19230]; // string
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["oct2"]; // number
|
||||
obj2[5.462437423415177e+244]; // boolean
|
||||
obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
|
||||
//// [octalIntegerLiteralES6.js]
|
||||
var oct1 = 0o45436;
|
||||
var oct2 = 0O45436;
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
var obj1 = {
|
||||
0o45436: "Hello",
|
||||
a: 0o45436,
|
||||
b: oct1,
|
||||
oct1,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true
|
||||
};
|
||||
var obj2 = {
|
||||
0O45436: "hi",
|
||||
a: 0O45436,
|
||||
b: oct2,
|
||||
oct2,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,
|
||||
};
|
||||
obj1[0o45436]; // string
|
||||
obj1["0o45436"]; // any
|
||||
obj1["19230"]; // string
|
||||
obj1[19230]; // string
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["oct1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
obj2[0O45436]; // string
|
||||
obj2["0O45436"]; // any
|
||||
obj2["19230"]; // string
|
||||
obj2[19230]; // string
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["oct2"]; // number
|
||||
obj2[5.462437423415177e+244]; // boolean
|
||||
obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
@@ -0,0 +1,121 @@
|
||||
=== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralES6.ts ===
|
||||
var oct1 = 0o45436;
|
||||
>oct1 : number
|
||||
|
||||
var oct2 = 0O45436;
|
||||
>oct2 : number
|
||||
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
>oct3 : number
|
||||
|
||||
var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
>oct4 : number
|
||||
|
||||
var obj1 = {
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
>{ 0o45436: "Hello", a: 0o45436, b: oct1, oct1, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true} : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
0o45436: "Hello",
|
||||
a: 0o45436,
|
||||
>a : number
|
||||
|
||||
b: oct1,
|
||||
>b : number
|
||||
>oct1 : number
|
||||
|
||||
oct1,
|
||||
>oct1 : number
|
||||
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
>{ 0O45436: "hi", a: 0O45436, b: oct2, oct2, 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,} : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
0O45436: "hi",
|
||||
a: 0O45436,
|
||||
>a : number
|
||||
|
||||
b: oct2,
|
||||
>b : number
|
||||
>oct2 : number
|
||||
|
||||
oct2,
|
||||
>oct2 : number
|
||||
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,
|
||||
}
|
||||
|
||||
obj1[0o45436]; // string
|
||||
>obj1[0o45436] : string
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["0o45436"]; // any
|
||||
>obj1["0o45436"] : any
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["19230"]; // string
|
||||
>obj1["19230"] : string
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1[19230]; // string
|
||||
>obj1[19230] : string
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["a"]; // number
|
||||
>obj1["a"] : number
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["b"]; // number
|
||||
>obj1["b"] : number
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["oct1"]; // number
|
||||
>obj1["oct1"] : number
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj1["Infinity"]; // boolean
|
||||
>obj1["Infinity"] : boolean
|
||||
>obj1 : { 0o45436: string; a: number; b: number; oct1: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2[0O45436]; // string
|
||||
>obj2[0O45436] : string
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["0O45436"]; // any
|
||||
>obj2["0O45436"] : any
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["19230"]; // string
|
||||
>obj2["19230"] : string
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2[19230]; // string
|
||||
>obj2[19230] : string
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["a"]; // number
|
||||
>obj2["a"] : number
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["b"]; // number
|
||||
>obj2["b"] : number
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["oct2"]; // number
|
||||
>obj2["oct2"] : number
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2[5.462437423415177e+244]; // boolean
|
||||
>obj2[5.462437423415177e+244] : boolean
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["5.462437423415177e+244"]; // boolean
|
||||
>obj2["5.462437423415177e+244"] : boolean
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
obj2["Infinity"]; // any
|
||||
>obj2["Infinity"] : any
|
||||
>obj2 : { 0O45436: string; a: number; b: number; oct2: number; 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: boolean; }
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts(2,19): error TS1005: ',' expected.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts(3,18): error TS1005: ',' expected.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts(6,5): error TS2300: Duplicate identifier '0O45436'.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts(7,5): error TS2300: Duplicate identifier '19230'.
|
||||
tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts(8,5): error TS2300: Duplicate identifier '"19230"'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/binaryAndOctalIntegerLiteral/octalIntegerLiteralError.ts (5 errors) ====
|
||||
// error
|
||||
var oct1 = 0O13334823;
|
||||
~~~
|
||||
!!! error TS1005: ',' expected.
|
||||
var oct2 = 0o34318592;
|
||||
~~~~
|
||||
!!! error TS1005: ',' expected.
|
||||
|
||||
var obj1 = {
|
||||
0O45436: "hi",
|
||||
~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '0O45436'.
|
||||
19230: "Hello",
|
||||
~~~~~
|
||||
!!! error TS2300: Duplicate identifier '19230'.
|
||||
"19230": "world",
|
||||
~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier '"19230"'.
|
||||
};
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// @target: es5
|
||||
var bin1 = 0b11010;
|
||||
var bin2 = 0B11010;
|
||||
var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
|
||||
var obj1 = {
|
||||
0b11010: "Hello",
|
||||
a: bin1,
|
||||
bin1,
|
||||
b: 0b11010,
|
||||
0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0B11010: "World",
|
||||
a: bin2,
|
||||
bin2,
|
||||
b: 0B11010,
|
||||
0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,
|
||||
}
|
||||
|
||||
obj1[0b11010]; // string
|
||||
obj1[26]; // string
|
||||
obj1["26"]; // string
|
||||
obj1["0b11010"]; // any
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["bin1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0B11010]; // string
|
||||
obj2[26]; // string
|
||||
obj2["26"]; // string
|
||||
obj2["0B11010"]; // any
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["bin2"]; // number
|
||||
obj2[9.671406556917009e+24]; // boolean
|
||||
obj2["9.671406556917009e+24"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
// @target: es6
|
||||
var bin1 = 0b11010;
|
||||
var bin2 = 0B11010;
|
||||
var bin3 = 0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
var bin4 = 0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111;
|
||||
|
||||
var obj1 = {
|
||||
0b11010: "Hello",
|
||||
a: bin1,
|
||||
bin1,
|
||||
b: 0b11010,
|
||||
0B111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101001010100000010111110001111111111: true,
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0B11010: "World",
|
||||
a: bin2,
|
||||
bin2,
|
||||
b: 0B11010,
|
||||
0B11111111111111111111111111111111111111111111111101001010100000010111110001111111111: false,
|
||||
}
|
||||
|
||||
obj1[0b11010]; // string
|
||||
obj1[26]; // string
|
||||
obj1["26"]; // string
|
||||
obj1["0b11010"]; // any
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["bin1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0B11010]; // string
|
||||
obj2[26]; // string
|
||||
obj2["26"]; // string
|
||||
obj2["0B11010"]; // any
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["bin2"]; // number
|
||||
obj2[9.671406556917009e+24]; // boolean
|
||||
obj2["9.671406556917009e+24"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// error
|
||||
var bin1 = 0B1102110;
|
||||
var bin1 = 0b11023410;
|
||||
|
||||
var obj1 = {
|
||||
0b11010: "hi",
|
||||
26: "Hello",
|
||||
"26": "world",
|
||||
};
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// Error
|
||||
var binary = 0b21010;
|
||||
var binary1 = 0B21010;
|
||||
var octal = 0o81010;
|
||||
var octal = 0O91010;
|
||||
@@ -0,0 +1,41 @@
|
||||
// @target: es5
|
||||
var oct1 = 0o45436;
|
||||
var oct2 = 0O45436;
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
|
||||
var obj1 = {
|
||||
0o45436: "Hello",
|
||||
a: 0o45436,
|
||||
b: oct1,
|
||||
oct1,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0O45436: "hi",
|
||||
a: 0O45436,
|
||||
b: oct2,
|
||||
oct2,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,
|
||||
}
|
||||
|
||||
obj1[0o45436]; // string
|
||||
obj1["0o45436"]; // any
|
||||
obj1["19230"]; // string
|
||||
obj1[19230]; // string
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["oct1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0O45436]; // string
|
||||
obj2["0O45436"]; // any
|
||||
obj2["19230"]; // string
|
||||
obj2[19230]; // string
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["oct2"]; // number
|
||||
obj2[5.462437423415177e+244]; // boolean
|
||||
obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
@@ -0,0 +1,41 @@
|
||||
// @target: es6
|
||||
var oct1 = 0o45436;
|
||||
var oct2 = 0O45436;
|
||||
var oct3 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
var oct4 = 0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777;
|
||||
|
||||
var obj1 = {
|
||||
0o45436: "Hello",
|
||||
a: 0o45436,
|
||||
b: oct1,
|
||||
oct1,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: true
|
||||
}
|
||||
|
||||
var obj2 = {
|
||||
0O45436: "hi",
|
||||
a: 0O45436,
|
||||
b: oct2,
|
||||
oct2,
|
||||
0o7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777: false,
|
||||
}
|
||||
|
||||
obj1[0o45436]; // string
|
||||
obj1["0o45436"]; // any
|
||||
obj1["19230"]; // string
|
||||
obj1[19230]; // string
|
||||
obj1["a"]; // number
|
||||
obj1["b"]; // number
|
||||
obj1["oct1"]; // number
|
||||
obj1["Infinity"]; // boolean
|
||||
|
||||
obj2[0O45436]; // string
|
||||
obj2["0O45436"]; // any
|
||||
obj2["19230"]; // string
|
||||
obj2[19230]; // string
|
||||
obj2["a"]; // number
|
||||
obj2["b"]; // number
|
||||
obj2["oct2"]; // number
|
||||
obj2[5.462437423415177e+244]; // boolean
|
||||
obj2["5.462437423415177e+244"]; // boolean
|
||||
obj2["Infinity"]; // any
|
||||
@@ -0,0 +1,9 @@
|
||||
// error
|
||||
var oct1 = 0O13334823;
|
||||
var oct2 = 0o34318592;
|
||||
|
||||
var obj1 = {
|
||||
0O45436: "hi",
|
||||
19230: "Hello",
|
||||
"19230": "world",
|
||||
};
|
||||
@@ -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