File tree 3 files changed +41
-1
lines changed
3 files changed +41
-1
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,12 @@ module ts {
219
219
// Create the emit resolver outside of the "emitTime" tracking code below. That way
220
220
// any cost associated with it (like type checking) are appropriate associated with
221
221
// the type-checking counter.
222
- let emitResolver = getDiagnosticsProducingTypeChecker ( ) . getEmitResolver ( sourceFile ) ;
222
+ //
223
+ // If the -out option is specified, we should not pass the source file to getEmitResolver.
224
+ // This is because in the -out scenario all files need to be emitted, and therefore all
225
+ // files need to be type checked. And the way to specify that all files need to be type
226
+ // checked is to not pass the file to getEmitResolver.
227
+ let emitResolver = getDiagnosticsProducingTypeChecker ( ) . getEmitResolver ( options . out ? undefined : sourceFile ) ;
223
228
224
229
let start = new Date ( ) . getTime ( ) ;
225
230
Original file line number Diff line number Diff line change
1
+ EmitSkipped: false
2
+ FileName : out.js
3
+ /// <reference path='my.d.ts' />
4
+ var foo;
5
+ (function (foo) {
6
+ var bar;
7
+ (function (bar) {
8
+ var baz1 = bar.Baz.prototype; // Should emit as bar.Baz.prototype
9
+ })(bar = foo.bar || (foo.bar = {}));
10
+ })(foo || (foo = {}));
11
+ var x;
12
+
Original file line number Diff line number Diff line change
1
+ /// <reference path="fourslash.ts" />
2
+
3
+ // @BaselineFile : getEmitOutputOut.baseline
4
+ // @out : out.js
5
+
6
+ // @Filename : my.d.ts
7
+ // @emitThisFile : false
8
+ ////declare module foo.bar {
9
+ //// class Baz { }
10
+ //// }
11
+
12
+ // @Filename : input0.ts
13
+ // @emitThisFile : false
14
+ /////// <reference path='my.d.ts' />
15
+ ////module foo.bar {
16
+ //// var baz1 = <any>Baz.prototype; // Should emit as bar.Baz.prototype
17
+ //// }
18
+
19
+ // @Filename : input1.ts
20
+ // @emitThisFile : true
21
+ ////var x;
22
+
23
+ verify . baselineGetEmitOutput ( ) ;
You can’t perform that action at this time.
0 commit comments