Merge branch 'master' into taggedSigHelp

This commit is contained in:
Daniel Rosenwasser
2014-11-18 17:42:27 -08:00
34 changed files with 8007 additions and 19691 deletions
+4
View File
@@ -499,6 +499,10 @@ declare var Number: {
POSITIVE_INFINITY: number;
}
interface TemplateStringsArray extends Array<string> {
raw: string[];
}
interface Math {
/** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
E: number;
+4
View File
@@ -499,6 +499,10 @@ declare var Number: {
POSITIVE_INFINITY: number;
}
interface TemplateStringsArray extends Array<string> {
raw: string[];
}
interface Math {
/** The mathematical constant e. This is Euler's number, the base of natural logarithms. */
E: number;
+2651 -2351
View File
File diff suppressed because one or more lines are too long
+5108 -17238
View File
File diff suppressed because one or more lines are too long
@@ -122,6 +122,8 @@ module ts {
let_declarations_can_only_be_declared_inside_a_block: { code: 1157, category: DiagnosticCategory.Error, key: "'let' declarations can only be declared inside a block." },
Invalid_template_literal_expected: { code: 1158, category: DiagnosticCategory.Error, key: "Invalid template literal; expected '}'" },
Tagged_templates_are_only_available_when_targeting_ECMAScript_6_and_higher: { code: 1159, category: DiagnosticCategory.Error, key: "Tagged templates are only available when targeting ECMAScript 6 and higher." },
Unterminated_template_literal: { code: 1160, category: DiagnosticCategory.Error, key: "Unterminated template literal." },
Unterminated_regular_expression_literal: { code: 1161, category: DiagnosticCategory.Error, key: "Unterminated regular expression literal." },
A_object_member_cannot_be_declared_optional: { code: 1160, category: DiagnosticCategory.Error, key: "A object member cannot be declared optional." },
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." },
@@ -271,6 +273,7 @@ module ts {
Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: { code: 2455, category: DiagnosticCategory.Error, key: "Type argument candidate '{1}' is not a valid type argument because it is not a supertype of candidate '{0}'." },
Type_alias_0_circularly_references_itself: { code: 2456, category: DiagnosticCategory.Error, key: "Type alias '{0}' circularly references itself." },
Type_alias_name_cannot_be_0: { code: 2457, category: DiagnosticCategory.Error, key: "Type alias name cannot be '{0}'" },
An_AMD_module_cannot_have_multiple_name_assignments: { code: 2458, category: DiagnosticCategory.Error, key: "An AMD module cannot have multiple name assignments." },
Import_declaration_0_is_using_private_name_1: { code: 4000, category: DiagnosticCategory.Error, key: "Import declaration '{0}' is using private name '{1}'." },
Type_parameter_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: { code: 4001, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using name '{1}' from private module '{2}'." },
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: { code: 4002, category: DiagnosticCategory.Error, key: "Type parameter '{0}' of exported class has or is using private name '{1}'." },
+12
View File
@@ -479,6 +479,14 @@
"category": "Error",
"code": 1159
},
"Unterminated template literal.": {
"category": "Error",
"code": 1160
},
"Unterminated regular expression literal.": {
"category": "Error",
"code": 1161
},
"A object member cannot be declared optional.": {
"category": "Error",
@@ -1081,6 +1089,10 @@
"category": "Error",
"code": 2457
},
"An AMD module cannot have multiple name assignments.": {
"category": "Error",
"code": 2458
},
"Import declaration '{0}' is using private name '{1}'.": {
"category": "Error",
+5 -1
View File
@@ -2134,7 +2134,11 @@ module ts {
function emitAMDModule(node: SourceFile, startIndex: number) {
var imports = getExternalImportDeclarations(node);
writeLine();
write("define([\"require\", \"exports\"");
write("define(");
if(node.amdModuleName) {
write("\"" + node.amdModuleName + "\", ");
}
write("[\"require\", \"exports\"");
forEach(imports, imp => {
write(", ");
emitLiteral(imp.externalModuleName);
+14 -1
View File
@@ -20,6 +20,7 @@ module ts {
interface ReferenceComments {
referencedFiles: FileReference[];
amdDependencies: string[];
amdModuleName: string;
}
export function getSourceFileOfNode(node: Node): SourceFile {
@@ -4262,6 +4263,7 @@ module ts {
function processReferenceComments(): ReferenceComments {
var referencedFiles: FileReference[] = [];
var amdDependencies: string[] = [];
var amdModuleName: string;
commentRanges = [];
token = scanner.scan();
@@ -4281,6 +4283,15 @@ module ts {
}
}
else {
var amdModuleNameRegEx = /^\/\/\/\s*<amd-module\s+name\s*=\s*('|")(.+?)\1/gim;
var amdModuleNameMatchResult = amdModuleNameRegEx.exec(comment);
if(amdModuleNameMatchResult) {
if(amdModuleName) {
errorAtPos(range.pos, range.end - range.pos, Diagnostics.An_AMD_module_cannot_have_multiple_name_assignments);
}
amdModuleName = amdModuleNameMatchResult[2];
}
var amdDependencyRegEx = /^\/\/\/\s*<amd-dependency\s+path\s*=\s*('|")(.+?)\1/gim;
var amdDependencyMatchResult = amdDependencyRegEx.exec(comment);
if (amdDependencyMatchResult) {
@@ -4291,7 +4302,8 @@ module ts {
commentRanges = undefined;
return {
referencedFiles: referencedFiles,
amdDependencies: amdDependencies
amdDependencies: amdDependencies,
amdModuleName: amdModuleName
};
}
@@ -4321,6 +4333,7 @@ module ts {
var referenceComments = processReferenceComments();
file.referencedFiles = referenceComments.referencedFiles;
file.amdDependencies = referenceComments.amdDependencies;
file.amdModuleName = referenceComments.amdModuleName;
file.statements = parseList(ParsingContext.SourceElements, /*checkForStrictMode*/ true, parseSourceElement);
file.externalModuleIndicator = getExternalModuleIndicator();
file.nodeCount = nodeCount;
+12 -11
View File
@@ -553,7 +553,7 @@ module ts {
while (true) {
if (pos >= len) {
result += text.substring(start, pos);
error(Diagnostics.Unexpected_end_of_text);
error(Diagnostics.Unterminated_string_literal);
break;
}
var ch = text.charCodeAt(pos);
@@ -593,7 +593,7 @@ module ts {
while (true) {
if (pos >= len) {
contents += text.substring(start, pos);
error(Diagnostics.Unexpected_end_of_text);
error(Diagnostics.Unterminated_template_literal);
resultingToken = startedWithBacktick ? SyntaxKind.NoSubstitutionTemplateLiteral : SyntaxKind.TemplateTail;
break;
}
@@ -1066,19 +1066,19 @@ module ts {
var inEscape = false;
var inCharacterClass = false;
while (true) {
// If we've hit EOF without closing off the regex,
// simply return the token we originally parsed.
// If we reach the end of a file, or hit a newline, then this is an unterminated
// regex. Report error and return what we have so far.
if (p >= len) {
return token;
error(Diagnostics.Unterminated_regular_expression_literal)
break;
}
var ch = text.charCodeAt(p);
// Line breaks are not permissible in the middle of a RegExp.
if (isLineBreak(ch)) {
return token;
error(Diagnostics.Unterminated_regular_expression_literal)
break;
}
if (inEscape) {
// Parsing an escape character;
// reset the flag and just advance to the next char.
@@ -1087,6 +1087,7 @@ module ts {
else if (ch === CharacterCodes.slash && !inCharacterClass) {
// A slash within a character class is permissible,
// but in general it signals the end of the regexp literal.
p++;
break;
}
else if (ch === CharacterCodes.openBracket) {
@@ -1100,8 +1101,8 @@ module ts {
}
p++;
}
p++;
while (isIdentifierPart(text.charCodeAt(p))) {
while (p < len && isIdentifierPart(text.charCodeAt(p))) {
p++;
}
pos = p;
+1
View File
@@ -642,6 +642,7 @@ module ts {
getPositionFromLineAndCharacter(line: number, character: number): number;
getLineStarts(): number[];
amdDependencies: string[];
amdModuleName: string;
referencedFiles: FileReference[];
syntacticErrors: Diagnostic[];
semanticErrors: Diagnostic[];
@@ -5,7 +5,7 @@ module TypeScript {
warning_TS_0_1: "warning TS{0}: {1}",
Unrecognized_escape_sequence: "Unrecognized escape sequence.",
Unexpected_character_0: "Unexpected character {0}.",
Missing_close_quote_character: "Missing close quote character.",
Unterminated_string_literal: "Unterminated string literal.",
Identifier_expected: "Identifier expected.",
_0_keyword_expected: "'{0}' keyword expected.",
_0_expected: "'{0}' expected.",
@@ -97,6 +97,8 @@ module TypeScript {
Template_literal_cannot_be_used_as_an_element_name: "Template literal cannot be used as an element name.",
Computed_property_names_cannot_be_used_here: "Computed property names cannot be used here.",
yield_expression_must_be_contained_within_a_generator_declaration: "'yield' expression must be contained within a generator declaration.",
Unterminated_regular_expression_literal: "Unterminated regular expression literal.",
Unterminated_template_literal: "Unterminated template literal.",
Duplicate_identifier_0: "Duplicate identifier '{0}'.",
The_name_0_does_not_exist_in_the_current_scope: "The name '{0}' does not exist in the current scope.",
The_name_0_does_not_refer_to_a_value: "The name '{0}' does not refer to a value.",
@@ -6,7 +6,7 @@ module TypeScript {
"warning TS{0}: {1}": { "code": 1, "category": DiagnosticCategory.NoPrefix },
"Unrecognized escape sequence.": { "code": 1000, "category": DiagnosticCategory.Error },
"Unexpected character {0}.": { "code": 1001, "category": DiagnosticCategory.Error },
"Missing close quote character.": { "code": 1002, "category": DiagnosticCategory.Error },
"Unterminated string literal.": { "code": 1002, "category": DiagnosticCategory.Error },
"Identifier expected.": { "code": 1003, "category": DiagnosticCategory.Error },
"'{0}' keyword expected.": { "code": 1004, "category": DiagnosticCategory.Error },
"'{0}' expected.": { "code": 1005, "category": DiagnosticCategory.Error },
@@ -99,6 +99,8 @@ module TypeScript {
"Template literal cannot be used as an element name.": { "code": 1111, "category": DiagnosticCategory.Error },
"Computed property names cannot be used here.": { "code": 1112, "category": DiagnosticCategory.Error },
"'yield' expression must be contained within a generator declaration.": { "code": 1113, "category": DiagnosticCategory.Error },
"Unterminated regular expression literal.": { "code": 1114, "category": DiagnosticCategory.Error },
"Unterminated template literal.": { "code": 1115, "category": DiagnosticCategory.Error },
"Duplicate identifier '{0}'.": { "code": 2000, "category": DiagnosticCategory.Error },
"The name '{0}' does not exist in the current scope.": { "code": 2001, "category": DiagnosticCategory.Error },
"The name '{0}' does not refer to a value.": { "code": 2002, "category": DiagnosticCategory.Error },
@@ -15,7 +15,7 @@
"category": "Error",
"code": 1001
},
"Missing close quote character.": {
"Unterminated string literal.": {
"category": "Error",
"code": 1002
},
@@ -383,6 +383,14 @@
"category": "Error",
"code": 1113
},
"Unterminated regular expression literal.": {
"category": "Error",
"code": 1114
},
"Unterminated template literal.": {
"category": "Error",
"code": 1115
},
"Duplicate identifier '{0}'.": {
"category": "Error",
"code": 2000
+18
View File
@@ -718,6 +718,7 @@ module ts {
public getPositionFromLineAndCharacter(line: number, character: number): number { return -1; }
public getLineStarts(): number[] { return undefined; }
public amdDependencies: string[];
public amdModuleName: string;
public referencedFiles: FileReference[];
public syntacticErrors: Diagnostic[];
public semanticErrors: Diagnostic[];
@@ -3351,6 +3352,23 @@ module ts {
var result: DefinitionInfo[] = [];
// Because name in short-hand property assignment has two different meanings: property name and property value,
// using go-to-definition at such position should go to the variable declaration of the property value rather than
// go to the declaration of the property name (in this case stay at the same position). However, if go-to-definition
// is performed at the location of property access, we would like to go to definition of the property in the short-hand
// assignment. This case and others are handled by the following code.
if (node.parent.kind === SyntaxKind.ShorthandPropertyAssignment) {
var shorthandSymbol = typeInfoResolver.getShorthandAssignmentValueSymbol(symbol.valueDeclaration);
var shorthandDeclarations = shorthandSymbol.getDeclarations();
var shorthandSymbolKind = getSymbolKind(shorthandSymbol, typeInfoResolver);
var shorthandSymbolName = typeInfoResolver.symbolToString(shorthandSymbol);
var shorthandContainerName = typeInfoResolver.symbolToString(symbol.parent, node);
forEach(shorthandDeclarations, declaration => {
result.push(getDefinitionInfo(declaration, shorthandSymbolKind, shorthandSymbolName, shorthandContainerName));
});
return result
}
var declarations = symbol.getDeclarations();
var symbolName = typeInfoResolver.symbolToString(symbol); // Do not get scoped name, just the name of the symbol
var symbolKind = getSymbolKind(symbol, typeInfoResolver);
+11 -30
View File
@@ -1373,7 +1373,8 @@ module TypeScript.Parser {
function parseFunctionDeclarationWorker(modifiers: ISyntaxToken[], functionKeyword: ISyntaxToken, asteriskToken: ISyntaxToken): FunctionDeclarationSyntax {
// GeneratorDeclaration[Yield, Default] :
// function * BindingIdentifier[?Yield](FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] }
// function * BindingIdentifier[?Yield](FormalParameters[Yield, GeneratorParameter]) { GeneratorBody[Yield] }
var isGenerator = asteriskToken !== undefined;
return new FunctionDeclarationSyntax(parseNodeData,
modifiers,
@@ -2167,14 +2168,9 @@ module TypeScript.Parser {
case SyntaxKind.SlashToken:
case SyntaxKind.SlashEqualsToken:
// Note: if we see a / or /= token then we always consider this an expression. Why?
// Well, either that / or /= is actually a regular expression, in which case we're
// definitely an expression. Or, it's actually a divide. In which case, we *still*
// want to think of ourself as an expression. "But wait", you say. '/' doesn't
// start an expression. That's true. BUt like the above check for =>, for error
// tolerance, we will consider ourselves in an expression. We'll then parse out an
// missing identifier and then will consume the / token naturally as a binary
// expression.
// Note: if we see a / or /= token then we always consider this an expression.
// The / or /= will actually be the start of a regex that we will contextually
// rescan.
// Simple epxressions.
case SyntaxKind.SuperKeyword:
@@ -2976,15 +2972,9 @@ module TypeScript.Parser {
case SyntaxKind.SlashToken:
case SyntaxKind.SlashEqualsToken:
// If we see a standalone / or /= and we're expecting a term, then try to reparse
// If we see a standalone / or /= and we're expecting an expression, then reparse
// it as a regular expression.
var result = tryReparseDivideAsRegularExpression();
// If we get a result, then use it. Otherwise, create a missing identifier so
// that parsing can continue. Note: we do this even if 'force' is false. That's
// because we *do* want to consider a standalone / as an expression that should be
// returned from tryParseExpression even when 'force' is set to false.
return result || eatIdentifierToken(DiagnosticCode.Expression_expected);
return reparseDivideAsRegularExpression();
}
if (!force) {
@@ -2995,7 +2985,7 @@ module TypeScript.Parser {
return eatIdentifierToken(DiagnosticCode.Expression_expected);
}
function tryReparseDivideAsRegularExpression(): IPrimaryExpressionSyntax {
function reparseDivideAsRegularExpression(): IPrimaryExpressionSyntax {
// If we see a / or /= token, then that may actually be the start of a regex in certain
// contexts.
@@ -3012,18 +3002,9 @@ module TypeScript.Parser {
// Debug.assert(SyntaxFacts.isAnyDivideOrRegularExpressionToken(currentToken.kind));
var tokenKind = currentToken.kind;
if (tokenKind === SyntaxKind.SlashToken || tokenKind === SyntaxKind.SlashEqualsToken) {
// Still came back as a / or /=. This is not a regular expression literal.
return undefined;
}
else if (tokenKind === SyntaxKind.RegularExpressionLiteral) {
return consumeToken(currentToken);
}
else {
// Something *very* wrong happened. This is an internal parser fault that we need
// to figure out and fix.
throw Errors.invalidOperation();
}
Debug.assert(tokenKind === SyntaxKind.RegularExpressionLiteral);
return consumeToken(currentToken);
}
function parseTypeOfExpression(typeOfKeyword: ISyntaxToken): TypeOfExpressionSyntax {
+10 -12
View File
@@ -281,7 +281,7 @@ module TypeScript.Scanner {
LargeScannerToken.prototype.childCount = 0;
export interface DiagnosticCallback {
(position: number, width: number, key: string, arguments: any[]): void;
(position: number, width: number, key: string, arguments?: any[]): void;
}
interface TokenInfo {
@@ -1008,7 +1008,7 @@ module TypeScript.Scanner {
while (true) {
if (index === end) {
// Hit the end of the file.
reportDiagnostic(end, 0, DiagnosticCode._0_expected, ["`"]);
reportDiagnostic(end, 0, DiagnosticCode.Unterminated_template_literal);
break;
}
@@ -1144,10 +1144,7 @@ module TypeScript.Scanner {
// term, and it sees one of these then it may restart us asking specifically if we could
// scan out a regex.
if (allowContextualToken) {
var result = tryScanRegularExpressionToken();
if (result !== SyntaxKind.None) {
return result;
}
return scanRegularExpressionToken();
}
if (str.charCodeAt(index) === CharacterCodes.equals) {
@@ -1159,7 +1156,7 @@ module TypeScript.Scanner {
}
}
function tryScanRegularExpressionToken(): SyntaxKind {
function scanRegularExpressionToken(): SyntaxKind {
var startIndex = index;
var inEscape = false;
@@ -1168,8 +1165,9 @@ module TypeScript.Scanner {
var ch = str.charCodeAt(index);
if (isNaN(ch) || isNewLineCharacter(ch)) {
index = startIndex;
return SyntaxKind.None;
// Hit the end of line, or end of the file. This is not a legal regex.
reportDiagnostic(index, 0, DiagnosticCode.Unterminated_regular_expression_literal);
break;
}
index++;
@@ -1193,7 +1191,7 @@ module TypeScript.Scanner {
continue;
case CharacterCodes.closeBracket:
// If we ever hit a cloe bracket then we're now no longer in a character
// If we ever hit a close bracket then we're now no longer in a character
// class. If we weren't in a character class to begin with, then this has
// no effect.
inCharacterClass = false;
@@ -1219,7 +1217,7 @@ module TypeScript.Scanner {
// TODO: The grammar says any identifier part is allowed here. Do we need to support
// \u identifiers here? The existing typescript parser does not.
while (isIdentifierPartCharacter[str.charCodeAt(index)]) {
while (index < end && isIdentifierPartCharacter[str.charCodeAt(index)]) {
index++;
}
@@ -1322,7 +1320,7 @@ module TypeScript.Scanner {
break;
}
else if (isNaN(ch) || isNewLineCharacter(ch)) {
reportDiagnostic(Math.min(index, end), 1, DiagnosticCode.Missing_close_quote_character, undefined);
reportDiagnostic(index, 0, DiagnosticCode.Unterminated_string_literal);
break;
}
else {
@@ -0,0 +1,22 @@
//// [amdModuleName1.ts]
///<amd-module name='NamedModule'/>
class Foo {
x: number;
constructor() {
this.x = 5;
}
}
export = Foo;
//// [amdModuleName1.js]
define("NamedModule", ["require", "exports"], function (require, exports) {
///<amd-module name='NamedModule'/>
var Foo = (function () {
function Foo() {
this.x = 5;
}
return Foo;
})();
return Foo;
});
@@ -0,0 +1,19 @@
=== tests/cases/compiler/amdModuleName1.ts ===
///<amd-module name='NamedModule'/>
class Foo {
>Foo : Foo
x: number;
>x : number
constructor() {
this.x = 5;
>this.x = 5 : number
>this.x : number
>this : Foo
>x : number
}
}
export = Foo;
>Foo : Foo
@@ -0,0 +1,16 @@
tests/cases/compiler/amdModuleName2.ts(2,1): error TS2458: An AMD module cannot have multiple name assignments.
==== tests/cases/compiler/amdModuleName2.ts (1 errors) ====
///<amd-module name='FirstModuleName'/>
///<amd-module name='SecondModuleName'/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
!!! error TS2458: An AMD module cannot have multiple name assignments.
class Foo {
x: number;
constructor() {
this.x = 5;
}
}
export = Foo;
@@ -1,9 +1,9 @@
tests/cases/compiler/noEmitOnError.ts(2,5): error TS2322: Type 'string' is not assignable to type 'number'.
==== tests/cases/compiler/noEmitOnError.ts (1 errors) ====
var x: number = "";
~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
tests/cases/compiler/noEmitOnError.ts(2,5): error TS2322: Type 'string' is not assignable to type 'number'.
==== tests/cases/compiler/noEmitOnError.ts (1 errors) ====
var x: number = "";
~
!!! error TS2322: Type 'string' is not assignable to type 'number'.
@@ -1,6 +1,6 @@
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,13): error TS1005: ',' expected.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,14): error TS1134: Variable declaration expected.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,15): error TS1109: Expression expected.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,15): error TS1161: Unterminated regular expression literal.
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts (3 errors) ====
@@ -10,4 +10,4 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_1.ts(1,1
~
!!! error TS1134: Variable declaration expected.
!!! error TS1109: Expression expected.
!!! error TS1161: Unterminated regular expression literal.
@@ -1,6 +1,6 @@
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,14): error TS1005: ',' expected.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,15): error TS1134: Variable declaration expected.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,16): error TS1109: Expression expected.
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,16): error TS1161: Unterminated regular expression literal.
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts (3 errors) ====
@@ -10,4 +10,4 @@ tests/cases/conformance/parser/ecmascript5/RegressionTests/parser645086_2.ts(1,1
~
!!! error TS1134: Variable declaration expected.
!!! error TS1109: Expression expected.
!!! error TS1161: Unterminated regular expression literal.
@@ -1,10 +1,7 @@
tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts(1,1): error TS1109: Expression expected.
tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts(1,3): error TS2304: Cannot find name 'b'.
tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts(1,2): error TS1161: Unterminated regular expression literal.
==== tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts (2 errors) ====
==== tests/cases/conformance/parser/ecmascript5/MissingTokens/parserMissingToken2.ts (1 errors) ====
/ b;
~
!!! error TS1109: Expression expected.
~
!!! error TS2304: Cannot find name 'b'.
!!! error TS1161: Unterminated regular expression literal.
@@ -1,13 +1,13 @@
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,5): error TS1109: Expression expected.
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,6): error TS1161: Unterminated regular expression literal.
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,17): error TS1005: ')' expected.
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,1): error TS2304: Cannot find name 'foo'.
tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts(1,6): error TS2304: Cannot find name 'notregexp'.
==== tests/cases/conformance/parser/ecmascript5/RegularExpressions/parserRegularExpressionDivideAmbiguity4.ts (3 errors) ====
foo(/notregexp);
~
!!! error TS1109: Expression expected.
!!! error TS1161: Unterminated regular expression literal.
!!! error TS1005: ')' expected.
~~~
!!! error TS2304: Cannot find name 'foo'.
~~~~~~~~~
!!! error TS2304: Cannot find name 'notregexp'.
!!! error TS2304: Cannot find name 'foo'.
@@ -1,5 +1,5 @@
tests/cases/conformance/scanner/ecmascript5/scannerStringLiterals.ts(10,34): error TS1002: Unterminated string literal.
tests/cases/conformance/scanner/ecmascript5/scannerStringLiterals.ts(11,38): error TS1126: Unexpected end of text.
tests/cases/conformance/scanner/ecmascript5/scannerStringLiterals.ts(11,38): error TS1002: Unterminated string literal.
==== tests/cases/conformance/scanner/ecmascript5/scannerStringLiterals.ts (2 errors) ====
@@ -17,4 +17,4 @@ tests/cases/conformance/scanner/ecmascript5/scannerStringLiterals.ts(11,38): err
!!! error TS1002: Unterminated string literal.
"Should error because of end of file.
!!! error TS1126: Unexpected end of text.
!!! error TS1002: Unterminated string literal.
@@ -14,7 +14,7 @@ tests/cases/compiler/stringLiteralsErrors.ts(22,16): error TS1125: Hexadecimal d
tests/cases/compiler/stringLiteralsErrors.ts(23,17): error TS1125: Hexadecimal digit expected.
tests/cases/compiler/stringLiteralsErrors.ts(24,16): error TS1125: Hexadecimal digit expected.
tests/cases/compiler/stringLiteralsErrors.ts(25,15): error TS1125: Hexadecimal digit expected.
tests/cases/compiler/stringLiteralsErrors.ts(28,14): error TS1126: Unexpected end of text.
tests/cases/compiler/stringLiteralsErrors.ts(28,14): error TS1002: Unterminated string literal.
==== tests/cases/compiler/stringLiteralsErrors.ts (17 errors) ====
@@ -79,4 +79,4 @@ tests/cases/compiler/stringLiteralsErrors.ts(28,14): error TS1126: Unexpected en
// End of file
var es13 = "
!!! error TS1126: Unexpected end of text.
!!! error TS1002: Unterminated string literal.
@@ -1,4 +1,4 @@
tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,15): error TS1126: Unexpected end of text.
tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,15): error TS1160: Unterminated template literal.
==== tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts (1 errors) ====
@@ -9,4 +9,4 @@ tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate1.ts(6,1
// Incomplete call, not enough parameters.
f `123qdawdrqw
!!! error TS1126: Unexpected end of text.
!!! error TS1160: Unterminated template literal.
@@ -1,4 +1,4 @@
tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4): error TS1126: Unexpected end of text.
tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4): error TS1160: Unterminated template literal.
==== tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts (1 errors) ====
@@ -9,4 +9,4 @@ tests/cases/compiler/taggedTemplatesWithIncompleteNoSubstitutionTemplate2.ts(6,4
// Incomplete call, not enough parameters, at EOF.
f `
!!! error TS1126: Unexpected end of text.
!!! error TS1160: Unterminated template literal.
@@ -2,7 +2,7 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,15): error TS1005: ';' expected.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,26): error TS1158: Invalid template literal; expected '}'
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,30): error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(5,1): error TS1126: Unexpected end of text.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(5,1): error TS1160: Unterminated template literal.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(1,11): error TS2304: Cannot find name 'gen'.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,20): error TS2304: Cannot find name 'yield'.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(3,30): error TS2304: Cannot find name 'def'.
@@ -31,4 +31,4 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeyword.ts(
!!! error TS1159: Tagged templates are only available when targeting ECMAScript 6 and higher.
!!! error TS1126: Unexpected end of text.
!!! error TS1160: Unterminated template literal.
@@ -1,7 +1,7 @@
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,9): error TS1003: Identifier expected.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,17): error TS1005: ';' expected.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,26): error TS1158: Invalid template literal; expected '}'
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(5,1): error TS1126: Unexpected end of text.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(5,1): error TS1160: Unterminated template literal.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(1,11): error TS2304: Cannot find name 'gen'.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,20): error TS2304: Cannot find name 'yield'.
tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.ts(3,30): error TS2304: Cannot find name 'def'.
@@ -26,4 +26,4 @@ tests/cases/conformance/es6/templates/templateStringWithEmbeddedYieldKeywordES6.
}
!!! error TS1126: Unexpected end of text.
!!! error TS1160: Unterminated template literal.
@@ -1,10 +1,7 @@
tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts(1,9): error TS1109: Expression expected.
tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts(1,10): error TS1109: Expression expected.
tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts(1,10): error TS1161: Unterminated regular expression literal.
==== tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts (2 errors) ====
==== tests/cases/compiler/unterminatedRegexAtEndOfSource1.ts (1 errors) ====
var a = /
~
!!! error TS1109: Expression expected.
!!! error TS1109: Expression expected.
!!! error TS1161: Unterminated regular expression literal.
+9
View File
@@ -0,0 +1,9 @@
//@module: amd
///<amd-module name='NamedModule'/>
class Foo {
x: number;
constructor() {
this.x = 5;
}
}
export = Foo;
+10
View File
@@ -0,0 +1,10 @@
//@module: amd
///<amd-module name='FirstModuleName'/>
///<amd-module name='SecondModuleName'/>
class Foo {
x: number;
constructor() {
this.x = 5;
}
}
export = Foo;
@@ -0,0 +1,25 @@
/// <reference path='fourslash.ts' />
//// var /*valueDeclaration1*/name = "hello";
//// var /*valueDeclaration2*/id = 100000;
//// declare var /*valueDeclaration3*/id;
//// var obj = {/*valueDefinition1*/name, /*valueDefinition2*/id};
//// obj./*valueReference1*/name;
//// obj./*valueReference2*/id;
goTo.marker("valueDefinition1");
goTo.definition();
verify.caretAtMarker("valueDeclaration1");
goTo.marker("valueDefinition2");
goTo.definition(0);
verify.caretAtMarker("valueDeclaration2");
goTo.definition(1);
verify.caretAtMarker("valueDeclaration3");
goTo.marker("valueReference1");
goTo.definition();
verify.caretAtMarker("valueDefinition1");
goTo.marker("valueReference2");
goTo.definition();
verify.caretAtMarker("valueDefinition2");