line.js 383 B

12345678910111213141516171819202122
  1. 'use strict';
  2. /**
  3. * Create a new LineComment.
  4. *
  5. * @param {String} `str` string of JavaScript
  6. * @param {Object} `token` Parsed AST token
  7. */
  8. function LineComment(str, token) {
  9. this.type = token.type;
  10. this.range = token.range;
  11. this.loc = token.loc;
  12. this.raw = token.value;
  13. this.value = this.raw.trim();
  14. }
  15. /**
  16. * expose `LineComment`
  17. */
  18. module.exports = LineComment;