mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
Merge pull request #7016 from Microsoft/CommonJSDefault
Make CommonJS the default (and some default "exclude" values).
This commit is contained in:
commit
1173473e3c
120 files changed
+1406
-605
No files matched your search
@@ -49,7 +49,7 @@ namespace ts {
|
||||
|
||||
const compilerOptions = host.getCompilerOptions();
|
||||
const languageVersion = compilerOptions.target || ScriptTarget.ES3;
|
||||
const modulekind = compilerOptions.module ? compilerOptions.module : languageVersion === ScriptTarget.ES6 ? ModuleKind.ES6 : ModuleKind.None;
|
||||
const modulekind = getEmitModuleKind(compilerOptions);
|
||||
const allowSyntheticDefaultImports = typeof compilerOptions.allowSyntheticDefaultImports !== "undefined" ? compilerOptions.allowSyntheticDefaultImports : modulekind === ModuleKind.System;
|
||||
|
||||
const emitResolver = createResolver();
|
||||
|
||||
@@ -78,6 +78,7 @@ namespace ts {
|
||||
name: "module",
|
||||
shortName: "m",
|
||||
type: {
|
||||
"none": ModuleKind.None,
|
||||
"commonjs": ModuleKind.CommonJS,
|
||||
"amd": ModuleKind.AMD,
|
||||
"system": ModuleKind.System,
|
||||
@@ -87,7 +88,7 @@ namespace ts {
|
||||
},
|
||||
description: Diagnostics.Specify_module_code_generation_Colon_commonjs_amd_system_umd_or_es2015,
|
||||
paramType: Diagnostics.KIND,
|
||||
error: Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_umd_or_es2015
|
||||
error: Diagnostics.Argument_for_module_option_must_be_commonjs_amd_system_umd_es2015_or_none
|
||||
},
|
||||
{
|
||||
name: "newLine",
|
||||
@@ -525,7 +526,21 @@ namespace ts {
|
||||
}
|
||||
else {
|
||||
const filesSeen: Map<boolean> = {};
|
||||
const exclude = json["exclude"] instanceof Array ? map(<string[]>json["exclude"], normalizeSlashes) : undefined;
|
||||
|
||||
let exclude: string[] = [];
|
||||
if (json["exclude"] instanceof Array) {
|
||||
exclude = json["exclude"];
|
||||
}
|
||||
else {
|
||||
// by default exclude node_modules, and any specificied output directory
|
||||
exclude = ["node_modules"];
|
||||
const outDir = json["compilerOptions"] && json["compilerOptions"]["outDir"];
|
||||
if (outDir) {
|
||||
exclude.push(outDir);
|
||||
}
|
||||
}
|
||||
exclude = map(exclude, normalizeSlashes);
|
||||
|
||||
const supportedExtensions = getSupportedExtensions(options);
|
||||
Debug.assert(indexOf(supportedExtensions, ".ts") < indexOf(supportedExtensions, ".d.ts"), "Changed priority of extensions to pick");
|
||||
|
||||
@@ -539,6 +554,11 @@ namespace ts {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip over any minified JavaScript files (ending in ".min.js")
|
||||
if (/\.min\.js$/.test(fileName)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// If this is one of the output extension (which would be .d.ts and .js if we are allowing compilation of js files)
|
||||
// do not include this file if we included .ts or .tsx file with same base name as it could be output of the earlier compilation
|
||||
if (extension === ".d.ts" || (options.allowJs && contains(supportedJavascriptExtensions, extension))) {
|
||||
@@ -562,7 +582,6 @@ namespace ts {
|
||||
const errors: Diagnostic[] = [];
|
||||
|
||||
if (configFileName && getBaseFileName(configFileName) === "jsconfig.json") {
|
||||
options.module = ModuleKind.CommonJS;
|
||||
options.allowJs = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -439,7 +439,7 @@
|
||||
"category": "Error",
|
||||
"code": 1147
|
||||
},
|
||||
"Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.": {
|
||||
"Cannot compile modules unless the '--module' flag is provided with a valid module type. Consider setting the 'module' compiler option in a 'tsconfig.json' file.": {
|
||||
"category": "Error",
|
||||
"code": 1148
|
||||
},
|
||||
@@ -2171,7 +2171,7 @@
|
||||
"category": "Error",
|
||||
"code": 5059
|
||||
},
|
||||
|
||||
|
||||
|
||||
"Concatenate and emit output to single file.": {
|
||||
"category": "Message",
|
||||
@@ -2305,7 +2305,7 @@
|
||||
"category": "Error",
|
||||
"code": 6045
|
||||
},
|
||||
"Argument for '--module' option must be 'commonjs', 'amd', 'system', 'umd', or 'es2015'.": {
|
||||
"Argument for '--module' option must be 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'none'.": {
|
||||
"category": "Error",
|
||||
"code": 6046
|
||||
},
|
||||
|
||||
@@ -1290,7 +1290,7 @@ namespace ts {
|
||||
|
||||
const firstExternalModuleSourceFile = forEach(files, f => isExternalModule(f) ? f : undefined);
|
||||
if (options.isolatedModules) {
|
||||
if (!options.module && languageVersion < ScriptTarget.ES6) {
|
||||
if (options.module === ModuleKind.None && languageVersion < ScriptTarget.ES6) {
|
||||
programDiagnostics.add(createCompilerDiagnostic(Diagnostics.Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher));
|
||||
}
|
||||
|
||||
@@ -1300,10 +1300,10 @@ namespace ts {
|
||||
programDiagnostics.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) {
|
||||
else if (firstExternalModuleSourceFile && languageVersion < ScriptTarget.ES6 && options.module === ModuleKind.None) {
|
||||
// We cannot use createDiagnosticFromNode because nodes do not have parents yet
|
||||
const span = getErrorSpanForNode(firstExternalModuleSourceFile, firstExternalModuleSourceFile.externalModuleIndicator);
|
||||
programDiagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file));
|
||||
programDiagnostics.add(createFileDiagnostic(firstExternalModuleSourceFile, span.start, span.length, Diagnostics.Cannot_compile_modules_unless_the_module_flag_is_provided_with_a_valid_module_type_Consider_setting_the_module_compiler_option_in_a_tsconfig_json_file));
|
||||
}
|
||||
|
||||
// Cannot specify module gen target of es6 when below es6
|
||||
|
||||
+1
-1
@@ -376,7 +376,7 @@ namespace ts {
|
||||
sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
return;
|
||||
}
|
||||
const configParseResult = parseJsonConfigFileContent(configObject, sys, getDirectoryPath(configFileName), commandLine.options);
|
||||
const configParseResult = parseJsonConfigFileContent(configObject, sys, getDirectoryPath(configFileName), commandLine.options, configFileName);
|
||||
if (configParseResult.errors.length > 0) {
|
||||
reportDiagnostics(configParseResult.errors, /* compilerHost */ undefined);
|
||||
sys.exit(ExitStatus.DiagnosticsPresent_OutputsSkipped);
|
||||
|
||||
@@ -2011,9 +2011,9 @@ namespace ts {
|
||||
}
|
||||
|
||||
export function getEmitModuleKind(compilerOptions: CompilerOptions) {
|
||||
return compilerOptions.module ?
|
||||
return typeof compilerOptions.module === "number" ?
|
||||
compilerOptions.module :
|
||||
getEmitScriptTarget(compilerOptions) === ScriptTarget.ES6 ? ModuleKind.ES6 : ModuleKind.None;
|
||||
getEmitScriptTarget(compilerOptions) === ScriptTarget.ES6 ? ModuleKind.ES6 : ModuleKind.CommonJS;
|
||||
}
|
||||
|
||||
export interface EmitFileNames {
|
||||
|
||||
@@ -974,7 +974,6 @@ namespace Harness {
|
||||
|
||||
const options: ts.CompilerOptions & HarnessOptions = compilerOptions ? ts.clone(compilerOptions) : { noResolve: false };
|
||||
options.target = options.target || ts.ScriptTarget.ES3;
|
||||
options.module = options.module || ts.ModuleKind.None;
|
||||
options.newLine = options.newLine || ts.NewLineKind.CarriageReturnLineFeed;
|
||||
options.noErrorTruncation = true;
|
||||
options.skipDefaultLibCheck = true;
|
||||
|
||||
@@ -1712,7 +1712,6 @@ namespace ts {
|
||||
// Always default to "ScriptTarget.ES5" for the language service
|
||||
return {
|
||||
target: ScriptTarget.ES5,
|
||||
module: ModuleKind.None,
|
||||
jsx: JsxEmit.Preserve
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
tests/cases/compiler/ExportAssignment7.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/ExportAssignment7.ts(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements.
|
||||
tests/cases/compiler/ExportAssignment7.ts(4,10): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/ExportAssignment7.ts (3 errors) ====
|
||||
==== tests/cases/compiler/ExportAssignment7.ts (2 errors) ====
|
||||
export class C {
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
}
|
||||
|
||||
export = B;
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
tests/cases/compiler/ExportAssignment8.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/ExportAssignment8.ts(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements.
|
||||
tests/cases/compiler/ExportAssignment8.ts(1,10): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/ExportAssignment8.ts (3 errors) ====
|
||||
==== tests/cases/compiler/ExportAssignment8.ts (2 errors) ====
|
||||
export = B;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2309: An export assignment cannot be used in a module with other exported elements.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'B'.
|
||||
|
||||
+1
-4
@@ -1,13 +1,10 @@
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/part1.ts(1,15): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(3,24): error TS2304: Cannot find name 'Point'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(7,36): error TS2304: Cannot find name 'Point'.
|
||||
tests/cases/conformance/internalModules/DeclarationMerging/part2.ts(7,54): error TS2304: Cannot find name 'Point'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts (1 errors) ====
|
||||
==== tests/cases/conformance/internalModules/DeclarationMerging/part1.ts (0 errors) ====
|
||||
export module A {
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
export interface Point {
|
||||
x: number;
|
||||
y: number;
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
tests/cases/conformance/ambient/consumer.ts(2,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/ambient/consumer.ts (1 errors) ====
|
||||
/// <reference path="decls.ts" />
|
||||
import imp1 = require('equ');
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
// Ambient external module members are always exported with or without export keyword when module lacks export assignment
|
||||
import imp3 = require('equ2');
|
||||
var n = imp3.x;
|
||||
var n: number;
|
||||
|
||||
==== tests/cases/conformance/ambient/decls.ts (0 errors) ====
|
||||
|
||||
// Ambient external module with export assignment
|
||||
declare module 'equ' {
|
||||
var x;
|
||||
export = x;
|
||||
}
|
||||
|
||||
declare module 'equ2' {
|
||||
var x: number;
|
||||
}
|
||||
|
||||
// Ambient external import declaration referencing ambient external module using top level module name
|
||||
@@ -0,0 +1,36 @@
|
||||
=== tests/cases/conformance/ambient/consumer.ts ===
|
||||
/// <reference path="decls.ts" />
|
||||
import imp1 = require('equ');
|
||||
>imp1 : Symbol(imp1, Decl(consumer.ts, 0, 0))
|
||||
|
||||
|
||||
// Ambient external module members are always exported with or without export keyword when module lacks export assignment
|
||||
import imp3 = require('equ2');
|
||||
>imp3 : Symbol(imp3, Decl(consumer.ts, 1, 29))
|
||||
|
||||
var n = imp3.x;
|
||||
>n : Symbol(n, Decl(consumer.ts, 6, 3), Decl(consumer.ts, 7, 3))
|
||||
>imp3.x : Symbol(imp3.x, Decl(decls.ts, 8, 7))
|
||||
>imp3 : Symbol(imp3, Decl(consumer.ts, 1, 29))
|
||||
>x : Symbol(imp3.x, Decl(decls.ts, 8, 7))
|
||||
|
||||
var n: number;
|
||||
>n : Symbol(n, Decl(consumer.ts, 6, 3), Decl(consumer.ts, 7, 3))
|
||||
|
||||
=== tests/cases/conformance/ambient/decls.ts ===
|
||||
|
||||
// Ambient external module with export assignment
|
||||
declare module 'equ' {
|
||||
var x;
|
||||
>x : Symbol(x, Decl(decls.ts, 3, 7))
|
||||
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(decls.ts, 3, 7))
|
||||
}
|
||||
|
||||
declare module 'equ2' {
|
||||
var x: number;
|
||||
>x : Symbol(x, Decl(decls.ts, 8, 7))
|
||||
}
|
||||
|
||||
// Ambient external import declaration referencing ambient external module using top level module name
|
||||
@@ -0,0 +1,36 @@
|
||||
=== tests/cases/conformance/ambient/consumer.ts ===
|
||||
/// <reference path="decls.ts" />
|
||||
import imp1 = require('equ');
|
||||
>imp1 : any
|
||||
|
||||
|
||||
// Ambient external module members are always exported with or without export keyword when module lacks export assignment
|
||||
import imp3 = require('equ2');
|
||||
>imp3 : typeof imp3
|
||||
|
||||
var n = imp3.x;
|
||||
>n : number
|
||||
>imp3.x : number
|
||||
>imp3 : typeof imp3
|
||||
>x : number
|
||||
|
||||
var n: number;
|
||||
>n : number
|
||||
|
||||
=== tests/cases/conformance/ambient/decls.ts ===
|
||||
|
||||
// Ambient external module with export assignment
|
||||
declare module 'equ' {
|
||||
var x;
|
||||
>x : any
|
||||
|
||||
export = x;
|
||||
>x : any
|
||||
}
|
||||
|
||||
declare module 'equ2' {
|
||||
var x: number;
|
||||
>x : number
|
||||
}
|
||||
|
||||
// Ambient external import declaration referencing ambient external module using top level module name
|
||||
@@ -1,4 +1,3 @@
|
||||
tests/cases/conformance/externalModules/foo1.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/externalModules/foo1.ts(9,12): error TS2339: Property 'x' does not exist on type 'C1'.
|
||||
tests/cases/conformance/externalModules/foo2.ts(8,12): error TS2339: Property 'y' does not exist on type 'C1'.
|
||||
tests/cases/conformance/externalModules/foo2.ts(13,8): error TS2339: Property 'x' does not exist on type 'C1'.
|
||||
@@ -26,10 +25,8 @@ tests/cases/conformance/externalModules/foo2.ts(13,8): error TS2339: Property 'x
|
||||
}
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ====
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
|
||||
import foo2 = require('./foo2');
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
export module M1 {
|
||||
export class C1 {
|
||||
m1: foo2.M1.C1;
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts(1,25): error TS1005: ';' expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts(3,1): error TS1128: Declaration or statement expected.
|
||||
tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts(4,17): error TS1005: '=' expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts (4 errors) ====
|
||||
==== tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractManyKeywords.ts (3 errors) ====
|
||||
export default abstract class A {}
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~
|
||||
!!! error TS1005: ';' expected.
|
||||
export abstract class B {}
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(4,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error TS2301: Initializer of instance member variable 'messageHandler' cannot reference identifier 'field1' declared in the constructor.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (0 errors) ====
|
||||
var field1: string;
|
||||
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts (2 errors) ====
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts (1 errors) ====
|
||||
declare var console: {
|
||||
log(msg?: any): void;
|
||||
};
|
||||
export class Test1 {
|
||||
~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
constructor(private field1: string) {
|
||||
}
|
||||
messageHandler = () => {
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts(8,21): error TS2304: Cannot find name 'field1'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (1 errors) ====
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_0.ts (0 errors) ====
|
||||
export var field1: string;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
==== tests/cases/compiler/classMemberInitializerWithLamdaScoping3_1.ts (1 errors) ====
|
||||
declare var console: {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
tests/cases/conformance/externalModules/foo1.ts(3,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/externalModules/foo1.ts(3,1): error TS2300: Duplicate identifier 'export='.
|
||||
tests/cases/conformance/externalModules/foo1.ts(4,1): error TS2300: Duplicate identifier 'export='.
|
||||
tests/cases/conformance/externalModules/foo2.ts(3,1): error TS2300: Duplicate identifier 'export='.
|
||||
@@ -12,13 +11,11 @@ tests/cases/conformance/externalModules/foo5.ts(5,1): error TS2300: Duplicate id
|
||||
tests/cases/conformance/externalModules/foo5.ts(6,1): error TS2300: Duplicate identifier 'export='.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (3 errors) ====
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (2 errors) ====
|
||||
var x = 10;
|
||||
var y = 20;
|
||||
export = x;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'export='.
|
||||
export = y;
|
||||
~~~~~~~~~~~
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(2,4): error TS1005: ';' expected.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(2,11): error TS1146: Declaration expected.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(2,13): error TS2304: Cannot find name 'commonjs'.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(12,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(187,22): error TS2403: Subsequent variable declarations must have the same type. Variable 'i' must be of type 'string', but here has type 'number'.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(187,29): error TS2365: Operator '<' cannot be applied to types 'string' and 'number'.
|
||||
tests/cases/compiler/duplicateLocalVariable1.ts(187,37): error TS2356: An arithmetic operand must be of type 'any', 'number' or an enum type.
|
||||
|
||||
|
||||
==== tests/cases/compiler/duplicateLocalVariable1.ts (7 errors) ====
|
||||
==== tests/cases/compiler/duplicateLocalVariable1.ts (6 errors) ====
|
||||
|
||||
/ /@module: commonjs
|
||||
~
|
||||
@@ -26,8 +25,6 @@ tests/cases/compiler/duplicateLocalVariable1.ts(187,37): error TS2356: An arithm
|
||||
var TestFileDir = ".\\TempTestFiles";
|
||||
|
||||
export class TestCase {
|
||||
~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
constructor (public name: string, public test: ()=>boolean, public errorMessageRegEx?: string) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
tests/cases/compiler/es5ModuleWithoutModuleGenTarget.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/compiler/es5ModuleWithoutModuleGenTarget.ts (1 errors) ====
|
||||
export class A
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
}
|
||||
|
||||
public B()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
=== tests/cases/compiler/es5ModuleWithoutModuleGenTarget.ts ===
|
||||
export class A
|
||||
>A : Symbol(A, Decl(es5ModuleWithoutModuleGenTarget.ts, 0, 0))
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
}
|
||||
|
||||
public B()
|
||||
>B : Symbol(B, Decl(es5ModuleWithoutModuleGenTarget.ts, 4, 5))
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/compiler/es5ModuleWithoutModuleGenTarget.ts ===
|
||||
export class A
|
||||
>A : A
|
||||
{
|
||||
constructor ()
|
||||
{
|
||||
}
|
||||
|
||||
public B()
|
||||
>B : () => number
|
||||
{
|
||||
return 42;
|
||||
>42 : number
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
tests/cases/conformance/externalModules/foo1.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
|
||||
import foo1 = require('./foo1');
|
||||
export = foo1.x; // Ok
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
|
||||
export function x(){
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
import foo1 = require('./foo1');
|
||||
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
|
||||
|
||||
export = foo1.x; // Ok
|
||||
>foo1.x : Symbol(foo1.x, Decl(foo1.ts, 0, 0))
|
||||
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
|
||||
>x : Symbol(foo1.x, Decl(foo1.ts, 0, 0))
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
export function x(){
|
||||
>x : Symbol(x, Decl(foo1.ts, 0, 0))
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
import foo1 = require('./foo1');
|
||||
>foo1 : typeof foo1
|
||||
|
||||
export = foo1.x; // Ok
|
||||
>foo1.x : () => boolean
|
||||
>foo1 : typeof foo1
|
||||
>x : () => boolean
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
export function x(){
|
||||
>x : () => boolean
|
||||
|
||||
return true;
|
||||
>true : boolean
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
tests/cases/conformance/externalModules/foo1.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo3.ts (0 errors) ====
|
||||
import foo2 = require('./foo2');
|
||||
var x = foo2(); // should be boolean
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
|
||||
export function x(){
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
return true;
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
|
||||
import foo1 = require('./foo1');
|
||||
var x = foo1.x;
|
||||
export = x;
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
=== tests/cases/conformance/externalModules/foo3.ts ===
|
||||
import foo2 = require('./foo2');
|
||||
>foo2 : Symbol(foo2, Decl(foo3.ts, 0, 0))
|
||||
|
||||
var x = foo2(); // should be boolean
|
||||
>x : Symbol(x, Decl(foo3.ts, 1, 3))
|
||||
>foo2 : Symbol(foo2, Decl(foo3.ts, 0, 0))
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
export function x(){
|
||||
>x : Symbol(x, Decl(foo1.ts, 0, 0))
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
import foo1 = require('./foo1');
|
||||
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
|
||||
|
||||
var x = foo1.x;
|
||||
>x : Symbol(x, Decl(foo2.ts, 1, 3))
|
||||
>foo1.x : Symbol(foo1.x, Decl(foo1.ts, 0, 0))
|
||||
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
|
||||
>x : Symbol(foo1.x, Decl(foo1.ts, 0, 0))
|
||||
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(foo2.ts, 1, 3))
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
=== tests/cases/conformance/externalModules/foo3.ts ===
|
||||
import foo2 = require('./foo2');
|
||||
>foo2 : () => boolean
|
||||
|
||||
var x = foo2(); // should be boolean
|
||||
>x : boolean
|
||||
>foo2() : boolean
|
||||
>foo2 : () => boolean
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
export function x(){
|
||||
>x : () => boolean
|
||||
|
||||
return true;
|
||||
>true : boolean
|
||||
}
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
import foo1 = require('./foo1');
|
||||
>foo1 : typeof foo1
|
||||
|
||||
var x = foo1.x;
|
||||
>x : () => boolean
|
||||
>foo1.x : () => boolean
|
||||
>foo1 : typeof foo1
|
||||
>x : () => boolean
|
||||
|
||||
export = x;
|
||||
>x : () => boolean
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
tests/cases/conformance/externalModules/foo1.ts(2,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/externalModules/foo6.ts(1,14): error TS1109: Expression expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (0 errors) ====
|
||||
var x = 10;
|
||||
export = typeof x; // Ok
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
|
||||
export = "sausages"; // Ok
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
tests/cases/conformance/externalModules/expString.ts(2,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/consumer.ts (0 errors) ====
|
||||
import iString = require('./expString');
|
||||
var v1: string = iString;
|
||||
|
||||
import iNumber = require('./expNumber');
|
||||
var v2: number = iNumber;
|
||||
|
||||
import iBoolean = require('./expBoolean');
|
||||
var v3: boolean = iBoolean;
|
||||
|
||||
import iArray = require('./expArray');
|
||||
var v4: Array<number> = iArray;
|
||||
|
||||
import iObject = require('./expObject');
|
||||
var v5: Object = iObject;
|
||||
|
||||
import iAny = require('./expAny');
|
||||
var v6 = iAny;
|
||||
|
||||
import iGeneric = require('./expGeneric');
|
||||
var v7: {<x>(p1: x): x} = iGeneric;
|
||||
|
||||
==== tests/cases/conformance/externalModules/expString.ts (1 errors) ====
|
||||
var x = "test";
|
||||
export = x;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
==== tests/cases/conformance/externalModules/expNumber.ts (0 errors) ====
|
||||
var x = 42;
|
||||
export = x;
|
||||
|
||||
==== tests/cases/conformance/externalModules/expBoolean.ts (0 errors) ====
|
||||
var x = true;
|
||||
export = x;
|
||||
|
||||
==== tests/cases/conformance/externalModules/expArray.ts (0 errors) ====
|
||||
var x = [1,2];
|
||||
export = x;
|
||||
|
||||
==== tests/cases/conformance/externalModules/expObject.ts (0 errors) ====
|
||||
var x = { answer: 42, when: 1776};
|
||||
export = x;
|
||||
|
||||
==== tests/cases/conformance/externalModules/expAny.ts (0 errors) ====
|
||||
var x;
|
||||
export = x;
|
||||
|
||||
==== tests/cases/conformance/externalModules/expGeneric.ts (0 errors) ====
|
||||
function x<T>(a: T){
|
||||
return a;
|
||||
}
|
||||
export = x;
|
||||
|
||||
@@ -0,0 +1,113 @@
|
||||
=== tests/cases/conformance/externalModules/consumer.ts ===
|
||||
import iString = require('./expString');
|
||||
>iString : Symbol(iString, Decl(consumer.ts, 0, 0))
|
||||
|
||||
var v1: string = iString;
|
||||
>v1 : Symbol(v1, Decl(consumer.ts, 1, 3))
|
||||
>iString : Symbol(iString, Decl(consumer.ts, 0, 0))
|
||||
|
||||
import iNumber = require('./expNumber');
|
||||
>iNumber : Symbol(iNumber, Decl(consumer.ts, 1, 25))
|
||||
|
||||
var v2: number = iNumber;
|
||||
>v2 : Symbol(v2, Decl(consumer.ts, 4, 3))
|
||||
>iNumber : Symbol(iNumber, Decl(consumer.ts, 1, 25))
|
||||
|
||||
import iBoolean = require('./expBoolean');
|
||||
>iBoolean : Symbol(iBoolean, Decl(consumer.ts, 4, 25))
|
||||
|
||||
var v3: boolean = iBoolean;
|
||||
>v3 : Symbol(v3, Decl(consumer.ts, 7, 3))
|
||||
>iBoolean : Symbol(iBoolean, Decl(consumer.ts, 4, 25))
|
||||
|
||||
import iArray = require('./expArray');
|
||||
>iArray : Symbol(iArray, Decl(consumer.ts, 7, 27))
|
||||
|
||||
var v4: Array<number> = iArray;
|
||||
>v4 : Symbol(v4, Decl(consumer.ts, 10, 3))
|
||||
>Array : Symbol(Array, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>iArray : Symbol(iArray, Decl(consumer.ts, 7, 27))
|
||||
|
||||
import iObject = require('./expObject');
|
||||
>iObject : Symbol(iObject, Decl(consumer.ts, 10, 31))
|
||||
|
||||
var v5: Object = iObject;
|
||||
>v5 : Symbol(v5, Decl(consumer.ts, 13, 3))
|
||||
>Object : Symbol(Object, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
|
||||
>iObject : Symbol(iObject, Decl(consumer.ts, 10, 31))
|
||||
|
||||
import iAny = require('./expAny');
|
||||
>iAny : Symbol(iAny, Decl(consumer.ts, 13, 25))
|
||||
|
||||
var v6 = iAny;
|
||||
>v6 : Symbol(v6, Decl(consumer.ts, 16, 3))
|
||||
>iAny : Symbol(iAny, Decl(consumer.ts, 13, 25))
|
||||
|
||||
import iGeneric = require('./expGeneric');
|
||||
>iGeneric : Symbol(iGeneric, Decl(consumer.ts, 16, 14))
|
||||
|
||||
var v7: {<x>(p1: x): x} = iGeneric;
|
||||
>v7 : Symbol(v7, Decl(consumer.ts, 19, 3))
|
||||
>x : Symbol(x, Decl(consumer.ts, 19, 10))
|
||||
>p1 : Symbol(p1, Decl(consumer.ts, 19, 13))
|
||||
>x : Symbol(x, Decl(consumer.ts, 19, 10))
|
||||
>x : Symbol(x, Decl(consumer.ts, 19, 10))
|
||||
>iGeneric : Symbol(iGeneric, Decl(consumer.ts, 16, 14))
|
||||
|
||||
=== tests/cases/conformance/externalModules/expString.ts ===
|
||||
var x = "test";
|
||||
>x : Symbol(x, Decl(expString.ts, 0, 3))
|
||||
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(expString.ts, 0, 3))
|
||||
|
||||
=== tests/cases/conformance/externalModules/expNumber.ts ===
|
||||
var x = 42;
|
||||
>x : Symbol(x, Decl(expNumber.ts, 0, 3))
|
||||
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(expNumber.ts, 0, 3))
|
||||
|
||||
=== tests/cases/conformance/externalModules/expBoolean.ts ===
|
||||
var x = true;
|
||||
>x : Symbol(x, Decl(expBoolean.ts, 0, 3))
|
||||
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(expBoolean.ts, 0, 3))
|
||||
|
||||
=== tests/cases/conformance/externalModules/expArray.ts ===
|
||||
var x = [1,2];
|
||||
>x : Symbol(x, Decl(expArray.ts, 0, 3))
|
||||
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(expArray.ts, 0, 3))
|
||||
|
||||
=== tests/cases/conformance/externalModules/expObject.ts ===
|
||||
var x = { answer: 42, when: 1776};
|
||||
>x : Symbol(x, Decl(expObject.ts, 0, 3))
|
||||
>answer : Symbol(answer, Decl(expObject.ts, 0, 9))
|
||||
>when : Symbol(when, Decl(expObject.ts, 0, 21))
|
||||
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(expObject.ts, 0, 3))
|
||||
|
||||
=== tests/cases/conformance/externalModules/expAny.ts ===
|
||||
var x;
|
||||
>x : Symbol(x, Decl(expAny.ts, 0, 3))
|
||||
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(expAny.ts, 0, 3))
|
||||
|
||||
=== tests/cases/conformance/externalModules/expGeneric.ts ===
|
||||
function x<T>(a: T){
|
||||
>x : Symbol(x, Decl(expGeneric.ts, 0, 0))
|
||||
>T : Symbol(T, Decl(expGeneric.ts, 0, 11))
|
||||
>a : Symbol(a, Decl(expGeneric.ts, 0, 14))
|
||||
>T : Symbol(T, Decl(expGeneric.ts, 0, 11))
|
||||
|
||||
return a;
|
||||
>a : Symbol(a, Decl(expGeneric.ts, 0, 14))
|
||||
}
|
||||
export = x;
|
||||
>x : Symbol(x, Decl(expGeneric.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,122 @@
|
||||
=== tests/cases/conformance/externalModules/consumer.ts ===
|
||||
import iString = require('./expString');
|
||||
>iString : string
|
||||
|
||||
var v1: string = iString;
|
||||
>v1 : string
|
||||
>iString : string
|
||||
|
||||
import iNumber = require('./expNumber');
|
||||
>iNumber : number
|
||||
|
||||
var v2: number = iNumber;
|
||||
>v2 : number
|
||||
>iNumber : number
|
||||
|
||||
import iBoolean = require('./expBoolean');
|
||||
>iBoolean : boolean
|
||||
|
||||
var v3: boolean = iBoolean;
|
||||
>v3 : boolean
|
||||
>iBoolean : boolean
|
||||
|
||||
import iArray = require('./expArray');
|
||||
>iArray : number[]
|
||||
|
||||
var v4: Array<number> = iArray;
|
||||
>v4 : number[]
|
||||
>Array : T[]
|
||||
>iArray : number[]
|
||||
|
||||
import iObject = require('./expObject');
|
||||
>iObject : { answer: number; when: number; }
|
||||
|
||||
var v5: Object = iObject;
|
||||
>v5 : Object
|
||||
>Object : Object
|
||||
>iObject : { answer: number; when: number; }
|
||||
|
||||
import iAny = require('./expAny');
|
||||
>iAny : any
|
||||
|
||||
var v6 = iAny;
|
||||
>v6 : any
|
||||
>iAny : any
|
||||
|
||||
import iGeneric = require('./expGeneric');
|
||||
>iGeneric : <T>(a: T) => T
|
||||
|
||||
var v7: {<x>(p1: x): x} = iGeneric;
|
||||
>v7 : <x>(p1: x) => x
|
||||
>x : x
|
||||
>p1 : x
|
||||
>x : x
|
||||
>x : x
|
||||
>iGeneric : <T>(a: T) => T
|
||||
|
||||
=== tests/cases/conformance/externalModules/expString.ts ===
|
||||
var x = "test";
|
||||
>x : string
|
||||
>"test" : string
|
||||
|
||||
export = x;
|
||||
>x : string
|
||||
|
||||
=== tests/cases/conformance/externalModules/expNumber.ts ===
|
||||
var x = 42;
|
||||
>x : number
|
||||
>42 : number
|
||||
|
||||
export = x;
|
||||
>x : number
|
||||
|
||||
=== tests/cases/conformance/externalModules/expBoolean.ts ===
|
||||
var x = true;
|
||||
>x : boolean
|
||||
>true : boolean
|
||||
|
||||
export = x;
|
||||
>x : boolean
|
||||
|
||||
=== tests/cases/conformance/externalModules/expArray.ts ===
|
||||
var x = [1,2];
|
||||
>x : number[]
|
||||
>[1,2] : number[]
|
||||
>1 : number
|
||||
>2 : number
|
||||
|
||||
export = x;
|
||||
>x : number[]
|
||||
|
||||
=== tests/cases/conformance/externalModules/expObject.ts ===
|
||||
var x = { answer: 42, when: 1776};
|
||||
>x : { answer: number; when: number; }
|
||||
>{ answer: 42, when: 1776} : { answer: number; when: number; }
|
||||
>answer : number
|
||||
>42 : number
|
||||
>when : number
|
||||
>1776 : number
|
||||
|
||||
export = x;
|
||||
>x : { answer: number; when: number; }
|
||||
|
||||
=== tests/cases/conformance/externalModules/expAny.ts ===
|
||||
var x;
|
||||
>x : any
|
||||
|
||||
export = x;
|
||||
>x : any
|
||||
|
||||
=== tests/cases/conformance/externalModules/expGeneric.ts ===
|
||||
function x<T>(a: T){
|
||||
>x : <T>(a: T) => T
|
||||
>T : T
|
||||
>a : T
|
||||
>T : T
|
||||
|
||||
return a;
|
||||
>a : T
|
||||
}
|
||||
export = x;
|
||||
>x : <T>(a: T) => T
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
tests/cases/conformance/externalModules/foo1.ts(6,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
|
||||
import foo1 = require('./foo1');
|
||||
var x: number = foo1.b();
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
|
||||
|
||||
declare module M1 {
|
||||
export var a: string;
|
||||
export function b(): number;
|
||||
}
|
||||
export = M1;
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
import foo1 = require('./foo1');
|
||||
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
|
||||
|
||||
var x: number = foo1.b();
|
||||
>x : Symbol(x, Decl(foo2.ts, 1, 3))
|
||||
>foo1.b : Symbol(foo1.b, Decl(foo1.ts, 2, 22))
|
||||
>foo1 : Symbol(foo1, Decl(foo2.ts, 0, 0))
|
||||
>b : Symbol(foo1.b, Decl(foo1.ts, 2, 22))
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
|
||||
declare module M1 {
|
||||
>M1 : Symbol(M1, Decl(foo1.ts, 0, 0))
|
||||
|
||||
export var a: string;
|
||||
>a : Symbol(a, Decl(foo1.ts, 2, 11))
|
||||
|
||||
export function b(): number;
|
||||
>b : Symbol(b, Decl(foo1.ts, 2, 22))
|
||||
}
|
||||
export = M1;
|
||||
>M1 : Symbol(M1, Decl(foo1.ts, 0, 0))
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
import foo1 = require('./foo1');
|
||||
>foo1 : typeof foo1
|
||||
|
||||
var x: number = foo1.b();
|
||||
>x : number
|
||||
>foo1.b() : number
|
||||
>foo1.b : () => number
|
||||
>foo1 : typeof foo1
|
||||
>b : () => number
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
|
||||
declare module M1 {
|
||||
>M1 : typeof M1
|
||||
|
||||
export var a: string;
|
||||
>a : string
|
||||
|
||||
export function b(): number;
|
||||
>b : () => number
|
||||
}
|
||||
export = M1;
|
||||
>M1 : typeof M1
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
tests/cases/conformance/externalModules/foo1.ts(7,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo1.ts (1 errors) ====
|
||||
interface I1 {
|
||||
a: string;
|
||||
b: number;
|
||||
}
|
||||
|
||||
var x: I1 = {a: "test", b: 42};
|
||||
export = x; // Should fail, I1 not exported.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo2.ts (0 errors) ====
|
||||
interface I1 {
|
||||
a: string;
|
||||
b: number;
|
||||
}
|
||||
|
||||
class C1 {
|
||||
m1: I1;
|
||||
}
|
||||
|
||||
export = C1; // Should fail, type I1 of visible member C1.m1 not exported.
|
||||
|
||||
==== tests/cases/conformance/externalModules/foo3.ts (0 errors) ====
|
||||
interface I1 {
|
||||
a: string;
|
||||
b: number;
|
||||
}
|
||||
|
||||
class C1 {
|
||||
private m1: I1;
|
||||
}
|
||||
|
||||
export = C1; // Should work, private type I1 of visible class C1 only used in private member m1.
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
interface I1 {
|
||||
>I1 : Symbol(I1, Decl(foo1.ts, 0, 0))
|
||||
|
||||
a: string;
|
||||
>a : Symbol(a, Decl(foo1.ts, 0, 14))
|
||||
|
||||
b: number;
|
||||
>b : Symbol(b, Decl(foo1.ts, 1, 11))
|
||||
}
|
||||
|
||||
var x: I1 = {a: "test", b: 42};
|
||||
>x : Symbol(x, Decl(foo1.ts, 5, 3))
|
||||
>I1 : Symbol(I1, Decl(foo1.ts, 0, 0))
|
||||
>a : Symbol(a, Decl(foo1.ts, 5, 13))
|
||||
>b : Symbol(b, Decl(foo1.ts, 5, 23))
|
||||
|
||||
export = x; // Should fail, I1 not exported.
|
||||
>x : Symbol(x, Decl(foo1.ts, 5, 3))
|
||||
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
interface I1 {
|
||||
>I1 : Symbol(I1, Decl(foo2.ts, 0, 0))
|
||||
|
||||
a: string;
|
||||
>a : Symbol(a, Decl(foo2.ts, 0, 14))
|
||||
|
||||
b: number;
|
||||
>b : Symbol(b, Decl(foo2.ts, 1, 11))
|
||||
}
|
||||
|
||||
class C1 {
|
||||
>C1 : Symbol(C1, Decl(foo2.ts, 3, 1))
|
||||
|
||||
m1: I1;
|
||||
>m1 : Symbol(m1, Decl(foo2.ts, 5, 10))
|
||||
>I1 : Symbol(I1, Decl(foo2.ts, 0, 0))
|
||||
}
|
||||
|
||||
export = C1; // Should fail, type I1 of visible member C1.m1 not exported.
|
||||
>C1 : Symbol(C1, Decl(foo2.ts, 3, 1))
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo3.ts ===
|
||||
interface I1 {
|
||||
>I1 : Symbol(I1, Decl(foo3.ts, 0, 0))
|
||||
|
||||
a: string;
|
||||
>a : Symbol(a, Decl(foo3.ts, 0, 14))
|
||||
|
||||
b: number;
|
||||
>b : Symbol(b, Decl(foo3.ts, 1, 11))
|
||||
}
|
||||
|
||||
class C1 {
|
||||
>C1 : Symbol(C1, Decl(foo3.ts, 3, 1))
|
||||
|
||||
private m1: I1;
|
||||
>m1 : Symbol(m1, Decl(foo3.ts, 5, 10))
|
||||
>I1 : Symbol(I1, Decl(foo3.ts, 0, 0))
|
||||
}
|
||||
|
||||
export = C1; // Should work, private type I1 of visible class C1 only used in private member m1.
|
||||
>C1 : Symbol(C1, Decl(foo3.ts, 3, 1))
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
=== tests/cases/conformance/externalModules/foo1.ts ===
|
||||
interface I1 {
|
||||
>I1 : I1
|
||||
|
||||
a: string;
|
||||
>a : string
|
||||
|
||||
b: number;
|
||||
>b : number
|
||||
}
|
||||
|
||||
var x: I1 = {a: "test", b: 42};
|
||||
>x : I1
|
||||
>I1 : I1
|
||||
>{a: "test", b: 42} : { a: string; b: number; }
|
||||
>a : string
|
||||
>"test" : string
|
||||
>b : number
|
||||
>42 : number
|
||||
|
||||
export = x; // Should fail, I1 not exported.
|
||||
>x : I1
|
||||
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo2.ts ===
|
||||
interface I1 {
|
||||
>I1 : I1
|
||||
|
||||
a: string;
|
||||
>a : string
|
||||
|
||||
b: number;
|
||||
>b : number
|
||||
}
|
||||
|
||||
class C1 {
|
||||
>C1 : C1
|
||||
|
||||
m1: I1;
|
||||
>m1 : I1
|
||||
>I1 : I1
|
||||
}
|
||||
|
||||
export = C1; // Should fail, type I1 of visible member C1.m1 not exported.
|
||||
>C1 : C1
|
||||
|
||||
=== tests/cases/conformance/externalModules/foo3.ts ===
|
||||
interface I1 {
|
||||
>I1 : I1
|
||||
|
||||
a: string;
|
||||
>a : string
|
||||
|
||||
b: number;
|
||||
>b : number
|
||||
}
|
||||
|
||||
class C1 {
|
||||
>C1 : C1
|
||||
|
||||
private m1: I1;
|
||||
>m1 : I1
|
||||
>I1 : I1
|
||||
}
|
||||
|
||||
export = C1; // Should work, private type I1 of visible class C1 only used in private member m1.
|
||||
>C1 : C1
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
tests/cases/compiler/externalModuleWithoutCompilerFlag1.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/compiler/externalModuleWithoutCompilerFlag1.ts (1 errors) ====
|
||||
|
||||
// Not on line 0 because we want to verify the error is placed in the appropriate location.
|
||||
export module M {
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/externalModuleWithoutCompilerFlag1.ts ===
|
||||
|
||||
// Not on line 0 because we want to verify the error is placed in the appropriate location.
|
||||
export module M {
|
||||
>M : Symbol(M, Decl(externalModuleWithoutCompilerFlag1.ts, 0, 0))
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/compiler/externalModuleWithoutCompilerFlag1.ts ===
|
||||
|
||||
// Not on line 0 because we want to verify the error is placed in the appropriate location.
|
||||
export module M {
|
||||
>M : any
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/genericArrayExtenstions.ts(1,22): error TS2420: Class 'ObservableArray<T>' incorrectly implements interface 'T[]'.
|
||||
Property 'length' is missing in type 'ObservableArray<T>'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/genericArrayExtenstions.ts (2 errors) ====
|
||||
==== tests/cases/compiler/genericArrayExtenstions.ts (1 errors) ====
|
||||
export declare class ObservableArray<T> implements Array<T> { // MS.Entertainment.ObservableArray
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2420: Class 'ObservableArray<T>' incorrectly implements interface 'T[]'.
|
||||
!!! error TS2420: Property 'length' is missing in type 'ObservableArray<T>'.
|
||||
concat<U extends T[]>(...items: U[]): T[];
|
||||
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file0.ts(1,15): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file1.ts (0 errors) ====
|
||||
import r = require('importAliasAnExternalModuleInsideAnInternalModule_file0');
|
||||
module m_private {
|
||||
//import r2 = require('m'); // would be error
|
||||
export import C = r; // no error
|
||||
C.m.foo();
|
||||
}
|
||||
|
||||
==== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file0.ts (1 errors) ====
|
||||
export module m {
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
export function foo() { }
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
=== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file1.ts ===
|
||||
import r = require('importAliasAnExternalModuleInsideAnInternalModule_file0');
|
||||
>r : Symbol(r, Decl(importAliasAnExternalModuleInsideAnInternalModule_file1.ts, 0, 0))
|
||||
|
||||
module m_private {
|
||||
>m_private : Symbol(m_private, Decl(importAliasAnExternalModuleInsideAnInternalModule_file1.ts, 0, 78))
|
||||
|
||||
//import r2 = require('m'); // would be error
|
||||
export import C = r; // no error
|
||||
>C : Symbol(C, Decl(importAliasAnExternalModuleInsideAnInternalModule_file1.ts, 1, 18))
|
||||
>r : Symbol(C, Decl(importAliasAnExternalModuleInsideAnInternalModule_file0.ts, 0, 0))
|
||||
|
||||
C.m.foo();
|
||||
>C.m.foo : Symbol(C.m.foo, Decl(importAliasAnExternalModuleInsideAnInternalModule_file0.ts, 0, 17))
|
||||
>C.m : Symbol(C.m, Decl(importAliasAnExternalModuleInsideAnInternalModule_file0.ts, 0, 0))
|
||||
>C : Symbol(C, Decl(importAliasAnExternalModuleInsideAnInternalModule_file1.ts, 1, 18))
|
||||
>m : Symbol(C.m, Decl(importAliasAnExternalModuleInsideAnInternalModule_file0.ts, 0, 0))
|
||||
>foo : Symbol(C.m.foo, Decl(importAliasAnExternalModuleInsideAnInternalModule_file0.ts, 0, 17))
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file0.ts ===
|
||||
export module m {
|
||||
>m : Symbol(m, Decl(importAliasAnExternalModuleInsideAnInternalModule_file0.ts, 0, 0))
|
||||
|
||||
export function foo() { }
|
||||
>foo : Symbol(foo, Decl(importAliasAnExternalModuleInsideAnInternalModule_file0.ts, 0, 17))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
=== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file1.ts ===
|
||||
import r = require('importAliasAnExternalModuleInsideAnInternalModule_file0');
|
||||
>r : typeof r
|
||||
|
||||
module m_private {
|
||||
>m_private : typeof m_private
|
||||
|
||||
//import r2 = require('m'); // would be error
|
||||
export import C = r; // no error
|
||||
>C : typeof C
|
||||
>r : typeof C
|
||||
|
||||
C.m.foo();
|
||||
>C.m.foo() : void
|
||||
>C.m.foo : () => void
|
||||
>C.m : typeof C.m
|
||||
>C : typeof C
|
||||
>m : typeof C.m
|
||||
>foo : () => void
|
||||
}
|
||||
|
||||
=== tests/cases/compiler/importAliasAnExternalModuleInsideAnInternalModule_file0.ts ===
|
||||
export module m {
|
||||
>m : typeof m
|
||||
|
||||
export function foo() { }
|
||||
>foo : () => void
|
||||
}
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(1,20): error TS2307: Cannot find module 'externalModule'.
|
||||
tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(2,16): error TS2664: Invalid module name in augmentation, module 'm1' cannot be found.
|
||||
tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts(3,26): error TS2307: Cannot find module 'externalModule'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts (4 errors) ====
|
||||
==== tests/cases/compiler/importDeclRefereingExternalModuleWithNoResolve.ts (3 errors) ====
|
||||
import b = require("externalModule");
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~~~~~~~~~~~
|
||||
!!! error TS2307: Cannot find module 'externalModule'.
|
||||
declare module "m1" {
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
tests/cases/compiler/importDeclWithDeclareModifier.ts(5,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/importDeclWithDeclareModifier.ts(5,9): error TS1029: 'export' modifier must precede 'declare' modifier.
|
||||
tests/cases/compiler/importDeclWithDeclareModifier.ts(5,29): error TS2305: Module 'x' has no exported member 'c'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/importDeclWithDeclareModifier.ts (3 errors) ====
|
||||
==== tests/cases/compiler/importDeclWithDeclareModifier.ts (2 errors) ====
|
||||
module x {
|
||||
interface c {
|
||||
}
|
||||
}
|
||||
declare export import a = x.c;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~
|
||||
!!! error TS1029: 'export' modifier must precede 'declare' modifier.
|
||||
~
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
error TS5047: Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher.
|
||||
|
||||
|
||||
!!! error TS5047: Option 'isolatedModules' can only be used when either option '--module' is provided or option 'target' is 'ES2015' or higher.
|
||||
==== tests/cases/compiler/file1.ts (0 errors) ====
|
||||
export var x;
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/file1.ts ===
|
||||
export var x;
|
||||
>x : Symbol(x, Decl(file1.ts, 0, 10))
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/compiler/file1.ts ===
|
||||
export var x;
|
||||
>x : any
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
tests/cases/compiler/a.js(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/a.js(1,1): error TS8003: 'export=' can only be used in a .ts file.
|
||||
|
||||
|
||||
!!! error TS5055: Cannot write file 'tests/cases/compiler/a.js' because it would overwrite input file.
|
||||
==== tests/cases/compiler/a.js (2 errors) ====
|
||||
==== tests/cases/compiler/a.js (1 errors) ====
|
||||
export = b;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS8003: 'export=' can only be used in a .ts file.
|
||||
@@ -1,13 +1,10 @@
|
||||
error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
|
||||
tests/cases/compiler/a.ts(2,1): error TS2448: Block-scoped variable 'a' used before its declaration.
|
||||
|
||||
|
||||
!!! error TS5053: Option 'allowJs' cannot be specified with option 'declaration'.
|
||||
==== tests/cases/compiler/a.ts (1 errors) ====
|
||||
==== tests/cases/compiler/a.ts (0 errors) ====
|
||||
let b = 30;
|
||||
a = 10;
|
||||
~
|
||||
!!! error TS2448: Block-scoped variable 'a' used before its declaration.
|
||||
==== tests/cases/compiler/b.js (0 errors) ====
|
||||
let a = 10;
|
||||
b = 30;
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
tests/cases/compiler/mergedModuleDeclarationCodeGen.ts(1,15): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/compiler/mergedModuleDeclarationCodeGen.ts (1 errors) ====
|
||||
export module X {
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
export module Y {
|
||||
class A {
|
||||
constructor(Y: any) {
|
||||
new B();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
export module X {
|
||||
export module Y {
|
||||
export class B {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
=== tests/cases/compiler/mergedModuleDeclarationCodeGen.ts ===
|
||||
export module X {
|
||||
>X : Symbol(X, Decl(mergedModuleDeclarationCodeGen.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen.ts, 8, 1))
|
||||
|
||||
export module Y {
|
||||
>Y : Symbol(Y, Decl(mergedModuleDeclarationCodeGen.ts, 0, 17), Decl(mergedModuleDeclarationCodeGen.ts, 9, 17))
|
||||
|
||||
class A {
|
||||
>A : Symbol(A, Decl(mergedModuleDeclarationCodeGen.ts, 1, 21))
|
||||
|
||||
constructor(Y: any) {
|
||||
>Y : Symbol(Y, Decl(mergedModuleDeclarationCodeGen.ts, 3, 24))
|
||||
|
||||
new B();
|
||||
>B : Symbol(B, Decl(mergedModuleDeclarationCodeGen.ts, 10, 21))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
export module X {
|
||||
>X : Symbol(X, Decl(mergedModuleDeclarationCodeGen.ts, 0, 0), Decl(mergedModuleDeclarationCodeGen.ts, 8, 1))
|
||||
|
||||
export module Y {
|
||||
>Y : Symbol(Y, Decl(mergedModuleDeclarationCodeGen.ts, 0, 17), Decl(mergedModuleDeclarationCodeGen.ts, 9, 17))
|
||||
|
||||
export class B {
|
||||
>B : Symbol(B, Decl(mergedModuleDeclarationCodeGen.ts, 10, 21))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
=== tests/cases/compiler/mergedModuleDeclarationCodeGen.ts ===
|
||||
export module X {
|
||||
>X : typeof X
|
||||
|
||||
export module Y {
|
||||
>Y : typeof Y
|
||||
|
||||
class A {
|
||||
>A : A
|
||||
|
||||
constructor(Y: any) {
|
||||
>Y : any
|
||||
|
||||
new B();
|
||||
>new B() : B
|
||||
>B : typeof B
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
export module X {
|
||||
>X : typeof X
|
||||
|
||||
export module Y {
|
||||
>Y : typeof Y
|
||||
|
||||
export class B {
|
||||
>B : B
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
tests/cases/compiler/a.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided with a valid module type. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/compiler/a.ts (1 errors) ====
|
||||
export class Foo {
|
||||
~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided with a valid module type. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
foo: string;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
//// [a.ts]
|
||||
export class Foo {
|
||||
foo: string;
|
||||
}
|
||||
|
||||
|
||||
//// [a.js]
|
||||
"use strict";
|
||||
var Foo = (function () {
|
||||
function Foo() {
|
||||
}
|
||||
return Foo;
|
||||
}());
|
||||
exports.Foo = Foo;
|
||||
@@ -1,26 +0,0 @@
|
||||
tests/cases/conformance/externalModules/file3.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/file1.ts (0 errors) ====
|
||||
var v1 = "sausages"; // Global scope
|
||||
|
||||
==== tests/cases/conformance/externalModules/file2.ts (0 errors) ====
|
||||
var v2 = 42; // Global scope
|
||||
var v4 = () => 5;
|
||||
|
||||
==== tests/cases/conformance/externalModules/file3.ts (1 errors) ====
|
||||
export var v3 = true;
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
var v2 = [1,2,3]; // Module scope. Should not appear in global scope
|
||||
|
||||
==== tests/cases/conformance/externalModules/file4.ts (0 errors) ====
|
||||
import file3 = require('./file3');
|
||||
var t1 = v1;
|
||||
var t2 = v2;
|
||||
var t3 = file3.v3;
|
||||
var v4 = {a: true, b: NaN}; // Should shadow global v2 in this module
|
||||
|
||||
==== tests/cases/conformance/externalModules/file5.ts (0 errors) ====
|
||||
var x = v2; // Should be global v2 of type number again
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
=== tests/cases/conformance/externalModules/file1.ts ===
|
||||
var v1 = "sausages"; // Global scope
|
||||
>v1 : Symbol(v1, Decl(file1.ts, 0, 3))
|
||||
|
||||
=== tests/cases/conformance/externalModules/file2.ts ===
|
||||
var v2 = 42; // Global scope
|
||||
>v2 : Symbol(v2, Decl(file2.ts, 0, 3))
|
||||
|
||||
var v4 = () => 5;
|
||||
>v4 : Symbol(v4, Decl(file2.ts, 1, 3))
|
||||
|
||||
=== tests/cases/conformance/externalModules/file3.ts ===
|
||||
export var v3 = true;
|
||||
>v3 : Symbol(v3, Decl(file3.ts, 0, 10))
|
||||
|
||||
var v2 = [1,2,3]; // Module scope. Should not appear in global scope
|
||||
>v2 : Symbol(v2, Decl(file3.ts, 1, 3))
|
||||
|
||||
=== tests/cases/conformance/externalModules/file4.ts ===
|
||||
import file3 = require('./file3');
|
||||
>file3 : Symbol(file3, Decl(file4.ts, 0, 0))
|
||||
|
||||
var t1 = v1;
|
||||
>t1 : Symbol(t1, Decl(file4.ts, 1, 3))
|
||||
>v1 : Symbol(v1, Decl(file1.ts, 0, 3))
|
||||
|
||||
var t2 = v2;
|
||||
>t2 : Symbol(t2, Decl(file4.ts, 2, 3))
|
||||
>v2 : Symbol(v2, Decl(file2.ts, 0, 3))
|
||||
|
||||
var t3 = file3.v3;
|
||||
>t3 : Symbol(t3, Decl(file4.ts, 3, 3))
|
||||
>file3.v3 : Symbol(file3.v3, Decl(file3.ts, 0, 10))
|
||||
>file3 : Symbol(file3, Decl(file4.ts, 0, 0))
|
||||
>v3 : Symbol(file3.v3, Decl(file3.ts, 0, 10))
|
||||
|
||||
var v4 = {a: true, b: NaN}; // Should shadow global v2 in this module
|
||||
>v4 : Symbol(v4, Decl(file4.ts, 4, 3))
|
||||
>a : Symbol(a, Decl(file4.ts, 4, 10))
|
||||
>b : Symbol(b, Decl(file4.ts, 4, 18))
|
||||
>NaN : Symbol(NaN, Decl(lib.d.ts, --, --))
|
||||
|
||||
=== tests/cases/conformance/externalModules/file5.ts ===
|
||||
var x = v2; // Should be global v2 of type number again
|
||||
>x : Symbol(x, Decl(file5.ts, 0, 3))
|
||||
>v2 : Symbol(v2, Decl(file2.ts, 0, 3))
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
=== tests/cases/conformance/externalModules/file1.ts ===
|
||||
var v1 = "sausages"; // Global scope
|
||||
>v1 : string
|
||||
>"sausages" : string
|
||||
|
||||
=== tests/cases/conformance/externalModules/file2.ts ===
|
||||
var v2 = 42; // Global scope
|
||||
>v2 : number
|
||||
>42 : number
|
||||
|
||||
var v4 = () => 5;
|
||||
>v4 : () => number
|
||||
>() => 5 : () => number
|
||||
>5 : number
|
||||
|
||||
=== tests/cases/conformance/externalModules/file3.ts ===
|
||||
export var v3 = true;
|
||||
>v3 : boolean
|
||||
>true : boolean
|
||||
|
||||
var v2 = [1,2,3]; // Module scope. Should not appear in global scope
|
||||
>v2 : number[]
|
||||
>[1,2,3] : number[]
|
||||
>1 : number
|
||||
>2 : number
|
||||
>3 : number
|
||||
|
||||
=== tests/cases/conformance/externalModules/file4.ts ===
|
||||
import file3 = require('./file3');
|
||||
>file3 : typeof file3
|
||||
|
||||
var t1 = v1;
|
||||
>t1 : string
|
||||
>v1 : string
|
||||
|
||||
var t2 = v2;
|
||||
>t2 : number
|
||||
>v2 : number
|
||||
|
||||
var t3 = file3.v3;
|
||||
>t3 : boolean
|
||||
>file3.v3 : boolean
|
||||
>file3 : typeof file3
|
||||
>v3 : boolean
|
||||
|
||||
var v4 = {a: true, b: NaN}; // Should shadow global v2 in this module
|
||||
>v4 : { a: boolean; b: number; }
|
||||
>{a: true, b: NaN} : { a: boolean; b: number; }
|
||||
>a : boolean
|
||||
>true : boolean
|
||||
>b : number
|
||||
>NaN : number
|
||||
|
||||
=== tests/cases/conformance/externalModules/file5.ts ===
|
||||
var x = v2; // Should be global v2 of type number again
|
||||
>x : number
|
||||
>v2 : number
|
||||
|
||||
@@ -1,18 +1,15 @@
|
||||
tests/cases/compiler/nonMergedOverloads.ts(1,5): error TS2300: Duplicate identifier 'f'.
|
||||
tests/cases/compiler/nonMergedOverloads.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/compiler/nonMergedOverloads.ts(3,17): error TS2300: Duplicate identifier 'f'.
|
||||
tests/cases/compiler/nonMergedOverloads.ts(4,17): error TS2300: Duplicate identifier 'f'.
|
||||
|
||||
|
||||
==== tests/cases/compiler/nonMergedOverloads.ts (4 errors) ====
|
||||
==== tests/cases/compiler/nonMergedOverloads.ts (3 errors) ====
|
||||
var f = 10;
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'f'.
|
||||
|
||||
export function f();
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~
|
||||
!!! error TS2300: Duplicate identifier 'f'.
|
||||
export function f() {
|
||||
~
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,28): error TS2304: Cannot find name 'DisplayPosition'.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,45): error TS1137: Expression or comma expected.
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,46): error TS1005: ';' expected.
|
||||
@@ -35,10 +34,8 @@ tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(2,97): error T
|
||||
tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts(3,25): error TS2304: Cannot find name 'SeedCoords'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (35 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/Fuzz/parser0_004152.ts (34 errors) ====
|
||||
export class Game {
|
||||
~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
private position = new DisplayPosition([), 3, 3, 3, 3, 3, 0, 3, 3, 3, 3, 3, 3, 0], NoMove, 0);
|
||||
~~~~~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'DisplayPosition'.
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts (1 errors) ====
|
||||
export class Logger {
|
||||
~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
public
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts ===
|
||||
export class Logger {
|
||||
>Logger : Symbol(Logger, Decl(parser509546.ts, 0, 0))
|
||||
|
||||
public
|
||||
>public : Symbol(public, Decl(parser509546.ts, 0, 21))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546.ts ===
|
||||
export class Logger {
|
||||
>Logger : Logger
|
||||
|
||||
public
|
||||
>public : any
|
||||
}
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts (1 errors) ====
|
||||
export class Logger {
|
||||
~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
public
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts ===
|
||||
export class Logger {
|
||||
>Logger : Symbol(Logger, Decl(parser509546_1.ts, 0, 0))
|
||||
|
||||
public
|
||||
>public : Symbol(public, Decl(parser509546_1.ts, 0, 21))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_1.ts ===
|
||||
export class Logger {
|
||||
>Logger : Logger
|
||||
|
||||
public
|
||||
>public : any
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts(3,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts (1 errors) ====
|
||||
"use strict";
|
||||
|
||||
export class Logger {
|
||||
~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
public
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts ===
|
||||
"use strict";
|
||||
|
||||
export class Logger {
|
||||
>Logger : Symbol(Logger, Decl(parser509546_2.ts, 0, 13))
|
||||
|
||||
public
|
||||
>public : Symbol(public, Decl(parser509546_2.ts, 2, 21))
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser509546_2.ts ===
|
||||
"use strict";
|
||||
>"use strict" : string
|
||||
|
||||
export class Logger {
|
||||
>Logger : Logger
|
||||
|
||||
public
|
||||
>public : any
|
||||
}
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser618973.ts(1,8): error TS1030: 'export' modifier already seen.
|
||||
tests/cases/conformance/parser/ecmascript5/RegressionTests/parser618973.ts(1,21): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser618973.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/RegressionTests/parser618973.ts (1 errors) ====
|
||||
export export class Foo {
|
||||
~~~~~~
|
||||
!!! error TS1030: 'export' modifier already seen.
|
||||
~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
public Bar() {
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts(1,35): error TS2304: Cannot find name 'HTMLElement'.
|
||||
tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts(2,42): error TS2304: Cannot find name '_classNameRegexp'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts (3 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/parserArgumentList1.ts (2 errors) ====
|
||||
export function removeClass (node:HTMLElement, className:string) {
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'HTMLElement'.
|
||||
node.className = node.className.replace(_classNameRegexp(className), function (everything, leftDelimiter, name, rightDelimiter) {
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass1.ts(1,18): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass1.ts(1,40): error TS2304: Cannot find name 'ILogger'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass1.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass1.ts (1 errors) ====
|
||||
export class NullLogger implements ILogger {
|
||||
~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'ILogger'.
|
||||
public information(): boolean { return false; }
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts(3,18): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts(3,43): error TS2304: Cannot find name 'ILogger'.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts(4,37): error TS2304: Cannot find name 'ILogger'.
|
||||
tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts(5,18): error TS2339: Property '_information' does not exist on type 'LoggerAdapter'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts (4 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ClassDeclarations/parserClass2.ts (3 errors) ====
|
||||
|
||||
|
||||
export class LoggerAdapter implements ILogger {
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~~
|
||||
!!! error TS2304: Cannot find name 'ILogger'.
|
||||
constructor (public logger: ILogger) {
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum1.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum1.ts (1 errors) ====
|
||||
|
||||
|
||||
export enum SignatureFlags {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
None = 0,
|
||||
IsIndexer = 1,
|
||||
IsStringIndexer = 1 << 1,
|
||||
IsNumberIndexer = 1 << 2,
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum1.ts ===
|
||||
|
||||
|
||||
export enum SignatureFlags {
|
||||
>SignatureFlags : Symbol(SignatureFlags, Decl(parserEnum1.ts, 0, 0))
|
||||
|
||||
None = 0,
|
||||
>None : Symbol(SignatureFlags.None, Decl(parserEnum1.ts, 2, 32))
|
||||
|
||||
IsIndexer = 1,
|
||||
>IsIndexer : Symbol(SignatureFlags.IsIndexer, Decl(parserEnum1.ts, 3, 17))
|
||||
|
||||
IsStringIndexer = 1 << 1,
|
||||
>IsStringIndexer : Symbol(SignatureFlags.IsStringIndexer, Decl(parserEnum1.ts, 4, 22))
|
||||
|
||||
IsNumberIndexer = 1 << 2,
|
||||
>IsNumberIndexer : Symbol(SignatureFlags.IsNumberIndexer, Decl(parserEnum1.ts, 5, 33))
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum1.ts ===
|
||||
|
||||
|
||||
export enum SignatureFlags {
|
||||
>SignatureFlags : SignatureFlags
|
||||
|
||||
None = 0,
|
||||
>None : SignatureFlags
|
||||
>0 : number
|
||||
|
||||
IsIndexer = 1,
|
||||
>IsIndexer : SignatureFlags
|
||||
>1 : number
|
||||
|
||||
IsStringIndexer = 1 << 1,
|
||||
>IsStringIndexer : SignatureFlags
|
||||
>1 << 1 : number
|
||||
>1 : number
|
||||
>1 : number
|
||||
|
||||
IsNumberIndexer = 1 << 2,
|
||||
>IsNumberIndexer : SignatureFlags
|
||||
>1 << 2 : number
|
||||
>1 : number
|
||||
>2 : number
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum2.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum2.ts (1 errors) ====
|
||||
|
||||
|
||||
export enum SignatureFlags {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
None = 0,
|
||||
IsIndexer = 1,
|
||||
IsStringIndexer = 1 << 1,
|
||||
IsNumberIndexer = 1 << 2
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum2.ts ===
|
||||
|
||||
|
||||
export enum SignatureFlags {
|
||||
>SignatureFlags : Symbol(SignatureFlags, Decl(parserEnum2.ts, 0, 0))
|
||||
|
||||
None = 0,
|
||||
>None : Symbol(SignatureFlags.None, Decl(parserEnum2.ts, 2, 32))
|
||||
|
||||
IsIndexer = 1,
|
||||
>IsIndexer : Symbol(SignatureFlags.IsIndexer, Decl(parserEnum2.ts, 3, 17))
|
||||
|
||||
IsStringIndexer = 1 << 1,
|
||||
>IsStringIndexer : Symbol(SignatureFlags.IsStringIndexer, Decl(parserEnum2.ts, 4, 22))
|
||||
|
||||
IsNumberIndexer = 1 << 2
|
||||
>IsNumberIndexer : Symbol(SignatureFlags.IsNumberIndexer, Decl(parserEnum2.ts, 5, 33))
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum2.ts ===
|
||||
|
||||
|
||||
export enum SignatureFlags {
|
||||
>SignatureFlags : SignatureFlags
|
||||
|
||||
None = 0,
|
||||
>None : SignatureFlags
|
||||
>0 : number
|
||||
|
||||
IsIndexer = 1,
|
||||
>IsIndexer : SignatureFlags
|
||||
>1 : number
|
||||
|
||||
IsStringIndexer = 1 << 1,
|
||||
>IsStringIndexer : SignatureFlags
|
||||
>1 << 1 : number
|
||||
>1 : number
|
||||
>1 : number
|
||||
|
||||
IsNumberIndexer = 1 << 2
|
||||
>IsNumberIndexer : SignatureFlags
|
||||
>1 << 2 : number
|
||||
>1 : number
|
||||
>2 : number
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum3.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum3.ts (1 errors) ====
|
||||
|
||||
|
||||
export enum SignatureFlags {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum3.ts ===
|
||||
|
||||
|
||||
export enum SignatureFlags {
|
||||
>SignatureFlags : Symbol(SignatureFlags, Decl(parserEnum3.ts, 0, 0))
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum3.ts ===
|
||||
|
||||
|
||||
export enum SignatureFlags {
|
||||
>SignatureFlags : SignatureFlags
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum4.ts(3,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum4.ts(4,9): error TS1132: Enum member expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum4.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/EnumDeclarations/parserEnum4.ts (1 errors) ====
|
||||
|
||||
|
||||
export enum SignatureFlags {
|
||||
~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
,
|
||||
~
|
||||
!!! error TS1132: Enum member expected.
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts(1,10): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment1.ts (1 errors) ====
|
||||
export = foo
|
||||
~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
@@ -1,10 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts(1,10): error TS2304: Cannot find name 'foo'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment2.ts (1 errors) ====
|
||||
export = foo;
|
||||
~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'foo'.
|
||||
@@ -1,10 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts(1,9): error TS1109: Expression expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment3.ts (1 errors) ====
|
||||
export =
|
||||
~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
!!! error TS1109: Expression expected.
|
||||
@@ -1,10 +1,7 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts(1,10): error TS1109: Expression expected.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment4.ts (1 errors) ====
|
||||
export = ;
|
||||
~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~
|
||||
!!! error TS1109: Expression expected.
|
||||
@@ -1,12 +1,9 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment7.ts(1,14): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment7.ts(4,1): error TS2309: An export assignment cannot be used in a module with other exported elements.
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment7.ts(4,10): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment7.ts (3 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment7.ts (2 errors) ====
|
||||
export class C {
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
}
|
||||
|
||||
export = B;
|
||||
|
||||
@@ -1,13 +1,10 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment8.ts(1,1): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment8.ts(1,1): error TS2309: An export assignment cannot be used in a module with other exported elements.
|
||||
tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment8.ts(1,10): error TS2304: Cannot find name 'B'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment8.ts (3 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ExportAssignments/parserExportAssignment8.ts (2 errors) ====
|
||||
export = B;
|
||||
~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
~~~~~~~~~~~
|
||||
!!! error TS2309: An export assignment cannot be used in a module with other exported elements.
|
||||
~
|
||||
!!! error TS2304: Cannot find name 'B'.
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration6.ts(1,8): error TS1030: 'export' modifier already seen.
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration6.ts(1,25): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration6.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration6.ts (1 errors) ====
|
||||
export export interface I {
|
||||
~~~~~~
|
||||
!!! error TS1030: 'export' modifier already seen.
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration7.ts(1,18): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration7.ts (1 errors) ====
|
||||
export interface I {
|
||||
~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration7.ts ===
|
||||
export interface I {
|
||||
>I : Symbol(I, Decl(parserInterfaceDeclaration7.ts, 0, 0))
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/InterfaceDeclarations/parserInterfaceDeclaration7.ts ===
|
||||
export interface I {
|
||||
>I : I
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock1.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock1.ts(2,4): error TS1184: Modifiers cannot appear here.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock1.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock1.ts (1 errors) ====
|
||||
export function foo() {
|
||||
~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
export var x = this;
|
||||
~~~~~~
|
||||
!!! error TS1184: Modifiers cannot appear here.
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock3.ts(1,17): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock3.ts(2,4): error TS1184: Modifiers cannot appear here.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock3.ts (2 errors) ====
|
||||
==== tests/cases/conformance/parser/ecmascript5/ErrorRecovery/parserModifierOnStatementInBlock3.ts (1 errors) ====
|
||||
export function foo() {
|
||||
~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
export function bar() {
|
||||
~~~~~~
|
||||
!!! error TS1184: Modifiers cannot appear here.
|
||||
|
||||
@@ -1,37 +0,0 @@
|
||||
tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModule1.ts(1,19): error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
|
||||
|
||||
==== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModule1.ts (1 errors) ====
|
||||
export module CompilerDiagnostics {
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS1148: Cannot compile modules unless the '--module' flag is provided. Consider setting the 'module' compiler option in a 'tsconfig.json' file.
|
||||
export var debug = false;
|
||||
export interface IDiagnosticWriter {
|
||||
Alert(output: string): void;
|
||||
}
|
||||
|
||||
export var diagnosticWriter: IDiagnosticWriter = null;
|
||||
|
||||
export var analysisPass: number = 0;
|
||||
|
||||
export function Alert(output: string) {
|
||||
if (diagnosticWriter) {
|
||||
diagnosticWriter.Alert(output);
|
||||
}
|
||||
}
|
||||
|
||||
export function debugPrint(s: string) {
|
||||
if (debug) {
|
||||
Alert(s);
|
||||
}
|
||||
}
|
||||
|
||||
export function assert(condition: boolean, s: string) {
|
||||
if (debug) {
|
||||
if (!condition) {
|
||||
Alert(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
=== tests/cases/conformance/parser/ecmascript5/ModuleDeclarations/parserModule1.ts ===
|
||||
export module CompilerDiagnostics {
|
||||
>CompilerDiagnostics : Symbol(CompilerDiagnostics, Decl(parserModule1.ts, 0, 0))
|
||||
|
||||
export var debug = false;
|
||||
>debug : Symbol(debug, Decl(parserModule1.ts, 1, 18))
|
||||
|
||||
export interface IDiagnosticWriter {
|
||||
>IDiagnosticWriter : Symbol(IDiagnosticWriter, Decl(parserModule1.ts, 1, 33))
|
||||
|
||||
Alert(output: string): void;
|
||||
>Alert : Symbol(Alert, Decl(parserModule1.ts, 2, 44))
|
||||
>output : Symbol(output, Decl(parserModule1.ts, 3, 18))
|
||||
}
|
||||
|
||||
export var diagnosticWriter: IDiagnosticWriter = null;
|
||||
>diagnosticWriter : Symbol(diagnosticWriter, Decl(parserModule1.ts, 6, 18))
|
||||
>IDiagnosticWriter : Symbol(IDiagnosticWriter, Decl(parserModule1.ts, 1, 33))
|
||||
|
||||
export var analysisPass: number = 0;
|
||||
>analysisPass : Symbol(analysisPass, Decl(parserModule1.ts, 8, 18))
|
||||
|
||||
export function Alert(output: string) {
|
||||
>Alert : Symbol(Alert, Decl(parserModule1.ts, 8, 44))
|
||||
>output : Symbol(output, Decl(parserModule1.ts, 10, 30))
|
||||
|
||||
if (diagnosticWriter) {
|
||||
>diagnosticWriter : Symbol(diagnosticWriter, Decl(parserModule1.ts, 6, 18))
|
||||
|
||||
diagnosticWriter.Alert(output);
|
||||
>diagnosticWriter.Alert : Symbol(IDiagnosticWriter.Alert, Decl(parserModule1.ts, 2, 44))
|
||||
>diagnosticWriter : Symbol(diagnosticWriter, Decl(parserModule1.ts, 6, 18))
|
||||
>Alert : Symbol(IDiagnosticWriter.Alert, Decl(parserModule1.ts, 2, 44))
|
||||
>output : Symbol(output, Decl(parserModule1.ts, 10, 30))
|
||||
}
|
||||
}
|
||||
|
||||
export function debugPrint(s: string) {
|
||||
>debugPrint : Symbol(debugPrint, Decl(parserModule1.ts, 14, 9))
|
||||
>s : Symbol(s, Decl(parserModule1.ts, 16, 35))
|
||||
|
||||
if (debug) {
|
||||
>debug : Symbol(debug, Decl(parserModule1.ts, 1, 18))
|
||||
|
||||
Alert(s);
|
||||
>Alert : Symbol(Alert, Decl(parserModule1.ts, 8, 44))
|
||||
>s : Symbol(s, Decl(parserModule1.ts, 16, 35))
|
||||
}
|
||||
}
|
||||
|
||||
export function assert(condition: boolean, s: string) {
|
||||
>assert : Symbol(assert, Decl(parserModule1.ts, 20, 9))
|
||||
>condition : Symbol(condition, Decl(parserModule1.ts, 22, 31))
|
||||
>s : Symbol(s, Decl(parserModule1.ts, 22, 50))
|
||||
|
||||
if (debug) {
|
||||
>debug : Symbol(debug, Decl(parserModule1.ts, 1, 18))
|
||||
|
||||
if (!condition) {
|
||||
>condition : Symbol(condition, Decl(parserModule1.ts, 22, 31))
|
||||
|
||||
Alert(s);
|
||||
>Alert : Symbol(Alert, Decl(parserModule1.ts, 8, 44))
|
||||
>s : Symbol(s, Decl(parserModule1.ts, 22, 50))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loaded 100 of 120 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user