Skip to content

Commit cac1873

Browse files
committed
Removing bug numbers from the testcases which are fixed and adding declaration generation in few testcases
1 parent 4801c34 commit cac1873

File tree

64 files changed

+3389
-920
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3389
-920
lines changed

tests/baselines/reference/aliasInaccessibleModule.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,21 @@ module M {
99
var M;
1010
(function (M) {
1111
})(M || (M = {}));
12+
13+
14+
//// [aliasInaccessibleModule.d.ts]
15+
declare module M {
16+
export import X = N;
17+
}
18+
19+
20+
//// [DtsFileErrors]
21+
22+
23+
==== tests/cases/compiler/aliasInaccessibleModule.d.ts (1 errors) ====
24+
declare module M {
25+
export import X = N;
26+
~~~~~~~~~~~~~~~~~~~~
27+
!!! Cannot find name 'N'.
28+
}
29+

tests/baselines/reference/aliasInaccessibleModule2.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,21 @@ var M;
2323
var R = N;
2424
M.X = R;
2525
})(M || (M = {}));
26+
27+
28+
//// [aliasInaccessibleModule2.d.ts]
29+
declare module M {
30+
export import X = R;
31+
}
32+
33+
34+
//// [DtsFileErrors]
35+
36+
37+
==== tests/cases/compiler/aliasInaccessibleModule2.d.ts (1 errors) ====
38+
declare module M {
39+
export import X = R;
40+
~~~~~~~~~~~~~~~~~~~~
41+
!!! Cannot find name 'R'.
42+
}
43+

tests/baselines/reference/aliasUsageInAccessorsOfClass.errors.txt

Lines changed: 0 additions & 30 deletions
This file was deleted.
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
//// [tests/cases/compiler/aliasUsageInAccessorsOfClass.ts] ////
2+
3+
//// [aliasUsage1_backbone.ts]
4+
export class Model {
5+
public someData: string;
6+
}
7+
8+
//// [aliasUsage1_moduleA.ts]
9+
import Backbone = require("aliasUsage1_backbone");
10+
export class VisualizationModel extends Backbone.Model {
11+
// interesting stuff here
12+
}
13+
14+
//// [aliasUsage1_main.ts]
15+
import Backbone = require("aliasUsage1_backbone");
16+
import moduleA = require("aliasUsage1_moduleA");
17+
interface IHasVisualizationModel {
18+
VisualizationModel: typeof Backbone.Model;
19+
}
20+
class C2 {
21+
x: IHasVisualizationModel;
22+
get A() {
23+
return this.x;
24+
}
25+
set A(x) {
26+
x = moduleA;
27+
}
28+
}
29+
30+
//// [aliasUsage1_backbone.js]
31+
var Model = (function () {
32+
function Model() {
33+
}
34+
return Model;
35+
})();
36+
exports.Model = Model;
37+
//// [aliasUsage1_moduleA.js]
38+
var __extends = this.__extends || function (d, b) {
39+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
40+
function __() { this.constructor = d; }
41+
__.prototype = b.prototype;
42+
d.prototype = new __();
43+
};
44+
var Backbone = require("aliasUsage1_backbone");
45+
var VisualizationModel = (function (_super) {
46+
__extends(VisualizationModel, _super);
47+
function VisualizationModel() {
48+
_super.apply(this, arguments);
49+
}
50+
return VisualizationModel;
51+
})(Backbone.Model);
52+
exports.VisualizationModel = VisualizationModel;
53+
//// [aliasUsage1_main.js]
54+
var moduleA = require("aliasUsage1_moduleA");
55+
var C2 = (function () {
56+
function C2() {
57+
}
58+
Object.defineProperty(C2.prototype, "A", {
59+
get: function () {
60+
return this.x;
61+
},
62+
set: function (x) {
63+
x = moduleA;
64+
},
65+
enumerable: true,
66+
configurable: true
67+
});
68+
return C2;
69+
})();

