diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-02-07 19:30:54 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-02-07 19:30:54 +0800 |
commit | c20285dd3655a9685b52205229e675c797cd4418 (patch) | |
tree | 2577945be926336f7a39a05d7c35e57a8a0251f7 /packages/sol-compiler/src/compiler.ts | |
parent | 7e19c944b91f573bb026ca3a916cd4e4b9169a9e (diff) | |
download | dexon-0x-contracts-c20285dd3655a9685b52205229e675c797cd4418.tar dexon-0x-contracts-c20285dd3655a9685b52205229e675c797cd4418.tar.gz dexon-0x-contracts-c20285dd3655a9685b52205229e675c797cd4418.tar.bz2 dexon-0x-contracts-c20285dd3655a9685b52205229e675c797cd4418.tar.lz dexon-0x-contracts-c20285dd3655a9685b52205229e675c797cd4418.tar.xz dexon-0x-contracts-c20285dd3655a9685b52205229e675c797cd4418.tar.zst dexon-0x-contracts-c20285dd3655a9685b52205229e675c797cd4418.zip |
Fix the undefined opts bug
Diffstat (limited to 'packages/sol-compiler/src/compiler.ts')
-rw-r--r-- | packages/sol-compiler/src/compiler.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/sol-compiler/src/compiler.ts b/packages/sol-compiler/src/compiler.ts index c5dea1155..686ba4f82 100644 --- a/packages/sol-compiler/src/compiler.ts +++ b/packages/sol-compiler/src/compiler.ts @@ -96,12 +96,12 @@ export class Compiler { * @return An instance of the Compiler class. */ constructor(opts?: CompilerOptions) { - assert.doesConformToSchema('opts', opts, compilerOptionsSchema); + const passedOpts = opts || {}; + assert.doesConformToSchema('opts', passedOpts, compilerOptionsSchema); // TODO: Look for config file in parent directories if not found in current directory const config: CompilerOptions = fs.existsSync(CONFIG_FILE) ? JSON.parse(fs.readFileSync(CONFIG_FILE).toString()) : {}; - const passedOpts = opts || {}; assert.doesConformToSchema('compiler.json', config, compilerOptionsSchema); this._contractsDir = path.resolve(passedOpts.contractsDir || config.contractsDir || DEFAULT_CONTRACTS_DIR); this._solcVersionIfExists = passedOpts.solcVersion || config.solcVersion; |