add named references for returned objects

This commit is contained in:
F. Eugene Aumson
2018-08-30 09:54:10 -04:00
parent 29f2ae605e
commit 6273339f7c

View File

@@ -170,17 +170,20 @@ export class Compiler {
* that version.
*/
public async getCompilerOutputsAsync(): Promise<StandardOutput[]> {
return this._compileContractsAsync(this._getContractNamesToCompile(), false);
const promisedOutputs = this._compileContractsAsync(this._getContractNamesToCompile(), false);
return promisedOutputs;
}
private _getContractNamesToCompile(): string[] {
let contractNamesToCompile;
if (this._specifiedContracts === ALL_CONTRACTS_IDENTIFIER) {
const allContracts = this._nameResolver.getAll();
return _.map(allContracts, contractSource =>
contractNamesToCompile = _.map(allContracts, contractSource =>
path.basename(contractSource.path, constants.SOLIDITY_FILE_EXTENSION),
);
} else {
return this._specifiedContracts;
contractNamesToCompile = this._specifiedContracts;
}
return contractNamesToCompile;
}
/**
* Compiles contracts, and, if `shouldPersist` is true, saves artifacts to artifactsDir.