From acb3c0d0aa065edf1c71970467d038d52096e865 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Thu, 16 Aug 2018 10:36:12 -0700 Subject: declare contractData before adding to map --- packages/sol-compiler/src/compiler.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'packages/sol-compiler/src/compiler.ts') diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index eb9670b03..bd7f751df 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -165,16 +165,17 @@ export class Compiler { for (const contractName of contractNames) { const contractSource = this._resolver.resolve(contractName); - contractPathToData[contractSource.path] = { + const contractData = { contractName, currentArtifactIfExists: await getContractArtifactIfExistsAsync(this._artifactsDir, contractName), sourceTreeHashHex: `0x${this._getSourceTreeHash( path.join(this._contractsDir, contractSource.path), ).toString('hex')}`, }; - if (!this._shouldCompile(contractPathToData[contractSource.path])) { + if (!this._shouldCompile(contractData)) { continue; } + contractPathToData[contractSource.path] = contractData; const solcVersion = _.isUndefined(this._solcVersionIfExists) ? semver.maxSatisfying(_.keys(binPaths), parseSolidityVersionRange(contractSource.source)) : this._solcVersionIfExists; -- cgit v1.2.3