Fix asc not printing text format to console by default

This commit is contained in:
dcodeIO 2018-03-21 23:34:40 +01:00
parent 00e6d613a9
commit 8cfc479cc0
3 changed files with 8 additions and 3 deletions

View File

@ -482,6 +482,7 @@ exports.main = function main(argv, options, callback) {
// Prepare output
if (!args.noEmit) {
let hasStdout = false;
let hasOutput = false;
if (args.outFile != null) {
if (/\.was?t$/.test(args.outFile) && args.textFile == null) {
@ -513,6 +514,7 @@ exports.main = function main(argv, options, callback) {
writeStdout(wasm.output);
hasStdout = true;
}
hasOutput = true;
// Post-process source map
if (wasm.sourceMap != null) {
@ -566,6 +568,7 @@ exports.main = function main(argv, options, callback) {
writeStdout(asm);
hasStdout = true;
}
hasOutput = true;
}
// Write WebIDL
@ -585,6 +588,7 @@ exports.main = function main(argv, options, callback) {
writeStdout(idl);
hasStdout = true;
}
hasOutput = true;
}
// Write TypeScript definition
@ -604,10 +608,11 @@ exports.main = function main(argv, options, callback) {
writeStdout(tsd);
hasStdout = true;
}
hasOutput = true;
}
// Write text (must be last)
if (args.textFile != null) {
if (args.textFile != null || !hasOutput) {
let wat;
if (args.textFile && args.textFile.length) {
stats.emitCount++;

2
dist/asc.js vendored

File diff suppressed because one or more lines are too long

2
dist/asc.js.map vendored

File diff suppressed because one or more lines are too long