diff --git a/bin/tsc.js b/bin/tsc.js index 47c6769ae8d..a73a566ef56 100644 --- a/bin/tsc.js +++ b/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) { diff --git a/bin/tsserver.js b/bin/tsserver.js index f617ae545f3..49c7b69b302 100644 --- a/bin/tsserver.js +++ b/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; diff --git a/bin/typescript.d.ts b/bin/typescript.d.ts index bcb379ed52f..50f5c1ade22 100644 --- a/bin/typescript.d.ts +++ b/bin/typescript.d.ts @@ -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; } diff --git a/bin/typescript.js b/bin/typescript.js index 4cab75bfcb6..f91570ad95f 100644 --- a/bin/typescript.js +++ b/bin/typescript.js @@ -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"; diff --git a/bin/typescriptServices.d.ts b/bin/typescriptServices.d.ts index f03a7a00e46..558504fcede 100644 --- a/bin/typescriptServices.d.ts +++ b/bin/typescriptServices.d.ts @@ -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; } diff --git a/bin/typescriptServices.js b/bin/typescriptServices.js index 4cab75bfcb6..f91570ad95f 100644 --- a/bin/typescriptServices.js +++ b/bin/typescriptServices.js @@ -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"; diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 759b235ad0a..276833cd818 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -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 diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 7a589fe61cb..be507f626d4 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -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 } ]; diff --git a/src/compiler/diagnosticInformationMap.generated.ts b/src/compiler/diagnosticInformationMap.generated.ts index 6e73d28bddd..8ccc9d890e2 100644 --- a/src/compiler/diagnosticInformationMap.generated.ts +++ b/src/compiler/diagnosticInformationMap.generated.ts @@ -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." }, diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index d5764605d51..fb246955f73 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -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", diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 32ebeaec08f..92afacdafca 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -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); } diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 38634f1dea6..955e24fd1de 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -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)); + } } } } \ No newline at end of file diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 14e53ee8f72..f653f2aa8eb 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -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; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index 5198d8a2288..6ac59b6a6ea 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -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; } diff --git a/src/harness/harness.ts b/src/harness/harness.ts index 90afab029eb..b3791283a63 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -1011,6 +1011,10 @@ module Harness { options.target = 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[] { diff --git a/src/services/services.ts b/src/services/services.ts index 1019c532192..72a714440bf 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -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; diff --git a/tests/baselines/reference/FunctionDeclaration10_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration10_es6.errors.txt index c0a45a2be52..35edf48564a 100644 --- a/tests/baselines/reference/FunctionDeclaration10_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration10_es6.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt index 2c674a63f93..e24f702213c 100644 --- a/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration11_es6.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt index aeb9e1fa6a6..2b090f4a733 100644 --- a/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration13_es6.errors.txt @@ -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; ~~~~~ diff --git a/tests/baselines/reference/FunctionDeclaration1_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration1_es6.errors.txt index e3601968a27..52bdfbd1afe 100644 --- a/tests/baselines/reference/FunctionDeclaration1_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration1_es6.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt index 27981b028ed..9f696e71084 100644 --- a/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration6_es6.errors.txt @@ -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'. } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt index 45e88ed7efb..91fab36ed31 100644 --- a/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration7_es6.errors.txt @@ -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'. } diff --git a/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt b/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt index b17b945e2f4..e4222409a66 100644 --- a/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt +++ b/tests/baselines/reference/FunctionDeclaration9_es6.errors.txt @@ -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 } } \ No newline at end of file diff --git a/tests/baselines/reference/FunctionExpression1_es6.errors.txt b/tests/baselines/reference/FunctionExpression1_es6.errors.txt index 0bc04c80860..cb2ebd7245e 100644 --- a/tests/baselines/reference/FunctionExpression1_es6.errors.txt +++ b/tests/baselines/reference/FunctionExpression1_es6.errors.txt @@ -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. \ No newline at end of file +!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionExpression2_es6.errors.txt b/tests/baselines/reference/FunctionExpression2_es6.errors.txt index e58fe7ab4c7..d5350b5fdec 100644 --- a/tests/baselines/reference/FunctionExpression2_es6.errors.txt +++ b/tests/baselines/reference/FunctionExpression2_es6.errors.txt @@ -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. \ No newline at end of file +!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments1_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments1_es6.errors.txt index ebbc2a4dbe1..a2aa32a9dd1 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments1_es6.errors.txt +++ b/tests/baselines/reference/FunctionPropertyAssignments1_es6.errors.txt @@ -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. \ No newline at end of file +!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher. \ No newline at end of file diff --git a/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt b/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt index b2b071ee5e6..8490be5cdc4 100644 --- a/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt +++ b/tests/baselines/reference/FunctionPropertyAssignments5_es6.errors.txt @@ -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'. \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration1_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration1_es6.errors.txt index 0da724d7ec3..7766ad8d790 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration1_es6.errors.txt +++ b/tests/baselines/reference/MemberFunctionDeclaration1_es6.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt index 8801b74cae5..38a761f6db7 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt +++ b/tests/baselines/reference/MemberFunctionDeclaration2_es6.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration3_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration3_es6.errors.txt index 458a3da62bb..e561954035e 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration3_es6.errors.txt +++ b/tests/baselines/reference/MemberFunctionDeclaration3_es6.errors.txt @@ -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'. } \ No newline at end of file diff --git a/tests/baselines/reference/MemberFunctionDeclaration7_es6.errors.txt b/tests/baselines/reference/MemberFunctionDeclaration7_es6.errors.txt index 210485e629f..3eb8f5051a0 100644 --- a/tests/baselines/reference/MemberFunctionDeclaration7_es6.errors.txt +++ b/tests/baselines/reference/MemberFunctionDeclaration7_es6.errors.txt @@ -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() { } ~ -!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher. +!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher. } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression10_es6.errors.txt b/tests/baselines/reference/YieldExpression10_es6.errors.txt index a4bf2a8eb8f..99a73c48ba5 100644 --- a/tests/baselines/reference/YieldExpression10_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression10_es6.errors.txt @@ -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'. diff --git a/tests/baselines/reference/YieldExpression11_es6.errors.txt b/tests/baselines/reference/YieldExpression11_es6.errors.txt index 1272295fe5f..c19e8b6cfa5 100644 --- a/tests/baselines/reference/YieldExpression11_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression11_es6.errors.txt @@ -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'. diff --git a/tests/baselines/reference/YieldExpression13_es6.errors.txt b/tests/baselines/reference/YieldExpression13_es6.errors.txt index 57329bb142d..3166d742ae3 100644 --- a/tests/baselines/reference/YieldExpression13_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression13_es6.errors.txt @@ -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. \ No newline at end of file +!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher. \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression16_es6.errors.txt b/tests/baselines/reference/YieldExpression16_es6.errors.txt index 8eb7a7be4cf..e792bc59240 100644 --- a/tests/baselines/reference/YieldExpression16_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression16_es6.errors.txt @@ -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; ~~~~~ diff --git a/tests/baselines/reference/YieldExpression19_es6.errors.txt b/tests/baselines/reference/YieldExpression19_es6.errors.txt index 7d7db15ebb6..02591de78ca 100644 --- a/tests/baselines/reference/YieldExpression19_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression19_es6.errors.txt @@ -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); } } diff --git a/tests/baselines/reference/YieldExpression3_es6.errors.txt b/tests/baselines/reference/YieldExpression3_es6.errors.txt index 01bd5a54d59..c03a5f1c469 100644 --- a/tests/baselines/reference/YieldExpression3_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression3_es6.errors.txt @@ -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 } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression4_es6.errors.txt b/tests/baselines/reference/YieldExpression4_es6.errors.txt index dbb543ba86e..cea33eabfa4 100644 --- a/tests/baselines/reference/YieldExpression4_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression4_es6.errors.txt @@ -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; } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression6_es6.errors.txt b/tests/baselines/reference/YieldExpression6_es6.errors.txt index a90cc45d24f..fce6583844f 100644 --- a/tests/baselines/reference/YieldExpression6_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression6_es6.errors.txt @@ -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. diff --git a/tests/baselines/reference/YieldExpression7_es6.errors.txt b/tests/baselines/reference/YieldExpression7_es6.errors.txt index 067d11ecde6..39d085b71f9 100644 --- a/tests/baselines/reference/YieldExpression7_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression7_es6.errors.txt @@ -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 } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression8_es6.errors.txt b/tests/baselines/reference/YieldExpression8_es6.errors.txt index 32ee997e38a..b14fa0872a2 100644 --- a/tests/baselines/reference/YieldExpression8_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression8_es6.errors.txt @@ -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); } \ No newline at end of file diff --git a/tests/baselines/reference/YieldExpression9_es6.errors.txt b/tests/baselines/reference/YieldExpression9_es6.errors.txt index 2bd42847e64..aceb0383200 100644 --- a/tests/baselines/reference/YieldExpression9_es6.errors.txt +++ b/tests/baselines/reference/YieldExpression9_es6.errors.txt @@ -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'. diff --git a/tests/baselines/reference/YieldStarExpression4_es6.errors.txt b/tests/baselines/reference/YieldStarExpression4_es6.errors.txt index 6247a366ba8..4935df494d5 100644 --- a/tests/baselines/reference/YieldStarExpression4_es6.errors.txt +++ b/tests/baselines/reference/YieldStarExpression4_es6.errors.txt @@ -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. diff --git a/tests/baselines/reference/generatorInAmbientContext1.errors.txt b/tests/baselines/reference/generatorInAmbientContext1.errors.txt index fcfcceb9ff5..f3e458e80ca 100644 --- a/tests/baselines/reference/generatorInAmbientContext1.errors.txt +++ b/tests/baselines/reference/generatorInAmbientContext1.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/generatorInAmbientContext2.errors.txt b/tests/baselines/reference/generatorInAmbientContext2.errors.txt index 8f471ef98bc..d6cd02f72ef 100644 --- a/tests/baselines/reference/generatorInAmbientContext2.errors.txt +++ b/tests/baselines/reference/generatorInAmbientContext2.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/generatorInAmbientContext3.d.errors.txt b/tests/baselines/reference/generatorInAmbientContext3.d.errors.txt index 44391cab730..d53591ef80c 100644 --- a/tests/baselines/reference/generatorInAmbientContext3.d.errors.txt +++ b/tests/baselines/reference/generatorInAmbientContext3.d.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/generatorInAmbientContext4.d.errors.txt b/tests/baselines/reference/generatorInAmbientContext4.d.errors.txt index 2b1701156f0..171ad2e6647 100644 --- a/tests/baselines/reference/generatorInAmbientContext4.d.errors.txt +++ b/tests/baselines/reference/generatorInAmbientContext4.d.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/generatorOverloads1.errors.txt b/tests/baselines/reference/generatorOverloads1.errors.txt index 9d2b5a2ee41..280ca7c516b 100644 --- a/tests/baselines/reference/generatorOverloads1.errors.txt +++ b/tests/baselines/reference/generatorOverloads1.errors.txt @@ -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; ~ -!!! 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; ~ -!!! 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 { } } \ No newline at end of file diff --git a/tests/baselines/reference/generatorOverloads2.errors.txt b/tests/baselines/reference/generatorOverloads2.errors.txt index 53dad48de63..349b9382eb1 100644 --- a/tests/baselines/reference/generatorOverloads2.errors.txt +++ b/tests/baselines/reference/generatorOverloads2.errors.txt @@ -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; ~ -!!! 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; ~ -!!! 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; ~ -!!! error TS1220: Generators are not allowed in an ambient context. +!!! error TS1221: Generators are not allowed in an ambient context. } \ No newline at end of file diff --git a/tests/baselines/reference/generatorOverloads3.errors.txt b/tests/baselines/reference/generatorOverloads3.errors.txt index c68e2fac0b0..d7ef5da20ec 100644 --- a/tests/baselines/reference/generatorOverloads3.errors.txt +++ b/tests/baselines/reference/generatorOverloads3.errors.txt @@ -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; ~ -!!! 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; ~ -!!! 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 { } } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck39.errors.txt b/tests/baselines/reference/generatorTypeCheck39.errors.txt index eb89fa23291..ae24837f712 100644 --- a/tests/baselines/reference/generatorTypeCheck39.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck39.errors.txt @@ -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. diff --git a/tests/baselines/reference/generatorTypeCheck59.errors.txt b/tests/baselines/reference/generatorTypeCheck59.errors.txt index 7f2c9b87529..d8d532a430a 100644 --- a/tests/baselines/reference/generatorTypeCheck59.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck59.errors.txt @@ -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. }; } \ No newline at end of file diff --git a/tests/baselines/reference/generatorTypeCheck61.errors.txt b/tests/baselines/reference/generatorTypeCheck61.errors.txt index 87e844dbfb6..b38e96d31ce 100644 --- a/tests/baselines/reference/generatorTypeCheck61.errors.txt +++ b/tests/baselines/reference/generatorTypeCheck61.errors.txt @@ -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. } \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesAmbientConstEnum.errors.txt b/tests/baselines/reference/isolatedModulesAmbientConstEnum.errors.txt new file mode 100644 index 00000000000..bb8a5202bc5 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesAmbientConstEnum.errors.txt @@ -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; \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesAmbientConstEnum.js b/tests/baselines/reference/isolatedModulesAmbientConstEnum.js new file mode 100644 index 00000000000..7742122b687 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesAmbientConstEnum.js @@ -0,0 +1,8 @@ +//// [isolatedModulesAmbientConstEnum.ts] + + +declare const enum E { X = 1} +export var y; + +//// [isolatedModulesAmbientConstEnum.js] +export var y; diff --git a/tests/baselines/reference/isolatedModulesDeclaration.errors.txt b/tests/baselines/reference/isolatedModulesDeclaration.errors.txt new file mode 100644 index 00000000000..de5cb97586c --- /dev/null +++ b/tests/baselines/reference/isolatedModulesDeclaration.errors.txt @@ -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; \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesDeclaration.js b/tests/baselines/reference/isolatedModulesDeclaration.js new file mode 100644 index 00000000000..12e6f23f92e --- /dev/null +++ b/tests/baselines/reference/isolatedModulesDeclaration.js @@ -0,0 +1,10 @@ +//// [isolatedModulesDeclaration.ts] + +export var x; + +//// [isolatedModulesDeclaration.js] +export var x; + + +//// [isolatedModulesDeclaration.d.ts] +export declare var x: any; diff --git a/tests/baselines/reference/isolatedModulesES6.js b/tests/baselines/reference/isolatedModulesES6.js new file mode 100644 index 00000000000..eb2ee3ee33a --- /dev/null +++ b/tests/baselines/reference/isolatedModulesES6.js @@ -0,0 +1,5 @@ +//// [isolatedModulesES6.ts] +export var x; + +//// [isolatedModulesES6.js] +export var x; diff --git a/tests/baselines/reference/isolatedModulesES6.symbols b/tests/baselines/reference/isolatedModulesES6.symbols new file mode 100644 index 00000000000..c705cbc5af8 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesES6.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/isolatedModulesES6.ts === +export var x; +>x : Symbol(x, Decl(isolatedModulesES6.ts, 0, 10)) + diff --git a/tests/baselines/reference/isolatedModulesES6.types b/tests/baselines/reference/isolatedModulesES6.types new file mode 100644 index 00000000000..898b9715ca4 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesES6.types @@ -0,0 +1,4 @@ +=== tests/cases/compiler/isolatedModulesES6.ts === +export var x; +>x : any + diff --git a/tests/baselines/reference/isolatedModulesImportExportElision.errors.txt b/tests/baselines/reference/isolatedModulesImportExportElision.errors.txt new file mode 100644 index 00000000000..8c6881a9bc1 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesImportExportElision.errors.txt @@ -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; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationImportExportElision.js b/tests/baselines/reference/isolatedModulesImportExportElision.js similarity index 86% rename from tests/baselines/reference/separateCompilationImportExportElision.js rename to tests/baselines/reference/isolatedModulesImportExportElision.js index cfa57980249..ca3eee0ac2b 100644 --- a/tests/baselines/reference/separateCompilationImportExportElision.js +++ b/tests/baselines/reference/isolatedModulesImportExportElision.js @@ -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; } diff --git a/tests/baselines/reference/isolatedModulesNoEmitOnError.errors.txt b/tests/baselines/reference/isolatedModulesNoEmitOnError.errors.txt new file mode 100644 index 00000000000..68b2747cf6b --- /dev/null +++ b/tests/baselines/reference/isolatedModulesNoEmitOnError.errors.txt @@ -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; \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesNoExternalModule.errors.txt b/tests/baselines/reference/isolatedModulesNoExternalModule.errors.txt new file mode 100644 index 00000000000..d00520a0618 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesNoExternalModule.errors.txt @@ -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. \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesNoExternalModule.js b/tests/baselines/reference/isolatedModulesNoExternalModule.js new file mode 100644 index 00000000000..dd5d23a538c --- /dev/null +++ b/tests/baselines/reference/isolatedModulesNoExternalModule.js @@ -0,0 +1,6 @@ +//// [isolatedModulesNoExternalModule.ts] + +var x; + +//// [isolatedModulesNoExternalModule.js] +var x; diff --git a/tests/baselines/reference/separateCompilationNonAmbientConstEnum.js b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.js similarity index 58% rename from tests/baselines/reference/separateCompilationNonAmbientConstEnum.js rename to tests/baselines/reference/isolatedModulesNonAmbientConstEnum.js index 74096adca1f..efdba17dc93 100644 --- a/tests/baselines/reference/separateCompilationNonAmbientConstEnum.js +++ b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.js @@ -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"; diff --git a/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.symbols b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.symbols new file mode 100644 index 00000000000..5e30fd0b2ff --- /dev/null +++ b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.symbols @@ -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)) + diff --git a/tests/baselines/reference/separateCompilationNonAmbientConstEnum.types b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types similarity index 60% rename from tests/baselines/reference/separateCompilationNonAmbientConstEnum.types rename to tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types index ce55b80f41d..d7e83b81070 100644 --- a/tests/baselines/reference/separateCompilationNonAmbientConstEnum.types +++ b/tests/baselines/reference/isolatedModulesNonAmbientConstEnum.types @@ -1,4 +1,4 @@ -=== tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts === +=== tests/cases/compiler/isolatedModulesNonAmbientConstEnum.ts === const enum E { X = 100 }; >E : E diff --git a/tests/baselines/reference/separateCompilationOut.errors.txt b/tests/baselines/reference/isolatedModulesOut.errors.txt similarity index 50% rename from tests/baselines/reference/separateCompilationOut.errors.txt rename to tests/baselines/reference/isolatedModulesOut.errors.txt index 9017809901f..8234ba94585 100644 --- a/tests/baselines/reference/separateCompilationOut.errors.txt +++ b/tests/baselines/reference/isolatedModulesOut.errors.txt @@ -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. \ No newline at end of file +!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationOut.js b/tests/baselines/reference/isolatedModulesOut.js similarity index 60% rename from tests/baselines/reference/separateCompilationOut.js rename to tests/baselines/reference/isolatedModulesOut.js index 67dd2dcfbfa..ca5eb2b7579 100644 --- a/tests/baselines/reference/separateCompilationOut.js +++ b/tests/baselines/reference/isolatedModulesOut.js @@ -1,4 +1,4 @@ -//// [tests/cases/compiler/separateCompilationOut.ts] //// +//// [tests/cases/compiler/isolatedModulesOut.ts] //// //// [file1.ts] diff --git a/tests/baselines/reference/isolatedModulesPlainFile-AMD.errors.txt b/tests/baselines/reference/isolatedModulesPlainFile-AMD.errors.txt new file mode 100644 index 00000000000..680070a73c8 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesPlainFile-AMD.errors.txt @@ -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); + \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-AMD.js b/tests/baselines/reference/isolatedModulesPlainFile-AMD.js similarity index 57% rename from tests/baselines/reference/separateCompilationPlainFile-AMD.js rename to tests/baselines/reference/isolatedModulesPlainFile-AMD.js index e3e9fc1eaeb..7f4f4219123 100644 --- a/tests/baselines/reference/separateCompilationPlainFile-AMD.js +++ b/tests/baselines/reference/isolatedModulesPlainFile-AMD.js @@ -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); }); diff --git a/tests/baselines/reference/isolatedModulesPlainFile-CommonJS.errors.txt b/tests/baselines/reference/isolatedModulesPlainFile-CommonJS.errors.txt new file mode 100644 index 00000000000..d1f0ca3caad --- /dev/null +++ b/tests/baselines/reference/isolatedModulesPlainFile-CommonJS.errors.txt @@ -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); + \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesPlainFile-CommonJS.js b/tests/baselines/reference/isolatedModulesPlainFile-CommonJS.js new file mode 100644 index 00000000000..7026a7d9bed --- /dev/null +++ b/tests/baselines/reference/isolatedModulesPlainFile-CommonJS.js @@ -0,0 +1,8 @@ +//// [isolatedModulesPlainFile-CommonJS.ts] + +declare function run(a: number): void; +run(1); + + +//// [isolatedModulesPlainFile-CommonJS.js] +run(1); diff --git a/tests/baselines/reference/isolatedModulesPlainFile-ES6.errors.txt b/tests/baselines/reference/isolatedModulesPlainFile-ES6.errors.txt new file mode 100644 index 00000000000..d46fce22fd7 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesPlainFile-ES6.errors.txt @@ -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); + \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesPlainFile-ES6.js b/tests/baselines/reference/isolatedModulesPlainFile-ES6.js new file mode 100644 index 00000000000..245d3fe668f --- /dev/null +++ b/tests/baselines/reference/isolatedModulesPlainFile-ES6.js @@ -0,0 +1,8 @@ +//// [isolatedModulesPlainFile-ES6.ts] + +declare function run(a: number): void; +run(1); + + +//// [isolatedModulesPlainFile-ES6.js] +run(1); diff --git a/tests/baselines/reference/isolatedModulesPlainFile-System.errors.txt b/tests/baselines/reference/isolatedModulesPlainFile-System.errors.txt new file mode 100644 index 00000000000..fe1a2f80018 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesPlainFile-System.errors.txt @@ -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); + \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-System.js b/tests/baselines/reference/isolatedModulesPlainFile-System.js similarity index 65% rename from tests/baselines/reference/separateCompilationPlainFile-System.js rename to tests/baselines/reference/isolatedModulesPlainFile-System.js index c256ed7862a..b924a3b21f9 100644 --- a/tests/baselines/reference/separateCompilationPlainFile-System.js +++ b/tests/baselines/reference/isolatedModulesPlainFile-System.js @@ -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:[], diff --git a/tests/baselines/reference/isolatedModulesPlainFile-UMD.errors.txt b/tests/baselines/reference/isolatedModulesPlainFile-UMD.errors.txt new file mode 100644 index 00000000000..24c5c86f8f8 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesPlainFile-UMD.errors.txt @@ -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); + \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-UMD.js b/tests/baselines/reference/isolatedModulesPlainFile-UMD.js similarity index 80% rename from tests/baselines/reference/separateCompilationPlainFile-UMD.js rename to tests/baselines/reference/isolatedModulesPlainFile-UMD.js index 6a145e7d239..0ed6e83a37f 100644 --- a/tests/baselines/reference/separateCompilationPlainFile-UMD.js +++ b/tests/baselines/reference/isolatedModulesPlainFile-UMD.js @@ -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; diff --git a/tests/baselines/reference/isolatedModulesSourceMap.errors.txt b/tests/baselines/reference/isolatedModulesSourceMap.errors.txt new file mode 100644 index 00000000000..6383e85ecd5 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesSourceMap.errors.txt @@ -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; \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesSourceMap.js b/tests/baselines/reference/isolatedModulesSourceMap.js new file mode 100644 index 00000000000..ca6f4b4190e --- /dev/null +++ b/tests/baselines/reference/isolatedModulesSourceMap.js @@ -0,0 +1,7 @@ +//// [isolatedModulesSourceMap.ts] + +export var x; + +//// [isolatedModulesSourceMap.js] +export var x; +//# sourceMappingURL=isolatedModulesSourceMap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesSourceMap.js.map b/tests/baselines/reference/isolatedModulesSourceMap.js.map new file mode 100644 index 00000000000..8e505dcda7a --- /dev/null +++ b/tests/baselines/reference/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"} \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSourceMap.sourcemap.txt b/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt similarity index 61% rename from tests/baselines/reference/separateCompilationSourceMap.sourcemap.txt rename to tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt index 74e0d73d7e0..5c6b7659bc6 100644 --- a/tests/baselines/reference/separateCompilationSourceMap.sourcemap.txt +++ b/tests/baselines/reference/isolatedModulesSourceMap.sourcemap.txt @@ -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 \ No newline at end of file +>>>//# sourceMappingURL=isolatedModulesSourceMap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesSpecifiedModule.js b/tests/baselines/reference/isolatedModulesSpecifiedModule.js new file mode 100644 index 00000000000..95e4ec88d92 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesSpecifiedModule.js @@ -0,0 +1,4 @@ +//// [isolatedModulesSpecifiedModule.ts] +export var x; + +//// [isolatedModulesSpecifiedModule.js] diff --git a/tests/baselines/reference/isolatedModulesSpecifiedModule.symbols b/tests/baselines/reference/isolatedModulesSpecifiedModule.symbols new file mode 100644 index 00000000000..91ede682d7c --- /dev/null +++ b/tests/baselines/reference/isolatedModulesSpecifiedModule.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/isolatedModulesSpecifiedModule.ts === +export var x; +>x : Symbol(x, Decl(isolatedModulesSpecifiedModule.ts, 0, 10)) + diff --git a/tests/baselines/reference/isolatedModulesSpecifiedModule.types b/tests/baselines/reference/isolatedModulesSpecifiedModule.types new file mode 100644 index 00000000000..8dee90a199f --- /dev/null +++ b/tests/baselines/reference/isolatedModulesSpecifiedModule.types @@ -0,0 +1,4 @@ +=== tests/cases/compiler/isolatedModulesSpecifiedModule.ts === +export var x; +>x : any + diff --git a/tests/baselines/reference/isolatedModulesUnspecifiedModule.errors.txt b/tests/baselines/reference/isolatedModulesUnspecifiedModule.errors.txt new file mode 100644 index 00000000000..7d290bcae44 --- /dev/null +++ b/tests/baselines/reference/isolatedModulesUnspecifiedModule.errors.txt @@ -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; \ No newline at end of file diff --git a/tests/baselines/reference/isolatedModulesUnspecifiedModule.js b/tests/baselines/reference/isolatedModulesUnspecifiedModule.js new file mode 100644 index 00000000000..68b9bfb62db --- /dev/null +++ b/tests/baselines/reference/isolatedModulesUnspecifiedModule.js @@ -0,0 +1,4 @@ +//// [isolatedModulesUnspecifiedModule.ts] +export var x; + +//// [isolatedModulesUnspecifiedModule.js] diff --git a/tests/baselines/reference/separateCompilationWithDeclarationFile.js b/tests/baselines/reference/isolatedModulesWithDeclarationFile.js similarity index 57% rename from tests/baselines/reference/separateCompilationWithDeclarationFile.js rename to tests/baselines/reference/isolatedModulesWithDeclarationFile.js index 71d7ef41929..42d091b6108 100644 --- a/tests/baselines/reference/separateCompilationWithDeclarationFile.js +++ b/tests/baselines/reference/isolatedModulesWithDeclarationFile.js @@ -1,4 +1,4 @@ -//// [tests/cases/compiler/separateCompilationWithDeclarationFile.ts] //// +//// [tests/cases/compiler/isolatedModulesWithDeclarationFile.ts] //// //// [file1.d.ts] diff --git a/tests/baselines/reference/separateCompilationWithDeclarationFile.symbols b/tests/baselines/reference/isolatedModulesWithDeclarationFile.symbols similarity index 100% rename from tests/baselines/reference/separateCompilationWithDeclarationFile.symbols rename to tests/baselines/reference/isolatedModulesWithDeclarationFile.symbols diff --git a/tests/baselines/reference/separateCompilationWithDeclarationFile.types b/tests/baselines/reference/isolatedModulesWithDeclarationFile.types similarity index 100% rename from tests/baselines/reference/separateCompilationWithDeclarationFile.types rename to tests/baselines/reference/isolatedModulesWithDeclarationFile.types diff --git a/tests/baselines/reference/separateCompilationAmbientConstEnum.errors.txt b/tests/baselines/reference/separateCompilationAmbientConstEnum.errors.txt deleted file mode 100644 index 6ea2e445e29..00000000000 --- a/tests/baselines/reference/separateCompilationAmbientConstEnum.errors.txt +++ /dev/null @@ -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; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationAmbientConstEnum.js b/tests/baselines/reference/separateCompilationAmbientConstEnum.js deleted file mode 100644 index 5b3af0957e7..00000000000 --- a/tests/baselines/reference/separateCompilationAmbientConstEnum.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [separateCompilationAmbientConstEnum.ts] - - -declare const enum E { X = 1} -export var y; - -//// [separateCompilationAmbientConstEnum.js] -export var y; diff --git a/tests/baselines/reference/separateCompilationDeclaration.errors.txt b/tests/baselines/reference/separateCompilationDeclaration.errors.txt deleted file mode 100644 index 8951184584c..00000000000 --- a/tests/baselines/reference/separateCompilationDeclaration.errors.txt +++ /dev/null @@ -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; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationDeclaration.js b/tests/baselines/reference/separateCompilationDeclaration.js deleted file mode 100644 index 33d64b088de..00000000000 --- a/tests/baselines/reference/separateCompilationDeclaration.js +++ /dev/null @@ -1,10 +0,0 @@ -//// [separateCompilationDeclaration.ts] - -export var x; - -//// [separateCompilationDeclaration.js] -export var x; - - -//// [separateCompilationDeclaration.d.ts] -export declare var x: any; diff --git a/tests/baselines/reference/separateCompilationES6.js b/tests/baselines/reference/separateCompilationES6.js deleted file mode 100644 index cf05e5590a8..00000000000 --- a/tests/baselines/reference/separateCompilationES6.js +++ /dev/null @@ -1,5 +0,0 @@ -//// [separateCompilationES6.ts] -export var x; - -//// [separateCompilationES6.js] -export var x; diff --git a/tests/baselines/reference/separateCompilationES6.symbols b/tests/baselines/reference/separateCompilationES6.symbols deleted file mode 100644 index 737d5e41365..00000000000 --- a/tests/baselines/reference/separateCompilationES6.symbols +++ /dev/null @@ -1,4 +0,0 @@ -=== tests/cases/compiler/separateCompilationES6.ts === -export var x; ->x : Symbol(x, Decl(separateCompilationES6.ts, 0, 10)) - diff --git a/tests/baselines/reference/separateCompilationES6.types b/tests/baselines/reference/separateCompilationES6.types deleted file mode 100644 index 70381906800..00000000000 --- a/tests/baselines/reference/separateCompilationES6.types +++ /dev/null @@ -1,4 +0,0 @@ -=== tests/cases/compiler/separateCompilationES6.ts === -export var x; ->x : any - diff --git a/tests/baselines/reference/separateCompilationImportExportElision.errors.txt b/tests/baselines/reference/separateCompilationImportExportElision.errors.txt deleted file mode 100644 index 0bac01d8134..00000000000 --- a/tests/baselines/reference/separateCompilationImportExportElision.errors.txt +++ /dev/null @@ -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; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationNoEmitOnError.errors.txt b/tests/baselines/reference/separateCompilationNoEmitOnError.errors.txt deleted file mode 100644 index 61d4f2d6d9e..00000000000 --- a/tests/baselines/reference/separateCompilationNoEmitOnError.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -error TS5045: Option 'noEmitOnError' cannot be specified with option 'separateCompilation'. - - -!!! error TS5045: Option 'noEmitOnError' cannot be specified with option 'separateCompilation'. -==== tests/cases/compiler/separateCompilationNoEmitOnError.ts (0 errors) ==== - - export var x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt b/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt deleted file mode 100644 index 71d7da73a80..00000000000 --- a/tests/baselines/reference/separateCompilationNoExternalModule.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -tests/cases/compiler/separateCompilationNoExternalModule.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. - - -==== tests/cases/compiler/separateCompilationNoExternalModule.ts (1 errors) ==== - - var x; - ~~~ -!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationNoExternalModule.js b/tests/baselines/reference/separateCompilationNoExternalModule.js deleted file mode 100644 index 9ddc8bdef2c..00000000000 --- a/tests/baselines/reference/separateCompilationNoExternalModule.js +++ /dev/null @@ -1,6 +0,0 @@ -//// [separateCompilationNoExternalModule.ts] - -var x; - -//// [separateCompilationNoExternalModule.js] -var x; diff --git a/tests/baselines/reference/separateCompilationNonAmbientConstEnum.symbols b/tests/baselines/reference/separateCompilationNonAmbientConstEnum.symbols deleted file mode 100644 index da3f7ce6452..00000000000 --- a/tests/baselines/reference/separateCompilationNonAmbientConstEnum.symbols +++ /dev/null @@ -1,15 +0,0 @@ -=== tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts === - -const enum E { X = 100 }; ->E : Symbol(E, Decl(separateCompilationNonAmbientConstEnum.ts, 0, 0)) ->X : Symbol(E.X, Decl(separateCompilationNonAmbientConstEnum.ts, 1, 14)) - -var e = E.X; ->e : Symbol(e, Decl(separateCompilationNonAmbientConstEnum.ts, 2, 3)) ->E.X : Symbol(E.X, Decl(separateCompilationNonAmbientConstEnum.ts, 1, 14)) ->E : Symbol(E, Decl(separateCompilationNonAmbientConstEnum.ts, 0, 0)) ->X : Symbol(E.X, Decl(separateCompilationNonAmbientConstEnum.ts, 1, 14)) - -export var x; ->x : Symbol(x, Decl(separateCompilationNonAmbientConstEnum.ts, 3, 10)) - diff --git a/tests/baselines/reference/separateCompilationPlainFile-AMD.errors.txt b/tests/baselines/reference/separateCompilationPlainFile-AMD.errors.txt deleted file mode 100644 index 6b80da30d33..00000000000 --- a/tests/baselines/reference/separateCompilationPlainFile-AMD.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/compiler/separateCompilationPlainFile-AMD.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. - - -==== tests/cases/compiler/separateCompilationPlainFile-AMD.ts (1 errors) ==== - - declare function run(a: number): void; - ~~~~~~~ -!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. - run(1); - \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-CommonJS.errors.txt b/tests/baselines/reference/separateCompilationPlainFile-CommonJS.errors.txt deleted file mode 100644 index 48a23a39653..00000000000 --- a/tests/baselines/reference/separateCompilationPlainFile-CommonJS.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/compiler/separateCompilationPlainFile-CommonJS.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. - - -==== tests/cases/compiler/separateCompilationPlainFile-CommonJS.ts (1 errors) ==== - - declare function run(a: number): void; - ~~~~~~~ -!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. - run(1); - \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-CommonJS.js b/tests/baselines/reference/separateCompilationPlainFile-CommonJS.js deleted file mode 100644 index cd82cdf20a6..00000000000 --- a/tests/baselines/reference/separateCompilationPlainFile-CommonJS.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [separateCompilationPlainFile-CommonJS.ts] - -declare function run(a: number): void; -run(1); - - -//// [separateCompilationPlainFile-CommonJS.js] -run(1); diff --git a/tests/baselines/reference/separateCompilationPlainFile-ES6.errors.txt b/tests/baselines/reference/separateCompilationPlainFile-ES6.errors.txt deleted file mode 100644 index b0b059c73bd..00000000000 --- a/tests/baselines/reference/separateCompilationPlainFile-ES6.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/compiler/separateCompilationPlainFile-ES6.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. - - -==== tests/cases/compiler/separateCompilationPlainFile-ES6.ts (1 errors) ==== - - declare function run(a: number): void; - ~~~~~~~ -!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. - run(1); - \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-ES6.js b/tests/baselines/reference/separateCompilationPlainFile-ES6.js deleted file mode 100644 index 1cb6082f134..00000000000 --- a/tests/baselines/reference/separateCompilationPlainFile-ES6.js +++ /dev/null @@ -1,8 +0,0 @@ -//// [separateCompilationPlainFile-ES6.ts] - -declare function run(a: number): void; -run(1); - - -//// [separateCompilationPlainFile-ES6.js] -run(1); diff --git a/tests/baselines/reference/separateCompilationPlainFile-System.errors.txt b/tests/baselines/reference/separateCompilationPlainFile-System.errors.txt deleted file mode 100644 index c3161c57275..00000000000 --- a/tests/baselines/reference/separateCompilationPlainFile-System.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/compiler/separateCompilationPlainFile-System.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. - - -==== tests/cases/compiler/separateCompilationPlainFile-System.ts (1 errors) ==== - - declare function run(a: number): void; - ~~~~~~~ -!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. - run(1); - \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationPlainFile-UMD.errors.txt b/tests/baselines/reference/separateCompilationPlainFile-UMD.errors.txt deleted file mode 100644 index 6a0fb1ac8df..00000000000 --- a/tests/baselines/reference/separateCompilationPlainFile-UMD.errors.txt +++ /dev/null @@ -1,10 +0,0 @@ -tests/cases/compiler/separateCompilationPlainFile-UMD.ts(2,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. - - -==== tests/cases/compiler/separateCompilationPlainFile-UMD.ts (1 errors) ==== - - declare function run(a: number): void; - ~~~~~~~ -!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided. - run(1); - \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSourceMap.errors.txt b/tests/baselines/reference/separateCompilationSourceMap.errors.txt deleted file mode 100644 index 5274ef3921e..00000000000 --- a/tests/baselines/reference/separateCompilationSourceMap.errors.txt +++ /dev/null @@ -1,7 +0,0 @@ -error TS5043: Option 'sourceMap' cannot be specified with option 'separateCompilation'. - - -!!! error TS5043: Option 'sourceMap' cannot be specified with option 'separateCompilation'. -==== tests/cases/compiler/separateCompilationSourceMap.ts (0 errors) ==== - - export var x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSourceMap.js b/tests/baselines/reference/separateCompilationSourceMap.js deleted file mode 100644 index 1e8f141eb47..00000000000 --- a/tests/baselines/reference/separateCompilationSourceMap.js +++ /dev/null @@ -1,7 +0,0 @@ -//// [separateCompilationSourceMap.ts] - -export var x; - -//// [separateCompilationSourceMap.js] -export var x; -//# sourceMappingURL=separateCompilationSourceMap.js.map \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSourceMap.js.map b/tests/baselines/reference/separateCompilationSourceMap.js.map deleted file mode 100644 index 68c4e2c78db..00000000000 --- a/tests/baselines/reference/separateCompilationSourceMap.js.map +++ /dev/null @@ -1,2 +0,0 @@ -//// [separateCompilationSourceMap.js.map] -{"version":3,"file":"separateCompilationSourceMap.js","sourceRoot":"","sources":["separateCompilationSourceMap.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,CAAC"} \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationSpecifiedModule.js b/tests/baselines/reference/separateCompilationSpecifiedModule.js deleted file mode 100644 index 02616b75874..00000000000 --- a/tests/baselines/reference/separateCompilationSpecifiedModule.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [separateCompilationSpecifiedModule.ts] -export var x; - -//// [separateCompilationSpecifiedModule.js] diff --git a/tests/baselines/reference/separateCompilationSpecifiedModule.symbols b/tests/baselines/reference/separateCompilationSpecifiedModule.symbols deleted file mode 100644 index a69b579b34d..00000000000 --- a/tests/baselines/reference/separateCompilationSpecifiedModule.symbols +++ /dev/null @@ -1,4 +0,0 @@ -=== tests/cases/compiler/separateCompilationSpecifiedModule.ts === -export var x; ->x : Symbol(x, Decl(separateCompilationSpecifiedModule.ts, 0, 10)) - diff --git a/tests/baselines/reference/separateCompilationSpecifiedModule.types b/tests/baselines/reference/separateCompilationSpecifiedModule.types deleted file mode 100644 index 497f63faf62..00000000000 --- a/tests/baselines/reference/separateCompilationSpecifiedModule.types +++ /dev/null @@ -1,4 +0,0 @@ -=== tests/cases/compiler/separateCompilationSpecifiedModule.ts === -export var x; ->x : any - diff --git a/tests/baselines/reference/separateCompilationUnspecifiedModule.errors.txt b/tests/baselines/reference/separateCompilationUnspecifiedModule.errors.txt deleted file mode 100644 index ab0fd7ffe9d..00000000000 --- a/tests/baselines/reference/separateCompilationUnspecifiedModule.errors.txt +++ /dev/null @@ -1,6 +0,0 @@ -error TS5047: Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher. - - -!!! error TS5047: Option 'separateCompilation' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher. -==== tests/cases/compiler/separateCompilationUnspecifiedModule.ts (0 errors) ==== - export var x; \ No newline at end of file diff --git a/tests/baselines/reference/separateCompilationUnspecifiedModule.js b/tests/baselines/reference/separateCompilationUnspecifiedModule.js deleted file mode 100644 index 1525207a93d..00000000000 --- a/tests/baselines/reference/separateCompilationUnspecifiedModule.js +++ /dev/null @@ -1,4 +0,0 @@ -//// [separateCompilationUnspecifiedModule.ts] -export var x; - -//// [separateCompilationUnspecifiedModule.js] diff --git a/tests/baselines/reference/templateStringInYieldKeyword.errors.txt b/tests/baselines/reference/templateStringInYieldKeyword.errors.txt index e6eef0a1840..5761d1464e0 100644 --- a/tests/baselines/reference/templateStringInYieldKeyword.errors.txt +++ b/tests/baselines/reference/templateStringInYieldKeyword.errors.txt @@ -1,10 +1,10 @@ -tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher. +tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher. ==== tests/cases/conformance/es6/templates/templateStringInYieldKeyword.ts (1 errors) ==== function* gen() { ~ -!!! error TS1219: Generators are only available when targeting ECMAScript 6 or higher. +!!! error TS1220: Generators are only available when targeting ECMAScript 6 or higher. // Once this is supported, the inner expression does not need to be parenthesized. var x = yield `abc${ x }def`; } diff --git a/tests/baselines/reference/yieldExpression1.errors.txt b/tests/baselines/reference/yieldExpression1.errors.txt index 22bd6387b3f..8eefb9024de 100644 --- a/tests/baselines/reference/yieldExpression1.errors.txt +++ b/tests/baselines/reference/yieldExpression1.errors.txt @@ -1,9 +1,9 @@ -tests/cases/compiler/yieldExpression1.ts(1,9): error TS1219: Generators are only available when targeting ECMAScript 6 or higher. +tests/cases/compiler/yieldExpression1.ts(1,9): error TS1220: Generators are only available when targeting ECMAScript 6 or higher. ==== tests/cases/compiler/yieldExpression1.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 } \ No newline at end of file diff --git a/tests/cases/compiler/classExpressionWithDecorator1.ts b/tests/cases/compiler/classExpressionWithDecorator1.ts index 74b49456a36..67e9c8aa6ce 100644 --- a/tests/cases/compiler/classExpressionWithDecorator1.ts +++ b/tests/cases/compiler/classExpressionWithDecorator1.ts @@ -1 +1,2 @@ +// @experimentaldecorators: true var v = @decorate class C { static p = 1 }; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationAmbientConstEnum.ts b/tests/cases/compiler/isolatedModulesAmbientConstEnum.ts similarity index 59% rename from tests/cases/compiler/separateCompilationAmbientConstEnum.ts rename to tests/cases/compiler/isolatedModulesAmbientConstEnum.ts index aaccfaaf02c..59fcdcd1fe4 100644 --- a/tests/cases/compiler/separateCompilationAmbientConstEnum.ts +++ b/tests/cases/compiler/isolatedModulesAmbientConstEnum.ts @@ -1,4 +1,4 @@ -// @separateCompilation: true +// @isolatedModules: true // @target: es6 // @filename: file1.ts diff --git a/tests/cases/compiler/separateCompilationDeclaration.ts b/tests/cases/compiler/isolatedModulesDeclaration.ts similarity index 56% rename from tests/cases/compiler/separateCompilationDeclaration.ts rename to tests/cases/compiler/isolatedModulesDeclaration.ts index 11003a19193..3d5e7db9b4f 100644 --- a/tests/cases/compiler/separateCompilationDeclaration.ts +++ b/tests/cases/compiler/isolatedModulesDeclaration.ts @@ -1,4 +1,4 @@ -// @separateCompilation: true +// @isolatedModules: true // @declaration: true // @target: es6 diff --git a/tests/cases/compiler/isolatedModulesES6.ts b/tests/cases/compiler/isolatedModulesES6.ts new file mode 100644 index 00000000000..12e8d8adb7f --- /dev/null +++ b/tests/cases/compiler/isolatedModulesES6.ts @@ -0,0 +1,4 @@ +// @isolatedModules: true +// @target: es6 +// @filename: file1.ts +export var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationImportExportElision.ts b/tests/cases/compiler/isolatedModulesImportExportElision.ts similarity index 78% rename from tests/cases/compiler/separateCompilationImportExportElision.ts rename to tests/cases/compiler/isolatedModulesImportExportElision.ts index d7af74a1a69..e50a0f8eb88 100644 --- a/tests/cases/compiler/separateCompilationImportExportElision.ts +++ b/tests/cases/compiler/isolatedModulesImportExportElision.ts @@ -1,4 +1,4 @@ -// @separateCompilation: true +// @isolatedModules: true // @target: es5 // @module: commonjs diff --git a/tests/cases/compiler/separateCompilationNoEmitOnError.ts b/tests/cases/compiler/isolatedModulesNoEmitOnError.ts similarity index 56% rename from tests/cases/compiler/separateCompilationNoEmitOnError.ts rename to tests/cases/compiler/isolatedModulesNoEmitOnError.ts index fe0f59199f6..ce3085dbc3b 100644 --- a/tests/cases/compiler/separateCompilationNoEmitOnError.ts +++ b/tests/cases/compiler/isolatedModulesNoEmitOnError.ts @@ -1,4 +1,4 @@ -// @separateCompilation: true +// @isolatedModules: true // @noEmitOnError:true // @target: es6 diff --git a/tests/cases/compiler/separateCompilationNoExternalModule.ts b/tests/cases/compiler/isolatedModulesNoExternalModule.ts similarity index 50% rename from tests/cases/compiler/separateCompilationNoExternalModule.ts rename to tests/cases/compiler/isolatedModulesNoExternalModule.ts index e66ef27c005..37b61fcbc1a 100644 --- a/tests/cases/compiler/separateCompilationNoExternalModule.ts +++ b/tests/cases/compiler/isolatedModulesNoExternalModule.ts @@ -1,4 +1,4 @@ -// @separateCompilation: true +// @isolatedModules: true // @target: es6 // @filename: file1.ts diff --git a/tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts b/tests/cases/compiler/isolatedModulesNonAmbientConstEnum.ts similarity index 61% rename from tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts rename to tests/cases/compiler/isolatedModulesNonAmbientConstEnum.ts index 5f3054238d9..d5aae618d8f 100644 --- a/tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts +++ b/tests/cases/compiler/isolatedModulesNonAmbientConstEnum.ts @@ -1,4 +1,4 @@ -// @separateCompilation: true +// @isolatedModules: true // @target: es6 // @filename: file1.ts diff --git a/tests/cases/compiler/separateCompilationOut.ts b/tests/cases/compiler/isolatedModulesOut.ts similarity index 68% rename from tests/cases/compiler/separateCompilationOut.ts rename to tests/cases/compiler/isolatedModulesOut.ts index 6c0a95f8ae5..c977a4b54da 100644 --- a/tests/cases/compiler/separateCompilationOut.ts +++ b/tests/cases/compiler/isolatedModulesOut.ts @@ -1,4 +1,4 @@ -// @separateCompilation: true +// @isolatedModules: true // @out:all.js // @target: es6 diff --git a/tests/cases/compiler/separateCompilationPlainFile-AMD.ts b/tests/cases/compiler/isolatedModulesPlainFile-AMD.ts similarity index 68% rename from tests/cases/compiler/separateCompilationPlainFile-AMD.ts rename to tests/cases/compiler/isolatedModulesPlainFile-AMD.ts index a1010ce3e8c..d28aea86250 100644 --- a/tests/cases/compiler/separateCompilationPlainFile-AMD.ts +++ b/tests/cases/compiler/isolatedModulesPlainFile-AMD.ts @@ -1,6 +1,6 @@ // @target: es5 // @module: amd -// @separateCompilation: true +// @isolatedModules: true declare function run(a: number): void; run(1); diff --git a/tests/cases/compiler/separateCompilationPlainFile-CommonJS.ts b/tests/cases/compiler/isolatedModulesPlainFile-CommonJS.ts similarity index 70% rename from tests/cases/compiler/separateCompilationPlainFile-CommonJS.ts rename to tests/cases/compiler/isolatedModulesPlainFile-CommonJS.ts index 532d97f09eb..6d07f10c4d0 100644 --- a/tests/cases/compiler/separateCompilationPlainFile-CommonJS.ts +++ b/tests/cases/compiler/isolatedModulesPlainFile-CommonJS.ts @@ -1,6 +1,6 @@ // @target: es5 // @module: commonjs -// @separateCompilation: true +// @isolatedModules: true declare function run(a: number): void; run(1); diff --git a/tests/cases/compiler/separateCompilationPlainFile-ES6.ts b/tests/cases/compiler/isolatedModulesPlainFile-ES6.ts similarity index 64% rename from tests/cases/compiler/separateCompilationPlainFile-ES6.ts rename to tests/cases/compiler/isolatedModulesPlainFile-ES6.ts index 20d4e8d79a2..051aa548149 100644 --- a/tests/cases/compiler/separateCompilationPlainFile-ES6.ts +++ b/tests/cases/compiler/isolatedModulesPlainFile-ES6.ts @@ -1,5 +1,5 @@ // @target: es6 -// @separateCompilation: true +// @isolatedModules: true declare function run(a: number): void; run(1); diff --git a/tests/cases/compiler/separateCompilationPlainFile-System.ts b/tests/cases/compiler/isolatedModulesPlainFile-System.ts similarity index 69% rename from tests/cases/compiler/separateCompilationPlainFile-System.ts rename to tests/cases/compiler/isolatedModulesPlainFile-System.ts index 69065718254..e16720596d9 100644 --- a/tests/cases/compiler/separateCompilationPlainFile-System.ts +++ b/tests/cases/compiler/isolatedModulesPlainFile-System.ts @@ -1,6 +1,6 @@ // @target: es5 // @module: system -// @separateCompilation: true +// @isolatedModules: true declare function run(a: number): void; run(1); diff --git a/tests/cases/compiler/separateCompilationPlainFile-UMD.ts b/tests/cases/compiler/isolatedModulesPlainFile-UMD.ts similarity index 68% rename from tests/cases/compiler/separateCompilationPlainFile-UMD.ts rename to tests/cases/compiler/isolatedModulesPlainFile-UMD.ts index 4ab45686c90..d452bbff96b 100644 --- a/tests/cases/compiler/separateCompilationPlainFile-UMD.ts +++ b/tests/cases/compiler/isolatedModulesPlainFile-UMD.ts @@ -1,6 +1,6 @@ // @target: es5 // @module: umd -// @separateCompilation: true +// @isolatedModules: true declare function run(a: number): void; run(1); diff --git a/tests/cases/compiler/separateCompilationSourceMap.ts b/tests/cases/compiler/isolatedModulesSourceMap.ts similarity index 55% rename from tests/cases/compiler/separateCompilationSourceMap.ts rename to tests/cases/compiler/isolatedModulesSourceMap.ts index 84c6290caf5..31dd4d9f0cf 100644 --- a/tests/cases/compiler/separateCompilationSourceMap.ts +++ b/tests/cases/compiler/isolatedModulesSourceMap.ts @@ -1,4 +1,4 @@ -// @separateCompilation: true +// @isolatedModules: true // @sourceMap:true // @target: es6 diff --git a/tests/cases/compiler/isolatedModulesSpecifiedModule.ts b/tests/cases/compiler/isolatedModulesSpecifiedModule.ts new file mode 100644 index 00000000000..0e72e6480b6 --- /dev/null +++ b/tests/cases/compiler/isolatedModulesSpecifiedModule.ts @@ -0,0 +1,4 @@ +// @isolatedModules: true +// @module: commonjs +// @filename: file1.ts +export var x; \ No newline at end of file diff --git a/tests/cases/compiler/isolatedModulesUnspecifiedModule.ts b/tests/cases/compiler/isolatedModulesUnspecifiedModule.ts new file mode 100644 index 00000000000..2435f22e952 --- /dev/null +++ b/tests/cases/compiler/isolatedModulesUnspecifiedModule.ts @@ -0,0 +1,3 @@ +// @isolatedModules: true +// @filename: file1.ts +export var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationWithDeclarationFile.ts b/tests/cases/compiler/isolatedModulesWithDeclarationFile.ts similarity index 65% rename from tests/cases/compiler/separateCompilationWithDeclarationFile.ts rename to tests/cases/compiler/isolatedModulesWithDeclarationFile.ts index 121db1702a5..01e96b4ec2a 100644 --- a/tests/cases/compiler/separateCompilationWithDeclarationFile.ts +++ b/tests/cases/compiler/isolatedModulesWithDeclarationFile.ts @@ -1,4 +1,4 @@ -// @separateCompilation: true +// @isolatedModules: true // @target: es6 // @filename: file1.d.ts diff --git a/tests/cases/compiler/noEmitHelpers2.ts b/tests/cases/compiler/noEmitHelpers2.ts index df71f4fae82..ccc17f7066e 100644 --- a/tests/cases/compiler/noEmitHelpers2.ts +++ b/tests/cases/compiler/noEmitHelpers2.ts @@ -1,4 +1,5 @@ // @noemithelpers: true +// @experimentaldecorators: true // @emitdecoratormetadata: true // @target: es5 diff --git a/tests/cases/compiler/separateCompilationES6.ts b/tests/cases/compiler/separateCompilationES6.ts deleted file mode 100644 index a2ac8c8d94e..00000000000 --- a/tests/cases/compiler/separateCompilationES6.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @separateCompilation: true -// @target: es6 -// @filename: file1.ts -export var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationSpecifiedModule.ts b/tests/cases/compiler/separateCompilationSpecifiedModule.ts deleted file mode 100644 index 6ba3a0d3bf4..00000000000 --- a/tests/cases/compiler/separateCompilationSpecifiedModule.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @separateCompilation: true -// @module: commonjs -// @filename: file1.ts -export var x; \ No newline at end of file diff --git a/tests/cases/compiler/separateCompilationUnspecifiedModule.ts b/tests/cases/compiler/separateCompilationUnspecifiedModule.ts deleted file mode 100644 index 38a3fd82868..00000000000 --- a/tests/cases/compiler/separateCompilationUnspecifiedModule.ts +++ /dev/null @@ -1,3 +0,0 @@ -// @separateCompilation: true -// @filename: file1.ts -export var x; \ No newline at end of file diff --git a/tests/cases/compiler/sourceMapValidationDecorators.ts b/tests/cases/compiler/sourceMapValidationDecorators.ts index c8bd16be80f..898d3f729b2 100644 --- a/tests/cases/compiler/sourceMapValidationDecorators.ts +++ b/tests/cases/compiler/sourceMapValidationDecorators.ts @@ -1,5 +1,6 @@ // @sourcemap: true // @target: es5 +// @experimentaldecorators: true declare function ClassDecorator1(target: Function): void; declare function ClassDecorator2(x: number): (target: Function) => void; declare function PropertyDecorator1(target: Object, key: string | symbol, descriptor?: PropertyDescriptor): void; diff --git a/tests/cases/compiler/systemModule10.ts b/tests/cases/compiler/systemModule10.ts index 49e99fb1c63..41aea2c8244 100644 --- a/tests/cases/compiler/systemModule10.ts +++ b/tests/cases/compiler/systemModule10.ts @@ -1,5 +1,5 @@ // @module: system -// @separateCompilation: true +// @isolatedModules: true import n, {x} from 'file1' import n2 = require('file2'); diff --git a/tests/cases/compiler/systemModule10_ES5.ts b/tests/cases/compiler/systemModule10_ES5.ts index 6468e4125d1..5e51b9152f8 100644 --- a/tests/cases/compiler/systemModule10_ES5.ts +++ b/tests/cases/compiler/systemModule10_ES5.ts @@ -1,6 +1,6 @@ // @target: es5 // @module: system -// @separateCompilation: true +// @isolatedModules: true import n, {x} from 'file1' import n2 = require('file2'); diff --git a/tests/cases/compiler/systemModule11.ts b/tests/cases/compiler/systemModule11.ts index 28e88688f87..15784b2f8c4 100644 --- a/tests/cases/compiler/systemModule11.ts +++ b/tests/cases/compiler/systemModule11.ts @@ -1,5 +1,5 @@ // @module: system -// @separateCompilation: true +// @isolatedModules: true // set of tests cases that checks generation of local storage for exported names diff --git a/tests/cases/compiler/systemModule9.ts b/tests/cases/compiler/systemModule9.ts index c6ff742b1bf..f124a1112c3 100644 --- a/tests/cases/compiler/systemModule9.ts +++ b/tests/cases/compiler/systemModule9.ts @@ -1,5 +1,5 @@ // @module: system -// @separateCompilation: true +// @isolatedModules: true import * as ns from 'file1'; import {a, b as c} from 'file2'; diff --git a/tests/cases/compiler/systemModuleAmbientDeclarations.ts b/tests/cases/compiler/systemModuleAmbientDeclarations.ts index 05f78592780..690d0c65c13 100644 --- a/tests/cases/compiler/systemModuleAmbientDeclarations.ts +++ b/tests/cases/compiler/systemModuleAmbientDeclarations.ts @@ -1,5 +1,5 @@ // @module: system -// @separateCompilation: true +// @isolatedModules: true // @filename: file1.ts declare class Promise { } diff --git a/tests/cases/compiler/systemModuleConstEnumsSeparateCompilation.ts b/tests/cases/compiler/systemModuleConstEnumsSeparateCompilation.ts index 2fc4707b78e..3813017639f 100644 --- a/tests/cases/compiler/systemModuleConstEnumsSeparateCompilation.ts +++ b/tests/cases/compiler/systemModuleConstEnumsSeparateCompilation.ts @@ -1,5 +1,5 @@ // @module: system -// @separateCompilation: true +// @isolatedModules: true declare function use(a: any); const enum TopLevelConstEnum { X } diff --git a/tests/cases/compiler/systemModuleDeclarationMerging.ts b/tests/cases/compiler/systemModuleDeclarationMerging.ts index 45c59c5b5dc..ae8b3a8dd0b 100644 --- a/tests/cases/compiler/systemModuleDeclarationMerging.ts +++ b/tests/cases/compiler/systemModuleDeclarationMerging.ts @@ -1,5 +1,5 @@ // @module: system -// @separateCompilation: true +// @isolatedModules: true export function F() {} export module F { var x; } diff --git a/tests/cases/compiler/systemModuleNonTopLevelModuleMembers.ts b/tests/cases/compiler/systemModuleNonTopLevelModuleMembers.ts index 756d430a2de..b5617970339 100644 --- a/tests/cases/compiler/systemModuleNonTopLevelModuleMembers.ts +++ b/tests/cases/compiler/systemModuleNonTopLevelModuleMembers.ts @@ -1,5 +1,5 @@ // @module: system -// @separateCompilation: true +// @isolatedModules: true export class TopLevelClass {} export module TopLevelModule {var v;} diff --git a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor1.ts b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor1.ts index 7e80e9e637d..19abd8231d6 100644 --- a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor1.ts +++ b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor1.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor2.ts b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor2.ts index bbe58e72eb9..5250b42929c 100644 --- a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor2.ts +++ b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor2.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts index bd1ce41bb12..4d7ccc6a825 100644 --- a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts +++ b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor3.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor4.ts b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor4.ts index 72259e5d212..35c15ae7a6f 100644 --- a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor4.ts +++ b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor4.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor5.ts b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor5.ts index ba5f82ab0ce..b32dd98ed2a 100644 --- a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor5.ts +++ b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor5.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts index 686127858b0..ffbd2713621 100644 --- a/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts +++ b/tests/cases/conformance/decorators/class/accessor/decoratorOnClassAccessor6.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/constructor/decoratorOnClassConstructor1.ts b/tests/cases/conformance/decorators/class/constructor/decoratorOnClassConstructor1.ts index 4a39536e30b..b9ee9295744 100644 --- a/tests/cases/conformance/decorators/class/constructor/decoratorOnClassConstructor1.ts +++ b/tests/cases/conformance/decorators/class/constructor/decoratorOnClassConstructor1.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter1.ts b/tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter1.ts index 3f4baabac7c..dbfd38c7896 100644 --- a/tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter1.ts +++ b/tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter1.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(target: Function, propertyKey: string | symbol, parameterIndex: number): void; class C { diff --git a/tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts b/tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts index e58771fbebb..4e0373ff5d1 100644 --- a/tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts +++ b/tests/cases/conformance/decorators/class/constructor/parameter/decoratorOnClassConstructorParameter4.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(target: Function, propertyKey: string | symbol, parameterIndex: number): void; class C { diff --git a/tests/cases/conformance/decorators/class/decoratedClassFromExternalModule.ts b/tests/cases/conformance/decorators/class/decoratedClassFromExternalModule.ts index cb622265b44..95f8bf4ab97 100644 --- a/tests/cases/conformance/decorators/class/decoratedClassFromExternalModule.ts +++ b/tests/cases/conformance/decorators/class/decoratedClassFromExternalModule.ts @@ -1,4 +1,5 @@ // @target: es6 +// @experimentaldecorators: true // @Filename: decorated.ts function decorate() { } diff --git a/tests/cases/conformance/decorators/class/decoratorChecksFunctionBodies.ts b/tests/cases/conformance/decorators/class/decoratorChecksFunctionBodies.ts index 31f5fe82551..b1cbd1a679c 100644 --- a/tests/cases/conformance/decorators/class/decoratorChecksFunctionBodies.ts +++ b/tests/cases/conformance/decorators/class/decoratorChecksFunctionBodies.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true // from #2971 function func(s: string): void { diff --git a/tests/cases/conformance/decorators/class/decoratorInstantiateModulesInFunctionBodies.ts b/tests/cases/conformance/decorators/class/decoratorInstantiateModulesInFunctionBodies.ts index 7fa7ab8dd84..9163ed0c384 100644 --- a/tests/cases/conformance/decorators/class/decoratorInstantiateModulesInFunctionBodies.ts +++ b/tests/cases/conformance/decorators/class/decoratorInstantiateModulesInFunctionBodies.ts @@ -1,5 +1,6 @@ // @target:es5 // @module:commonjs +// @experimentaldecorators: true // @filename: a.ts // from #3108 diff --git a/tests/cases/conformance/decorators/class/decoratorOnClass1.ts b/tests/cases/conformance/decorators/class/decoratorOnClass1.ts index 1d3c87e7a6a..c1a729f56f3 100644 --- a/tests/cases/conformance/decorators/class/decoratorOnClass1.ts +++ b/tests/cases/conformance/decorators/class/decoratorOnClass1.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(target: T): T; @dec diff --git a/tests/cases/conformance/decorators/class/decoratorOnClass2.ts b/tests/cases/conformance/decorators/class/decoratorOnClass2.ts index c82b9fe04a7..062ef391205 100644 --- a/tests/cases/conformance/decorators/class/decoratorOnClass2.ts +++ b/tests/cases/conformance/decorators/class/decoratorOnClass2.ts @@ -1,5 +1,6 @@ // @target:es5 // @module: commonjs +// @experimentaldecorators: true declare function dec(target: T): T; @dec diff --git a/tests/cases/conformance/decorators/class/decoratorOnClass3.ts b/tests/cases/conformance/decorators/class/decoratorOnClass3.ts index cf778380356..e410eaa1b07 100644 --- a/tests/cases/conformance/decorators/class/decoratorOnClass3.ts +++ b/tests/cases/conformance/decorators/class/decoratorOnClass3.ts @@ -1,5 +1,6 @@ // @target:es5 // @module: commonjs +// @experimentaldecorators: true declare function dec(target: T): T; export diff --git a/tests/cases/conformance/decorators/class/decoratorOnClass4.ts b/tests/cases/conformance/decorators/class/decoratorOnClass4.ts index e365df091fc..bebf595a170 100644 --- a/tests/cases/conformance/decorators/class/decoratorOnClass4.ts +++ b/tests/cases/conformance/decorators/class/decoratorOnClass4.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(): (target: T) => T; @dec() diff --git a/tests/cases/conformance/decorators/class/decoratorOnClass5.ts b/tests/cases/conformance/decorators/class/decoratorOnClass5.ts index e365df091fc..bebf595a170 100644 --- a/tests/cases/conformance/decorators/class/decoratorOnClass5.ts +++ b/tests/cases/conformance/decorators/class/decoratorOnClass5.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(): (target: T) => T; @dec() diff --git a/tests/cases/conformance/decorators/class/decoratorOnClass8.ts b/tests/cases/conformance/decorators/class/decoratorOnClass8.ts index a7227964180..bade386a56b 100644 --- a/tests/cases/conformance/decorators/class/decoratorOnClass8.ts +++ b/tests/cases/conformance/decorators/class/decoratorOnClass8.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(): (target: Function, paramIndex: number) => void; @dec() diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod1.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod1.ts index 7216be210f1..418ace9a0dc 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod1.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod1.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod10.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod10.ts index 03f75f16552..c4658cc6405 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod10.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod10.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(target: Function, paramIndex: number): void; class C { diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts index 6f80fa00bca..058f8134880 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod11.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true module M { class C { decorator(target: Object, key: string): void { } diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts index a9a2607c39b..9af80e32c46 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod12.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true module M { class S { decorator(target: Object, key: string): void { } diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts index df0b847e99d..f41481d4ad0 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod13.ts @@ -1,4 +1,5 @@ // @target: ES6 +// @experimentaldecorators: true declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod2.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod2.ts index 7b7f089e4d4..8305ed1a448 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod2.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod2.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts index aa80151cf83..b951bd5c8c9 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod3.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod4.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod4.ts index 92b35ae6189..3d3ff2c8785 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod4.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod4.ts @@ -1,4 +1,5 @@ // @target: ES6 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod5.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod5.ts index cd891b4231b..d91d4331ce0 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod5.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod5.ts @@ -1,4 +1,5 @@ // @target: ES6 +// @experimentaldecorators: true declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts index a1fa7005892..b3cd6ee75d4 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod6.ts @@ -1,4 +1,5 @@ // @target: ES6 +// @experimentaldecorators: true declare function dec(): (target: any, propertyKey: string, descriptor: TypedPropertyDescriptor) => TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod7.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod7.ts index 4bf86aa4995..16915e9aaab 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod7.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod7.ts @@ -1,4 +1,5 @@ // @target: ES6 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string, descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor; class C { diff --git a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts index 9bd2c192c2d..73f58809420 100644 --- a/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts +++ b/tests/cases/conformance/decorators/class/method/decoratorOnClassMethod8.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(target: T): T; class C { diff --git a/tests/cases/conformance/decorators/class/method/parameter/decoratorOnClassMethodParameter1.ts b/tests/cases/conformance/decorators/class/method/parameter/decoratorOnClassMethodParameter1.ts index e525933fb6a..18a7fff6dd0 100644 --- a/tests/cases/conformance/decorators/class/method/parameter/decoratorOnClassMethodParameter1.ts +++ b/tests/cases/conformance/decorators/class/method/parameter/decoratorOnClassMethodParameter1.ts @@ -1,4 +1,5 @@ // @target:es5 +// @experimentaldecorators: true declare function dec(target: Function, propertyKey: string | symbol, parameterIndex: number): void; class C { diff --git a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty1.ts b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty1.ts index 0d8fd82225d..026949fb5b8 100644 --- a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty1.ts +++ b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty1.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string): void; class C { diff --git a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty10.ts b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty10.ts index 4be77035692..2b10c0aec08 100644 --- a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty10.ts +++ b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty10.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(): (target: any, propertyKey: string) => void; class C { diff --git a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts index 60ea10189e2..eb720b20dff 100644 --- a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts +++ b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty11.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(): (target: any, propertyKey: string) => void; class C { diff --git a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty2.ts b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty2.ts index dc2886e7dbd..01af3e6ee81 100644 --- a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty2.ts +++ b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty2.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string): void; class C { diff --git a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts index cf58b4b71ec..55fd6fe93e1 100644 --- a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts +++ b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty3.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(target: any, propertyKey: string): void; class C { diff --git a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty6.ts b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty6.ts index 1dd184419af..412a592ece1 100644 --- a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty6.ts +++ b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty6.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(target: Function): void; class C { diff --git a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty7.ts b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty7.ts index d82ca6eb2eb..0e11e103ce7 100644 --- a/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty7.ts +++ b/tests/cases/conformance/decorators/class/property/decoratorOnClassProperty7.ts @@ -1,4 +1,5 @@ // @target: ES5 +// @experimentaldecorators: true declare function dec(target: Function, propertyKey: string | symbol, paramIndex: number): void; class C { diff --git a/tests/cases/conformance/decorators/missingDecoratorType.ts b/tests/cases/conformance/decorators/missingDecoratorType.ts index 1407e00b7a3..905edaf0756 100644 --- a/tests/cases/conformance/decorators/missingDecoratorType.ts +++ b/tests/cases/conformance/decorators/missingDecoratorType.ts @@ -1,4 +1,5 @@ -// @target: ES5 +// @target: ES5 +// @experimentaldecorators: true // @noLib: true // @Filename: a.ts @@ -11,8 +12,7 @@ interface Function { } interface RegExp { } interface IArguments { } -// @Filename: b.ts -/// +// @Filename: b.ts declare var dec: any; @dec diff --git a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts index 3e7c3d0ca85..e409029276b 100644 --- a/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts +++ b/tests/cases/fourslash/getJavaScriptSyntacticDiagnostics1.ts @@ -14,6 +14,6 @@ verify.getSyntacticDiagnostics(`[ "start": 26, "length": 4, "category": "error", - "code": 1222 + "code": 1223 } ]`); \ No newline at end of file