Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
7d06789
naive change
weswigham Sep 30, 2015
b6a57ea
Concatenated module emit fixes up all included paths
weswigham Oct 1, 2015
122753b
sourcemap correctness
weswigham Oct 2, 2015
8e409f3
new baselines for sourcemaps tests (given that modules can now get em…
weswigham Oct 2, 2015
4c4087c
Add compiler error for incompatible module formats
weswigham Oct 3, 2015
145fa0c
Accept baselines
weswigham Oct 3, 2015
03256e7
cusotm tests, forbid umd
weswigham Oct 3, 2015
3c73a66
removed umd as allowed, accepted new baselines
weswigham Oct 3, 2015
613c51d
Fix jakefile rules build
weswigham Oct 5, 2015
05dc9da
concatenated type emit
weswigham Oct 5, 2015
d8ec703
merge with master
weswigham Oct 5, 2015
d07e33d
Correct output, accept new baselines
weswigham Oct 5, 2015
6c1f3ef
m'lint
weswigham Oct 5, 2015
732ec34
update comment
weswigham Oct 5, 2015
1ae7b7c
Merge branch 'master' into out-module-concat
weswigham Oct 12, 2015
a83b858
Merge branch 'master' into out-module-concat
weswigham Oct 20, 2015
7a4e995
feedback form pr
weswigham Oct 20, 2015
79cf984
feedback form pr
weswigham Oct 20, 2015
d178945
rename variable
weswigham Oct 20, 2015
37bc277
feedback form pr
weswigham Oct 21, 2015
3f52686
cleanup a bit, think toward the future
weswigham Oct 21, 2015
2fcdb0f
bit more cleanup
weswigham Oct 21, 2015
d18facb
fix lint
weswigham Oct 21, 2015
255cde5
remove assertion
weswigham Oct 21, 2015
c165be8
change triple-slash ref emit critaera, add a new tests and accept new…
weswigham Oct 22, 2015
6c81242
Merge branch 'master' into out-module-concat
weswigham Oct 30, 2015
95a3fc7
feedback form pr, new baselines
weswigham Oct 30, 2015
70fba0b
Merge branch 'master' into out-module-concat
weswigham Oct 30, 2015
d4d6078
accept new baselines postmerge
weswigham Oct 30, 2015
f06627f
prevent absolutre paths from leaking through error baselines
weswigham Oct 30, 2015
6de5221
dont mutate
weswigham Nov 2, 2015
265fb51
feedback from CR
weswigham Nov 3, 2015
6f97021
Merge branch 'master' into out-module-concat
weswigham Nov 3, 2015
1baea88
shorten function
weswigham Nov 3, 2015
cadf543
Merge branch 'master' into out-module-concat
weswigham Nov 9, 2015
977c3ee
fix lints
weswigham Nov 9, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
change triple-slash ref emit critaera, add a new tests and accept new…
… baselines
  • Loading branch information
weswigham committed Oct 22, 2015
commit c165be8b3a28bee144a35eb880fe0ba5dd49178d
10 changes: 6 additions & 4 deletions src/compiler/declarationEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,25 @@ namespace ts {
let emittedReferencedFiles: SourceFile[] = [];
let prevModuleElementDeclarationEmitInfo: ModuleElementDeclarationEmitInfo[] = [];
forEach(host.getSourceFiles(), sourceFile => {
if (!isExternalModuleOrDeclarationFile(sourceFile)) {
noDeclare = false;
if (!isDeclarationFile(sourceFile)) {
// Check what references need to be added
if (!compilerOptions.noResolve) {
forEach(sourceFile.referencedFiles, fileReference => {
let referencedFile = tryResolveScriptReference(host, sourceFile, fileReference);

// If the reference file is a declaration file or an external module, emit that reference
if (referencedFile && (isExternalModuleOrDeclarationFile(referencedFile) &&
// If the reference file is a declaration file, emit that reference
if (referencedFile && (isDeclarationFile(referencedFile) &&
!contains(emittedReferencedFiles, referencedFile))) { // If the file reference was not already emitted

writeReferencePath(referencedFile);
emittedReferencedFiles.push(referencedFile);
}
});
}
}

if (!isExternalModuleOrDeclarationFile(sourceFile)) {
noDeclare = false;
emitSourceFile(sourceFile);
}
else if (isExternalModule(sourceFile)) {
Expand Down
116 changes: 116 additions & 0 deletions tests/baselines/reference/outModuleTripleSlashRefs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
//// [tests/cases/compiler/outModuleTripleSlashRefs.ts] ////

//// [a.ts]

/// <reference path="./b.ts" />
export class A {
member: typeof GlobalFoo;
}

//// [b.ts]
/// <reference path="./c.d.ts" />
class Foo {
member: Bar;
}
declare var GlobalFoo: Foo;

//// [c.d.ts]
/// <reference path="./d.d.ts" />
declare class Bar {
member: Baz;
}

//// [d.d.ts]
declare class Baz {
member: number;
}

//// [b.ts]
import {A} from "./ref/a";
export class B extends A { }


//// [a.js]
define(["require", "exports"], function (require, exports) {
/// <reference path="./b.ts" />
var A = (function () {
function A() {
}
return A;
})();
exports.A = A;
});
//# sourceMappingURL=a.js.map//// [b.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
define(["require", "exports", "./ref/a"], function (require, exports, a_1) {
var B = (function (_super) {
__extends(B, _super);
function B() {
_super.apply(this, arguments);
}
return B;
})(a_1.A);
exports.B = B;
});
//# sourceMappingURL=b.js.map//// [all.js]
var __extends = (this && this.__extends) || function (d, b) {
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
/// <reference path="./c.d.ts" />
var Foo = (function () {
function Foo() {
}
return Foo;
})();
define("tests/cases/compiler/ref/a", ["require", "exports"], function (require, exports) {
/// <reference path="./b.ts" />
var A = (function () {
function A() {
}
return A;
})();
exports.A = A;
});
define("tests/cases/compiler/b", ["require", "exports", "tests/cases/compiler/ref/a"], function (require, exports, a_1) {
var B = (function (_super) {
__extends(B, _super);
function B() {
_super.apply(this, arguments);
}
return B;
})(a_1.A);
exports.B = B;
});
//# sourceMappingURL=all.js.map

//// [a.d.ts]
/// <reference path="../../../../all.d.ts" />
export declare class A {
member: typeof GlobalFoo;
}
//// [b.d.ts]
import { A } from "./ref/a";
export declare class B extends A {
}
//// [all.d.ts]
/// <reference path="tests/cases/compiler/ref/c.d.ts" />
declare class Foo {
member: Bar;
}
declare var GlobalFoo: Foo;
declare module "tests/cases/compiler/ref/a" {
export class A {
member: typeof GlobalFoo;
}
}
declare module "tests/cases/compiler/b" {
import { A } from "tests/cases/compiler/ref/a";
export class B extends A {
}
}
4 changes: 4 additions & 0 deletions tests/baselines/reference/outModuleTripleSlashRefs.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading