bin/asc.js
function writeText(wasmModule, format, output, callback) {
  if (format === "linear" || format === "stack") {
    if (!assemblyscript.util.wabt) {
      process.stderr.write("\nwabt.js not found\n");
      return callback(EFAILURE);
    }
    var binary = wasmModule.ascCurrentBinary || (wasmModule.ascCurrentBinary = wasmModule.emitBinary()); // reuse
    output.write(assemblyscript.util.wasmToWast(binary, { readDebugNames: true }), "utf8", end);
  } else
    output.write(wasmModule.emitText(), "utf8", end);

  function end(err) {
    if (err || output === process.stdout) return callback(err);
    output.end(callback);
  }
}
function writeText(wasmModule, format, output, callback) {
  if (format === "linear" || format === "stack") {
    if (!assemblyscript.util.wabt) {
      process.stderr.write("\nwabt.js not found\n");
      return callback(EFAILURE);
    }
    var binary = wasmModule.ascCurrentBinary || (wasmModule.ascCurrentBinary = wasmModule.emitBinary()); // reuse
    output.write(assemblyscript.util.wasmToWast(binary, { readDebugNames: true }), "utf8", end);
  } else
    output.write(wasmModule.emitText(), "utf8", end);

  function end(err) {
    if (err || output === process.stdout) return callback(err);
    output.end(callback);
  }
}
function writeText ( wasmModule , format , output , callback ) { if ( format === "linear" || format === "stack" ) { if ( ! assemblyscript . util . wabt ) { process . stderr . write ( "\nwabt.js not found\n" ) ; return callback ( EFAILURE ) ; } var binary = wasmModule . ascCurrentBinary || ( wasmModule . ascCurrentBinary = wasmModule . emitBinary ( ) ) ; // reuse output . write ( assemblyscript . util . wasmToWast ( binary , { readDebugNames : true } ) , "utf8" , end ) ; } else output . write ( wasmModule . emitText ( ) , "utf8" , end ) ; function end ( err ) { if ( err || output === process . stdout ) return callback ( err ) ; output . end ( callback ) ; } }
Writes text format of the specified module, using the specified format.
Writes text format of the specified module using the specified format .