Skip to content

Commit 1188a55

Browse files
authored
Merge pull request #155 from ethereum/fix_ancient_compiler_wrapper
Fix standard wrapper for ancient compiler.
2 parents 5c072f3 + 246aa08 commit 1188a55

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

wrapper.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function setupMethods (soljson) {
137137
}
138138

139139
var sources = translateSources(input);
140-
if (sources === null) {
140+
if (sources === null || Object.keys(sources).length === 0) {
141141
return formatFatalError('Failed to process sources');
142142
}
143143

@@ -151,7 +151,7 @@ function setupMethods (soljson) {
151151
}
152152

153153
// Try our luck with an ancient compiler
154-
return translateOutput(compileJSON(sources[0], isOptimizerEnabled(input)));
154+
return translateOutput(compileJSON(sources[Object.keys(sources)[0]], isOptimizerEnabled(input)));
155155
};
156156

157157
var version = soljson.cwrap('version', 'string', []);

0 commit comments

Comments
 (0)