Last change
on this file since 1ad8e64 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
490 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | 'use strict';
|
---|
| 2 |
|
---|
| 3 | const Container = require('./container');
|
---|
| 4 | const Node = require('./node');
|
---|
| 5 |
|
---|
| 6 | class Comment extends Node {
|
---|
| 7 | constructor (opts) {
|
---|
| 8 | super(opts);
|
---|
| 9 | this.type = 'comment';
|
---|
| 10 | this.inline = Object(opts).inline || false;
|
---|
| 11 | }
|
---|
| 12 |
|
---|
| 13 | toString () {
|
---|
| 14 | return [
|
---|
| 15 | this.raws.before,
|
---|
| 16 | this.inline ? '//' : '/*',
|
---|
| 17 | String(this.value),
|
---|
| 18 | this.inline ? '' : '*/',
|
---|
| 19 | this.raws.after
|
---|
| 20 | ].join('');
|
---|
| 21 | }
|
---|
| 22 | };
|
---|
| 23 |
|
---|
| 24 | Container.registerWalker(Comment);
|
---|
| 25 |
|
---|
| 26 | module.exports = Comment;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.