mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #3208 from Microsoft/updateSingleCompilationFlagName
Update singleCompilation flag name to isolatedModules
This commit is contained in:
@@ -732,7 +732,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) {
|
||||
@@ -8889,7 +8889,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;
|
||||
}
|
||||
@@ -10054,7 +10054,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);
|
||||
}
|
||||
@@ -10470,8 +10470,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:
|
||||
@@ -10561,7 +10561,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)) {
|
||||
@@ -11661,7 +11661,7 @@ module ts {
|
||||
|
||||
function isAliasResolvedToValue(symbol: Symbol): boolean {
|
||||
let target = resolveAlias(symbol);
|
||||
if (target === unknownSymbol && compilerOptions.separateCompilation) {
|
||||
if (target === unknownSymbol && compilerOptions.isolatedModules) {
|
||||
return true;
|
||||
}
|
||||
// const enums and modules that contain only const enums are not considered values from the emit perespective
|
||||
|
||||
@@ -142,7 +142,7 @@ module ts {
|
||||
paramType: Diagnostics.LOCATION,
|
||||
},
|
||||
{
|
||||
name: "separateCompilation",
|
||||
name: "isolatedModules",
|
||||
type: "boolean",
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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" },
|
||||
@@ -449,11 +449,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'." },
|
||||
|
||||
@@ -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
|
||||
},
|
||||
@@ -1785,23 +1785,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
|
||||
},
|
||||
|
||||
@@ -1717,7 +1717,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;
|
||||
}
|
||||
@@ -4368,7 +4368,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) {
|
||||
@@ -4473,7 +4473,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) {
|
||||
@@ -5682,7 +5682,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);
|
||||
}
|
||||
|
||||
@@ -529,21 +529,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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,15 +580,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) {
|
||||
|
||||
@@ -1676,7 +1676,7 @@ module ts {
|
||||
target?: ScriptTarget;
|
||||
version?: boolean;
|
||||
watch?: boolean;
|
||||
separateCompilation?: boolean;
|
||||
isolatedModules?: boolean;
|
||||
emitDecoratorMetadata?: boolean;
|
||||
/* @internal */ stripInternal?: boolean;
|
||||
[option: string]: string | number | boolean;
|
||||
|
||||
@@ -1438,7 +1438,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;
|
||||
}
|
||||
|
||||
@@ -45,10 +45,10 @@ module Utils {
|
||||
export function getExecutionEnvironment() {
|
||||
if (typeof WScript !== "undefined" && typeof ActiveXObject === "function") {
|
||||
return ExecutionEnvironment.CScript;
|
||||
} else if (typeof window !== "undefined") {
|
||||
} else if (typeof window !== "undefined") {
|
||||
return ExecutionEnvironment.Browser;
|
||||
} else {
|
||||
return ExecutionEnvironment.Node;
|
||||
} else {
|
||||
return ExecutionEnvironment.Node;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1092,8 +1092,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':
|
||||
@@ -1509,7 +1509,7 @@ module Harness {
|
||||
"noimplicitany", "noresolve", "newline", "normalizenewline", "emitbom",
|
||||
"errortruncation", "usecasesensitivefilenames", "preserveconstenums",
|
||||
"includebuiltfile", "suppressimplicitanyindexerrors", "stripinternal",
|
||||
"separatecompilation", "inlinesourcemap", "maproot", "sourceroot",
|
||||
"isolatedmodules", "inlinesourcemap", "maproot", "sourceroot",
|
||||
"inlinesources", "emitdecoratormetadata"];
|
||||
|
||||
function extractCompilerSettings(content: string): CompilerSetting[] {
|
||||
|
||||
@@ -1761,13 +1761,13 @@ module ts {
|
||||
* This function will compile source text from 'input' argument using specified compiler options.
|
||||
* If not options are provided - it will use a set of default compiler options.
|
||||
* Extra compiler options that will unconditionally be used bu this function are:
|
||||
* - separateCompilation = true
|
||||
* - isolatedModules = true
|
||||
* - allowNonTsExtensions = true
|
||||
*/
|
||||
export function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[]): string {
|
||||
let options = compilerOptions ? clone(compilerOptions) : getDefaultCompilerOptions();
|
||||
|
||||
options.separateCompilation = true;
|
||||
options.isolatedModules = true;
|
||||
|
||||
// Filename can be non-ts file.
|
||||
options.allowNonTsExtensions = true;
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesAmbientConstEnum.ts(3,20): error TS1209: Ambient const enums are not allowed when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesAmbientConstEnum.ts (1 errors) ====
|
||||
|
||||
|
||||
declare const enum E { X = 1}
|
||||
~
|
||||
!!! error TS1209: Ambient const enums are not allowed when the '--isolatedModules' flag is provided.
|
||||
export var y;
|
||||
@@ -0,0 +1,8 @@
|
||||
//// [isolatedModulesAmbientConstEnum.ts]
|
||||
|
||||
|
||||
declare const enum E { X = 1}
|
||||
export var y;
|
||||
|
||||
//// [isolatedModulesAmbientConstEnum.js]
|
||||
export var y;
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
error TS5044: Option 'declaration' cannot be specified with option 'separateCompilation'.
|
||||
error TS5044: Option 'declaration' cannot be specified with option 'isolatedModules'.
|
||||
|
||||
|
||||
!!! error TS5044: Option 'declaration' cannot be specified with option 'separateCompilation'.
|
||||
==== tests/cases/compiler/separateCompilationDeclaration.ts (0 errors) ====
|
||||
!!! error TS5044: Option 'declaration' cannot be specified with option 'isolatedModules'.
|
||||
==== tests/cases/compiler/isolatedModulesDeclaration.ts (0 errors) ====
|
||||
|
||||
export var x;
|
||||
@@ -0,0 +1,10 @@
|
||||
//// [isolatedModulesDeclaration.ts]
|
||||
|
||||
export var x;
|
||||
|
||||
//// [isolatedModulesDeclaration.js]
|
||||
export var x;
|
||||
|
||||
|
||||
//// [isolatedModulesDeclaration.d.ts]
|
||||
export declare var x: any;
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [isolatedModulesES6.ts]
|
||||
export var x;
|
||||
|
||||
//// [isolatedModulesES6.js]
|
||||
export var x;
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/isolatedModulesES6.ts ===
|
||||
export var x;
|
||||
>x : Symbol(x, Decl(isolatedModulesES6.ts, 0, 10))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/isolatedModulesES6.ts ===
|
||||
export var x;
|
||||
>x : any
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
tests/cases/compiler/isolatedModulesImportExportElision.ts(2,17): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/isolatedModulesImportExportElision.ts(3,18): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/isolatedModulesImportExportElision.ts(4,21): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/isolatedModulesImportExportElision.ts(12,18): error TS2307: Cannot find module 'module'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesImportExportElision.ts (4 errors) ====
|
||||
|
||||
import {c} from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
import {c2} from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
import * as ns from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
|
||||
class C extends c2.C {
|
||||
}
|
||||
|
||||
let x = new c();
|
||||
let y = ns.value;
|
||||
|
||||
export {c1} from "module";
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
export var z = x;
|
||||
+2
-2
@@ -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; }
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
error TS5045: Option 'noEmitOnError' cannot be specified with option 'separateCompilation'.
|
||||
error TS5045: Option 'noEmitOnError' cannot be specified with option 'isolatedModules'.
|
||||
|
||||
|
||||
!!! error TS5045: Option 'noEmitOnError' cannot be specified with option 'separateCompilation'.
|
||||
==== tests/cases/compiler/separateCompilationNoEmitOnError.ts (0 errors) ====
|
||||
!!! error TS5045: Option 'noEmitOnError' cannot be specified with option 'isolatedModules'.
|
||||
==== tests/cases/compiler/isolatedModulesNoEmitOnError.ts (0 errors) ====
|
||||
|
||||
export var x;
|
||||
@@ -0,0 +1,8 @@
|
||||
tests/cases/compiler/isolatedModulesNoExternalModule.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesNoExternalModule.ts (1 errors) ====
|
||||
|
||||
var x;
|
||||
~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
@@ -0,0 +1,6 @@
|
||||
//// [isolatedModulesNoExternalModule.ts]
|
||||
|
||||
var x;
|
||||
|
||||
//// [isolatedModulesNoExternalModule.js]
|
||||
var x;
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
//// [separateCompilationNonAmbientConstEnum.ts]
|
||||
//// [isolatedModulesNonAmbientConstEnum.ts]
|
||||
|
||||
const enum E { X = 100 };
|
||||
var e = E.X;
|
||||
export var x;
|
||||
|
||||
//// [separateCompilationNonAmbientConstEnum.js]
|
||||
//// [isolatedModulesNonAmbientConstEnum.js]
|
||||
var E;
|
||||
(function (E) {
|
||||
E[E["X"] = 100] = "X";
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/isolatedModulesNonAmbientConstEnum.ts ===
|
||||
|
||||
const enum E { X = 100 };
|
||||
>E : Symbol(E, Decl(isolatedModulesNonAmbientConstEnum.ts, 0, 0))
|
||||
>X : Symbol(E.X, Decl(isolatedModulesNonAmbientConstEnum.ts, 1, 14))
|
||||
|
||||
var e = E.X;
|
||||
>e : Symbol(e, Decl(isolatedModulesNonAmbientConstEnum.ts, 2, 3))
|
||||
>E.X : Symbol(E.X, Decl(isolatedModulesNonAmbientConstEnum.ts, 1, 14))
|
||||
>E : Symbol(E, Decl(isolatedModulesNonAmbientConstEnum.ts, 0, 0))
|
||||
>X : Symbol(E.X, Decl(isolatedModulesNonAmbientConstEnum.ts, 1, 14))
|
||||
|
||||
export var x;
|
||||
>x : Symbol(x, Decl(isolatedModulesNonAmbientConstEnum.ts, 3, 10))
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
=== tests/cases/compiler/separateCompilationNonAmbientConstEnum.ts ===
|
||||
=== tests/cases/compiler/isolatedModulesNonAmbientConstEnum.ts ===
|
||||
|
||||
const enum E { X = 100 };
|
||||
>E : E
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
error TS5046: Option 'out' cannot be specified with option 'separateCompilation'.
|
||||
tests/cases/compiler/file2.ts(1,1): error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided.
|
||||
error TS5046: Option 'out' cannot be specified with option 'isolatedModules'.
|
||||
tests/cases/compiler/file2.ts(1,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
!!! error TS5046: Option 'out' cannot be specified with option 'separateCompilation'.
|
||||
!!! error TS5046: Option 'out' cannot be specified with option 'isolatedModules'.
|
||||
==== tests/cases/compiler/file1.ts (0 errors) ====
|
||||
|
||||
export var x;
|
||||
==== tests/cases/compiler/file2.ts (1 errors) ====
|
||||
var y;
|
||||
~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--separateCompilation' flag is provided.
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//// [tests/cases/compiler/separateCompilationOut.ts] ////
|
||||
//// [tests/cases/compiler/isolatedModulesOut.ts] ////
|
||||
|
||||
//// [file1.ts]
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesPlainFile-AMD.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesPlainFile-AMD.ts (1 errors) ====
|
||||
|
||||
declare function run(a: number): void;
|
||||
~~~~~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
run(1);
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
//// [separateCompilationPlainFile-AMD.ts]
|
||||
//// [isolatedModulesPlainFile-AMD.ts]
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
|
||||
|
||||
//// [separateCompilationPlainFile-AMD.js]
|
||||
//// [isolatedModulesPlainFile-AMD.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
run(1);
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesPlainFile-CommonJS.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesPlainFile-CommonJS.ts (1 errors) ====
|
||||
|
||||
declare function run(a: number): void;
|
||||
~~~~~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
run(1);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
//// [isolatedModulesPlainFile-CommonJS.ts]
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
|
||||
|
||||
//// [isolatedModulesPlainFile-CommonJS.js]
|
||||
run(1);
|
||||
@@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesPlainFile-ES6.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesPlainFile-ES6.ts (1 errors) ====
|
||||
|
||||
declare function run(a: number): void;
|
||||
~~~~~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
run(1);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
//// [isolatedModulesPlainFile-ES6.ts]
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
|
||||
|
||||
//// [isolatedModulesPlainFile-ES6.js]
|
||||
run(1);
|
||||
@@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesPlainFile-System.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesPlainFile-System.ts (1 errors) ====
|
||||
|
||||
declare function run(a: number): void;
|
||||
~~~~~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
run(1);
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
//// [separateCompilationPlainFile-System.ts]
|
||||
//// [isolatedModulesPlainFile-System.ts]
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
|
||||
|
||||
//// [separateCompilationPlainFile-System.js]
|
||||
//// [isolatedModulesPlainFile-System.js]
|
||||
System.register([], function(exports_1) {
|
||||
return {
|
||||
setters:[],
|
||||
@@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/isolatedModulesPlainFile-UMD.ts(2,1): error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/isolatedModulesPlainFile-UMD.ts (1 errors) ====
|
||||
|
||||
declare function run(a: number): void;
|
||||
~~~~~~~
|
||||
!!! error TS1208: Cannot compile namespaces when the '--isolatedModules' flag is provided.
|
||||
run(1);
|
||||
|
||||
+2
-2
@@ -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;
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
error TS5043: Option 'sourceMap' cannot be specified with option 'separateCompilation'.
|
||||
error TS5043: Option 'sourceMap' cannot be specified with option 'isolatedModules'.
|
||||
|
||||
|
||||
!!! error TS5043: Option 'sourceMap' cannot be specified with option 'separateCompilation'.
|
||||
==== tests/cases/compiler/separateCompilationSourceMap.ts (0 errors) ====
|
||||
!!! error TS5043: Option 'sourceMap' cannot be specified with option 'isolatedModules'.
|
||||
==== tests/cases/compiler/isolatedModulesSourceMap.ts (0 errors) ====
|
||||
|
||||
export var x;
|
||||
@@ -0,0 +1,7 @@
|
||||
//// [isolatedModulesSourceMap.ts]
|
||||
|
||||
export var x;
|
||||
|
||||
//// [isolatedModulesSourceMap.js]
|
||||
export var x;
|
||||
//# sourceMappingURL=isolatedModulesSourceMap.js.map
|
||||
@@ -0,0 +1,2 @@
|
||||
//// [isolatedModulesSourceMap.js.map]
|
||||
{"version":3,"file":"isolatedModulesSourceMap.js","sourceRoot":"","sources":["isolatedModulesSourceMap.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,CAAC"}
|
||||
+7
-7
@@ -1,19 +1,19 @@
|
||||
===================================================================
|
||||
JsFile: separateCompilationSourceMap.js
|
||||
mapUrl: separateCompilationSourceMap.js.map
|
||||
JsFile: isolatedModulesSourceMap.js
|
||||
mapUrl: isolatedModulesSourceMap.js.map
|
||||
sourceRoot:
|
||||
sources: separateCompilationSourceMap.ts
|
||||
sources: isolatedModulesSourceMap.ts
|
||||
===================================================================
|
||||
-------------------------------------------------------------------
|
||||
emittedFile:tests/cases/compiler/separateCompilationSourceMap.js
|
||||
sourceFile:separateCompilationSourceMap.ts
|
||||
emittedFile:tests/cases/compiler/isolatedModulesSourceMap.js
|
||||
sourceFile:isolatedModulesSourceMap.ts
|
||||
-------------------------------------------------------------------
|
||||
>>>export var x;
|
||||
1 >
|
||||
2 >^^^^^^^^^^^
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 >export var
|
||||
@@ -24,4 +24,4 @@ sourceFile:separateCompilationSourceMap.ts
|
||||
3 >Emitted(1, 13) Source(2, 13) + SourceIndex(0)
|
||||
4 >Emitted(1, 14) Source(2, 14) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=separateCompilationSourceMap.js.map
|
||||
>>>//# sourceMappingURL=isolatedModulesSourceMap.js.map
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [isolatedModulesSpecifiedModule.ts]
|
||||
export var x;
|
||||
|
||||
//// [isolatedModulesSpecifiedModule.js]
|
||||
exports.x;
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/isolatedModulesSpecifiedModule.ts ===
|
||||
export var x;
|
||||
>x : Symbol(x, Decl(isolatedModulesSpecifiedModule.ts, 0, 10))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/isolatedModulesSpecifiedModule.ts ===
|
||||
export var x;
|
||||
>x : any
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
error TS5047: Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.
|
||||
|
||||
|
||||
!!! error TS5047: Option 'isolatedModules' can only be used when either option'--module' is provided or option 'target' is 'ES6' or higher.
|
||||
==== tests/cases/compiler/isolatedModulesUnspecifiedModule.ts (0 errors) ====
|
||||
export var x;
|
||||
@@ -0,0 +1,5 @@
|
||||
//// [isolatedModulesUnspecifiedModule.ts]
|
||||
export var x;
|
||||
|
||||
//// [isolatedModulesUnspecifiedModule.js]
|
||||
exports.x;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//// [tests/cases/compiler/separateCompilationWithDeclarationFile.ts] ////
|
||||
//// [tests/cases/compiler/isolatedModulesWithDeclarationFile.ts] ////
|
||||
|
||||
//// [file1.d.ts]
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
tests/cases/compiler/separateCompilationAmbientConstEnum.ts(3,20): error TS1209: Ambient const enums are not allowed when the '--separateCompilation' flag is provided.
|
||||
|
||||
|
||||
==== tests/cases/compiler/separateCompilationAmbientConstEnum.ts (1 errors) ====
|
||||
|
||||
|
||||
declare const enum E { X = 1}
|
||||
~
|
||||
!!! error TS1209: Ambient const enums are not allowed when the '--separateCompilation' flag is provided.
|
||||
export var y;
|
||||
@@ -1,8 +0,0 @@
|
||||
//// [separateCompilationAmbientConstEnum.ts]
|
||||
|
||||
|
||||
declare const enum E { X = 1}
|
||||
export var y;
|
||||
|
||||
//// [separateCompilationAmbientConstEnum.js]
|
||||
export var y;
|
||||
@@ -1,10 +0,0 @@
|
||||
//// [separateCompilationDeclaration.ts]
|
||||
|
||||
export var x;
|
||||
|
||||
//// [separateCompilationDeclaration.js]
|
||||
export var x;
|
||||
|
||||
|
||||
//// [separateCompilationDeclaration.d.ts]
|
||||
export declare var x: any;
|
||||
@@ -1,5 +0,0 @@
|
||||
//// [separateCompilationES6.ts]
|
||||
export var x;
|
||||
|
||||
//// [separateCompilationES6.js]
|
||||
export var x;
|
||||
@@ -1,4 +0,0 @@
|
||||
=== tests/cases/compiler/separateCompilationES6.ts ===
|
||||
export var x;
|
||||
>x : Symbol(x, Decl(separateCompilationES6.ts, 0, 10))
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
=== tests/cases/compiler/separateCompilationES6.ts ===
|
||||
export var x;
|
||||
>x : any
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
tests/cases/compiler/separateCompilationImportExportElision.ts(2,17): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/separateCompilationImportExportElision.ts(3,18): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/separateCompilationImportExportElision.ts(4,21): error TS2307: Cannot find module 'module'.
|
||||
tests/cases/compiler/separateCompilationImportExportElision.ts(12,18): error TS2307: Cannot find module 'module'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/separateCompilationImportExportElision.ts (4 errors) ====
|
||||
|
||||
import {c} from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
import {c2} from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
import * as ns from "module"
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
|
||||
class C extends c2.C {
|
||||
}
|
||||
|
||||
let x = new c();
|
||||
let y = ns.value;
|
||||
|
||||
export {c1} from "module";
|
||||
~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'module'.
|
||||
export var z = x;
|
||||
@@ -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.
|
||||
@@ -1,6 +0,0 @@
|
||||
//// [separateCompilationNoExternalModule.ts]
|
||||
|
||||
var x;
|
||||
|
||||
//// [separateCompilationNoExternalModule.js]
|
||||
var x;
|
||||
@@ -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))
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
//// [separateCompilationPlainFile-CommonJS.ts]
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
|
||||
|
||||
//// [separateCompilationPlainFile-CommonJS.js]
|
||||
run(1);
|
||||
@@ -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);
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
//// [separateCompilationPlainFile-ES6.ts]
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
|
||||
|
||||
//// [separateCompilationPlainFile-ES6.js]
|
||||
run(1);
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
//// [separateCompilationSourceMap.ts]
|
||||
|
||||
export var x;
|
||||
|
||||
//// [separateCompilationSourceMap.js]
|
||||
export var x;
|
||||
//# sourceMappingURL=separateCompilationSourceMap.js.map
|
||||
@@ -1,2 +0,0 @@
|
||||
//// [separateCompilationSourceMap.js.map]
|
||||
{"version":3,"file":"separateCompilationSourceMap.js","sourceRoot":"","sources":["separateCompilationSourceMap.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,CAAC"}
|
||||
@@ -1,5 +0,0 @@
|
||||
//// [separateCompilationSpecifiedModule.ts]
|
||||
export var x;
|
||||
|
||||
//// [separateCompilationSpecifiedModule.js]
|
||||
exports.x;
|
||||
@@ -1,4 +0,0 @@
|
||||
=== tests/cases/compiler/separateCompilationSpecifiedModule.ts ===
|
||||
export var x;
|
||||
>x : Symbol(x, Decl(separateCompilationSpecifiedModule.ts, 0, 10))
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
=== tests/cases/compiler/separateCompilationSpecifiedModule.ts ===
|
||||
export var x;
|
||||
>x : any
|
||||
|
||||
@@ -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;
|
||||
@@ -1,5 +0,0 @@
|
||||
//// [separateCompilationUnspecifiedModule.ts]
|
||||
export var x;
|
||||
|
||||
//// [separateCompilationUnspecifiedModule.js]
|
||||
exports.x;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @target: es6
|
||||
|
||||
// @filename: file1.ts
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @declaration: true
|
||||
// @target: es6
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @target: es6
|
||||
// @filename: file1.ts
|
||||
export var x;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @target: es5
|
||||
// @module: commonjs
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @noEmitOnError:true
|
||||
// @target: es6
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @target: es6
|
||||
|
||||
// @filename: file1.ts
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @target: es6
|
||||
|
||||
// @filename: file1.ts
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @out:all.js
|
||||
// @target: es6
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// @target: es5
|
||||
// @module: amd
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// @target: es5
|
||||
// @module: commonjs
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// @target: es6
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// @target: es5
|
||||
// @module: system
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// @target: es5
|
||||
// @module: umd
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
|
||||
declare function run(a: number): void;
|
||||
run(1);
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @sourceMap:true
|
||||
// @target: es6
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @module: commonjs
|
||||
// @filename: file1.ts
|
||||
export var x;
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @filename: file1.ts
|
||||
export var x;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
// @target: es6
|
||||
|
||||
// @filename: file1.d.ts
|
||||
@@ -1,5 +1,5 @@
|
||||
// @module: system
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
|
||||
import n, {x} from 'file1'
|
||||
import n2 = require('file2');
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @target: es5
|
||||
// @module: system
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
|
||||
import n, {x} from 'file1'
|
||||
import n2 = require('file2');
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// @module: system
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
|
||||
// set of tests cases that checks generation of local storage for exported names
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// @module: system
|
||||
// @separateCompilation: true
|
||||
// @isolatedModules: true
|
||||
|
||||
import * as ns from 'file1';
|
||||
import {a, b as c} from 'file2';
|
||||
|
||||
Reference in New Issue
Block a user