Skip to content

Commit 94fd678

Browse files
committed
Merge branch 'master' into release-1.5
2 parents b18dd53 + 55d6e10 commit 94fd678

File tree

424 files changed

+9728
-42448
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

424 files changed

+9728
-42448
lines changed

Jakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ var harnessSources = [
144144
"services/colorization.ts",
145145
"services/documentRegistry.ts",
146146
"services/preProcessFile.ts",
147-
"services/patternMatcher.ts"
147+
"services/patternMatcher.ts",
148+
"versionCache.ts"
148149
].map(function (f) {
149150
return path.join(unittestsDirectory, f);
150151
})).concat([

src/compiler/binder.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -388,23 +388,28 @@ module ts {
388388
bindChildren(node, /*symbolKind:*/ 0, /*isBlockScopeContainer:*/ true);
389389
}
390390

391-
function bindBlockScopedVariableDeclaration(node: Declaration) {
391+
function bindBlockScopedDeclaration(node: Declaration, symbolKind: SymbolFlags, symbolExcludes: SymbolFlags) {
392392
switch (blockScopeContainer.kind) {
393393
case SyntaxKind.ModuleDeclaration:
394-
declareModuleMember(node, SymbolFlags.BlockScopedVariable, SymbolFlags.BlockScopedVariableExcludes);
394+
declareModuleMember(node, symbolKind, symbolExcludes);
395395
break;
396396
case SyntaxKind.SourceFile:
397397
if (isExternalModule(<SourceFile>container)) {
398-
declareModuleMember(node, SymbolFlags.BlockScopedVariable, SymbolFlags.BlockScopedVariableExcludes);
398+
declareModuleMember(node, symbolKind, symbolExcludes);
399399
break;
400400
}
401+
// fall through.
401402
default:
402403
if (!blockScopeContainer.locals) {
403404
blockScopeContainer.locals = {};
404405
}
405-
declareSymbol(blockScopeContainer.locals, undefined, node, SymbolFlags.BlockScopedVariable, SymbolFlags.BlockScopedVariableExcludes);
406+
declareSymbol(blockScopeContainer.locals, undefined, node, symbolKind, symbolExcludes);
406407
}
407-
bindChildren(node, SymbolFlags.BlockScopedVariable, /*isBlockScopeContainer*/ false);
408+
bindChildren(node, symbolKind, /*isBlockScopeContainer*/ false);
409+
}
410+
411+
function bindBlockScopedVariableDeclaration(node: Declaration) {
412+
bindBlockScopedDeclaration(node, SymbolFlags.BlockScopedVariable, SymbolFlags.BlockScopedVariableExcludes);
408413
}
409414

410415
function getDestructuringParameterName(node: Declaration) {
@@ -493,7 +498,7 @@ module ts {
493498
bindCatchVariableDeclaration(<CatchClause>node);
494499
break;
495500
case SyntaxKind.ClassDeclaration:
496-
bindDeclaration(<Declaration>node, SymbolFlags.Class, SymbolFlags.ClassExcludes, /*isBlockScopeContainer*/ false);
501+
bindBlockScopedDeclaration(<Declaration>node, SymbolFlags.Class, SymbolFlags.ClassExcludes);
497502
break;
498503
case SyntaxKind.InterfaceDeclaration:
499504
bindDeclaration(<Declaration>node, SymbolFlags.Interface, SymbolFlags.InterfaceExcludes, /*isBlockScopeContainer*/ false);

src/compiler/checker.ts

Lines changed: 428 additions & 93 deletions
Large diffs are not rendered by default.

src/compiler/commandLineParser.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ module ts {
156156
shortName: "w",
157157
type: "boolean",
158158
description: Diagnostics.Watch_input_files,
159+
},
160+
{
161+
name: "emitDecoratorMetadata",
162+
type: "boolean",
163+
experimental: true
159164
}
160165
];
161166

src/compiler/core.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ module ts {
434434
return path.replace(/\\/g, "/");
435435
}
436436

437-
// Returns length of path root (i.e. length of "/", "x:/", "//server/share/")
437+
// Returns length of path root (i.e. length of "/", "x:/", "//server/share/, file:///user/files")
438438
export function getRootLength(path: string): number {
439439
if (path.charCodeAt(0) === CharacterCodes.slash) {
440440
if (path.charCodeAt(1) !== CharacterCodes.slash) return 1;
@@ -448,6 +448,8 @@ module ts {
448448
if (path.charCodeAt(2) === CharacterCodes.slash) return 3;
449449
return 2;
450450
}
451+
let idx = path.indexOf('://');
452+
if (idx !== -1) return idx + 3
451453
return 0;
452454
}
453455

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ module ts {
167167
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." },
168168
Cannot_compile_non_external_modules_when_the_separateCompilation_flag_is_provided: { code: 1208, category: DiagnosticCategory.Error, key: "Cannot compile non-external modules when the '--separateCompilation' flag is provided." },
169169
Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." },
170+
Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." },
171+
A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" },
170172
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
171173
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." },
172174
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
@@ -342,8 +344,8 @@ module ts {
342344
The_left_hand_side_of_a_for_of_statement_cannot_be_a_previously_defined_constant: { code: 2485, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...of' statement cannot be a previously defined constant." },
343345
The_left_hand_side_of_a_for_in_statement_cannot_be_a_previously_defined_constant: { code: 2486, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a previously defined constant." },
344346
Invalid_left_hand_side_in_for_of_statement: { code: 2487, category: DiagnosticCategory.Error, key: "Invalid left-hand side in 'for...of' statement." },
345-
The_right_hand_side_of_a_for_of_statement_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: DiagnosticCategory.Error, key: "The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator." },
346-
The_iterator_returned_by_the_right_hand_side_of_a_for_of_statement_must_have_a_next_method: { code: 2489, category: DiagnosticCategory.Error, key: "The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method." },
347+
Type_must_have_a_Symbol_iterator_method_that_returns_an_iterator: { code: 2488, category: DiagnosticCategory.Error, key: "Type must have a '[Symbol.iterator]()' method that returns an iterator." },
348+
An_iterator_must_have_a_next_method: { code: 2489, category: DiagnosticCategory.Error, key: "An iterator must have a 'next()' method." },
347349
The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: { code: 2490, category: DiagnosticCategory.Error, key: "The type returned by the 'next()' method of an iterator must have a 'value' property." },
348350
The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: { code: 2491, category: DiagnosticCategory.Error, key: "The left-hand side of a 'for...in' statement cannot be a destructuring pattern." },
349351
Cannot_redeclare_identifier_0_in_catch_clause: { code: 2492, category: DiagnosticCategory.Error, key: "Cannot redeclare identifier '{0}' in catch clause" },
@@ -505,6 +507,22 @@ module ts {
505507
Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: { code: 7024, category: DiagnosticCategory.Error, key: "Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions." },
506508
You_cannot_rename_this_element: { code: 8000, category: DiagnosticCategory.Error, key: "You cannot rename this element." },
507509
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: { code: 8001, category: DiagnosticCategory.Error, key: "You cannot rename elements that are defined in the standard TypeScript library." },
510+
import_can_only_be_used_in_a_ts_file: { code: 8002, category: DiagnosticCategory.Error, key: "'import ... =' can only be used in a .ts file." },
511+
export_can_only_be_used_in_a_ts_file: { code: 8003, category: DiagnosticCategory.Error, key: "'export=' can only be used in a .ts file." },
512+
type_parameter_declarations_can_only_be_used_in_a_ts_file: { code: 8004, category: DiagnosticCategory.Error, key: "'type parameter declarations' can only be used in a .ts file." },
513+
implements_clauses_can_only_be_used_in_a_ts_file: { code: 8005, category: DiagnosticCategory.Error, key: "'implements clauses' can only be used in a .ts file." },
514+
interface_declarations_can_only_be_used_in_a_ts_file: { code: 8006, category: DiagnosticCategory.Error, key: "'interface declarations' can only be used in a .ts file." },
515+
module_declarations_can_only_be_used_in_a_ts_file: { code: 8007, category: DiagnosticCategory.Error, key: "'module declarations' can only be used in a .ts file." },
516+
type_aliases_can_only_be_used_in_a_ts_file: { code: 8008, category: DiagnosticCategory.Error, key: "'type aliases' can only be used in a .ts file." },
517+
_0_can_only_be_used_in_a_ts_file: { code: 8009, category: DiagnosticCategory.Error, key: "'{0}' can only be used in a .ts file." },
518+
types_can_only_be_used_in_a_ts_file: { code: 8010, category: DiagnosticCategory.Error, key: "'types' can only be used in a .ts file." },
519+
type_arguments_can_only_be_used_in_a_ts_file: { code: 8011, category: DiagnosticCategory.Error, key: "'type arguments' can only be used in a .ts file." },
520+
parameter_modifiers_can_only_be_used_in_a_ts_file: { code: 8012, category: DiagnosticCategory.Error, key: "'parameter modifiers' can only be used in a .ts file." },
521+
can_only_be_used_in_a_ts_file: { code: 8013, category: DiagnosticCategory.Error, key: "'?' can only be used in a .ts file." },
522+
property_declarations_can_only_be_used_in_a_ts_file: { code: 8014, category: DiagnosticCategory.Error, key: "'property declarations' can only be used in a .ts file." },
523+
enum_declarations_can_only_be_used_in_a_ts_file: { code: 8015, category: DiagnosticCategory.Error, key: "'enum declarations' can only be used in a .ts file." },
524+
type_assertion_expressions_can_only_be_used_in_a_ts_file: { code: 8016, category: DiagnosticCategory.Error, key: "'type assertion expressions' can only be used in a .ts file." },
525+
decorators_can_only_be_used_in_a_ts_file: { code: 8017, category: DiagnosticCategory.Error, key: "'decorators' can only be used in a .ts file." },
508526
yield_expressions_are_not_currently_supported: { code: 9000, category: DiagnosticCategory.Error, key: "'yield' expressions are not currently supported." },
509527
Generators_are_not_currently_supported: { code: 9001, category: DiagnosticCategory.Error, key: "Generators are not currently supported." },
510528
Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clauses: { code: 9002, category: DiagnosticCategory.Error, key: "Only identifiers/qualified-names with optional type arguments are currently supported in a class 'extends' clauses." },

src/compiler/diagnosticMessages.json

Lines changed: 75 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,14 @@
659659
"category": "Error",
660660
"code": 1209
661661
},
662+
"Invalid use of '{0}'. Class definitions are automatically in strict mode.": {
663+
"category": "Error",
664+
"code": 1210
665+
},
666+
"A class declaration without the 'default' modifier must have a name": {
667+
"category": "Error",
668+
"code": 1211
669+
},
662670
"Duplicate identifier '{0}'.": {
663671
"category": "Error",
664672
"code": 2300
@@ -1359,11 +1367,11 @@
13591367
"category": "Error",
13601368
"code": 2487
13611369
},
1362-
"The right-hand side of a 'for...of' statement must have a '[Symbol.iterator]()' method that returns an iterator.": {
1370+
"Type must have a '[Symbol.iterator]()' method that returns an iterator.": {
13631371
"category": "Error",
13641372
"code": 2488
13651373
},
1366-
"The iterator returned by the right-hand side of a 'for...of' statement must have a 'next()' method.": {
1374+
"An iterator must have a 'next()' method.": {
13671375
"category": "Error",
13681376
"code": 2489
13691377
},
@@ -2013,6 +2021,71 @@
20132021
"category": "Error",
20142022
"code": 8001
20152023
},
2024+
"'import ... =' can only be used in a .ts file.": {
2025+
"category": "Error",
2026+
"code": 8002
2027+
},
2028+
"'export=' can only be used in a .ts file.": {
2029+
"category": "Error",
2030+
"code": 8003
2031+
},
2032+
"'type parameter declarations' can only be used in a .ts file.": {
2033+
"category": "Error",
2034+
"code": 8004
2035+
},
2036+
"'implements clauses' can only be used in a .ts file.": {
2037+
"category": "Error",
2038+
"code": 8005
2039+
},
2040+
"'interface declarations' can only be used in a .ts file.": {
2041+
"category": "Error",
2042+
"code": 8006
2043+
},
2044+
"'module declarations' can only be used in a .ts file.": {
2045+
"category": "Error",
2046+
"code": 8007
2047+
},
2048+
"'type aliases' can only be used in a .ts file.": {
2049+
"category": "Error",
2050+
"code": 8008
2051+
},
2052+
"'{0}' can only be used in a .ts file.": {
2053+
"category": "Error",
2054+
"code": 8009
2055+
},
2056+
"'types' can only be used in a .ts file.": {
2057+
"category": "Error",
2058+
"code": 8010
2059+
},
2060+
"'type arguments' can only be used in a .ts file.": {
2061+
"category": "Error",
2062+
"code": 8011
2063+
},
2064+
"'parameter modifiers' can only be used in a .ts file.": {
2065+
"category": "Error",
2066+
"code": 8012
2067+
},
2068+
"'?' can only be used in a .ts file.": {
2069+
"category": "Error",
2070+
"code": 8013
2071+
},
2072+
"'property declarations' can only be used in a .ts file.": {
2073+
"category": "Error",
2074+
"code": 8014
2075+
},
2076+
"'enum declarations' can only be used in a .ts file.": {
2077+
"category": "Error",
2078+
"code": 8015
2079+
},
2080+
"'type assertion expressions' can only be used in a .ts file.": {
2081+
"category": "Error",
2082+
"code": 8016
2083+
},
2084+
"'decorators' can only be used in a .ts file.": {
2085+
"category": "Error",
2086+
"code": 8017
2087+
},
2088+
20162089
"'yield' expressions are not currently supported.": {
20172090
"category": "Error",
20182091
"code": 9000

0 commit comments

Comments
 (0)