mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge pull request #3085 from tinganho/nonInitExport
No emit on non initialized exports
This commit is contained in:
@@ -139,7 +139,7 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
let exportEquals: ExportAssignment;
|
||||
let hasExportStars: boolean;
|
||||
|
||||
/** write emitted output to disk*/
|
||||
/** Write emitted output to disk */
|
||||
let writeEmittedFiles = writeJavaScriptFile;
|
||||
|
||||
let detachedCommentsInfo: { nodePos: number; detachedCommentEndPos: number }[];
|
||||
@@ -3059,13 +3059,15 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
||||
}
|
||||
|
||||
function emitVariableStatement(node: VariableStatement) {
|
||||
let startIsEmitted = true;
|
||||
if (!(node.flags & NodeFlags.Export)) {
|
||||
startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList);
|
||||
let startIsEmitted = false;
|
||||
if (node.flags & NodeFlags.Export) {
|
||||
if (isES6ExportedDeclaration(node)) {
|
||||
// Exported ES6 module member
|
||||
write("export ");
|
||||
startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList);
|
||||
}
|
||||
}
|
||||
else if (isES6ExportedDeclaration(node)) {
|
||||
// Exported ES6 module member
|
||||
write("export ");
|
||||
else {
|
||||
startIsEmitted = tryEmitStartOfVariableDeclarationList(node.declarationList);
|
||||
}
|
||||
if (startIsEmitted) {
|
||||
|
||||
-1
@@ -16,6 +16,5 @@ var A;
|
||||
}
|
||||
return B;
|
||||
})();
|
||||
A.beez;
|
||||
A.beez2 = new Array();
|
||||
})(A || (A = {}));
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(3,8): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(4,5): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts(5,10): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/internalModules/exportDeclarations/NonInitializedExportInInternalModule.ts (3 errors) ====
|
||||
|
||||
module Inner {
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
//// [NonInitializedExportInInternalModule.ts]
|
||||
|
||||
module Inner {
|
||||
var;
|
||||
let;
|
||||
const;
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
}
|
||||
|
||||
//// [NonInitializedExportInInternalModule.js]
|
||||
var Inner;
|
||||
(function (Inner) {
|
||||
var ;
|
||||
let;
|
||||
var ;
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
var B;
|
||||
(function (B) {
|
||||
B.a = 1, B.c = 2;
|
||||
})(B || (B = {}));
|
||||
var C;
|
||||
(function (C) {
|
||||
C.a = 1, C.c = 2;
|
||||
})(C || (C = {}));
|
||||
// Shouldn't be filtered
|
||||
Inner.a1 = 1;
|
||||
Inner.b1 = 1;
|
||||
Inner.c1 = 'a';
|
||||
Inner.d1 = 1;
|
||||
var D = (function () {
|
||||
function D() {
|
||||
}
|
||||
return D;
|
||||
})();
|
||||
Inner.e1 = new D;
|
||||
Inner.f1 = new D;
|
||||
Inner.g1 = new D;
|
||||
Inner.h1 = new D;
|
||||
})(Inner || (Inner = {}));
|
||||
-2
@@ -39,14 +39,12 @@ var A;
|
||||
(function (A) {
|
||||
var B;
|
||||
(function (B) {
|
||||
B.x;
|
||||
})(B = A.B || (A.B = {}));
|
||||
})(A || (A = {}));
|
||||
var A;
|
||||
(function (A) {
|
||||
var B;
|
||||
(function (B) {
|
||||
B.x;
|
||||
})(B || (B = {}));
|
||||
})(A || (A = {}));
|
||||
// ensure the right var decl is exported
|
||||
|
||||
@@ -55,7 +55,6 @@ var E;
|
||||
})(E || (E = {}));
|
||||
var M;
|
||||
(function (M) {
|
||||
M.a;
|
||||
})(M || (M = {}));
|
||||
var a;
|
||||
var b;
|
||||
|
||||
@@ -56,7 +56,6 @@ var E;
|
||||
})(E || (E = {}));
|
||||
var M;
|
||||
(function (M) {
|
||||
M.a;
|
||||
})(M || (M = {}));
|
||||
var a;
|
||||
var b;
|
||||
|
||||
@@ -19,7 +19,6 @@ export var a = function () {
|
||||
|
||||
|
||||
//// [aliasUsedAsNameValue_0.js]
|
||||
exports.id;
|
||||
//// [aliasUsedAsNameValue_1.js]
|
||||
function b(a) { return null; }
|
||||
exports.b = b;
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.obj;
|
||||
__test2__.__val__obj = __test2__.obj;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
__test2__.__val__obj = __test1__.__val__obj4;
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.obj;
|
||||
__test2__.__val__obj = __test2__.obj;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
__test2__.__val__obj = __test1__.__val__obj4;
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -19,7 +19,6 @@ var __test1__;
|
||||
})(__test1__ || (__test1__ = {}));
|
||||
var __test2__;
|
||||
(function (__test2__) {
|
||||
__test2__.aa;
|
||||
;
|
||||
__test2__.__val__aa = __test2__.aa;
|
||||
})(__test2__ || (__test2__ = {}));
|
||||
|
||||
@@ -93,7 +93,6 @@ this = value;
|
||||
// identifiers: module, class, enum, function
|
||||
var M;
|
||||
(function (M) {
|
||||
M.a;
|
||||
})(M || (M = {}));
|
||||
M = value;
|
||||
C = value;
|
||||
|
||||
@@ -79,7 +79,6 @@ x = ''; // Error
|
||||
(x) = ''; // Error
|
||||
var M;
|
||||
(function (M) {
|
||||
M.y;
|
||||
})(M || (M = {}));
|
||||
M.y = 3; // OK
|
||||
(M).y = 3; // OK
|
||||
@@ -93,7 +92,6 @@ var M2;
|
||||
(function (M2) {
|
||||
var M3;
|
||||
(function (M3) {
|
||||
M3.x;
|
||||
})(M3 = M2.M3 || (M2.M3 = {}));
|
||||
M3 = { x: 3 }; // Error
|
||||
})(M2 || (M2 = {}));
|
||||
|
||||
@@ -84,7 +84,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// any other type var
|
||||
|
||||
@@ -50,7 +50,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// boolean type var
|
||||
|
||||
@@ -57,7 +57,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// number type var
|
||||
|
||||
@@ -56,7 +56,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// string type var
|
||||
|
||||
-1
@@ -27,7 +27,6 @@ var A = (function () {
|
||||
})();
|
||||
var A;
|
||||
(function (A) {
|
||||
A.v;
|
||||
})(A || (A = {}));
|
||||
var Foo;
|
||||
(function (Foo) {
|
||||
|
||||
@@ -16,7 +16,6 @@ export class Test1 {
|
||||
}
|
||||
|
||||
//// [classMemberInitializerWithLamdaScoping3_0.js]
|
||||
exports.field1;
|
||||
//// [classMemberInitializerWithLamdaScoping3_1.js]
|
||||
var Test1 = (function () {
|
||||
function Test1(field1) {
|
||||
|
||||
@@ -6,5 +6,4 @@ export var b: number;
|
||||
//// [commentsBeforeVariableStatement1.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
/** b's comment*/
|
||||
exports.b;
|
||||
});
|
||||
|
||||
@@ -67,7 +67,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
var m1;
|
||||
(function (m1) {
|
||||
/** b's comment*/
|
||||
m1.b;
|
||||
/** foo's comment*/
|
||||
function foo() {
|
||||
return m1.b;
|
||||
@@ -98,7 +97,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
var m4;
|
||||
(function (m4) {
|
||||
/** b's comment */
|
||||
m4.b;
|
||||
/** foo's comment
|
||||
*/
|
||||
function foo() {
|
||||
|
||||
@@ -67,7 +67,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
var m1;
|
||||
(function (m1) {
|
||||
/** b's comment*/
|
||||
m1.b;
|
||||
/** foo's comment*/
|
||||
function foo() {
|
||||
return m1.b;
|
||||
@@ -98,7 +97,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
var m4;
|
||||
(function (m4) {
|
||||
/** b's comment */
|
||||
m4.b;
|
||||
/** foo's comment
|
||||
*/
|
||||
function foo() {
|
||||
|
||||
@@ -66,7 +66,6 @@ export var newVar2 = new extMod.m4.m2.c();
|
||||
var m1;
|
||||
(function (m1) {
|
||||
/** b's comment*/
|
||||
m1.b;
|
||||
/** foo's comment*/
|
||||
function foo() {
|
||||
return m1.b;
|
||||
@@ -97,7 +96,6 @@ var myvar = new m1.m2.c();
|
||||
var m4;
|
||||
(function (m4) {
|
||||
/** b's comment */
|
||||
m4.b;
|
||||
/** foo's comment
|
||||
*/
|
||||
function foo() {
|
||||
|
||||
@@ -102,7 +102,6 @@ new m7.m8.m9.c();
|
||||
var m1;
|
||||
(function (m1) {
|
||||
/** b's comment*/
|
||||
m1.b;
|
||||
/** foo's comment*/
|
||||
function foo() {
|
||||
return m1.b;
|
||||
|
||||
@@ -163,7 +163,6 @@ var m1;
|
||||
return C5;
|
||||
})();
|
||||
m1.C5 = C5;
|
||||
m1.v2;
|
||||
})(m1 || (m1 = {}));
|
||||
var C2 = (function () {
|
||||
function C2() {
|
||||
|
||||
@@ -156,7 +156,6 @@ this += value;
|
||||
// identifiers: module, class, enum, function
|
||||
var M;
|
||||
(function (M) {
|
||||
M.a;
|
||||
})(M || (M = {}));
|
||||
M *= value;
|
||||
M += value;
|
||||
|
||||
@@ -283,7 +283,6 @@ var C4T5 = (function () {
|
||||
// CONTEXT: Module property assignment
|
||||
var C5T5;
|
||||
(function (C5T5) {
|
||||
C5T5.foo;
|
||||
C5T5.foo = function (i, s) {
|
||||
return s;
|
||||
};
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -20,7 +20,6 @@ export var x: SubModule.m.m3.c;
|
||||
|
||||
//// [declFileAmbientExternalModuleWithSingleExportedModule_0.js]
|
||||
//// [declFileAmbientExternalModuleWithSingleExportedModule_1.js]
|
||||
exports.x;
|
||||
|
||||
|
||||
//// [declFileAmbientExternalModuleWithSingleExportedModule_0.d.ts]
|
||||
|
||||
@@ -24,7 +24,6 @@ export = m;
|
||||
//// [declFileExportAssignmentImportInternalModule.js]
|
||||
var m3;
|
||||
(function (m3) {
|
||||
m3.server;
|
||||
})(m3 || (m3 = {}));
|
||||
var m = m3;
|
||||
module.exports = m;
|
||||
|
||||
@@ -17,7 +17,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
});
|
||||
//// [declFileExportAssignmentOfGenericInterface_1.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
exports.x;
|
||||
exports.x.a;
|
||||
});
|
||||
|
||||
|
||||
@@ -54,7 +54,6 @@ define(["require", "exports", "declFileExportImportChain_b1"], function (require
|
||||
});
|
||||
//// [declFileExportImportChain_d.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
exports.x;
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -47,7 +47,6 @@ define(["require", "exports", "declFileExportImportChain2_b"], function (require
|
||||
});
|
||||
//// [declFileExportImportChain2_d.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
exports.x;
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ export import b = a;
|
||||
var z = b.x;
|
||||
|
||||
//// [declFileForExportedImport_0.js]
|
||||
exports.x;
|
||||
//// [declFileForExportedImport_1.js]
|
||||
///<reference path='declFileForExportedImport_0.ts'/>
|
||||
exports.a = require('declFileForExportedImport_0');
|
||||
|
||||
@@ -80,7 +80,6 @@ var C;
|
||||
})();
|
||||
C.D = D;
|
||||
})(C = exports.C || (exports.C = {}));
|
||||
exports.a;
|
||||
exports.b = C.F;
|
||||
exports.c = C.F2;
|
||||
exports.d = C.F3;
|
||||
|
||||
@@ -34,7 +34,6 @@ module M {
|
||||
//// [declFileTypeAnnotationTypeAlias.js]
|
||||
var M;
|
||||
(function (M) {
|
||||
M.x;
|
||||
var c = (function () {
|
||||
function c() {
|
||||
}
|
||||
@@ -61,7 +60,6 @@ var M;
|
||||
return Window;
|
||||
})();
|
||||
N.Window = Window;
|
||||
N.p;
|
||||
})(N = M.N || (M.N = {}));
|
||||
})(M || (M = {}));
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ var M;
|
||||
return Window;
|
||||
})();
|
||||
N.Window = Window;
|
||||
N.p; // Should report error that W is private
|
||||
// Should report error that W is private
|
||||
})(N = M.N || (M.N = {}));
|
||||
})(M || (M = {}));
|
||||
var M1;
|
||||
@@ -65,7 +65,7 @@ var M1;
|
||||
return Window;
|
||||
})();
|
||||
N.Window = Window;
|
||||
N.p; // No error
|
||||
// No error
|
||||
})(N = M1.N || (M1.N = {}));
|
||||
})(M1 || (M1 = {}));
|
||||
var M2;
|
||||
|
||||
@@ -51,7 +51,6 @@ var m;
|
||||
})();
|
||||
m2.public1 = public1;
|
||||
})(m2 || (m2 = {}));
|
||||
m.x;
|
||||
m.x2 = {
|
||||
x: new private1(),
|
||||
y: new m2.public1(),
|
||||
@@ -61,9 +60,7 @@ var m;
|
||||
};
|
||||
m.x3 = m.x;
|
||||
// Function type
|
||||
m.y;
|
||||
m.y2 = m.y;
|
||||
// constructor type
|
||||
m.z;
|
||||
m.z2 = m.z;
|
||||
})(m || (m = {}));
|
||||
|
||||
@@ -50,11 +50,9 @@ var m;
|
||||
// Directly using names from this module
|
||||
var x;
|
||||
var y = new private1();
|
||||
m.k;
|
||||
m.l = new private1();
|
||||
var x2;
|
||||
var y2 = new public1();
|
||||
m.k2;
|
||||
m.l2 = new public1();
|
||||
var m2;
|
||||
(function (m2) {
|
||||
@@ -67,6 +65,5 @@ var m;
|
||||
})(m2 || (m2 = {}));
|
||||
var x3;
|
||||
var y3 = new m2.public2();
|
||||
m.k3;
|
||||
m.l3 = new m2.public2();
|
||||
})(m || (m = {}));
|
||||
|
||||
@@ -16,13 +16,11 @@ var m2_2: typeof m2;
|
||||
//// [declFileTypeofModule.js]
|
||||
var m1;
|
||||
(function (m1) {
|
||||
m1.c;
|
||||
})(m1 || (m1 = {}));
|
||||
var m1_1 = m1;
|
||||
var m1_2;
|
||||
var m2;
|
||||
(function (m2) {
|
||||
m2.d;
|
||||
})(m2 || (m2 = {}));
|
||||
var m2_1 = m2;
|
||||
var m2_2;
|
||||
|
||||
@@ -22,7 +22,6 @@ var m;
|
||||
})();
|
||||
c_1.c = c;
|
||||
})(c = m.c || (m.c = {}));
|
||||
m.a;
|
||||
})(m || (m = {}));
|
||||
module.exports = m;
|
||||
|
||||
|
||||
@@ -32,7 +32,6 @@ var X;
|
||||
base.C = C;
|
||||
var M;
|
||||
(function (M) {
|
||||
M.v;
|
||||
})(M = base.M || (base.M = {}));
|
||||
(function (E) {
|
||||
})(base.E || (base.E = {}));
|
||||
|
||||
@@ -74,7 +74,7 @@ var M;
|
||||
D[D["f"] = 0] = "f";
|
||||
})(P.D || (P.D = {}));
|
||||
var D = P.D;
|
||||
P.v; // ok
|
||||
// ok
|
||||
P.w = M.D.f; // error, should be typeof M.D.f
|
||||
P.x = M.C.f; // error, should be typeof M.C.f
|
||||
P.x = M.E.f; // error, should be typeof M.E.f
|
||||
|
||||
@@ -9,7 +9,7 @@ export module M {
|
||||
//// [declarationEmit_nameConflictsWithAlias.js]
|
||||
var M;
|
||||
(function (M) {
|
||||
M.w; // Gets emitted as C.I, which is the wrong interface
|
||||
// Gets emitted as C.I, which is the wrong interface
|
||||
})(M = exports.M || (exports.M = {}));
|
||||
|
||||
|
||||
|
||||
@@ -13,5 +13,4 @@ module M2 {
|
||||
//// [decoratorOnImportEquals1.js]
|
||||
var M1;
|
||||
(function (M1) {
|
||||
M1.X;
|
||||
})(M1 || (M1 = {}));
|
||||
|
||||
@@ -10,5 +10,4 @@ import lib = require('./decoratorOnImportEquals2_0');
|
||||
declare function dec<T>(target: T): T;
|
||||
|
||||
//// [decoratorOnImportEquals2_0.js]
|
||||
exports.X;
|
||||
//// [decoratorOnImportEquals2_1.js]
|
||||
|
||||
@@ -61,7 +61,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// any type var
|
||||
|
||||
@@ -93,7 +93,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// any type var
|
||||
|
||||
@@ -50,7 +50,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// number type var
|
||||
|
||||
@@ -59,7 +59,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
//number type var
|
||||
|
||||
@@ -66,7 +66,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// boolean type var
|
||||
|
||||
@@ -78,7 +78,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// string type var
|
||||
|
||||
@@ -62,7 +62,6 @@ var f5 = function (a) {
|
||||
};
|
||||
var U;
|
||||
(function (U) {
|
||||
U.x;
|
||||
})(U || (U = {}));
|
||||
var f6 = function (t) {
|
||||
if (t === void 0) { t = T; }
|
||||
|
||||
@@ -83,7 +83,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// any type var
|
||||
|
||||
@@ -50,7 +50,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// boolean type var
|
||||
|
||||
@@ -58,7 +58,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// number type var
|
||||
|
||||
@@ -57,7 +57,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// string type var
|
||||
|
||||
@@ -117,7 +117,7 @@ var Foo = (function () {
|
||||
})();
|
||||
var Foo;
|
||||
(function (Foo) {
|
||||
Foo.x; // error for redeclaring var in a different parent
|
||||
// error for redeclaring var in a different parent
|
||||
})(Foo || (Foo = {}));
|
||||
var N;
|
||||
(function (N) {
|
||||
|
||||
@@ -83,9 +83,9 @@ define(["require", "exports"], function (require, exports) {
|
||||
var M2;
|
||||
(function (M2) {
|
||||
var v;
|
||||
M2.v; // one error (visibility)
|
||||
// one error (visibility)
|
||||
var w;
|
||||
M2.w; // two errors (visibility and type mismatch)
|
||||
// two errors (visibility and type mismatch)
|
||||
})(M2 || (M2 = {}));
|
||||
var M;
|
||||
(function (M) {
|
||||
|
||||
@@ -140,11 +140,9 @@ b++;
|
||||
// modules
|
||||
var moduleType1;
|
||||
(function (moduleType1) {
|
||||
moduleType1.baz1;
|
||||
})(moduleType1 || (moduleType1 = {}));
|
||||
var moduleType\u0032;
|
||||
(function (moduleType2) {
|
||||
moduleType2.baz2;
|
||||
})(moduleType\u0032 || (moduleType\u0032 = {}));
|
||||
moduleType1.baz1 = 3;
|
||||
moduleType\u0031.baz1 = 3;
|
||||
|
||||
@@ -12,7 +12,6 @@ export = M2; // should not error
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
var M;
|
||||
(function (M) {
|
||||
M.x;
|
||||
})(M || (M = {}));
|
||||
var M2 = M;
|
||||
return M2;
|
||||
|
||||
@@ -16,7 +16,6 @@ var n: number = modM.x;
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
var M;
|
||||
(function (M) {
|
||||
M.x;
|
||||
})(M || (M = {}));
|
||||
return M;
|
||||
});
|
||||
|
||||
@@ -25,7 +25,6 @@ export = M;
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
var M;
|
||||
(function (M) {
|
||||
M.server;
|
||||
})(M || (M = {}));
|
||||
return M;
|
||||
});
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts(3,1): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts(4,6): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesAMD.ts (3 errors) ====
|
||||
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
//// [exportNonInitializedVariablesAMD.ts]
|
||||
|
||||
var;
|
||||
let;
|
||||
const;
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
|
||||
|
||||
//// [exportNonInitializedVariablesAMD.js]
|
||||
define(["require", "exports"], function (require, exports) {
|
||||
var ;
|
||||
let;
|
||||
var ;
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
var B;
|
||||
(function (B) {
|
||||
B.a = 1, B.c = 2;
|
||||
})(B || (B = {}));
|
||||
var C;
|
||||
(function (C) {
|
||||
C.a = 1, C.c = 2;
|
||||
})(C || (C = {}));
|
||||
// Shouldn't be filtered
|
||||
exports.a1 = 1;
|
||||
exports.b1 = 1;
|
||||
exports.c1 = 'a';
|
||||
exports.d1 = 1;
|
||||
var D = (function () {
|
||||
function D() {
|
||||
}
|
||||
return D;
|
||||
})();
|
||||
exports.e1 = new D;
|
||||
exports.f1 = new D;
|
||||
exports.g1 = new D;
|
||||
exports.h1 = new D;
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts(3,1): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts(4,6): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesCommonJS.ts (3 errors) ====
|
||||
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
//// [exportNonInitializedVariablesCommonJS.ts]
|
||||
|
||||
var;
|
||||
let;
|
||||
const;
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
|
||||
|
||||
//// [exportNonInitializedVariablesCommonJS.js]
|
||||
var ;
|
||||
let;
|
||||
var ;
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
var B;
|
||||
(function (B) {
|
||||
B.a = 1, B.c = 2;
|
||||
})(B || (B = {}));
|
||||
var C;
|
||||
(function (C) {
|
||||
C.a = 1, C.c = 2;
|
||||
})(C || (C = {}));
|
||||
// Shouldn't be filtered
|
||||
exports.a1 = 1;
|
||||
exports.b1 = 1;
|
||||
exports.c1 = 'a';
|
||||
exports.d1 = 1;
|
||||
var D = (function () {
|
||||
function D() {
|
||||
}
|
||||
return D;
|
||||
})();
|
||||
exports.e1 = new D;
|
||||
exports.f1 = new D;
|
||||
exports.g1 = new D;
|
||||
exports.h1 = new D;
|
||||
@@ -0,0 +1,46 @@
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts(3,1): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts(4,6): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesES6.ts (3 errors) ====
|
||||
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
//// [exportNonInitializedVariablesES6.ts]
|
||||
|
||||
var;
|
||||
let;
|
||||
const;
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
|
||||
|
||||
//// [exportNonInitializedVariablesES6.js]
|
||||
var ;
|
||||
let;
|
||||
const ;
|
||||
export var a;
|
||||
export let b;
|
||||
export var c;
|
||||
export let d;
|
||||
class A {
|
||||
}
|
||||
export var e;
|
||||
export let f;
|
||||
var B;
|
||||
(function (B) {
|
||||
B.a = 1, B.c = 2;
|
||||
})(B || (B = {}));
|
||||
var C;
|
||||
(function (C) {
|
||||
C.a = 1, C.c = 2;
|
||||
})(C || (C = {}));
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1 = 'a';
|
||||
export let d1 = 1;
|
||||
class D {
|
||||
}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1 = new D;
|
||||
export let h1 = new D;
|
||||
@@ -0,0 +1,46 @@
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts(3,1): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts(4,6): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesSystem.ts (3 errors) ====
|
||||
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
//// [exportNonInitializedVariablesSystem.ts]
|
||||
|
||||
var;
|
||||
let;
|
||||
const;
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
|
||||
|
||||
//// [exportNonInitializedVariablesSystem.js]
|
||||
System.register([], function(exports_1) {
|
||||
var a, b, c, d, A, e, f, B, C, a1, b1, c1, d1, D, e1, f1, g1, h1;
|
||||
return {
|
||||
setters:[],
|
||||
execute: function() {
|
||||
let;
|
||||
A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
(function (B) {
|
||||
B.a = 1, B.c = 2;
|
||||
})(B || (B = {}));
|
||||
(function (C) {
|
||||
C.a = 1, C.c = 2;
|
||||
})(C || (C = {}));
|
||||
// Shouldn't be filtered
|
||||
exports_1("a1", a1 = 1);
|
||||
exports_1("b1", b1 = 1);
|
||||
exports_1("c1", c1 = 'a');
|
||||
exports_1("d1", d1 = 1);
|
||||
D = (function () {
|
||||
function D() {
|
||||
}
|
||||
return D;
|
||||
})();
|
||||
exports_1("e1", e1 = new D);
|
||||
exports_1("f1", f1 = new D);
|
||||
exports_1("g1", g1 = new D);
|
||||
exports_1("h1", h1 = new D);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts(2,4): error TS1123: Variable declaration list cannot be empty.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts(3,1): error TS2304: Cannot find name 'let'.
|
||||
tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts(4,6): error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
|
||||
==== tests/cases/conformance/externalModules/exportNonInitializedVariablesUMD.ts (3 errors) ====
|
||||
|
||||
var;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
let;
|
||||
~~~
|
||||
!!! error TS2304: Cannot find name 'let'.
|
||||
const;
|
||||
|
||||
!!! error TS1123: Variable declaration list cannot be empty.
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
//// [exportNonInitializedVariablesUMD.ts]
|
||||
|
||||
var;
|
||||
let;
|
||||
const;
|
||||
|
||||
export var a;
|
||||
export let b;
|
||||
export var c: string;
|
||||
export let d: number;
|
||||
class A {}
|
||||
export var e: A;
|
||||
export let f: A;
|
||||
|
||||
namespace B {
|
||||
export let a = 1, b, c = 2;
|
||||
export let x, y, z;
|
||||
}
|
||||
|
||||
module C {
|
||||
export var a = 1, b, c = 2;
|
||||
export var x, y, z;
|
||||
}
|
||||
|
||||
// Shouldn't be filtered
|
||||
export var a1 = 1;
|
||||
export let b1 = 1;
|
||||
export var c1: string = 'a';
|
||||
export let d1: number = 1;
|
||||
class D {}
|
||||
export var e1 = new D;
|
||||
export let f1 = new D;
|
||||
export var g1: D = new D;
|
||||
export let h1: D = new D;
|
||||
|
||||
|
||||
//// [exportNonInitializedVariablesUMD.js]
|
||||
(function (deps, factory) {
|
||||
if (typeof module === 'object' && typeof module.exports === 'object') {
|
||||
var v = factory(require, exports); if (v !== undefined) module.exports = v;
|
||||
}
|
||||
else if (typeof define === 'function' && define.amd) {
|
||||
define(deps, factory);
|
||||
}
|
||||
})(["require", "exports"], function (require, exports) {
|
||||
var ;
|
||||
let;
|
||||
var ;
|
||||
var A = (function () {
|
||||
function A() {
|
||||
}
|
||||
return A;
|
||||
})();
|
||||
var B;
|
||||
(function (B) {
|
||||
B.a = 1, B.c = 2;
|
||||
})(B || (B = {}));
|
||||
var C;
|
||||
(function (C) {
|
||||
C.a = 1, C.c = 2;
|
||||
})(C || (C = {}));
|
||||
// Shouldn't be filtered
|
||||
exports.a1 = 1;
|
||||
exports.b1 = 1;
|
||||
exports.c1 = 'a';
|
||||
exports.d1 = 1;
|
||||
var D = (function () {
|
||||
function D() {
|
||||
}
|
||||
return D;
|
||||
})();
|
||||
exports.e1 = new D;
|
||||
exports.f1 = new D;
|
||||
exports.g1 = new D;
|
||||
exports.h1 = new D;
|
||||
});
|
||||
@@ -45,9 +45,5 @@ var foo;
|
||||
return C2;
|
||||
})();
|
||||
// None of the types are exported, so per section 10.3, should all be errors
|
||||
foo.e;
|
||||
foo.f;
|
||||
foo.g;
|
||||
foo.h;
|
||||
})(foo || (foo = {}));
|
||||
var y = foo.g; // Exported variable 'y' has or is using private type 'foo.C2'.
|
||||
|
||||
@@ -55,7 +55,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
exports.E = E;
|
||||
var M;
|
||||
(function (M) {
|
||||
M.x;
|
||||
})(M || (M = {}));
|
||||
exports.M = M;
|
||||
var a = M.x;
|
||||
|
||||
@@ -54,7 +54,6 @@ var E;
|
||||
exports.E = E;
|
||||
var M;
|
||||
(function (M) {
|
||||
M.x;
|
||||
})(M || (M = {}));
|
||||
exports.M = M;
|
||||
var a = M.x;
|
||||
|
||||
@@ -57,7 +57,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
exports.E1 = exports.E;
|
||||
var M;
|
||||
(function (M) {
|
||||
M.x;
|
||||
})(M = exports.M || (exports.M = {}));
|
||||
exports.M1 = exports.M;
|
||||
exports.a = M.x;
|
||||
|
||||
@@ -56,7 +56,6 @@ var E = exports.E;
|
||||
exports.E1 = exports.E;
|
||||
var M;
|
||||
(function (M) {
|
||||
M.x;
|
||||
})(M = exports.M || (exports.M = {}));
|
||||
exports.M1 = exports.M;
|
||||
exports.a = M.x;
|
||||
|
||||
@@ -10,6 +10,5 @@ module foo {
|
||||
function foo(y, z) { return y; }
|
||||
var foo;
|
||||
(function (foo) {
|
||||
foo.x;
|
||||
var y = 1;
|
||||
})(foo || (foo = {}));
|
||||
|
||||
@@ -14,6 +14,5 @@ var foo = (function () {
|
||||
})();
|
||||
var foo;
|
||||
(function (foo) {
|
||||
foo.x;
|
||||
var y = 1;
|
||||
})(foo || (foo = {}));
|
||||
|
||||
@@ -805,7 +805,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
;
|
||||
;
|
||||
;
|
||||
M.eV;
|
||||
function eF() { }
|
||||
M.eF = eF;
|
||||
;
|
||||
@@ -822,7 +821,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
;
|
||||
;
|
||||
})(M || (M = {}));
|
||||
M_1.eV;
|
||||
function eF() { }
|
||||
M_1.eF = eF;
|
||||
;
|
||||
@@ -884,7 +882,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
;
|
||||
;
|
||||
;
|
||||
eM.eV;
|
||||
function eF() { }
|
||||
eM.eF = eF;
|
||||
;
|
||||
@@ -903,7 +900,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
})(eM = M_1.eM || (M_1.eM = {}));
|
||||
;
|
||||
})(M || (M = {}));
|
||||
exports.eV;
|
||||
function eF() { }
|
||||
exports.eF = eF;
|
||||
;
|
||||
@@ -1014,7 +1010,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
;
|
||||
;
|
||||
;
|
||||
M.eV;
|
||||
function eF() { }
|
||||
M.eF = eF;
|
||||
;
|
||||
@@ -1031,7 +1026,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
;
|
||||
;
|
||||
})(M || (M = {}));
|
||||
eM_1.eV;
|
||||
function eF() { }
|
||||
eM_1.eF = eF;
|
||||
;
|
||||
@@ -1093,7 +1087,6 @@ define(["require", "exports"], function (require, exports) {
|
||||
;
|
||||
;
|
||||
;
|
||||
eM.eV;
|
||||
function eF() { }
|
||||
eM.eF = eF;
|
||||
;
|
||||
|
||||
@@ -88,7 +88,6 @@ var d = (function () {
|
||||
return d;
|
||||
})();
|
||||
exports.d = d;
|
||||
exports.x;
|
||||
function foo() { return null; }
|
||||
exports.foo = foo;
|
||||
//// [importDecl_require1.js]
|
||||
@@ -108,7 +107,6 @@ var d = (function () {
|
||||
return d;
|
||||
})();
|
||||
exports.d = d;
|
||||
exports.x;
|
||||
function foo() { return null; }
|
||||
exports.foo = foo;
|
||||
//// [importDecl_require3.js]
|
||||
@@ -118,7 +116,6 @@ var d = (function () {
|
||||
return d;
|
||||
})();
|
||||
exports.d = d;
|
||||
exports.x;
|
||||
function foo() { return null; }
|
||||
exports.foo = foo;
|
||||
//// [importDecl_require4.js]
|
||||
|
||||
@@ -19,7 +19,6 @@ var B = (function () {
|
||||
})();
|
||||
exports.B = B;
|
||||
//// [importDeclarationUsedAsTypeQuery_1.js]
|
||||
exports.x;
|
||||
|
||||
|
||||
//// [importDeclarationUsedAsTypeQuery_require.d.ts]
|
||||
|
||||
@@ -13,7 +13,6 @@ module B {
|
||||
//// [importOnAliasedIdentifiers.js]
|
||||
var A;
|
||||
(function (A) {
|
||||
A.X;
|
||||
})(A || (A = {}));
|
||||
var B;
|
||||
(function (B) {
|
||||
|
||||
@@ -61,7 +61,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// any type var
|
||||
|
||||
@@ -90,7 +90,6 @@ var A = (function () {
|
||||
})();
|
||||
var M;
|
||||
(function (M) {
|
||||
M.n;
|
||||
})(M || (M = {}));
|
||||
var objA = new A();
|
||||
// any type var
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user