marko/compiler/ast/HtmlComment.js
Patrick Steele-Idem c386da875e Fixes #349 - Inline Marko template compilation support
Also changed how JavaScript code is generated
2016-08-19 10:50:28 -06:00

27 lines
540 B
JavaScript

'use strict';
var Node = require('./Node');
class HtmlComment extends Node {
constructor(def) {
super('HtmlComment');
this.comment = def.comment;
}
generateHtmlCode(codegen) {
var comment = this.comment;
var builder = codegen.builder;
return [
builder.htmlLiteral('<!--'),
builder.html(comment),
builder.htmlLiteral('-->')
];
}
walk(walker) {
this.comment = walker.walk(this.comment);
}
}
module.exports = HtmlComment;