code: function emitTrailingCommentsOfPosition(pos) {
                  if (compilerOptions.removeComments) {
                      return;
                  }
                  var trailingComments = ts.getTrailingCommentRanges(currentText, pos);
                  // trailing comments are emitted at space/*trailing comment1 */space/*trailing comment*/
                  ts.emitComments(currentText, currentLineMap, writer, trailingComments, /*trailingSeparator*/ true, newLine, writeComment);
              }
docs: Emit trailing comments at the position. The term trailing comment is used here to describe following comment:
  x, /comment1/ y
  ^ => pos; the function will emit "comment1" in the emitJS