Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cli/asc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ interface CompilerOptions {
binaryFile?: string;
/** Specifies the text output file (.wat). */
textFile?: string;
/** Specifies the asm.js output file (.js). */
asmjsFile?: string;
/** Specifies the JavaScript (via wasm2js) output file (.js). */
jsFile?: string;
/** Specifies the WebIDL output file (.webidl). */
idlFile?: string;
/** Specifies the TypeScript definition output file (.d.ts). */
Expand Down
20 changes: 10 additions & 10 deletions cli/asc.js
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,8 @@ exports.main = function main(argv, options, callback) {
if (args.outFile != null) {
if (/\.was?t$/.test(args.outFile) && args.textFile == null) {
args.textFile = args.outFile;
} else if (/\.js$/.test(args.outFile) && args.asmjsFile == null) {
args.asmjsFile = args.outFile;
} else if (/\.js$/.test(args.outFile) && args.jsFile == null) {
args.jsFile = args.outFile;
} else if (args.binaryFile == null) {
args.binaryFile = args.outFile;
}
Expand Down Expand Up @@ -766,21 +766,21 @@ exports.main = function main(argv, options, callback) {
}
}

// Write asm.js
if (args.asmjsFile != null) {
let asm;
if (args.asmjsFile.length) {
// Write JS
if (args.jsFile != null) {
let js;
if (args.jsFile.length) {
stats.emitCount++;
stats.emitTime += measure(() => {
asm = module.toAsmjs();
js = module.toAsmjs();
});
writeFile(args.asmjsFile, asm, baseDir);
writeFile(args.jsFile, js, baseDir);
} else if (!hasStdout) {
stats.emitCount++;
stats.emitTime += measure(() => {
asm = module.toAsmjs();
js = module.toAsmjs();
});
writeStdout(asm);
writeStdout(js);
hasStdout = true;
}
hasOutput = true;
Expand Down
6 changes: 3 additions & 3 deletions cli/asc.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@
"type": "s",
"alias": "t"
},
"asmjsFile": {
"jsFile": {
"category": "Output",
"description": "Specifies the asm.js output file (.js).",
"description": "Specifies the JavaScript (via wasm2js) output file (.js).",
"type": "s",
"alias": "a"
"alias": "j"
},
"idlFile": {
"category": "Output",
Expand Down