Skip to content

Commit f96cf33

Browse files
committed
Merge branch 'release-1.5' into master
2 parents 9d736bc + 5b94e40 commit f96cf33

File tree

186 files changed

+766
-535
lines changed

Some content is hidden

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

186 files changed

+766
-535
lines changed

bin/tsc.js

Lines changed: 49 additions & 30 deletions
Large diffs are not rendered by default.

bin/tsserver.js

Lines changed: 69 additions & 32 deletions
Large diffs are not rendered by default.

bin/typescript.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,8 @@ declare module "typescript" {
11141114
target?: ScriptTarget;
11151115
version?: boolean;
11161116
watch?: boolean;
1117-
separateCompilation?: boolean;
1117+
isolatedModules?: boolean;
1118+
experimentalDecorators?: boolean;
11181119
emitDecoratorMetadata?: boolean;
11191120
[option: string]: string | number | boolean;
11201121
}

bin/typescript.js

Lines changed: 76 additions & 34 deletions
Large diffs are not rendered by default.

bin/typescriptServices.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1114,7 +1114,8 @@ declare module ts {
11141114
target?: ScriptTarget;
11151115
version?: boolean;
11161116
watch?: boolean;
1117-
separateCompilation?: boolean;
1117+
isolatedModules?: boolean;
1118+
experimentalDecorators?: boolean;
11181119
emitDecoratorMetadata?: boolean;
11191120
[option: string]: string | number | boolean;
11201121
}

bin/typescriptServices.js

Lines changed: 76 additions & 34 deletions
Large diffs are not rendered by default.

