mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
Merge branch 'master' into gotoDefShorthand
This commit is contained in:
@@ -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.
|
||||
@@ -8,4 +8,4 @@ test.markers().forEach(marker => {
|
||||
goTo.position(marker.position);
|
||||
|
||||
verify.completionListItemsCountIsGreaterThan(0)
|
||||
}}
|
||||
});
|
||||
@@ -8,4 +8,4 @@ test.markers().forEach(marker => {
|
||||
goTo.position(marker.position);
|
||||
|
||||
verify.completionListIsEmpty()
|
||||
}
|
||||
});
|
||||
@@ -8,5 +8,5 @@ test.ranges().forEach(targetRange => {
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.referencesAtPositionContains(range);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -8,5 +8,5 @@ test.ranges().forEach(targetRange => {
|
||||
|
||||
test.ranges().forEach(range => {
|
||||
verify.referencesAtPositionContains(range);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
14
tests/cases/fourslash/formattingInMultilineComments.ts
Normal file
14
tests/cases/fourslash/formattingInMultilineComments.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////var x = function() {
|
||||
//// if (true) {
|
||||
//// /*1*/} else {/*2*/
|
||||
////}
|
||||
////
|
||||
////// newline at the end of the file
|
||||
|
||||
goTo.marker("2");
|
||||
edit.insertLine("");
|
||||
goTo.marker("1");
|
||||
// else formating should not be affected
|
||||
verify.currentLineContentIs(' } else {');
|
||||
@@ -51,4 +51,4 @@ for (var i = 1; i <= test.markers().length; i++) {
|
||||
verify.occurrencesAtPositionCount(1); // 'return' is an instance member
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -5,8 +5,8 @@ describe("DocumentRegistry", () => {
|
||||
var documentRegistry = ts.createDocumentRegistry();
|
||||
var defaultCompilerOptions = ts.getDefaultCompilerOptions();
|
||||
|
||||
var f1 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f2 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f1 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f2 = documentRegistry.acquireDocument("file1.ts", defaultCompilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
|
||||
assert(f1 === f2, "DocumentRegistry should return the same document for the same name");
|
||||
});
|
||||
@@ -17,21 +17,21 @@ describe("DocumentRegistry", () => {
|
||||
|
||||
// change compilation setting that doesn't affect parsing - should have the same document
|
||||
compilerOptions.declaration = true;
|
||||
var f1 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f1 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
compilerOptions.declaration = false;
|
||||
var f2 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f2 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
|
||||
assert(f1 === f2, "Expected to have the same document instance");
|
||||
|
||||
|
||||
// change value of compilation setting that is used during production of AST - new document is required
|
||||
compilerOptions.target = ts.ScriptTarget.ES3;
|
||||
var f3 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f3 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
|
||||
assert(f1 !== f3, "Changed target: Expected to have different instances of document");
|
||||
|
||||
compilerOptions.module = ts.ModuleKind.CommonJS;
|
||||
var f4 = documentRegistry.acquireDocument("file1.ts", compilerOptions, TypeScript.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
var f4 = documentRegistry.acquireDocument("file1.ts", compilerOptions, ts.ScriptSnapshot.fromString("var x = 1;"), "1", false);
|
||||
|
||||
assert(f1 !== f4, "Changed module: Expected to have different instances of document");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user