Skip to content

Commit 24a8cce

Browse files
authored
Merge pull request #420 from ethereum/small-test-improvements
Small test improvements
2 parents b90ff0b + bcbe85a commit 24a8cce

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

translate.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,9 @@ function escapeString (text) {
155155
.replace(/\t/g, '\\t');
156156
}
157157

158+
// 'asm' can be an object or a string
158159
function formatAssemblyText (asm, prefix, source) {
159-
if (typeof asm === typeof '' || asm === null || asm === undefined) {
160+
if (typeof asm === 'string' || asm === null || asm === undefined) {
160161
return prefix + (asm || '') + '\n';
161162
}
162163
var text = prefix + '.code\n';

wrapper.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ function setupMethods (soljson) {
163163
return formatFatalError('No input sources specified.');
164164
}
165165

166-
// Bail out early
167-
if ((input['sources'].length > 1) && (compileJSONMulti === null)) {
168-
return formatFatalError('Multiple sources provided, but compiler only supports single input.');
169-
}
170-
171166
function isOptimizerEnabled (input) {
172167
return input['settings'] && input['settings']['optimizer'] && input['settings']['optimizer']['enabled'];
173168
}
@@ -223,6 +218,9 @@ function setupMethods (soljson) {
223218

224219
// Try our luck with an ancient compiler
225220
if (compileJSON !== null) {
221+
if (Object.keys(sources).length !== 1) {
222+
return formatFatalError('Multiple sources provided, but compiler only supports single input.');
223+
}
226224
return translateOutput(compileJSON(sources[Object.keys(sources)[0]], isOptimizerEnabled(input)), libraries);
227225
}
228226

0 commit comments

Comments
 (0)