Upgrade to TypeScript 2.2.2
This commit is contained in:
parent
c51fbd57c3
commit
4989e70425
4 changed files with 10 additions and 13 deletions
|
@ -97,13 +97,13 @@ export class PackageLoader {
|
|||
// Ensure the project has the correct fields, coerce it, and return a metadata object.
|
||||
if (blob.name && typeof blob.name === "string") {
|
||||
pkg = <pack.Package>blob;
|
||||
|
||||
// Memoize the result so we don't need to continuously search for the same packages.
|
||||
this.cache.set(blobPath!, pkg);
|
||||
}
|
||||
else {
|
||||
diagnostics.push(dctx.newMissingCocopackNameError(blobPath!));
|
||||
}
|
||||
|
||||
// Memoize the result so we don't need to continuously search for the same packages.
|
||||
this.cache.set(blobPath!, pkg);
|
||||
}
|
||||
else {
|
||||
// The file was missing; issue an error, and make sure to include the set of extensions we tried.
|
||||
|
|
|
@ -645,17 +645,14 @@ export class Transformer {
|
|||
// Resolve the module name to a real symbol.
|
||||
// TODO(joe): ensure that this dependency exists, to avoid "accidentally" satisfyied name resolution in the
|
||||
// TypeScript compiler; for example, if the package just happens to exist in `node_modules`, etc.
|
||||
let candidates: ts.Map<ts.ResolvedModuleFull> = this.getResolvedModules();
|
||||
let resolvedModule: ts.ResolvedModuleFull | undefined;
|
||||
for (let candidateName of Object.keys(candidates)) {
|
||||
let candidate: ts.ResolvedModuleFull = candidates[candidateName];
|
||||
this.getResolvedModules().forEach((candidate: ts.ResolvedModuleFull, candidateName: string) => {
|
||||
if ((name && candidateName === name) ||
|
||||
(path && (candidate.resolvedFileName === path || candidate.resolvedFileName === path+".ts"))) {
|
||||
resolvedModule = candidate;
|
||||
break;
|
||||
}
|
||||
}
|
||||
contract.assert(!!resolvedModule, `Expected '${name}|${path}' to resolve to a module`);
|
||||
});
|
||||
contract.assert(!!resolvedModule, `Expected mod='${name}' path='${path}' to resolve to a module`);
|
||||
return this.getResolvedModuleSymbol(resolvedModule!);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
"minimist": "^1.2.0",
|
||||
"nodejs-ts": "^0.5.5",
|
||||
"source-map-support": "^0.4.8",
|
||||
"typescript": "^2.1.4"
|
||||
"typescript": "^2.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^2.2.36",
|
||||
|
|
|
@ -879,9 +879,9 @@ type-check@~0.3.2:
|
|||
dependencies:
|
||||
prelude-ls "~1.1.2"
|
||||
|
||||
typescript@^2.1.4:
|
||||
version "2.1.5"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.1.5.tgz#6fe9479e00e01855247cea216e7561bafcdbcd4a"
|
||||
typescript@^2.2.2:
|
||||
version "2.2.2"
|
||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.2.2.tgz#606022508479b55ffa368b58fee963a03dfd7b0c"
|
||||
|
||||
uglify-js@^2.6:
|
||||
version "2.7.5"
|
||||
|
|
Loading…
Reference in a new issue