tests/baselines/reference/cyclicModuleImport.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,24 @@ declare module "MainModule" {
2020

2121

2222
//// [cyclicModuleImport.js]
23+
24+
25+
//// [cyclicModuleImport.d.ts]
26+
declare module "SubModule" {
27+
import MainModule = require('MainModule');
28+
class SubModule {
29+
static StaticVar: number;
30+
InstanceVar: number;
31+
main: MainModule;
32+
constructor();
33+
}
34+
export = SubModule;
35+
}
36+
declare module "MainModule" {
37+
import SubModule = require('SubModule');
38+
class MainModule {
39+
SubModule: SubModule;
40+
constructor();
41+
}
42+
export = MainModule;
43+
}

tests/baselines/reference/declarationEmit_nameConflictsWithAlias.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//// [declarationEmit_nameConflictsWithAlias.ts]
2-
// Bug 887180
32
export module C { export interface I { } }
43
export import v = C;
54
export module M {

tests/baselines/reference/importDecl.errors.txt

Lines changed: 0 additions & 83 deletions
This file was deleted.

tests/baselines/reference/importDecl.js

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export module m1 {
5555

5656
//Emit global only usage
5757
import glo_m4 = require("importDecl_require1");
58-
export var useGlo_m4_x4 = glo_m4.x;
5958
export var useGlo_m4_d4 = glo_m4.d;
6059
export var useGlo_m4_f4 = glo_m4.foo();
6160

@@ -150,7 +149,6 @@ exports.f4 = m4.foo();
150149
})(exports.m1 || (exports.m1 = {}));
151150
var m1 = exports.m1;
152151
var glo_m4 = require("importDecl_require1");
153-
exports.useGlo_m4_x4 = glo_m4.x;
154152
exports.useGlo_m4_d4 = glo_m4.d;
155153
exports.useGlo_m4_f4 = glo_m4.foo();
156154
var fncOnly_m4 = require("importDecl_require2");
@@ -168,3 +166,57 @@ var multiImport_m4 = require("importDecl_require");
168166
exports.useMultiImport_m4_x4 = multiImport_m4.x;
169167
exports.useMultiImport_m4_d4 = multiImport_m4.d;
170168
exports.useMultiImport_m4_f4 = multiImport_m4.foo();
169+
170+
171+
//// [importDecl_require.d.ts]
172+
export declare class d {
173+
foo: string;
174+
}
175+
export declare var x: d;
176+
export declare function foo(): d;
177+
//// [importDecl_require1.d.ts]
178+
export declare class d {
179+
bar: string;
180+
}
181+
export declare function foo(): d;
182+
//// [importDecl_require2.d.ts]
183+
export declare class d {
184+
baz: string;
185+
}
186+
export declare var x: d;
187+
export declare function foo(): d;
188+
//// [importDecl_require3.d.ts]
189+
export declare class d {
190+
bing: string;
191+
}
192+
export declare var x: d;
193+
export declare function foo(): d;
194+
//// [importDecl_require4.d.ts]
195+
import m4 = require("importDecl_require");
196+
export declare function foo2(): m4.d;
197+
//// [importDecl_1.d.ts]
198+
/// <reference path='importDecl_require.d.ts' />
199+
/// <reference path='importDecl_require1.d.ts' />
200+
/// <reference path='importDecl_require2.d.ts' />
201+
/// <reference path='importDecl_require3.d.ts' />
202+
/// <reference path='importDecl_require4.d.ts' />
203+
import m4 = require("importDecl_require");
204+
export declare var x4: m4.d;
205+
export declare var d4: typeof m4.d;
206+
export declare var f4: m4.d;
207+
export declare module m1 {
208+
var x2: m4.d;
209+
var d2: typeof m4.d;
210+
var f2: m4.d;
211+
}
212+
import glo_m4 = require("importDecl_require1");
213+
export declare var useGlo_m4_d4: typeof glo_m4.d;
214+
export declare var useGlo_m4_f4: glo_m4.d;
215+
import fncOnly_m4 = require("importDecl_require2");
216+
export declare var useFncOnly_m4_f4: fncOnly_m4.d;
217+
export declare module usePrivate_m4_m1 {
218+
}
219+
export declare var d: m4.d;
220+
export declare var useMultiImport_m4_x4: m4.d;
221+
export declare var useMultiImport_m4_d4: typeof m4.d;
222+
export declare var useMultiImport_m4_f4: m4.d;

tests/baselines/reference/internalAliasWithDottedNameEmit.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,11 @@ var a;
1818
})(a.b || (a.b = {}));
1919
var b = a.b;
2020
})(a || (a = {}));
21+
22+
23+
//// [internalAliasWithDottedNameEmit.d.ts]
24+
declare module a.b.c {
25+
var d: any;
26+
}
27+
declare module a.e.f {
28+
}

tests/baselines/reference/multiImportExport.errors.txt

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)