src/compiler/checker.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ module ts {
745745
let target = resolveAlias(symbol);
746746
if (target) {
747747
let markAlias =
748-
(target === unknownSymbol && compilerOptions.separateCompilation) ||
748+
(target === unknownSymbol && compilerOptions.isolatedModules) ||
749749
(target !== unknownSymbol && (target.flags & SymbolFlags.Value) && !isConstEnumOrConstEnumOnlyModule(target));
750750

751751
if (markAlias) {
@@ -9153,7 +9153,7 @@ module ts {
91539153
// serialize the type metadata.
91549154
if (node && node.kind === SyntaxKind.TypeReference) {
91559155
let type = getTypeFromTypeNode(node);
9156-
let shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation;
9156+
let shouldCheckIfUnknownType = type === unknownType && compilerOptions.isolatedModules;
91579157
if (!type || (!shouldCheckIfUnknownType && type.flags & (TypeFlags.Intrinsic | TypeFlags.NumberLike | TypeFlags.StringLike))) {
91589158
return;
91599159
}
@@ -9206,6 +9206,10 @@ module ts {
92069206
if (!nodeCanBeDecorated(node)) {
92079207
return;
92089208
}
9209+
9210+
if (!compilerOptions.experimentalDecorators) {
9211+
error(node, Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalDecorators_to_remove_this_warning);
9212+
}
92099213

92109214
if (compilerOptions.emitDecoratorMetadata) {
92119215
// we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator.
@@ -10365,7 +10369,7 @@ module ts {
1036510369
}
1036610370
}
1036710371

10368-
if (baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) {
10372+
if (baseTypes.length || (baseTypeNode && compilerOptions.isolatedModules)) {
1036910373
// Check that base type can be evaluated as expression
1037010374
checkExpressionOrQualifiedName(baseTypeNode.expression);
1037110375
}
@@ -10781,8 +10785,8 @@ module ts {
1078110785
computeEnumMemberValues(node);
1078210786

1078310787
let enumIsConst = isConst(node);
10784-
if (compilerOptions.separateCompilation && enumIsConst && isInAmbientContext(node)) {
10785-
error(node.name, Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided);
10788+
if (compilerOptions.isolatedModules && enumIsConst && isInAmbientContext(node)) {
10789+
error(node.name, Diagnostics.Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided);
1078610790
}
1078710791

1078810792
// Spec 2014 - Section 9.3:
@@ -10872,7 +10876,7 @@ module ts {
1087210876
if (symbol.flags & SymbolFlags.ValueModule
1087310877
&& symbol.declarations.length > 1
1087410878
&& !isInAmbientContext(node)
10875-
&& isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) {
10879+
&& isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) {
1087610880
let firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
1087710881
if (firstNonAmbientClassOrFunc) {
1087810882
if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
@@ -11887,7 +11891,7 @@ module ts {
1188711891

1188811892
function isAliasResolvedToValue(symbol: Symbol): boolean {
1188911893
let target = resolveAlias(symbol);
11890-
if (target === unknownSymbol && compilerOptions.separateCompilation) {
11894+
if (target === unknownSymbol && compilerOptions.isolatedModules) {
1189111895
return true;
1189211896
}
1189311897
// const enums and modules that contain only const enums are not considered values from the emit perespective

src/compiler/commandLineParser.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ module ts {
142142
paramType: Diagnostics.LOCATION,
143143
},
144144
{
145-
name: "separateCompilation",
145+
name: "isolatedModules",
146146
type: "boolean",
147147
},
148148
{
@@ -188,10 +188,16 @@ module ts {
188188
type: "boolean",
189189
description: Diagnostics.Watch_input_files,
190190
},
191+
{
192+
name: "experimentalDecorators",
193+
type: "boolean",
194+
description: Diagnostics.Enables_experimental_support_for_ES7_decorators
195+
},
191196
{
192197
name: "emitDecoratorMetadata",
193198
type: "boolean",
194-
experimental: true
199+
experimental: true,
200+
description: Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
195201
}
196202
];
197203

src/compiler/diagnosticInformationMap.generated.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,20 @@ module ts {
165165
Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." },
166166
Decorators_are_not_valid_here: { code: 1206, category: DiagnosticCategory.Error, key: "Decorators are not valid here." },
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." },
168-
Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided: { code: 1208, category: DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--separateCompilation' flag is provided." },
169-
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." },
168+
Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--isolatedModules' flag is provided." },
169+
Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." },
170170
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." },
171171
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" },
172172
Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" },
173173
Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1213, category: DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
174174
Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
175175
Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
176176
Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." },
177-
Generators_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 1219, category: DiagnosticCategory.Error, key: "Generators are only available when targeting ECMAScript 6 or higher." },
178-
Generators_are_not_allowed_in_an_ambient_context: { code: 1220, category: DiagnosticCategory.Error, key: "Generators are not allowed in an ambient context." },
179-
An_overload_signature_cannot_be_declared_as_a_generator: { code: 1221, category: DiagnosticCategory.Error, key: "An overload signature cannot be declared as a generator." },
180-
_0_tag_already_specified: { code: 1222, category: DiagnosticCategory.Error, key: "'{0}' tag already specified." },
177+
Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalDecorators_to_remove_this_warning: { code: 1219, category: DiagnosticCategory.Error, key: "Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning." },
178+
Generators_are_only_available_when_targeting_ECMAScript_6_or_higher: { code: 1220, category: DiagnosticCategory.Error, key: "Generators are only available when targeting ECMAScript 6 or higher." },
179+
Generators_are_not_allowed_in_an_ambient_context: { code: 1221, category: DiagnosticCategory.Error, key: "Generators are not allowed in an ambient context." },
180+
An_overload_signature_cannot_be_declared_as_a_generator: { code: 1222, category: DiagnosticCategory.Error, key: "An overload signature cannot be declared as a generator." },
181+
_0_tag_already_specified: { code: 1223, category: DiagnosticCategory.Error, key: "'{0}' tag already specified." },
181182
Duplicate_identifier_0: { code: 2300, category: DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
182183
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." },
183184
Static_members_cannot_reference_class_type_parameters: { code: 2302, category: DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
@@ -455,11 +456,11 @@ module ts {
455456
Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." },
456457
Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." },
457458
Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." },
458-
Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { code: 5043, category: DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." },
459-
Option_declaration_cannot_be_specified_with_option_separateCompilation: { code: 5044, category: DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'separateCompilation'." },
460-
Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." },
461-
Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." },
462-
Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: DiagnosticCategory.Error, key: "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." },
459+
Option_sourceMap_cannot_be_specified_with_option_isolatedModules: { code: 5043, category: DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'isolatedModules'." },
460+
Option_declaration_cannot_be_specified_with_option_isolatedModules: { code: 5044, category: DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'isolatedModules'." },
461+
Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules: { code: 5045, category: DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'isolatedModules'." },
462+
Option_out_cannot_be_specified_with_option_isolatedModules: { code: 5046, category: DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'isolatedModules'." },
463+
Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: DiagnosticCategory.Error, key: "Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." },
463464
Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." },
464465
Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." },
465466
Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." },
@@ -513,6 +514,9 @@ module ts {
513514
Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." },
514515
NEWLINE: { code: 6061, category: DiagnosticCategory.Message, key: "NEWLINE" },
515516
Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." },
517+
Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified: { code: 6064, category: DiagnosticCategory.Error, key: "Option 'experimentalDecorators' must also be specified when option 'emitDecoratorMetadata' is specified." },
518+
Enables_experimental_support_for_ES7_decorators: { code: 6065, category: DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." },
519+
Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." },
516520
Variable_0_implicitly_has_an_1_type: { code: 7005, category: DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." },
517521
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." },
518522
Member_0_implicitly_has_an_1_type: { code: 7008, category: DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." },

0 commit comments

Comments
 (0)