File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -155,8 +155,9 @@ function escapeString (text) {
155
155
. replace ( / \t / g, '\\t' ) ;
156
156
}
157
157
158
+ // 'asm' can be an object or a string
158
159
function formatAssemblyText ( asm , prefix , source ) {
159
- if ( typeof asm === typeof ' ' || asm === null || asm === undefined ) {
160
+ if ( typeof asm === 'string ' || asm === null || asm === undefined ) {
160
161
return prefix + ( asm || '' ) + '\n' ;
161
162
}
162
163
var text = prefix + '.code\n' ;
Original file line number Diff line number Diff line change @@ -163,11 +163,6 @@ function setupMethods (soljson) {
163
163
return formatFatalError ( 'No input sources specified.' ) ;
164
164
}
165
165
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
-
171
166
function isOptimizerEnabled ( input ) {
172
167
return input [ 'settings' ] && input [ 'settings' ] [ 'optimizer' ] && input [ 'settings' ] [ 'optimizer' ] [ 'enabled' ] ;
173
168
}
@@ -223,6 +218,9 @@ function setupMethods (soljson) {
223
218
224
219
// Try our luck with an ancient compiler
225
220
if ( compileJSON !== null ) {
221
+ if ( Object . keys ( sources ) . length !== 1 ) {
222
+ return formatFatalError ( 'Multiple sources provided, but compiler only supports single input.' ) ;
223
+ }
226
224
return translateOutput ( compileJSON ( sources [ Object . keys ( sources ) [ 0 ] ] , isOptimizerEnabled ( input ) ) , libraries ) ;
227
225
}
228
226
You can’t perform that action at this time.
0 commit comments