Fix unsafe parameter coercions related to PragmaPseudoMap

This commit is contained in:
Anders Hejlsberg 2019-04-06 06:29:59 -10:00
parent 9832a83711
commit e1fd5e5225

View File

@ -7784,7 +7784,7 @@ namespace ts {
const referencedFiles = context.referencedFiles;
const typeReferenceDirectives = context.typeReferenceDirectives;
const libReferenceDirectives = context.libReferenceDirectives;
forEach(toArray(entryOrList), (arg: PragmaPseudoMap["reference"]) => {
forEach(toArray(entryOrList) as PragmaPseudoMap["reference"][], arg => {
const { types, lib, path } = arg.arguments;
if (arg.arguments["no-default-lib"]) {
context.hasNoDefaultLib = true;
@ -7806,8 +7806,8 @@ namespace ts {
}
case "amd-dependency": {
context.amdDependencies = map(
toArray(entryOrList),
(x: PragmaPseudoMap["amd-dependency"]) => ({ name: x.arguments.name, path: x.arguments.path }));
toArray(entryOrList) as PragmaPseudoMap["amd-dependency"][],
x => ({ name: x.arguments.name, path: x.arguments.path }));
break;
}
case "amd-module": {