mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-11 09:24:19 -06:00
Merge branch 'release-1.5' into master
This commit is contained in:
commit
f96cf338d9
79
bin/tsc.js
79
bin/tsc.js
@ -1084,8 +1084,8 @@ var ts;
|
||||
Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." },
|
||||
Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." },
|
||||
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." },
|
||||
Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--separateCompilation' flag is provided." },
|
||||
Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." },
|
||||
Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--isolatedModules' flag is provided." },
|
||||
Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." },
|
||||
Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." },
|
||||
A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" },
|
||||
Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" },
|
||||
@ -1093,6 +1093,7 @@ var ts;
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
|
||||
Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." },
|
||||
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: ts.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." },
|
||||
Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
|
||||
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.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: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
|
||||
@ -1368,11 +1369,11 @@ var ts;
|
||||
Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." },
|
||||
Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." },
|
||||
Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." },
|
||||
Option_declaration_cannot_be_specified_with_option_separateCompilation: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'separateCompilation'." },
|
||||
Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." },
|
||||
Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." },
|
||||
Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_isolatedModules: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'isolatedModules'." },
|
||||
Option_declaration_cannot_be_specified_with_option_isolatedModules: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'isolatedModules'." },
|
||||
Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'isolatedModules'." },
|
||||
Option_out_cannot_be_specified_with_option_isolatedModules: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'isolatedModules'." },
|
||||
Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." },
|
||||
@ -1426,6 +1427,9 @@ var ts;
|
||||
Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." },
|
||||
NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" },
|
||||
Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." },
|
||||
Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified: { code: 6064, category: ts.DiagnosticCategory.Error, key: "Option 'experimentalDecorators' must also be specified when option 'emitDecoratorMetadata' is specified." },
|
||||
Enables_experimental_support_for_ES7_decorators: { code: 6065, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." },
|
||||
Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." },
|
||||
@ -4427,7 +4431,7 @@ var ts;
|
||||
function shouldEmitToOwnFile(sourceFile, compilerOptions) {
|
||||
if (!isDeclarationFile(sourceFile)) {
|
||||
if ((isExternalModule(sourceFile) || !compilerOptions.out)) {
|
||||
return compilerOptions.separateCompilation || !ts.fileExtensionIs(sourceFile.fileName, ".js");
|
||||
return compilerOptions.isolatedModules || !ts.fileExtensionIs(sourceFile.fileName, ".js");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -9130,7 +9134,7 @@ var ts;
|
||||
var symbol = getSymbolOfNode(node);
|
||||
var target = resolveAlias(symbol);
|
||||
if (target) {
|
||||
var markAlias = (target === unknownSymbol && compilerOptions.separateCompilation) ||
|
||||
var markAlias = (target === unknownSymbol && compilerOptions.isolatedModules) ||
|
||||
(target !== unknownSymbol && (target.flags & 107455) && !isConstEnumOrConstEnumOnlyModule(target));
|
||||
if (markAlias) {
|
||||
markAliasSymbolAsReferenced(symbol);
|
||||
@ -15549,7 +15553,7 @@ var ts;
|
||||
function checkTypeNodeAsExpression(node) {
|
||||
if (node && node.kind === 142) {
|
||||
var type = getTypeFromTypeNode(node);
|
||||
var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation;
|
||||
var shouldCheckIfUnknownType = type === unknownType && compilerOptions.isolatedModules;
|
||||
if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 | 132 | 258))) {
|
||||
return;
|
||||
}
|
||||
@ -15590,6 +15594,9 @@ var ts;
|
||||
if (!ts.nodeCanBeDecorated(node)) {
|
||||
return;
|
||||
}
|
||||
if (!compilerOptions.experimentalDecorators) {
|
||||
error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalDecorators_to_remove_this_warning);
|
||||
}
|
||||
if (compilerOptions.emitDecoratorMetadata) {
|
||||
switch (node.kind) {
|
||||
case 202:
|
||||
@ -16376,7 +16383,7 @@ var ts;
|
||||
checkKindsOfPropertyMemberOverrides(type, baseType);
|
||||
}
|
||||
}
|
||||
if (baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) {
|
||||
if (baseTypes.length || (baseTypeNode && compilerOptions.isolatedModules)) {
|
||||
checkExpressionOrQualifiedName(baseTypeNode.expression);
|
||||
}
|
||||
var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node);
|
||||
@ -16720,8 +16727,8 @@ var ts;
|
||||
checkExportsOnMergedDeclarations(node);
|
||||
computeEnumMemberValues(node);
|
||||
var enumIsConst = ts.isConst(node);
|
||||
if (compilerOptions.separateCompilation && enumIsConst && ts.isInAmbientContext(node)) {
|
||||
error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided);
|
||||
if (compilerOptions.isolatedModules && enumIsConst && ts.isInAmbientContext(node)) {
|
||||
error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided);
|
||||
}
|
||||
var enumSymbol = getSymbolOfNode(node);
|
||||
var firstDeclaration = ts.getDeclarationOfKind(enumSymbol, node.kind);
|
||||
@ -16793,7 +16800,7 @@ var ts;
|
||||
if (symbol.flags & 512
|
||||
&& symbol.declarations.length > 1
|
||||
&& !ts.isInAmbientContext(node)
|
||||
&& ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) {
|
||||
&& ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) {
|
||||
var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
|
||||
if (firstNonAmbientClassOrFunc) {
|
||||
if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
|
||||
@ -17120,6 +17127,7 @@ var ts;
|
||||
break;
|
||||
case 135:
|
||||
case 134:
|
||||
ts.forEach(node.decorators, checkFunctionExpressionBodies);
|
||||
ts.forEach(node.parameters, checkFunctionExpressionBodies);
|
||||
if (ts.isObjectLiteralMethod(node)) {
|
||||
checkFunctionExpressionOrObjectLiteralMethodBody(node);
|
||||
@ -17134,6 +17142,7 @@ var ts;
|
||||
case 193:
|
||||
checkFunctionExpressionBodies(node.expression);
|
||||
break;
|
||||
case 131:
|
||||
case 130:
|
||||
case 133:
|
||||
case 132:
|
||||
@ -17715,7 +17724,7 @@ var ts;
|
||||
}
|
||||
function isAliasResolvedToValue(symbol) {
|
||||
var target = resolveAlias(symbol);
|
||||
if (target === unknownSymbol && compilerOptions.separateCompilation) {
|
||||
if (target === unknownSymbol && compilerOptions.isolatedModules) {
|
||||
return true;
|
||||
}
|
||||
return target !== unknownSymbol && target && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target);
|
||||
@ -21545,7 +21554,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function tryEmitConstantValue(node) {
|
||||
if (compilerOptions.separateCompilation) {
|
||||
if (compilerOptions.isolatedModules) {
|
||||
return false;
|
||||
}
|
||||
var constantValue = resolver.getConstantValue(node);
|
||||
@ -23641,7 +23650,7 @@ var ts;
|
||||
}
|
||||
function shouldEmitEnumDeclaration(node) {
|
||||
var isConstEnum = ts.isConst(node);
|
||||
return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation;
|
||||
return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.isolatedModules;
|
||||
}
|
||||
function emitEnumDeclaration(node) {
|
||||
if (!shouldEmitEnumDeclaration(node)) {
|
||||
@ -23736,7 +23745,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function shouldEmitModuleDeclaration(node) {
|
||||
return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation);
|
||||
return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules);
|
||||
}
|
||||
function isModuleMergedWithES6Class(node) {
|
||||
return languageVersion === 2 && !!(resolver.getNodeCheckFlags(node) & 2048);
|
||||
@ -24692,7 +24701,7 @@ var ts;
|
||||
paramEmitted = true;
|
||||
}
|
||||
}
|
||||
if (ts.isExternalModule(node) || compilerOptions.separateCompilation) {
|
||||
if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
|
||||
if (languageVersion >= 2) {
|
||||
emitES6Module(node, startIndex);
|
||||
}
|
||||
@ -25048,7 +25057,7 @@ var ts;
|
||||
ts.emitTime = 0;
|
||||
ts.ioReadTime = 0;
|
||||
ts.ioWriteTime = 0;
|
||||
ts.version = "1.5.2";
|
||||
ts.version = "1.5.3";
|
||||
var carriageReturnLineFeed = "\r\n";
|
||||
var lineFeed = "\n";
|
||||
function findConfigFile(searchPath) {
|
||||
@ -25470,18 +25479,18 @@ var ts;
|
||||
return allFilesBelongToPath;
|
||||
}
|
||||
function verifyCompilerOptions() {
|
||||
if (options.separateCompilation) {
|
||||
if (options.isolatedModules) {
|
||||
if (options.sourceMap) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.declaration) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.noEmitOnError) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.out) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
}
|
||||
if (options.inlineSourceMap) {
|
||||
@ -25511,14 +25520,14 @@ var ts;
|
||||
}
|
||||
var languageVersion = options.target || 0;
|
||||
var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; });
|
||||
if (options.separateCompilation) {
|
||||
if (options.isolatedModules) {
|
||||
if (!options.module && languageVersion < 2) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
|
||||
}
|
||||
var firstNonExternalModuleSourceFile = ts.forEach(files, function (f) { return !ts.isExternalModule(f) && !ts.isDeclarationFile(f) ? f : undefined; });
|
||||
if (firstNonExternalModuleSourceFile) {
|
||||
var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile);
|
||||
diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided));
|
||||
diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided));
|
||||
}
|
||||
}
|
||||
else if (firstExternalModuleSourceFile && languageVersion < 2 && !options.module) {
|
||||
@ -25550,6 +25559,10 @@ var ts;
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmit_cannot_be_specified_with_option_declaration));
|
||||
}
|
||||
}
|
||||
if (options.emitDecoratorMetadata &&
|
||||
!options.experimentalDecorators) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified));
|
||||
}
|
||||
}
|
||||
}
|
||||
ts.createProgram = createProgram;
|
||||
@ -25697,7 +25710,7 @@ var ts;
|
||||
paramType: ts.Diagnostics.LOCATION
|
||||
},
|
||||
{
|
||||
name: "separateCompilation",
|
||||
name: "isolatedModules",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
@ -25743,10 +25756,16 @@ var ts;
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Watch_input_files
|
||||
},
|
||||
{
|
||||
name: "experimentalDecorators",
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators
|
||||
},
|
||||
{
|
||||
name: "emitDecoratorMetadata",
|
||||
type: "boolean",
|
||||
experimental: true
|
||||
experimental: true,
|
||||
description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
|
||||
}
|
||||
];
|
||||
function parseCommandLine(commandLine) {
|
||||
|
||||
101
bin/tsserver.js
101
bin/tsserver.js
@ -1084,8 +1084,8 @@ var ts;
|
||||
Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." },
|
||||
Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." },
|
||||
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." },
|
||||
Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--separateCompilation' flag is provided." },
|
||||
Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." },
|
||||
Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--isolatedModules' flag is provided." },
|
||||
Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." },
|
||||
Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." },
|
||||
A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" },
|
||||
Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" },
|
||||
@ -1093,6 +1093,7 @@ var ts;
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
|
||||
Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." },
|
||||
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: ts.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." },
|
||||
Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
|
||||
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.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: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
|
||||
@ -1368,11 +1369,11 @@ var ts;
|
||||
Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." },
|
||||
Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." },
|
||||
Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." },
|
||||
Option_declaration_cannot_be_specified_with_option_separateCompilation: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'separateCompilation'." },
|
||||
Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." },
|
||||
Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." },
|
||||
Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_isolatedModules: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'isolatedModules'." },
|
||||
Option_declaration_cannot_be_specified_with_option_isolatedModules: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'isolatedModules'." },
|
||||
Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'isolatedModules'." },
|
||||
Option_out_cannot_be_specified_with_option_isolatedModules: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'isolatedModules'." },
|
||||
Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." },
|
||||
@ -1426,6 +1427,9 @@ var ts;
|
||||
Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." },
|
||||
NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" },
|
||||
Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." },
|
||||
Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified: { code: 6064, category: ts.DiagnosticCategory.Error, key: "Option 'experimentalDecorators' must also be specified when option 'emitDecoratorMetadata' is specified." },
|
||||
Enables_experimental_support_for_ES7_decorators: { code: 6065, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." },
|
||||
Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." },
|
||||
@ -2855,7 +2859,7 @@ var ts;
|
||||
paramType: ts.Diagnostics.LOCATION
|
||||
},
|
||||
{
|
||||
name: "separateCompilation",
|
||||
name: "isolatedModules",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
@ -2901,10 +2905,16 @@ var ts;
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Watch_input_files
|
||||
},
|
||||
{
|
||||
name: "experimentalDecorators",
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators
|
||||
},
|
||||
{
|
||||
name: "emitDecoratorMetadata",
|
||||
type: "boolean",
|
||||
experimental: true
|
||||
experimental: true,
|
||||
description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
|
||||
}
|
||||
];
|
||||
function parseCommandLine(commandLine) {
|
||||
@ -4295,7 +4305,7 @@ var ts;
|
||||
function shouldEmitToOwnFile(sourceFile, compilerOptions) {
|
||||
if (!isDeclarationFile(sourceFile)) {
|
||||
if ((isExternalModule(sourceFile) || !compilerOptions.out)) {
|
||||
return compilerOptions.separateCompilation || !ts.fileExtensionIs(sourceFile.fileName, ".js");
|
||||
return compilerOptions.isolatedModules || !ts.fileExtensionIs(sourceFile.fileName, ".js");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -9514,7 +9524,7 @@ var ts;
|
||||
var symbol = getSymbolOfNode(node);
|
||||
var target = resolveAlias(symbol);
|
||||
if (target) {
|
||||
var markAlias = (target === unknownSymbol && compilerOptions.separateCompilation) ||
|
||||
var markAlias = (target === unknownSymbol && compilerOptions.isolatedModules) ||
|
||||
(target !== unknownSymbol && (target.flags & 107455) && !isConstEnumOrConstEnumOnlyModule(target));
|
||||
if (markAlias) {
|
||||
markAliasSymbolAsReferenced(symbol);
|
||||
@ -15933,7 +15943,7 @@ var ts;
|
||||
function checkTypeNodeAsExpression(node) {
|
||||
if (node && node.kind === 142) {
|
||||
var type = getTypeFromTypeNode(node);
|
||||
var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation;
|
||||
var shouldCheckIfUnknownType = type === unknownType && compilerOptions.isolatedModules;
|
||||
if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 | 132 | 258))) {
|
||||
return;
|
||||
}
|
||||
@ -15974,6 +15984,9 @@ var ts;
|
||||
if (!ts.nodeCanBeDecorated(node)) {
|
||||
return;
|
||||
}
|
||||
if (!compilerOptions.experimentalDecorators) {
|
||||
error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalDecorators_to_remove_this_warning);
|
||||
}
|
||||
if (compilerOptions.emitDecoratorMetadata) {
|
||||
switch (node.kind) {
|
||||
case 202:
|
||||
@ -16760,7 +16773,7 @@ var ts;
|
||||
checkKindsOfPropertyMemberOverrides(type, baseType);
|
||||
}
|
||||
}
|
||||
if (baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) {
|
||||
if (baseTypes.length || (baseTypeNode && compilerOptions.isolatedModules)) {
|
||||
checkExpressionOrQualifiedName(baseTypeNode.expression);
|
||||
}
|
||||
var implementedTypeNodes = ts.getClassImplementsHeritageClauseElements(node);
|
||||
@ -17104,8 +17117,8 @@ var ts;
|
||||
checkExportsOnMergedDeclarations(node);
|
||||
computeEnumMemberValues(node);
|
||||
var enumIsConst = ts.isConst(node);
|
||||
if (compilerOptions.separateCompilation && enumIsConst && ts.isInAmbientContext(node)) {
|
||||
error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided);
|
||||
if (compilerOptions.isolatedModules && enumIsConst && ts.isInAmbientContext(node)) {
|
||||
error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided);
|
||||
}
|
||||
var enumSymbol = getSymbolOfNode(node);
|
||||
var firstDeclaration = ts.getDeclarationOfKind(enumSymbol, node.kind);
|
||||
@ -17177,7 +17190,7 @@ var ts;
|
||||
if (symbol.flags & 512
|
||||
&& symbol.declarations.length > 1
|
||||
&& !ts.isInAmbientContext(node)
|
||||
&& ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) {
|
||||
&& ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) {
|
||||
var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
|
||||
if (firstNonAmbientClassOrFunc) {
|
||||
if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
|
||||
@ -17504,6 +17517,7 @@ var ts;
|
||||
break;
|
||||
case 135:
|
||||
case 134:
|
||||
ts.forEach(node.decorators, checkFunctionExpressionBodies);
|
||||
ts.forEach(node.parameters, checkFunctionExpressionBodies);
|
||||
if (ts.isObjectLiteralMethod(node)) {
|
||||
checkFunctionExpressionOrObjectLiteralMethodBody(node);
|
||||
@ -17518,6 +17532,7 @@ var ts;
|
||||
case 193:
|
||||
checkFunctionExpressionBodies(node.expression);
|
||||
break;
|
||||
case 131:
|
||||
case 130:
|
||||
case 133:
|
||||
case 132:
|
||||
@ -18099,7 +18114,7 @@ var ts;
|
||||
}
|
||||
function isAliasResolvedToValue(symbol) {
|
||||
var target = resolveAlias(symbol);
|
||||
if (target === unknownSymbol && compilerOptions.separateCompilation) {
|
||||
if (target === unknownSymbol && compilerOptions.isolatedModules) {
|
||||
return true;
|
||||
}
|
||||
return target !== unknownSymbol && target && target.flags & 107455 && !isConstEnumOrConstEnumOnlyModule(target);
|
||||
@ -21929,7 +21944,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function tryEmitConstantValue(node) {
|
||||
if (compilerOptions.separateCompilation) {
|
||||
if (compilerOptions.isolatedModules) {
|
||||
return false;
|
||||
}
|
||||
var constantValue = resolver.getConstantValue(node);
|
||||
@ -24025,7 +24040,7 @@ var ts;
|
||||
}
|
||||
function shouldEmitEnumDeclaration(node) {
|
||||
var isConstEnum = ts.isConst(node);
|
||||
return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation;
|
||||
return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.isolatedModules;
|
||||
}
|
||||
function emitEnumDeclaration(node) {
|
||||
if (!shouldEmitEnumDeclaration(node)) {
|
||||
@ -24120,7 +24135,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function shouldEmitModuleDeclaration(node) {
|
||||
return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation);
|
||||
return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules);
|
||||
}
|
||||
function isModuleMergedWithES6Class(node) {
|
||||
return languageVersion === 2 && !!(resolver.getNodeCheckFlags(node) & 2048);
|
||||
@ -25076,7 +25091,7 @@ var ts;
|
||||
paramEmitted = true;
|
||||
}
|
||||
}
|
||||
if (ts.isExternalModule(node) || compilerOptions.separateCompilation) {
|
||||
if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
|
||||
if (languageVersion >= 2) {
|
||||
emitES6Module(node, startIndex);
|
||||
}
|
||||
@ -25432,7 +25447,7 @@ var ts;
|
||||
ts.emitTime = 0;
|
||||
ts.ioReadTime = 0;
|
||||
ts.ioWriteTime = 0;
|
||||
ts.version = "1.5.2";
|
||||
ts.version = "1.5.3";
|
||||
var carriageReturnLineFeed = "\r\n";
|
||||
var lineFeed = "\n";
|
||||
function findConfigFile(searchPath) {
|
||||
@ -25854,18 +25869,18 @@ var ts;
|
||||
return allFilesBelongToPath;
|
||||
}
|
||||
function verifyCompilerOptions() {
|
||||
if (options.separateCompilation) {
|
||||
if (options.isolatedModules) {
|
||||
if (options.sourceMap) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.declaration) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.noEmitOnError) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.out) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
}
|
||||
if (options.inlineSourceMap) {
|
||||
@ -25895,14 +25910,14 @@ var ts;
|
||||
}
|
||||
var languageVersion = options.target || 0;
|
||||
var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; });
|
||||
if (options.separateCompilation) {
|
||||
if (options.isolatedModules) {
|
||||
if (!options.module && languageVersion < 2) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
|
||||
}
|
||||
var firstNonExternalModuleSourceFile = ts.forEach(files, function (f) { return !ts.isExternalModule(f) && !ts.isDeclarationFile(f) ? f : undefined; });
|
||||
if (firstNonExternalModuleSourceFile) {
|
||||
var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile);
|
||||
diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided));
|
||||
diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided));
|
||||
}
|
||||
}
|
||||
else if (firstExternalModuleSourceFile && languageVersion < 2 && !options.module) {
|
||||
@ -25934,6 +25949,10 @@ var ts;
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmit_cannot_be_specified_with_option_declaration));
|
||||
}
|
||||
}
|
||||
if (options.emitDecoratorMetadata &&
|
||||
!options.experimentalDecorators) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified));
|
||||
}
|
||||
}
|
||||
}
|
||||
ts.createProgram = createProgram;
|
||||
@ -31359,7 +31378,7 @@ var ts;
|
||||
}
|
||||
function transpile(input, compilerOptions, fileName, diagnostics) {
|
||||
var options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions();
|
||||
options.separateCompilation = true;
|
||||
options.isolatedModules = true;
|
||||
options.allowNonTsExtensions = true;
|
||||
var inputFileName = fileName || "module.ts";
|
||||
var sourceFile = ts.createSourceFile(inputFileName, input, options.target);
|
||||
@ -31400,7 +31419,25 @@ var ts;
|
||||
if (textChangeRange) {
|
||||
if (version !== sourceFile.version) {
|
||||
if (!ts.disableIncrementalParsing) {
|
||||
var newSourceFile = ts.updateSourceFile(sourceFile, scriptSnapshot.getText(0, scriptSnapshot.getLength()), textChangeRange, aggressiveChecks);
|
||||
var newText;
|
||||
var prefix = textChangeRange.span.start !== 0
|
||||
? sourceFile.text.substr(0, textChangeRange.span.start)
|
||||
: "";
|
||||
var suffix = ts.textSpanEnd(textChangeRange.span) !== sourceFile.text.length
|
||||
? sourceFile.text.substr(ts.textSpanEnd(textChangeRange.span))
|
||||
: "";
|
||||
if (textChangeRange.newLength === 0) {
|
||||
newText = prefix && suffix ? prefix + suffix : prefix || suffix;
|
||||
}
|
||||
else {
|
||||
var changedText = scriptSnapshot.getText(textChangeRange.span.start, textChangeRange.span.start + textChangeRange.newLength);
|
||||
newText = prefix && suffix
|
||||
? prefix + changedText + suffix
|
||||
: prefix
|
||||
? (prefix + changedText)
|
||||
: (changedText + suffix);
|
||||
}
|
||||
var newSourceFile = ts.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
|
||||
setSourceFileFields(newSourceFile, scriptSnapshot, version);
|
||||
newSourceFile.nameTable = undefined;
|
||||
return newSourceFile;
|
||||
|
||||
3
bin/typescript.d.ts
vendored
3
bin/typescript.d.ts
vendored
@ -1114,7 +1114,8 @@ declare module "typescript" {
|
||||
target?: ScriptTarget;
|
||||
version?: boolean;
|
||||
watch?: boolean;
|
||||
separateCompilation?: boolean;
|
||||
isolatedModules?: boolean;
|
||||
experimentalDecorators?: boolean;
|
||||
emitDecoratorMetadata?: boolean;
|
||||
[option: string]: string | number | boolean;
|
||||
}
|
||||
|
||||
@ -1835,8 +1835,8 @@ var ts;
|
||||
Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." },
|
||||
Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." },
|
||||
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." },
|
||||
Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--separateCompilation' flag is provided." },
|
||||
Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." },
|
||||
Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--isolatedModules' flag is provided." },
|
||||
Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." },
|
||||
Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." },
|
||||
A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" },
|
||||
Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" },
|
||||
@ -1844,6 +1844,7 @@ var ts;
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
|
||||
Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." },
|
||||
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: ts.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." },
|
||||
Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
|
||||
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.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: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
|
||||
@ -2119,11 +2120,11 @@ var ts;
|
||||
Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." },
|
||||
Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." },
|
||||
Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." },
|
||||
Option_declaration_cannot_be_specified_with_option_separateCompilation: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'separateCompilation'." },
|
||||
Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." },
|
||||
Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." },
|
||||
Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_isolatedModules: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'isolatedModules'." },
|
||||
Option_declaration_cannot_be_specified_with_option_isolatedModules: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'isolatedModules'." },
|
||||
Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'isolatedModules'." },
|
||||
Option_out_cannot_be_specified_with_option_isolatedModules: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'isolatedModules'." },
|
||||
Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." },
|
||||
@ -2177,6 +2178,9 @@ var ts;
|
||||
Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." },
|
||||
NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" },
|
||||
Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." },
|
||||
Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified: { code: 6064, category: ts.DiagnosticCategory.Error, key: "Option 'experimentalDecorators' must also be specified when option 'emitDecoratorMetadata' is specified." },
|
||||
Enables_experimental_support_for_ES7_decorators: { code: 6065, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." },
|
||||
Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." },
|
||||
@ -5502,7 +5506,7 @@ var ts;
|
||||
if ((isExternalModule(sourceFile) || !compilerOptions.out)) {
|
||||
// 1. in-browser single file compilation scenario
|
||||
// 2. non .js file
|
||||
return compilerOptions.separateCompilation || !ts.fileExtensionIs(sourceFile.fileName, ".js");
|
||||
return compilerOptions.isolatedModules || !ts.fileExtensionIs(sourceFile.fileName, ".js");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -11448,7 +11452,7 @@ var ts;
|
||||
var symbol = getSymbolOfNode(node);
|
||||
var target = resolveAlias(symbol);
|
||||
if (target) {
|
||||
var markAlias = (target === unknownSymbol && compilerOptions.separateCompilation) ||
|
||||
var markAlias = (target === unknownSymbol && compilerOptions.isolatedModules) ||
|
||||
(target !== unknownSymbol && (target.flags & 107455 /* Value */) && !isConstEnumOrConstEnumOnlyModule(target));
|
||||
if (markAlias) {
|
||||
markAliasSymbolAsReferenced(symbol);
|
||||
@ -18898,7 +18902,7 @@ var ts;
|
||||
// serialize the type metadata.
|
||||
if (node && node.kind === 142 /* TypeReference */) {
|
||||
var type = getTypeFromTypeNode(node);
|
||||
var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation;
|
||||
var shouldCheckIfUnknownType = type === unknownType && compilerOptions.isolatedModules;
|
||||
if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 /* Intrinsic */ | 132 /* NumberLike */ | 258 /* StringLike */))) {
|
||||
return;
|
||||
}
|
||||
@ -18948,6 +18952,9 @@ var ts;
|
||||
if (!ts.nodeCanBeDecorated(node)) {
|
||||
return;
|
||||
}
|
||||
if (!compilerOptions.experimentalDecorators) {
|
||||
error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalDecorators_to_remove_this_warning);
|
||||
}
|
||||
if (compilerOptions.emitDecoratorMetadata) {
|
||||
// we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator.
|
||||
switch (node.kind) {
|
||||
@ -19902,7 +19909,7 @@ var ts;
|
||||
checkKindsOfPropertyMemberOverrides(type, baseType);
|
||||
}
|
||||
}
|
||||
if (baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) {
|
||||
if (baseTypes.length || (baseTypeNode && compilerOptions.isolatedModules)) {
|
||||
// Check that base type can be evaluated as expression
|
||||
checkExpressionOrQualifiedName(baseTypeNode.expression);
|
||||
}
|
||||
@ -20271,8 +20278,8 @@ var ts;
|
||||
checkExportsOnMergedDeclarations(node);
|
||||
computeEnumMemberValues(node);
|
||||
var enumIsConst = ts.isConst(node);
|
||||
if (compilerOptions.separateCompilation && enumIsConst && ts.isInAmbientContext(node)) {
|
||||
error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided);
|
||||
if (compilerOptions.isolatedModules && enumIsConst && ts.isInAmbientContext(node)) {
|
||||
error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided);
|
||||
}
|
||||
// Spec 2014 - Section 9.3:
|
||||
// It isn't possible for one enum declaration to continue the automatic numbering sequence of another,
|
||||
@ -20354,7 +20361,7 @@ var ts;
|
||||
if (symbol.flags & 512 /* ValueModule */
|
||||
&& symbol.declarations.length > 1
|
||||
&& !ts.isInAmbientContext(node)
|
||||
&& ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) {
|
||||
&& ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) {
|
||||
var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
|
||||
if (firstNonAmbientClassOrFunc) {
|
||||
if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
|
||||
@ -20705,6 +20712,7 @@ var ts;
|
||||
break;
|
||||
case 135 /* MethodDeclaration */:
|
||||
case 134 /* MethodSignature */:
|
||||
ts.forEach(node.decorators, checkFunctionExpressionBodies);
|
||||
ts.forEach(node.parameters, checkFunctionExpressionBodies);
|
||||
if (ts.isObjectLiteralMethod(node)) {
|
||||
checkFunctionExpressionOrObjectLiteralMethodBody(node);
|
||||
@ -20719,6 +20727,7 @@ var ts;
|
||||
case 193 /* WithStatement */:
|
||||
checkFunctionExpressionBodies(node.expression);
|
||||
break;
|
||||
case 131 /* Decorator */:
|
||||
case 130 /* Parameter */:
|
||||
case 133 /* PropertyDeclaration */:
|
||||
case 132 /* PropertySignature */:
|
||||
@ -21356,7 +21365,7 @@ var ts;
|
||||
}
|
||||
function isAliasResolvedToValue(symbol) {
|
||||
var target = resolveAlias(symbol);
|
||||
if (target === unknownSymbol && compilerOptions.separateCompilation) {
|
||||
if (target === unknownSymbol && compilerOptions.isolatedModules) {
|
||||
return true;
|
||||
}
|
||||
// const enums and modules that contain only const enums are not considered values from the emit perespective
|
||||
@ -25669,7 +25678,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function tryEmitConstantValue(node) {
|
||||
if (compilerOptions.separateCompilation) {
|
||||
if (compilerOptions.isolatedModules) {
|
||||
// do not inline enum values in separate compilation mode
|
||||
return false;
|
||||
}
|
||||
@ -28066,7 +28075,7 @@ var ts;
|
||||
}
|
||||
function shouldEmitEnumDeclaration(node) {
|
||||
var isConstEnum = ts.isConst(node);
|
||||
return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation;
|
||||
return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.isolatedModules;
|
||||
}
|
||||
function emitEnumDeclaration(node) {
|
||||
// const enums are completely erased during compilation.
|
||||
@ -28165,7 +28174,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function shouldEmitModuleDeclaration(node) {
|
||||
return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation);
|
||||
return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules);
|
||||
}
|
||||
function isModuleMergedWithES6Class(node) {
|
||||
return languageVersion === 2 /* ES6 */ && !!(resolver.getNodeCheckFlags(node) & 2048 /* LexicalModuleMergesWithClass */);
|
||||
@ -29265,7 +29274,7 @@ var ts;
|
||||
paramEmitted = true;
|
||||
}
|
||||
}
|
||||
if (ts.isExternalModule(node) || compilerOptions.separateCompilation) {
|
||||
if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
|
||||
if (languageVersion >= 2 /* ES6 */) {
|
||||
emitES6Module(node, startIndex);
|
||||
}
|
||||
@ -29656,7 +29665,7 @@ var ts;
|
||||
/* @internal */ ts.ioReadTime = 0;
|
||||
/* @internal */ ts.ioWriteTime = 0;
|
||||
/** The version of the TypeScript compiler release */
|
||||
ts.version = "1.5.2";
|
||||
ts.version = "1.5.3";
|
||||
var carriageReturnLineFeed = "\r\n";
|
||||
var lineFeed = "\n";
|
||||
function findConfigFile(searchPath) {
|
||||
@ -30108,18 +30117,18 @@ var ts;
|
||||
return allFilesBelongToPath;
|
||||
}
|
||||
function verifyCompilerOptions() {
|
||||
if (options.separateCompilation) {
|
||||
if (options.isolatedModules) {
|
||||
if (options.sourceMap) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.declaration) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.noEmitOnError) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.out) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
}
|
||||
if (options.inlineSourceMap) {
|
||||
@ -30150,14 +30159,14 @@ var ts;
|
||||
}
|
||||
var languageVersion = options.target || 0 /* ES3 */;
|
||||
var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; });
|
||||
if (options.separateCompilation) {
|
||||
if (options.isolatedModules) {
|
||||
if (!options.module && languageVersion < 2 /* ES6 */) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
|
||||
}
|
||||
var firstNonExternalModuleSourceFile = ts.forEach(files, function (f) { return !ts.isExternalModule(f) && !ts.isDeclarationFile(f) ? f : undefined; });
|
||||
if (firstNonExternalModuleSourceFile) {
|
||||
var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile);
|
||||
diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided));
|
||||
diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided));
|
||||
}
|
||||
}
|
||||
else if (firstExternalModuleSourceFile && languageVersion < 2 /* ES6 */ && !options.module) {
|
||||
@ -30198,6 +30207,10 @@ var ts;
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmit_cannot_be_specified_with_option_declaration));
|
||||
}
|
||||
}
|
||||
if (options.emitDecoratorMetadata &&
|
||||
!options.experimentalDecorators) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified));
|
||||
}
|
||||
}
|
||||
}
|
||||
ts.createProgram = createProgram;
|
||||
@ -30346,7 +30359,7 @@ var ts;
|
||||
paramType: ts.Diagnostics.LOCATION
|
||||
},
|
||||
{
|
||||
name: "separateCompilation",
|
||||
name: "isolatedModules",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
@ -30392,10 +30405,16 @@ var ts;
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Watch_input_files
|
||||
},
|
||||
{
|
||||
name: "experimentalDecorators",
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators
|
||||
},
|
||||
{
|
||||
name: "emitDecoratorMetadata",
|
||||
type: "boolean",
|
||||
experimental: true
|
||||
experimental: true,
|
||||
description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
|
||||
}
|
||||
];
|
||||
function parseCommandLine(commandLine) {
|
||||
@ -36687,12 +36706,12 @@ var ts;
|
||||
* This function will compile source text from 'input' argument using specified compiler options.
|
||||
* If not options are provided - it will use a set of default compiler options.
|
||||
* Extra compiler options that will unconditionally be used bu this function are:
|
||||
* - separateCompilation = true
|
||||
* - isolatedModules = true
|
||||
* - allowNonTsExtensions = true
|
||||
*/
|
||||
function transpile(input, compilerOptions, fileName, diagnostics) {
|
||||
var options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions();
|
||||
options.separateCompilation = true;
|
||||
options.isolatedModules = true;
|
||||
// Filename can be non-ts file.
|
||||
options.allowNonTsExtensions = true;
|
||||
// Parse
|
||||
@ -36743,7 +36762,30 @@ var ts;
|
||||
if (version !== sourceFile.version) {
|
||||
// Once incremental parsing is ready, then just call into this function.
|
||||
if (!ts.disableIncrementalParsing) {
|
||||
var newSourceFile = ts.updateSourceFile(sourceFile, scriptSnapshot.getText(0, scriptSnapshot.getLength()), textChangeRange, aggressiveChecks);
|
||||
var newText;
|
||||
// grab the fragment from the beginning of the original text to the beginning of the span
|
||||
var prefix = textChangeRange.span.start !== 0
|
||||
? sourceFile.text.substr(0, textChangeRange.span.start)
|
||||
: "";
|
||||
// grab the fragment from the end of the span till the end of the original text
|
||||
var suffix = ts.textSpanEnd(textChangeRange.span) !== sourceFile.text.length
|
||||
? sourceFile.text.substr(ts.textSpanEnd(textChangeRange.span))
|
||||
: "";
|
||||
if (textChangeRange.newLength === 0) {
|
||||
// edit was a deletion - just combine prefix and suffix
|
||||
newText = prefix && suffix ? prefix + suffix : prefix || suffix;
|
||||
}
|
||||
else {
|
||||
// it was actual edit, fetch the fragment of new text that correspond to new span
|
||||
var changedText = scriptSnapshot.getText(textChangeRange.span.start, textChangeRange.span.start + textChangeRange.newLength);
|
||||
// combine prefix, changed text and suffix
|
||||
newText = prefix && suffix
|
||||
? prefix + changedText + suffix
|
||||
: prefix
|
||||
? (prefix + changedText)
|
||||
: (changedText + suffix);
|
||||
}
|
||||
var newSourceFile = ts.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
|
||||
setSourceFileFields(newSourceFile, scriptSnapshot, version);
|
||||
// after incremental parsing nameTable might not be up-to-date
|
||||
// drop it so it can be lazily recreated later
|
||||
@ -42444,4 +42486,4 @@ var TypeScript;
|
||||
})(Services = TypeScript.Services || (TypeScript.Services = {}));
|
||||
})(TypeScript || (TypeScript = {}));
|
||||
/* @internal */
|
||||
var toolsVersion = "1.4";
|
||||
var toolsVersion = "1.5";
|
||||
|
||||
3
bin/typescriptServices.d.ts
vendored
3
bin/typescriptServices.d.ts
vendored
@ -1114,7 +1114,8 @@ declare module ts {
|
||||
target?: ScriptTarget;
|
||||
version?: boolean;
|
||||
watch?: boolean;
|
||||
separateCompilation?: boolean;
|
||||
isolatedModules?: boolean;
|
||||
experimentalDecorators?: boolean;
|
||||
emitDecoratorMetadata?: boolean;
|
||||
[option: string]: string | number | boolean;
|
||||
}
|
||||
|
||||
@ -1835,8 +1835,8 @@ var ts;
|
||||
Decorators_are_only_available_when_targeting_ECMAScript_5_and_higher: { code: 1205, category: ts.DiagnosticCategory.Error, key: "Decorators are only available when targeting ECMAScript 5 and higher." },
|
||||
Decorators_are_not_valid_here: { code: 1206, category: ts.DiagnosticCategory.Error, key: "Decorators are not valid here." },
|
||||
Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: { code: 1207, category: ts.DiagnosticCategory.Error, key: "Decorators cannot be applied to multiple get/set accessors of the same name." },
|
||||
Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--separateCompilation' flag is provided." },
|
||||
Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--separateCompilation' flag is provided." },
|
||||
Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: ts.DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--isolatedModules' flag is provided." },
|
||||
Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: { code: 1209, category: ts.DiagnosticCategory.Error, key: "Ambient const enums are not allowed when the '--isolatedModules' flag is provided." },
|
||||
Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: { code: 1210, category: ts.DiagnosticCategory.Error, key: "Invalid use of '{0}'. Class definitions are automatically in strict mode." },
|
||||
A_class_declaration_without_the_default_modifier_must_have_a_name: { code: 1211, category: ts.DiagnosticCategory.Error, key: "A class declaration without the 'default' modifier must have a name" },
|
||||
Identifier_expected_0_is_a_reserved_word_in_strict_mode: { code: 1212, category: ts.DiagnosticCategory.Error, key: "Identifier expected. '{0}' is a reserved word in strict mode" },
|
||||
@ -1844,6 +1844,7 @@ var ts;
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode: { code: 1215, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode" },
|
||||
Type_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: { code: 1216, category: ts.DiagnosticCategory.Error, key: "Type expected. '{0}' is a reserved word in strict mode. Class definitions are automatically in strict mode." },
|
||||
Export_assignment_is_not_supported_when_module_flag_is_system: { code: 1218, category: ts.DiagnosticCategory.Error, key: "Export assignment is not supported when '--module' flag is 'system'." },
|
||||
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: ts.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." },
|
||||
Duplicate_identifier_0: { code: 2300, category: ts.DiagnosticCategory.Error, key: "Duplicate identifier '{0}'." },
|
||||
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: { code: 2301, category: ts.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: ts.DiagnosticCategory.Error, key: "Static members cannot reference class type parameters." },
|
||||
@ -2119,11 +2120,11 @@ var ts;
|
||||
Option_noEmit_cannot_be_specified_with_option_out_or_outDir: { code: 5040, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'out' or 'outDir'." },
|
||||
Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: ts.DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." },
|
||||
Option_project_cannot_be_mixed_with_source_files_on_a_command_line: { code: 5042, category: ts.DiagnosticCategory.Error, key: "Option 'project' cannot be mixed with source files on a command line." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." },
|
||||
Option_declaration_cannot_be_specified_with_option_separateCompilation: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'separateCompilation'." },
|
||||
Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." },
|
||||
Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." },
|
||||
Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_isolatedModules: { code: 5043, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'isolatedModules'." },
|
||||
Option_declaration_cannot_be_specified_with_option_isolatedModules: { code: 5044, category: ts.DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'isolatedModules'." },
|
||||
Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules: { code: 5045, category: ts.DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'isolatedModules'." },
|
||||
Option_out_cannot_be_specified_with_option_isolatedModules: { code: 5046, category: ts.DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'isolatedModules'." },
|
||||
Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher: { code: 5047, category: ts.DiagnosticCategory.Error, key: "Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: ts.DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: ts.DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_mapRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5050, category: ts.DiagnosticCategory.Error, key: "Option 'mapRoot' cannot be specified with option 'inlineSourceMap'." },
|
||||
@ -2177,6 +2178,9 @@ var ts;
|
||||
Specifies_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: { code: 6060, category: ts.DiagnosticCategory.Message, key: "Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." },
|
||||
NEWLINE: { code: 6061, category: ts.DiagnosticCategory.Message, key: "NEWLINE" },
|
||||
Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: ts.DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." },
|
||||
Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified: { code: 6064, category: ts.DiagnosticCategory.Error, key: "Option 'experimentalDecorators' must also be specified when option 'emitDecoratorMetadata' is specified." },
|
||||
Enables_experimental_support_for_ES7_decorators: { code: 6065, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." },
|
||||
Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: ts.DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: ts.DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: ts.DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: ts.DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." },
|
||||
@ -5502,7 +5506,7 @@ var ts;
|
||||
if ((isExternalModule(sourceFile) || !compilerOptions.out)) {
|
||||
// 1. in-browser single file compilation scenario
|
||||
// 2. non .js file
|
||||
return compilerOptions.separateCompilation || !ts.fileExtensionIs(sourceFile.fileName, ".js");
|
||||
return compilerOptions.isolatedModules || !ts.fileExtensionIs(sourceFile.fileName, ".js");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@ -11448,7 +11452,7 @@ var ts;
|
||||
var symbol = getSymbolOfNode(node);
|
||||
var target = resolveAlias(symbol);
|
||||
if (target) {
|
||||
var markAlias = (target === unknownSymbol && compilerOptions.separateCompilation) ||
|
||||
var markAlias = (target === unknownSymbol && compilerOptions.isolatedModules) ||
|
||||
(target !== unknownSymbol && (target.flags & 107455 /* Value */) && !isConstEnumOrConstEnumOnlyModule(target));
|
||||
if (markAlias) {
|
||||
markAliasSymbolAsReferenced(symbol);
|
||||
@ -18898,7 +18902,7 @@ var ts;
|
||||
// serialize the type metadata.
|
||||
if (node && node.kind === 142 /* TypeReference */) {
|
||||
var type = getTypeFromTypeNode(node);
|
||||
var shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation;
|
||||
var shouldCheckIfUnknownType = type === unknownType && compilerOptions.isolatedModules;
|
||||
if (!type || (!shouldCheckIfUnknownType && type.flags & (1048703 /* Intrinsic */ | 132 /* NumberLike */ | 258 /* StringLike */))) {
|
||||
return;
|
||||
}
|
||||
@ -18948,6 +18952,9 @@ var ts;
|
||||
if (!ts.nodeCanBeDecorated(node)) {
|
||||
return;
|
||||
}
|
||||
if (!compilerOptions.experimentalDecorators) {
|
||||
error(node, ts.Diagnostics.Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Specify_experimentalDecorators_to_remove_this_warning);
|
||||
}
|
||||
if (compilerOptions.emitDecoratorMetadata) {
|
||||
// we only need to perform these checks if we are emitting serialized type metadata for the target of a decorator.
|
||||
switch (node.kind) {
|
||||
@ -19902,7 +19909,7 @@ var ts;
|
||||
checkKindsOfPropertyMemberOverrides(type, baseType);
|
||||
}
|
||||
}
|
||||
if (baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) {
|
||||
if (baseTypes.length || (baseTypeNode && compilerOptions.isolatedModules)) {
|
||||
// Check that base type can be evaluated as expression
|
||||
checkExpressionOrQualifiedName(baseTypeNode.expression);
|
||||
}
|
||||
@ -20271,8 +20278,8 @@ var ts;
|
||||
checkExportsOnMergedDeclarations(node);
|
||||
computeEnumMemberValues(node);
|
||||
var enumIsConst = ts.isConst(node);
|
||||
if (compilerOptions.separateCompilation && enumIsConst && ts.isInAmbientContext(node)) {
|
||||
error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided);
|
||||
if (compilerOptions.isolatedModules && enumIsConst && ts.isInAmbientContext(node)) {
|
||||
error(node.name, ts.Diagnostics.Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided);
|
||||
}
|
||||
// Spec 2014 - Section 9.3:
|
||||
// It isn't possible for one enum declaration to continue the automatic numbering sequence of another,
|
||||
@ -20354,7 +20361,7 @@ var ts;
|
||||
if (symbol.flags & 512 /* ValueModule */
|
||||
&& symbol.declarations.length > 1
|
||||
&& !ts.isInAmbientContext(node)
|
||||
&& ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) {
|
||||
&& ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) {
|
||||
var firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
|
||||
if (firstNonAmbientClassOrFunc) {
|
||||
if (ts.getSourceFileOfNode(node) !== ts.getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
|
||||
@ -20705,6 +20712,7 @@ var ts;
|
||||
break;
|
||||
case 135 /* MethodDeclaration */:
|
||||
case 134 /* MethodSignature */:
|
||||
ts.forEach(node.decorators, checkFunctionExpressionBodies);
|
||||
ts.forEach(node.parameters, checkFunctionExpressionBodies);
|
||||
if (ts.isObjectLiteralMethod(node)) {
|
||||
checkFunctionExpressionOrObjectLiteralMethodBody(node);
|
||||
@ -20719,6 +20727,7 @@ var ts;
|
||||
case 193 /* WithStatement */:
|
||||
checkFunctionExpressionBodies(node.expression);
|
||||
break;
|
||||
case 131 /* Decorator */:
|
||||
case 130 /* Parameter */:
|
||||
case 133 /* PropertyDeclaration */:
|
||||
case 132 /* PropertySignature */:
|
||||
@ -21356,7 +21365,7 @@ var ts;
|
||||
}
|
||||
function isAliasResolvedToValue(symbol) {
|
||||
var target = resolveAlias(symbol);
|
||||
if (target === unknownSymbol && compilerOptions.separateCompilation) {
|
||||
if (target === unknownSymbol && compilerOptions.isolatedModules) {
|
||||
return true;
|
||||
}
|
||||
// const enums and modules that contain only const enums are not considered values from the emit perespective
|
||||
@ -25669,7 +25678,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function tryEmitConstantValue(node) {
|
||||
if (compilerOptions.separateCompilation) {
|
||||
if (compilerOptions.isolatedModules) {
|
||||
// do not inline enum values in separate compilation mode
|
||||
return false;
|
||||
}
|
||||
@ -28066,7 +28075,7 @@ var ts;
|
||||
}
|
||||
function shouldEmitEnumDeclaration(node) {
|
||||
var isConstEnum = ts.isConst(node);
|
||||
return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation;
|
||||
return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.isolatedModules;
|
||||
}
|
||||
function emitEnumDeclaration(node) {
|
||||
// const enums are completely erased during compilation.
|
||||
@ -28165,7 +28174,7 @@ var ts;
|
||||
}
|
||||
}
|
||||
function shouldEmitModuleDeclaration(node) {
|
||||
return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation);
|
||||
return ts.isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules);
|
||||
}
|
||||
function isModuleMergedWithES6Class(node) {
|
||||
return languageVersion === 2 /* ES6 */ && !!(resolver.getNodeCheckFlags(node) & 2048 /* LexicalModuleMergesWithClass */);
|
||||
@ -29265,7 +29274,7 @@ var ts;
|
||||
paramEmitted = true;
|
||||
}
|
||||
}
|
||||
if (ts.isExternalModule(node) || compilerOptions.separateCompilation) {
|
||||
if (ts.isExternalModule(node) || compilerOptions.isolatedModules) {
|
||||
if (languageVersion >= 2 /* ES6 */) {
|
||||
emitES6Module(node, startIndex);
|
||||
}
|
||||
@ -29656,7 +29665,7 @@ var ts;
|
||||
/* @internal */ ts.ioReadTime = 0;
|
||||
/* @internal */ ts.ioWriteTime = 0;
|
||||
/** The version of the TypeScript compiler release */
|
||||
ts.version = "1.5.2";
|
||||
ts.version = "1.5.3";
|
||||
var carriageReturnLineFeed = "\r\n";
|
||||
var lineFeed = "\n";
|
||||
function findConfigFile(searchPath) {
|
||||
@ -30108,18 +30117,18 @@ var ts;
|
||||
return allFilesBelongToPath;
|
||||
}
|
||||
function verifyCompilerOptions() {
|
||||
if (options.separateCompilation) {
|
||||
if (options.isolatedModules) {
|
||||
if (options.sourceMap) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_sourceMap_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.declaration) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_declaration_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.noEmitOnError) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
if (options.out) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_out_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
}
|
||||
if (options.inlineSourceMap) {
|
||||
@ -30150,14 +30159,14 @@ var ts;
|
||||
}
|
||||
var languageVersion = options.target || 0 /* ES3 */;
|
||||
var firstExternalModuleSourceFile = ts.forEach(files, function (f) { return ts.isExternalModule(f) ? f : undefined; });
|
||||
if (options.separateCompilation) {
|
||||
if (options.isolatedModules) {
|
||||
if (!options.module && languageVersion < 2 /* ES6 */) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
|
||||
}
|
||||
var firstNonExternalModuleSourceFile = ts.forEach(files, function (f) { return !ts.isExternalModule(f) && !ts.isDeclarationFile(f) ? f : undefined; });
|
||||
if (firstNonExternalModuleSourceFile) {
|
||||
var span = ts.getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile);
|
||||
diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided));
|
||||
diagnostics.add(ts.createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, ts.Diagnostics.Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided));
|
||||
}
|
||||
}
|
||||
else if (firstExternalModuleSourceFile && languageVersion < 2 /* ES6 */ && !options.module) {
|
||||
@ -30198,6 +30207,10 @@ var ts;
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_noEmit_cannot_be_specified_with_option_declaration));
|
||||
}
|
||||
}
|
||||
if (options.emitDecoratorMetadata &&
|
||||
!options.experimentalDecorators) {
|
||||
diagnostics.add(ts.createCompilerDiagnostic(ts.Diagnostics.Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified));
|
||||
}
|
||||
}
|
||||
}
|
||||
ts.createProgram = createProgram;
|
||||
@ -30346,7 +30359,7 @@ var ts;
|
||||
paramType: ts.Diagnostics.LOCATION
|
||||
},
|
||||
{
|
||||
name: "separateCompilation",
|
||||
name: "isolatedModules",
|
||||
type: "boolean"
|
||||
},
|
||||
{
|
||||
@ -30392,10 +30405,16 @@ var ts;
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Watch_input_files
|
||||
},
|
||||
{
|
||||
name: "experimentalDecorators",
|
||||
type: "boolean",
|
||||
description: ts.Diagnostics.Enables_experimental_support_for_ES7_decorators
|
||||
},
|
||||
{
|
||||
name: "emitDecoratorMetadata",
|
||||
type: "boolean",
|
||||
experimental: true
|
||||
experimental: true,
|
||||
description: ts.Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
|
||||
}
|
||||
];
|
||||
function parseCommandLine(commandLine) {
|
||||
@ -36687,12 +36706,12 @@ var ts;
|
||||
* This function will compile source text from 'input' argument using specified compiler options.
|
||||
* If not options are provided - it will use a set of default compiler options.
|
||||
* Extra compiler options that will unconditionally be used bu this function are:
|
||||
* - separateCompilation = true
|
||||
* - isolatedModules = true
|
||||
* - allowNonTsExtensions = true
|
||||
*/
|
||||
function transpile(input, compilerOptions, fileName, diagnostics) {
|
||||
var options = compilerOptions ? ts.clone(compilerOptions) : getDefaultCompilerOptions();
|
||||
options.separateCompilation = true;
|
||||
options.isolatedModules = true;
|
||||
// Filename can be non-ts file.
|
||||
options.allowNonTsExtensions = true;
|
||||
// Parse
|
||||
@ -36743,7 +36762,30 @@ var ts;
|
||||
if (version !== sourceFile.version) {
|
||||
// Once incremental parsing is ready, then just call into this function.
|
||||
if (!ts.disableIncrementalParsing) {
|
||||
var newSourceFile = ts.updateSourceFile(sourceFile, scriptSnapshot.getText(0, scriptSnapshot.getLength()), textChangeRange, aggressiveChecks);
|
||||
var newText;
|
||||
// grab the fragment from the beginning of the original text to the beginning of the span
|
||||
var prefix = textChangeRange.span.start !== 0
|
||||
? sourceFile.text.substr(0, textChangeRange.span.start)
|
||||
: "";
|
||||
// grab the fragment from the end of the span till the end of the original text
|
||||
var suffix = ts.textSpanEnd(textChangeRange.span) !== sourceFile.text.length
|
||||
? sourceFile.text.substr(ts.textSpanEnd(textChangeRange.span))
|
||||
: "";
|
||||
if (textChangeRange.newLength === 0) {
|
||||
// edit was a deletion - just combine prefix and suffix
|
||||
newText = prefix && suffix ? prefix + suffix : prefix || suffix;
|
||||
}
|
||||
else {
|
||||
// it was actual edit, fetch the fragment of new text that correspond to new span
|
||||
var changedText = scriptSnapshot.getText(textChangeRange.span.start, textChangeRange.span.start + textChangeRange.newLength);
|
||||
// combine prefix, changed text and suffix
|
||||
newText = prefix && suffix
|
||||
? prefix + changedText + suffix
|
||||
: prefix
|
||||
? (prefix + changedText)
|
||||
: (changedText + suffix);
|
||||
}
|
||||
var newSourceFile = ts.updateSourceFile(sourceFile, newText, textChangeRange, aggressiveChecks);
|
||||
setSourceFileFields(newSourceFile, scriptSnapshot, version);
|
||||
// after incremental parsing nameTable might not be up-to-date
|
||||
// drop it so it can be lazily recreated later
|
||||
@ -42444,4 +42486,4 @@ var TypeScript;
|
||||
})(Services = TypeScript.Services || (TypeScript.Services = {}));
|
||||
})(TypeScript || (TypeScript = {}));
|
||||
/* @internal */
|
||||
var toolsVersion = "1.4";
|
||||
var toolsVersion = "1.5";
|
||||
|
||||
@ -745,7 +745,7 @@ module ts {
|
||||
let target = resolveAlias(symbol);
|
||||
if (target) {
|
||||
let markAlias =
|
||||
(target === unknownSymbol && compilerOptions.separateCompilation) ||
|
||||
(target === unknownSymbol && compilerOptions.isolatedModules) ||
|
||||
(target !== unknownSymbol && (target.flags & SymbolFlags.Value) && !isConstEnumOrConstEnumOnlyModule(target));
|
||||
|
||||
if (markAlias) {
|
||||
@ -9153,7 +9153,7 @@ module ts {
|
||||
// serialize the type metadata.
|
||||
if (node && node.kind === SyntaxKind.TypeReference) {
|
||||
let type = getTypeFromTypeNode(node);
|
||||
let shouldCheckIfUnknownType = type === unknownType && compilerOptions.separateCompilation;
|
||||
let shouldCheckIfUnknownType = type === unknownType && compilerOptions.isolatedModules;
|
||||
if (!type || (!shouldCheckIfUnknownType && type.flags & (TypeFlags.Intrinsic | TypeFlags.NumberLike | TypeFlags.StringLike))) {
|
||||
return;
|
||||
}
|
||||
@ -9206,6 +9206,10 @@ module ts {
|
||||
if (!nodeCanBeDecorated(node)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!compilerOptions.experimentalDecorators) {
|
||||
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);
|
||||
}
|
||||
|
||||
if (compilerOptions.emitDecoratorMetadata) {
|
||||
// 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 {
|
||||
}
|
||||
}
|
||||
|
||||
if (baseTypes.length || (baseTypeNode && compilerOptions.separateCompilation)) {
|
||||
if (baseTypes.length || (baseTypeNode && compilerOptions.isolatedModules)) {
|
||||
// Check that base type can be evaluated as expression
|
||||
checkExpressionOrQualifiedName(baseTypeNode.expression);
|
||||
}
|
||||
@ -10781,8 +10785,8 @@ module ts {
|
||||
computeEnumMemberValues(node);
|
||||
|
||||
let enumIsConst = isConst(node);
|
||||
if (compilerOptions.separateCompilation && enumIsConst && isInAmbientContext(node)) {
|
||||
error(node.name, Diagnostics.Ambient_const_enums_are_not_allowed_when_the_separateCompilation_flag_is_provided);
|
||||
if (compilerOptions.isolatedModules && enumIsConst && isInAmbientContext(node)) {
|
||||
error(node.name, Diagnostics.Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided);
|
||||
}
|
||||
|
||||
// Spec 2014 - Section 9.3:
|
||||
@ -10872,7 +10876,7 @@ module ts {
|
||||
if (symbol.flags & SymbolFlags.ValueModule
|
||||
&& symbol.declarations.length > 1
|
||||
&& !isInAmbientContext(node)
|
||||
&& isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation)) {
|
||||
&& isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules)) {
|
||||
let firstNonAmbientClassOrFunc = getFirstNonAmbientClassOrFunctionDeclaration(symbol);
|
||||
if (firstNonAmbientClassOrFunc) {
|
||||
if (getSourceFileOfNode(node) !== getSourceFileOfNode(firstNonAmbientClassOrFunc)) {
|
||||
@ -11887,7 +11891,7 @@ module ts {
|
||||
|
||||
function isAliasResolvedToValue(symbol: Symbol): boolean {
|
||||
let target = resolveAlias(symbol);
|
||||
if (target === unknownSymbol && compilerOptions.separateCompilation) {
|
||||
if (target === unknownSymbol && compilerOptions.isolatedModules) {
|
||||
return true;
|
||||
}
|
||||
// const enums and modules that contain only const enums are not considered values from the emit perespective
|
||||
|
||||
@ -142,7 +142,7 @@ module ts {
|
||||
paramType: Diagnostics.LOCATION,
|
||||
},
|
||||
{
|
||||
name: "separateCompilation",
|
||||
name: "isolatedModules",
|
||||
type: "boolean",
|
||||
},
|
||||
{
|
||||
@ -188,10 +188,16 @@ module ts {
|
||||
type: "boolean",
|
||||
description: Diagnostics.Watch_input_files,
|
||||
},
|
||||
{
|
||||
name: "experimentalDecorators",
|
||||
type: "boolean",
|
||||
description: Diagnostics.Enables_experimental_support_for_ES7_decorators
|
||||
},
|
||||
{
|
||||
name: "emitDecoratorMetadata",
|
||||
type: "boolean",
|
||||
experimental: true
|
||||
experimental: true,
|
||||
description: Diagnostics.Enables_experimental_support_for_emitting_type_metadata_for_decorators
|
||||
}
|
||||
];
|
||||
|
||||
|
||||
@ -165,8 +165,8 @@ module ts {
|
||||
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." },
|
||||
Decorators_are_not_valid_here: { code: 1206, category: DiagnosticCategory.Error, key: "Decorators are not valid here." },
|
||||
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." },
|
||||
Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided: { code: 1208, category: DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--separateCompilation' flag is provided." },
|
||||
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." },
|
||||
Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: { code: 1208, category: DiagnosticCategory.Error, key: "Cannot compile namespaces when the '--isolatedModules' flag is provided." },
|
||||
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." },
|
||||
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." },
|
||||
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" },
|
||||
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" },
|
||||
@ -174,10 +174,11 @@ module ts {
|
||||
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" },
|
||||
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." },
|
||||
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'." },
|
||||
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." },
|
||||
Generators_are_not_allowed_in_an_ambient_context: { code: 1220, category: DiagnosticCategory.Error, key: "Generators are not allowed in an ambient context." },
|
||||
An_overload_signature_cannot_be_declared_as_a_generator: { code: 1221, category: DiagnosticCategory.Error, key: "An overload signature cannot be declared as a generator." },
|
||||
_0_tag_already_specified: { code: 1222, category: DiagnosticCategory.Error, key: "'{0}' tag already specified." },
|
||||
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." },
|
||||
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." },
|
||||
Generators_are_not_allowed_in_an_ambient_context: { code: 1221, category: DiagnosticCategory.Error, key: "Generators are not allowed in an ambient context." },
|
||||
An_overload_signature_cannot_be_declared_as_a_generator: { code: 1222, category: DiagnosticCategory.Error, key: "An overload signature cannot be declared as a generator." },
|
||||
_0_tag_already_specified: { code: 1223, category: DiagnosticCategory.Error, key: "'{0}' tag already specified." },
|
||||
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." },
|
||||
@ -455,11 +456,11 @@ module ts {
|
||||
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'." },
|
||||
Option_noEmit_cannot_be_specified_with_option_declaration: { code: 5041, category: DiagnosticCategory.Error, key: "Option 'noEmit' cannot be specified with option 'declaration'." },
|
||||
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." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_separateCompilation: { code: 5043, category: DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'separateCompilation'." },
|
||||
Option_declaration_cannot_be_specified_with_option_separateCompilation: { code: 5044, category: DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'separateCompilation'." },
|
||||
Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation: { code: 5045, category: DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'separateCompilation'." },
|
||||
Option_out_cannot_be_specified_with_option_separateCompilation: { code: 5046, category: DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'separateCompilation'." },
|
||||
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." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_isolatedModules: { code: 5043, category: DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'isolatedModules'." },
|
||||
Option_declaration_cannot_be_specified_with_option_isolatedModules: { code: 5044, category: DiagnosticCategory.Error, key: "Option 'declaration' cannot be specified with option 'isolatedModules'." },
|
||||
Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules: { code: 5045, category: DiagnosticCategory.Error, key: "Option 'noEmitOnError' cannot be specified with option 'isolatedModules'." },
|
||||
Option_out_cannot_be_specified_with_option_isolatedModules: { code: 5046, category: DiagnosticCategory.Error, key: "Option 'out' cannot be specified with option 'isolatedModules'." },
|
||||
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." },
|
||||
Option_sourceMap_cannot_be_specified_with_option_inlineSourceMap: { code: 5048, category: DiagnosticCategory.Error, key: "Option 'sourceMap' cannot be specified with option 'inlineSourceMap'." },
|
||||
Option_sourceRoot_cannot_be_specified_with_option_inlineSourceMap: { code: 5049, category: DiagnosticCategory.Error, key: "Option 'sourceRoot' cannot be specified with option 'inlineSourceMap'." },
|
||||
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 {
|
||||
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)." },
|
||||
NEWLINE: { code: 6061, category: DiagnosticCategory.Message, key: "NEWLINE" },
|
||||
Argument_for_newLine_option_must_be_CRLF_or_LF: { code: 6062, category: DiagnosticCategory.Error, key: "Argument for '--newLine' option must be 'CRLF' or 'LF'." },
|
||||
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." },
|
||||
Enables_experimental_support_for_ES7_decorators: { code: 6065, category: DiagnosticCategory.Message, key: "Enables experimental support for ES7 decorators." },
|
||||
Enables_experimental_support_for_emitting_type_metadata_for_decorators: { code: 6066, category: DiagnosticCategory.Message, key: "Enables experimental support for emitting type metadata for decorators." },
|
||||
Variable_0_implicitly_has_an_1_type: { code: 7005, category: DiagnosticCategory.Error, key: "Variable '{0}' implicitly has an '{1}' type." },
|
||||
Parameter_0_implicitly_has_an_1_type: { code: 7006, category: DiagnosticCategory.Error, key: "Parameter '{0}' implicitly has an '{1}' type." },
|
||||
Member_0_implicitly_has_an_1_type: { code: 7008, category: DiagnosticCategory.Error, key: "Member '{0}' implicitly has an '{1}' type." },
|
||||
|
||||
@ -647,11 +647,11 @@
|
||||
"category": "Error",
|
||||
"code": 1207
|
||||
},
|
||||
"Cannot compile namespaces when the '--separateCompilation' flag is provided.": {
|
||||
"Cannot compile namespaces when the '--isolatedModules' flag is provided.": {
|
||||
"category": "Error",
|
||||
"code": 1208
|
||||
},
|
||||
"Ambient const enums are not allowed when the '--separateCompilation' flag is provided.": {
|
||||
"Ambient const enums are not allowed when the '--isolatedModules' flag is provided.": {
|
||||
"category": "Error",
|
||||
"code": 1209
|
||||
},
|
||||
@ -682,25 +682,28 @@
|
||||
"Export assignment is not supported when '--module' flag is 'system'.": {
|
||||
"category": "Error",
|
||||
"code": 1218
|
||||
},
|
||||
"Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning.": {
|
||||
"category": "Error",
|
||||
"code": 1219
|
||||
},
|
||||
"Generators are only available when targeting ECMAScript 6 or higher.": {
|
||||
"category": "Error",
|
||||
"code": 1219
|
||||
"code": 1220
|
||||
},
|
||||
"Generators are not allowed in an ambient context.": {
|
||||
"category": "Error",
|
||||
"code": 1220
|
||||
"code": 1221
|
||||
},
|
||||
"An overload signature cannot be declared as a generator.": {
|
||||
"category": "Error",
|
||||
"code": 1221
|
||||
},
|
||||
|
||||
|
||||
"'{0}' tag already specified.": {
|
||||
"category": "Error",
|
||||
"code": 1222
|
||||
},
|
||||
"'{0}' tag already specified.": {
|
||||
"category": "Error",
|
||||
"code": 1223
|
||||
},
|
||||
|
||||
"Duplicate identifier '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2300
|
||||
@ -1456,15 +1459,15 @@
|
||||
"A rest element cannot contain a binding pattern.": {
|
||||
"category": "Error",
|
||||
"code": 2501
|
||||
},
|
||||
},
|
||||
"'{0}' is referenced directly or indirectly in its own type annotation.": {
|
||||
"category": "Error",
|
||||
"code": 2502
|
||||
},
|
||||
},
|
||||
"Cannot find namespace '{0}'.": {
|
||||
"category": "Error",
|
||||
"code": 2503
|
||||
},
|
||||
},
|
||||
"No best common type exists among yield expressions.": {
|
||||
"category": "Error",
|
||||
"code": 2504
|
||||
@ -1472,7 +1475,7 @@
|
||||
"A generator cannot have a 'void' type annotation.": {
|
||||
"category": "Error",
|
||||
"code": 2505
|
||||
},
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
@ -1810,23 +1813,23 @@
|
||||
"category": "Error",
|
||||
"code": 5042
|
||||
},
|
||||
"Option 'sourceMap' cannot be specified with option 'separateCompilation'.": {
|
||||
"Option 'sourceMap' cannot be specified with option 'isolatedModules'.": {
|
||||
"category": "Error",
|
||||
"code": 5043
|
||||
},
|
||||
"Option 'declaration' cannot be specified with option 'separateCompilation'.": {
|
||||
"Option 'declaration' cannot be specified with option 'isolatedModules'.": {
|
||||
"category": "Error",
|
||||
"code": 5044
|
||||
},
|
||||
"Option 'noEmitOnError' cannot be specified with option 'separateCompilation'.": {
|
||||
"Option 'noEmitOnError' cannot be specified with option 'isolatedModules'.": {
|
||||
"category": "Error",
|
||||
"code": 5045
|
||||
},
|
||||
"Option 'out' cannot be specified with option 'separateCompilation'.": {
|
||||
"Option 'out' cannot be specified with option 'isolatedModules'.": {
|
||||
"category": "Error",
|
||||
"code": 5046
|
||||
},
|
||||
"Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.": {
|
||||
"Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.": {
|
||||
"category": "Error",
|
||||
"code": 5047
|
||||
},
|
||||
@ -2043,7 +2046,18 @@
|
||||
"category": "Error",
|
||||
"code": 6062
|
||||
},
|
||||
|
||||
"Option 'experimentalDecorators' must also be specified when option 'emitDecoratorMetadata' is specified.": {
|
||||
"category": "Error",
|
||||
"code": 6064
|
||||
},
|
||||
"Enables experimental support for ES7 decorators.": {
|
||||
"category": "Message",
|
||||
"code": 6065
|
||||
},
|
||||
"Enables experimental support for emitting type metadata for decorators.": {
|
||||
"category": "Message",
|
||||
"code": 6066
|
||||
},
|
||||
|
||||
"Variable '{0}' implicitly has an '{1}' type.": {
|
||||
"category": "Error",
|
||||
|
||||
@ -1719,7 +1719,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
}
|
||||
|
||||
function tryEmitConstantValue(node: PropertyAccessExpression | ElementAccessExpression): boolean {
|
||||
if (compilerOptions.separateCompilation) {
|
||||
if (compilerOptions.isolatedModules) {
|
||||
// do not inline enum values in separate compilation mode
|
||||
return false;
|
||||
}
|
||||
@ -4430,7 +4430,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
|
||||
function shouldEmitEnumDeclaration(node: EnumDeclaration) {
|
||||
let isConstEnum = isConst(node);
|
||||
return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.separateCompilation;
|
||||
return !isConstEnum || compilerOptions.preserveConstEnums || compilerOptions.isolatedModules;
|
||||
}
|
||||
|
||||
function emitEnumDeclaration(node: EnumDeclaration) {
|
||||
@ -4535,7 +4535,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
}
|
||||
|
||||
function shouldEmitModuleDeclaration(node: ModuleDeclaration) {
|
||||
return isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.separateCompilation);
|
||||
return isInstantiatedModule(node, compilerOptions.preserveConstEnums || compilerOptions.isolatedModules);
|
||||
}
|
||||
|
||||
function isModuleMergedWithES6Class(node: ModuleDeclaration) {
|
||||
@ -5744,7 +5744,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isExternalModule(node) || compilerOptions.separateCompilation) {
|
||||
if (isExternalModule(node) || compilerOptions.isolatedModules) {
|
||||
if (languageVersion >= ScriptTarget.ES6) {
|
||||
emitES6Module(node, startIndex);
|
||||
}
|
||||
|
||||
@ -8,7 +8,7 @@ module ts {
|
||||
/* @internal */ export let ioWriteTime = 0;
|
||||
|
||||
/** The version of the TypeScript compiler release */
|
||||
export const version = "1.5.2";
|
||||
export const version = "1.5.3";
|
||||
|
||||
const carriageReturnLineFeed = "\r\n";
|
||||
const lineFeed = "\n";
|
||||
@ -534,21 +534,21 @@ module ts {
|
||||
}
|
||||
|
||||
function verifyCompilerOptions() {
|
||||
if (options.separateCompilation) {
|
||||
if (options.isolatedModules) {
|
||||
if (options.sourceMap) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceMap_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_sourceMap_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
|
||||
if (options.declaration) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_declaration_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_declaration_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
|
||||
if (options.noEmitOnError) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_noEmitOnError_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
|
||||
if (options.out) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_out_cannot_be_specified_with_option_separateCompilation));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_out_cannot_be_specified_with_option_isolatedModules));
|
||||
}
|
||||
}
|
||||
|
||||
@ -585,15 +585,15 @@ module ts {
|
||||
let languageVersion = options.target || ScriptTarget.ES3;
|
||||
|
||||
let firstExternalModuleSourceFile = forEach(files, f => isExternalModule(f) ? f : undefined);
|
||||
if (options.separateCompilation) {
|
||||
if (options.isolatedModules) {
|
||||
if (!options.module && languageVersion < ScriptTarget.ES6) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_separateCompilation_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES6_or_higher));
|
||||
}
|
||||
|
||||
let firstNonExternalModuleSourceFile = forEach(files, f => !isExternalModule(f) && !isDeclarationFile(f) ? f : undefined);
|
||||
if (firstNonExternalModuleSourceFile) {
|
||||
let span = getErrorSpanForNode(firstNonExternalModuleSourceFile, firstNonExternalModuleSourceFile);
|
||||
diagnostics.add(createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_namespaces_when_the_separateCompilation_flag_is_provided));
|
||||
diagnostics.add(createFileDiagnostic(firstNonExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided));
|
||||
}
|
||||
}
|
||||
else if (firstExternalModuleSourceFile && languageVersion < ScriptTarget.ES6 && !options.module) {
|
||||
@ -640,6 +640,11 @@ module ts {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_noEmit_cannot_be_specified_with_option_declaration));
|
||||
}
|
||||
}
|
||||
|
||||
if (options.emitDecoratorMetadata &&
|
||||
!options.experimentalDecorators) {
|
||||
diagnostics.add(createCompilerDiagnostic(Diagnostics.Option_experimentalDecorators_must_also_be_specified_when_option_emitDecoratorMetadata_is_specified));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1819,7 +1819,8 @@ module ts {
|
||||
target?: ScriptTarget;
|
||||
version?: boolean;
|
||||
watch?: boolean;
|
||||
separateCompilation?: boolean;
|
||||
isolatedModules?: boolean;
|
||||
experimentalDecorators?: boolean;
|
||||
emitDecoratorMetadata?: boolean;
|
||||
/* @internal */ stripInternal?: boolean;
|
||||
[option: string]: string | number | boolean;
|
||||
|
||||
@ -1653,7 +1653,7 @@ module ts {
|
||||
if ((isExternalModule(sourceFile) || !compilerOptions.out)) {
|
||||
// 1. in-browser single file compilation scenario
|
||||
// 2. non .js file
|
||||
return compilerOptions.separateCompilation || !fileExtensionIs(sourceFile.fileName, ".js");
|
||||
return compilerOptions.isolatedModules || !fileExtensionIs(sourceFile.fileName, ".js");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1011,6 +1011,10 @@ module Harness {
|
||||
options.target = <any>setting.value;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'experimentaldecorators':
|
||||
options.experimentalDecorators = setting.value === 'true';
|
||||
break;
|
||||
|
||||
case 'emitdecoratormetadata':
|
||||
options.emitDecoratorMetadata = setting.value === 'true';
|
||||
@ -1105,8 +1109,8 @@ module Harness {
|
||||
options.preserveConstEnums = setting.value === 'true';
|
||||
break;
|
||||
|
||||
case 'separatecompilation':
|
||||
options.separateCompilation = setting.value === 'true';
|
||||
case 'isolatedmodules':
|
||||
options.isolatedModules = setting.value === 'true';
|
||||
break;
|
||||
|
||||
case 'suppressimplicitanyindexerrors':
|
||||
@ -1522,8 +1526,8 @@ module Harness {
|
||||
"noimplicitany", "noresolve", "newline", "normalizenewline", "emitbom",
|
||||
"errortruncation", "usecasesensitivefilenames", "preserveconstenums",
|
||||
"includebuiltfile", "suppressimplicitanyindexerrors", "stripinternal",
|
||||
"separatecompilation", "inlinesourcemap", "maproot", "sourceroot",
|
||||
"inlinesources", "emitdecoratormetadata"];
|
||||
"isolatedmodules", "inlinesourcemap", "maproot", "sourceroot",
|
||||
"inlinesources", "emitdecoratormetadata", "experimentaldecorators"];
|
||||
|
||||
function extractCompilerSettings(content: string): CompilerSetting[] {
|
||||
|
||||
|
||||
@ -1761,13 +1761,13 @@ module ts {
|
||||
* This function will compile source text from 'input' argument using specified compiler options.
|
||||
* If not options are provided - it will use a set of default compiler options.
|
||||
* Extra compiler options that will unconditionally be used bu this function are:
|
||||
* - separateCompilation = true
|
||||
* - isolatedModules = true
|
||||
* - allowNonTsExtensions = true
|
||||
*/
|
||||
export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string {
|
||||
let options = compilerOptions ? clone(compilerOptions) : getDefaultCompilerOptions();
|
||||
|
||||
options.separateCompilation = true;
|
||||
options.isolatedModules = true;
|
||||
|
||||
// Filename can be non-ts file.
|
||||
options.allowNonTsExtensions = true;
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts(1,10): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration10_es6.ts (1 errors) ====
|
||||
function * foo(a = yield => yield) {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts(1,10): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration11_es6.ts (1 errors) ====
|
||||
function * yield() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(1,10): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts(3,11): error TS2304: Cannot find name 'yield'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration13_es6.ts (2 errors) ====
|
||||
function * foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
// Legal to use 'yield' in a type context.
|
||||
var v: yield;
|
||||
~~~~~
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts(1,10): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration1_es6.ts (1 errors) ====
|
||||
function * foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts(1,18): error TS2304: Cannot find name 'yield'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration6_es6.ts (2 errors) ====
|
||||
function*foo(a = yield) {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
~~~~~
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
}
|
||||
@ -1,16 +1,16 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,11): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,11): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts(3,20): error TS2304: Cannot find name 'yield'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration7_es6.ts (3 errors) ====
|
||||
function*bar() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
// 'yield' here is an identifier, and not a yield expression.
|
||||
function*foo(a = yield) {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
~~~~~
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
}
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts(1,10): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionDeclarations/FunctionDeclaration9_es6.ts (1 errors) ====
|
||||
function * foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
var v = { [yield]: foo }
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts(1,18): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts(1,18): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionExpressions/FunctionExpression1_es6.ts (1 errors) ====
|
||||
var v = function * () { }
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts(1,18): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts(1,18): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionExpressions/FunctionExpression2_es6.ts (1 errors) ====
|
||||
var v = function * foo() { }
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts(1,11): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts(1,11): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments1_es6.ts (1 errors) ====
|
||||
var v = { *foo() { } }
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,11): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,11): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts(1,13): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/functionPropertyAssignments/FunctionPropertyAssignments5_es6.ts (2 errors) ====
|
||||
var v = { *[foo()]() { } }
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts(2,4): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts(2,4): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration1_es6.ts (1 errors) ====
|
||||
class C {
|
||||
*foo() { }
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts(2,11): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts(2,11): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration2_es6.ts (1 errors) ====
|
||||
class C {
|
||||
public * foo() { }
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,4): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,4): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration3_es6.ts(2,6): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration
|
||||
class C {
|
||||
*[foo]() { }
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts(2,4): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts(2,4): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/memberFunctionDeclarations/MemberFunctionDeclaration7_es6.ts (1 errors) ====
|
||||
class C {
|
||||
*foo<T>() { }
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(1,11): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(1,11): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts(2,11): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression10_es6.ts (2 errors) ====
|
||||
var v = { * foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield(foo);
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(2,3): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,11): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression11_es6.ts(3,11): err
|
||||
class C {
|
||||
*foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield(foo);
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression13_es6.ts (1 errors) ====
|
||||
function* foo() { yield }
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts(3,5): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression16_es6.ts (2 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
function bar() {
|
||||
yield foo;
|
||||
~~~~~
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(3,13): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts(3,13): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression19_es6.ts (2 errors) ====
|
||||
function*foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
function bar() {
|
||||
function* quux() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield(foo);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression3_es6.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield
|
||||
yield
|
||||
}
|
||||
@ -1,10 +1,10 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression4_es6.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield;
|
||||
yield;
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts(2,9): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression6_es6.ts (2 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield*foo
|
||||
~~~
|
||||
!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression7_es6.ts (1 errors) ====
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield foo
|
||||
}
|
||||
@ -1,5 +1,5 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(1,1): error TS2304: Cannot find name 'yield'.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts (2 errors) ====
|
||||
@ -8,6 +8,6 @@ tests/cases/conformance/es6/yieldExpressions/YieldExpression8_es6.ts(2,9): error
|
||||
!!! error TS2304: Cannot find name 'yield'.
|
||||
function* foo() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield(foo);
|
||||
}
|
||||
@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(1,17): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(1,17): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts(2,9): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldExpression9_es6.ts (2 errors) ====
|
||||
var v = function*() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield(foo);
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts(1,10): error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts(1,10): error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts(2,13): error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/YieldStarExpression4_es6.ts (2 errors) ====
|
||||
function *g() {
|
||||
~
|
||||
!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher.
|
||||
yield * [];
|
||||
~~
|
||||
!!! error TS2488: Type must have a '[Symbol.iterator]()' method that returns an iterator.
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext1.ts(2,5): error TS1220: Generators are not allowed in an ambient context.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext1.ts(2,5): error TS1221: Generators are not allowed in an ambient context.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext1.ts (1 errors) ====
|
||||
declare class C {
|
||||
*generator(): any;
|
||||
~
|
||||
!!! error TS1220: Generators are not allowed in an ambient context.
|
||||
!!! error TS1221: Generators are not allowed in an ambient context.
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext2.ts(2,14): error TS1220: Generators are not allowed in an ambient context.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext2.ts(2,14): error TS1221: Generators are not allowed in an ambient context.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext2.ts (1 errors) ====
|
||||
declare module M {
|
||||
function *generator(): any;
|
||||
~
|
||||
!!! error TS1220: Generators are not allowed in an ambient context.
|
||||
!!! error TS1221: Generators are not allowed in an ambient context.
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext3.d.ts(2,5): error TS1220: Generators are not allowed in an ambient context.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext3.d.ts(2,5): error TS1221: Generators are not allowed in an ambient context.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext3.d.ts (1 errors) ====
|
||||
declare class C {
|
||||
*generator(): any;
|
||||
~
|
||||
!!! error TS1220: Generators are not allowed in an ambient context.
|
||||
!!! error TS1221: Generators are not allowed in an ambient context.
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext4.d.ts(2,14): error TS1220: Generators are not allowed in an ambient context.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext4.d.ts(2,14): error TS1221: Generators are not allowed in an ambient context.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorInAmbientContext4.d.ts (1 errors) ====
|
||||
declare module M {
|
||||
function *generator(): any;
|
||||
~
|
||||
!!! error TS1220: Generators are not allowed in an ambient context.
|
||||
!!! error TS1221: Generators are not allowed in an ambient context.
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads1.ts(2,13): error TS1221: An overload signature cannot be declared as a generator.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads1.ts(3,13): error TS1221: An overload signature cannot be declared as a generator.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads1.ts(2,13): error TS1222: An overload signature cannot be declared as a generator.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads1.ts(3,13): error TS1222: An overload signature cannot be declared as a generator.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorOverloads1.ts (2 errors) ====
|
||||
module M {
|
||||
function* f(s: string): Iterable<any>;
|
||||
~
|
||||
!!! error TS1221: An overload signature cannot be declared as a generator.
|
||||
!!! error TS1222: An overload signature cannot be declared as a generator.
|
||||
function* f(s: number): Iterable<any>;
|
||||
~
|
||||
!!! error TS1221: An overload signature cannot be declared as a generator.
|
||||
!!! error TS1222: An overload signature cannot be declared as a generator.
|
||||
function* f(s: any): Iterable<any> { }
|
||||
}
|
||||
@ -1,17 +1,17 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads2.ts(2,13): error TS1220: Generators are not allowed in an ambient context.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads2.ts(3,13): error TS1220: Generators are not allowed in an ambient context.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads2.ts(4,13): error TS1220: Generators are not allowed in an ambient context.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads2.ts(2,13): error TS1221: Generators are not allowed in an ambient context.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads2.ts(3,13): error TS1221: Generators are not allowed in an ambient context.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads2.ts(4,13): error TS1221: Generators are not allowed in an ambient context.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorOverloads2.ts (3 errors) ====
|
||||
declare module M {
|
||||
function* f(s: string): Iterable<any>;
|
||||
~
|
||||
!!! error TS1220: Generators are not allowed in an ambient context.
|
||||
!!! error TS1221: Generators are not allowed in an ambient context.
|
||||
function* f(s: number): Iterable<any>;
|
||||
~
|
||||
!!! error TS1220: Generators are not allowed in an ambient context.
|
||||
!!! error TS1221: Generators are not allowed in an ambient context.
|
||||
function* f(s: any): Iterable<any>;
|
||||
~
|
||||
!!! error TS1220: Generators are not allowed in an ambient context.
|
||||
!!! error TS1221: Generators are not allowed in an ambient context.
|
||||
}
|
||||
@ -1,14 +1,14 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads3.ts(2,5): error TS1221: An overload signature cannot be declared as a generator.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads3.ts(3,5): error TS1221: An overload signature cannot be declared as a generator.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads3.ts(2,5): error TS1222: An overload signature cannot be declared as a generator.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorOverloads3.ts(3,5): error TS1222: An overload signature cannot be declared as a generator.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorOverloads3.ts (2 errors) ====
|
||||
class C {
|
||||
*f(s: string): Iterable<any>;
|
||||
~
|
||||
!!! error TS1221: An overload signature cannot be declared as a generator.
|
||||
!!! error TS1222: An overload signature cannot be declared as a generator.
|
||||
*f(s: number): Iterable<any>;
|
||||
~
|
||||
!!! error TS1221: An overload signature cannot be declared as a generator.
|
||||
!!! error TS1222: An overload signature cannot be declared as a generator.
|
||||
*f(s: any): Iterable<any> { }
|
||||
}
|
||||
@ -1,8 +1,9 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck39.ts(5,16): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck39.ts(6,11): error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck39.ts(7,13): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck39.ts (2 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck39.ts (3 errors) ====
|
||||
function decorator(x: any) {
|
||||
return y => { };
|
||||
}
|
||||
@ -11,6 +12,8 @@ tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck39.ts(7,13): erro
|
||||
~~~~~
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
class C {
|
||||
~
|
||||
!!! error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning.
|
||||
x = yield 0;
|
||||
~~~~~
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
@ -1,12 +1,16 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck59.ts(3,9): error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck59.ts(3,11): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck59.ts (1 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck59.ts (2 errors) ====
|
||||
function* g() {
|
||||
class C {
|
||||
@(yield "")
|
||||
~~~~~~~~~~~
|
||||
~~~~~
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
m() { }
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning.
|
||||
};
|
||||
}
|
||||
@ -1,10 +1,13 @@
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck61.ts(2,7): error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck61.ts(3,11): error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck61.ts (1 errors) ====
|
||||
==== tests/cases/conformance/es6/yieldExpressions/generatorTypeCheck61.ts (2 errors) ====
|
||||
function * g() {
|
||||
@(yield 0)
|
||||
~~~~~
|
||||
!!! error TS1163: A 'yield' expression is only allowed in a generator body.
|
||||
class C {};
|
||||
~
|
||||
!!! error TS1219: Experimental support for decorators is a feature that is subject to change in a future release. Specify '--experimentalDecorators' to remove this warning.
|
||||
}
|
||||
@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesAmbientConstEnum.ts(3,20): error TS1209: Ambient const enums are not allowed when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesAmbientConstEnum.ts (1 errors) ====
|
||||
|
||||
|
||||
declare const enum E { X = 1}
|
||||
~
|
||||
!!! error TS1209: Ambient const enums are not allowed when the '--isolatedModules' flag is provided.
|
||||
export var y;
|
||||
@ -0,0 +1,8 @@
|
||||
//// [isolatedModulesAmbientConstEnum.ts]
|
||||
|
||||
|
||||
declare const enum E { X = 1}
|
||||
export var y;
|
||||
|
||||
//// [isolatedModulesAmbientConstEnum.js]
|
||||
export var y;
|
||||
@ -0,0 +1,7 @@
|
||||
error TS5044: Option 'declaration' cannot be specified with option 'isolatedModules'.
|
||||
|
||||
|
||||
!!! error TS5044: Option 'declaration' cannot be specified with option 'isolatedModules'.
|
||||
==== tests/cases/compiler/isolatedModulesDeclaration.ts (0 errors) ====
|
||||
|
||||
export var x;
|
||||
10
tests/baselines/reference/isolatedModulesDeclaration.js
Normal file
10
tests/baselines/reference/isolatedModulesDeclaration.js
Normal file
@ -0,0 +1,10 @@
|
||||
//// [isolatedModulesDeclaration.ts]
|
||||
|
||||
export var x;
|
||||
|
||||
//// [isolatedModulesDeclaration.js]
|
||||
export var x;
|
||||
|
||||
|
||||
//// [isolatedModulesDeclaration.d.ts]
|
||||
export declare var x: any;
|
||||
5
tests/baselines/reference/isolatedModulesES6.js
Normal file
5
tests/baselines/reference/isolatedModulesES6.js
Normal file
@ -0,0 +1,5 @@
|
||||
//// [isolatedModulesES6.ts]
|
||||
export var x;
|
||||
|
||||
//// [isolatedModulesES6.js]
|
||||
export var x;
|
||||
4
tests/baselines/reference/isolatedModulesES6.symbols
Normal file
4
tests/baselines/reference/isolatedModulesES6.symbols
Normal file
@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/isolatedModulesES6.ts ===
|
||||
export var x;
|
||||
>x : Symbol(x, Decl(isolatedModulesES6.ts, 0, 10))
|
||||
|
||||
4
tests/baselines/reference/isolatedModulesES6.types
Normal file
4
tests/baselines/reference/isolatedModulesES6.types
Normal file
@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/isolatedModulesES6.ts ===
|
||||
export var x;
|
||||
>x : any
|
||||
|
||||
@ -0,0 +1,28 @@
|
||||
tests/cases/compiler/isolatedModulesImportExportElision.ts(2,17): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/isolatedModulesImportExportElision.ts(3,18): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/isolatedModulesImportExportElision.ts(4,21): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/isolatedModulesImportExportElision.ts(12,18): error TS2307: Cannot find module 'module'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesImportExportElision.ts (4 errors) ====
|
||||
|
||||
import {c} from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
import {c2} from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
import * as ns from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
|
||||
class C extends c2.C {
|
||||
}
|
||||
|
||||
let x = new c();
|
||||
let y = ns.value;
|
||||
|
||||
export {c1} from "module";
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
export var z = x;
|
||||
@ -1,4 +1,4 @@
|
||||
//// [separateCompilationImportExportElision.ts]
|
||||
//// [isolatedModulesImportExportElision.ts]
|
||||
|
||||
import {c} from "module"
|
||||
import {c2} from "module"
|
||||
@ -13,7 +13,7 @@ let y = ns.value;
|
||||
export {c1} from "module";
|
||||
export var z = x;
|
||||
|
||||
//// [separateCompilationImportExportElision.js]
|
||||
//// [isolatedModulesImportExportElision.js]
|
||||
var __extends = (this && this.__extends) || function (d, b) {
|
||||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
||||
function __() { this.constructor = d; }
|
||||
@ -0,0 +1,7 @@
|
||||
error TS5045: Option 'noEmitOnError' cannot be specified with option 'isolatedModules'.
|
||||
|
||||
|
||||
!!! error TS5045: Option 'noEmitOnError' cannot be specified with option 'isolatedModules'.
|
||||
==== tests/cases/compiler/isolatedModulesNoEmitOnError.ts (0 errors) ====
|
||||
|
||||
export var x;
|
||||
@ -0,0 +1,8 @@
|
||||
tests/cases/compiler/isolatedModulesNoExternalModule.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesNoExternalModule.ts (1 errors) ====
|
||||
|
||||
var x;
|
||||
~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
@ -0,0 +1,6 @@
|
||||
//// [isolatedModulesNoExternalModule.ts]
|
||||
|
||||
var x;
|
||||
|
||||
//// [isolatedModulesNoExternalModule.js]
|
||||
var x;
|
||||
@ -1,10 +1,10 @@
|
||||
//// [separateCompilationNonAmbientConstEnum.ts]
|
||||
//// [isolatedModulesNonAmbientConstEnum.ts]
|
||||
|
||||
const enum E { X = 100 };
|
||||
var e = E.X;
|
||||
export var x;
|
||||
|
||||
//// [separateCompilationNonAmbientConstEnum.js]
|
||||
//// [isolatedModulesNonAmbientConstEnum.js]
|
||||
var E;
|
||||
(function (E) {
|
||||
E[E["X"] = 100] = "X";
|
||||
@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/isolatedModulesNonAmbientConstEnum.ts ===
|
||||
|
||||
const enum E { X = 100 };
|
||||
>E : Symbol(E, Decl(isolatedModulesNonAmbientConstEnum.ts, 0, 0))
|
||||
>X : Symbol(E.X, Decl(isolatedModulesNonAmbientConstEnum.ts, 1, 14))
|
||||
|
||||
var e = E.X;
|
||||
>e : Symbol(e, Decl(isolatedModulesNonAmbientConstEnum.ts, 2, 3))
|
||||
>E.X : Symbol(E.X, Decl(isolatedModulesNonAmbientConstEnum.ts, 1, 14))
|
||||
>E : Symbol(E, Decl(isolatedModulesNonAmbientConstEnum.ts, 0, 0))
|
||||
>X : Symbol(E.X, Decl(isolatedModulesNonAmbientConstEnum.ts, 1, 14))
|
||||
|
||||
export var x;
|
||||
>x : Symbol(x, Decl(isolatedModulesNonAmbientConstEnum.ts, 3, 10))
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
=== tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts ===
|
||||
=== tests/cases/compiler/isolatedModulesNonAmbientConstEnum.ts ===
|
||||
|
||||
const enum E { X = 100 };
|
||||
>E : E
|
||||
@ -1,12 +1,12 @@
|
||||
error TS5046: Option 'out' cannot be specified with option 'separateCompilation'.
|
||||
tests/cases/compiler/file2.ts(1,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided.
|
||||
error TS5046: Option 'out' cannot be specified with option 'isolatedModules'.
|
||||
tests/cases/compiler/file2.ts(1,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
!!! error TS5046: Option 'out' cannot be specified with option 'separateCompilation'.
|
||||
!!! error TS5046: Option 'out' cannot be specified with option 'isolatedModules'.
|
||||
==== tests/cases/compiler/file1.ts (0 errors) ====
|
||||
|
||||
export var x;
|
||||
==== tests/cases/compiler/file2.ts (1 errors) ====
|
||||
var y;
|
||||
~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided.
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
@ -1,4 +1,4 @@
|
||||
//// [tests/cases/compiler/separateCompilationOut.ts] ////
|
||||
//// [tests/cases/compiler/isolatedModulesOut.ts] ////
|
||||
|
||||
//// [file1.ts]
|
||||
|
||||
@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesPlainFile-AMD.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesPlainFile-AMD.ts (1 errors) ====
|
||||
|
||||
declare function run(a: number): void;
|
||||
~~~~~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
run(1);
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
//// [separateCompilationPlainFile-AMD.ts]
|
||||
//// [isolatedModulesPlainFile-AMD.ts]
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
|
||||
|
||||
//// [separateCompilationPlainFile-AMD.js]
|
||||
//// [isolatedModulesPlainFile-AMD.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
run(1);
|
||||
});
|
||||
@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesPlainFile-CommonJS.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesPlainFile-CommonJS.ts (1 errors) ====
|
||||
|
||||
declare function run(a: number): void;
|
||||
~~~~~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
run(1);
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
//// [isolatedModulesPlainFile-CommonJS.ts]
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
|
||||
|
||||
//// [isolatedModulesPlainFile-CommonJS.js]
|
||||
run(1);
|
||||
@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesPlainFile-ES6.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesPlainFile-ES6.ts (1 errors) ====
|
||||
|
||||
declare function run(a: number): void;
|
||||
~~~~~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
run(1);
|
||||
|
||||
@ -0,0 +1,8 @@
|
||||
//// [isolatedModulesPlainFile-ES6.ts]
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
|
||||
|
||||
//// [isolatedModulesPlainFile-ES6.js]
|
||||
run(1);
|
||||
@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesPlainFile-System.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesPlainFile-System.ts (1 errors) ====
|
||||
|
||||
declare function run(a: number): void;
|
||||
~~~~~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
run(1);
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
//// [separateCompilationPlainFile-System.ts]
|
||||
//// [isolatedModulesPlainFile-System.ts]
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
|
||||
|
||||
//// [separateCompilationPlainFile-System.js]
|
||||
//// [isolatedModulesPlainFile-System.js]
|
||||
System.register([], function(exports_1) {
|
||||
return {
|
||||
setters:[],
|
||||
@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesPlainFile-UMD.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesPlainFile-UMD.ts (1 errors) ====
|
||||
|
||||
declare function run(a: number): void;
|
||||
~~~~~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
run(1);
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
//// [separateCompilationPlainFile-UMD.ts]
|
||||
//// [isolatedModulesPlainFile-UMD.ts]
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
|
||||
|
||||
//// [separateCompilationPlainFile-UMD.js]
|
||||
//// [isolatedModulesPlainFile-UMD.js]
|
||||
(function (deps, factory) {
|
||||
if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
var v = factory(require, exports); if (v !== undefined) module.exports = v;
|
||||
@ -0,0 +1,7 @@
|
||||
error TS5043: Option 'sourceMap' cannot be specified with option 'isolatedModules'.
|
||||
|
||||
|
||||
!!! error TS5043: Option 'sourceMap' cannot be specified with option 'isolatedModules'.
|
||||
==== tests/cases/compiler/isolatedModulesSourceMap.ts (0 errors) ====
|
||||
|
||||
export var x;
|
||||
7
tests/baselines/reference/isolatedModulesSourceMap.js
Normal file
7
tests/baselines/reference/isolatedModulesSourceMap.js
Normal file
@ -0,0 +1,7 @@
|
||||
//// [isolatedModulesSourceMap.ts]
|
||||
|
||||
export var x;
|
||||
|
||||
//// [isolatedModulesSourceMap.js]
|
||||
export var x;
|
||||
//# sourceMappingURL=isolatedModulesSourceMap.js.map
|
||||
@ -0,0 +1,2 @@
|
||||
//// [isolatedModulesSourceMap.js.map]
|
||||
{"version":3,"file":"isolatedModulesSourceMap.js","sourceRoot":"","sources":["isolatedModulesSourceMap.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,CAAC"}
|
||||
@ -1,19 +1,19 @@
|
||||
===================================================================
|
||||
JsFile: separateCompilationSourceMap.js
|
||||
mapUrl: separateCompilationSourceMap.js.map
|
||||
JsFile: isolatedModulesSourceMap.js
|
||||
mapUrl: isolatedModulesSourceMap.js.map
|
||||
sourceRoot:
|
||||
sources: separateCompilationSourceMap.ts
|
||||
sources: isolatedModulesSourceMap.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:tests/cases/compiler/separateCompilationSourceMap.js
|
||||
sourceFile:separateCompilationSourceMap.ts
|
||||
emittedFile:tests/cases/compiler/isolatedModulesSourceMap.js
|
||||
sourceFile:isolatedModulesSourceMap.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>export var x;
|
||||
1 >
|
||||
2 >^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 >export var
|
||||
@ -24,4 +24,4 @@ sourceFile:separateCompilationSourceMap.ts
|
||||
3 >Emitted(1, 13) Source(2, 13) + SourceIndex(0)
|
||||
4 >Emitted(1, 14) Source(2, 14) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=separateCompilationSourceMap.js.map
|
||||
>>>//# sourceMappingURL=isolatedModulesSourceMap.js.map
|
||||
@ -0,0 +1,4 @@
|
||||
//// [isolatedModulesSpecifiedModule.ts]
|
||||
export var x;
|
||||
|
||||
//// [isolatedModulesSpecifiedModule.js]
|
||||
@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/isolatedModulesSpecifiedModule.ts ===
|
||||
export var x;
|
||||
>x : Symbol(x, Decl(isolatedModulesSpecifiedModule.ts, 0, 10))
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/isolatedModulesSpecifiedModule.ts ===
|
||||
export var x;
|
||||
>x : any
|
||||
|
||||
@ -0,0 +1,6 @@
|
||||
error TS5047: Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.
|
||||
|
||||
|
||||
!!! error TS5047: Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.
|
||||
==== tests/cases/compiler/isolatedModulesUnspecifiedModule.ts (0 errors) ====
|
||||
export var x;
|
||||
@ -0,0 +1,4 @@
|
||||
//// [isolatedModulesUnspecifiedModule.ts]
|
||||
export var x;
|
||||
|
||||
//// [isolatedModulesUnspecifiedModule.js]
|
||||
@ -1,4 +1,4 @@
|
||||
//// [tests/cases/compiler/separateCompilationWithDeclarationFile.ts] ////
|
||||
//// [tests/cases/compiler/isolatedModulesWithDeclarationFile.ts] ////
|
||||
|
||||
//// [file1.d.ts]
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
tests/cases/compiler/separateCompilationAmbientConstEnum.ts(3,20): error TS1209: Ambient const enums are not allowed when the '--separateCompilation' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/separateCompilationAmbientConstEnum.ts (1 errors) ====
|
||||
|
||||
|
||||
declare const enum E { X = 1}
|
||||
~
|
||||
!!! error TS1209: Ambient const enums are not allowed when the '--separateCompilation' flag is provided.
|
||||
export var y;
|
||||
@ -1,8 +0,0 @@
|
||||
//// [separateCompilationAmbientConstEnum.ts]
|
||||
|
||||
|
||||
declare const enum E { X = 1}
|
||||
export var y;
|
||||
|
||||
//// [separateCompilationAmbientConstEnum.js]
|
||||
export var y;
|
||||
@ -1,7 +0,0 @@
|
||||
error TS5044: Option 'declaration' cannot be specified with option 'separateCompilation'.
|
||||
|
||||
|
||||
!!! error TS5044: Option 'declaration' cannot be specified with option 'separateCompilation'.
|
||||
==== tests/cases/compiler/separateCompilationDeclaration.ts (0 errors) ====
|
||||
|
||||
export var x;
|
||||
@ -1,10 +0,0 @@
|
||||
//// [separateCompilationDeclaration.ts]
|
||||
|
||||
export var x;
|
||||
|
||||
//// [separateCompilationDeclaration.js]
|
||||
export var x;
|
||||
|
||||
|
||||
//// [separateCompilationDeclaration.d.ts]
|
||||
export declare var x: any;
|
||||
@ -1,5 +0,0 @@
|
||||
//// [separateCompilationES6.ts]
|
||||
export var x;
|
||||
|
||||
//// [separateCompilationES6.js]
|
||||
export var x;
|
||||
@ -1,4 +0,0 @@
|
||||
=== tests/cases/compiler/separateCompilationES6.ts ===
|
||||
export var x;
|
||||
>x : Symbol(x, Decl(separateCompilationES6.ts, 0, 10))
|
||||
|
||||
@ -1,4 +0,0 @@
|
||||
=== tests/cases/compiler/separateCompilationES6.ts ===
|
||||
export var x;
|
||||
>x : any
|
||||
|
||||
@ -1,28 +0,0 @@
|
||||
tests/cases/compiler/separateCompilationImportExportElision.ts(2,17): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/separateCompilationImportExportElision.ts(3,18): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/separateCompilationImportExportElision.ts(4,21): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/separateCompilationImportExportElision.ts(12,18): error TS2307: Cannot find module 'module'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/separateCompilationImportExportElision.ts (4 errors) ====
|
||||
|
||||
import {c} from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
import {c2} from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
import * as ns from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
|
||||
class C extends c2.C {
|
||||
}
|
||||
|
||||
let x = new c();
|
||||
let y = ns.value;
|
||||
|
||||
export {c1} from "module";
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
export var z = x;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user