Skip to content

Commit fb1daa5

Browse files
committed
Simplify translateAsmJson's test
1 parent b90ff0b commit fb1daa5

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

test/compiler.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,3 +654,11 @@ for (var version in versions) {
654654
const newSolc = require('../wrapper.js')(require(`/tmp/${version}.js`));
655655
runTests(newSolc, version);
656656
}
657+
658+
659+
// add tests:
660+
// - multiple sources with very old version (error)
661+
// - compiler warnings/errors
662+
// - no bytecode output (gas estimation) from compiler
663+
664+

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';

0 commit comments

Comments
 (0)