From 9ee897af4b5d5269b939166666975dbcf9021c52 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Wed, 7 Sep 2016 11:07:44 -0700 Subject: [PATCH] Fix #10755: remove uses of `package` as an identifier name --- src/services/services.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/services/services.ts b/src/services/services.ts index eaba4779a522e..0155b2fef6f3c 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4048,8 +4048,8 @@ namespace ts { if (host.getDirectories) { // Also get all @types typings installed in visible node_modules directories - for (const package of findPackageJsons(scriptPath)) { - const typesDir = combinePaths(getDirectoryPath(package), "node_modules/@types"); + for (const packageJson of findPackageJsons(scriptPath)) { + const typesDir = combinePaths(getDirectoryPath(packageJson), "node_modules/@types"); getCompletionEntriesFromDirectories(host, options, typesDir, span, result); } } @@ -4095,8 +4095,8 @@ namespace ts { if (host.readFile && host.fileExists) { for (const packageJson of findPackageJsons(scriptPath)) { - const package = tryReadingPackageJson(packageJson); - if (!package) { + const contents = tryReadingPackageJson(packageJson); + if (!contents) { return; } @@ -4105,7 +4105,7 @@ namespace ts { // Provide completions for all non @types dependencies for (const key of nodeModulesDependencyKeys) { - addPotentialPackageNames(package[key], foundModuleNames); + addPotentialPackageNames(contents[key], foundModuleNames); } for (const moduleName of foundModuleNames) {