From 93ac62413272c450e58132b1798532228b3131b0 Mon Sep 17 00:00:00 2001 From: Richard Harris Date: Sat, 9 Nov 2019 12:59:50 -0500 Subject: [PATCH] reinstate block comments --- src/compiler/compile/render_dom/Block.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/compiler/compile/render_dom/Block.ts b/src/compiler/compile/render_dom/Block.ts index 56b5d08489..0b9784a6e8 100644 --- a/src/compiler/compile/render_dom/Block.ts +++ b/src/compiler/compile/render_dom/Block.ts @@ -423,17 +423,17 @@ export default class Block { const key = this.key && this.get_unique_name('key'); const args: any[] = [x`#ctx`]; - if (key) args.unshift(key); - // TODO include this.comment - // ${this.comment && `// ${escape(this.comment, { only_escape_at_symbol: true })}`} + const fn = b`function ${this.name}(${args}) { + ${this.get_contents(key)} + }`; - return b` - function ${this.name}(${args}) { - ${this.get_contents(key)} - } - `; + return this.comment + ? b` + // ${this.comment} + ${fn}` + : fn; } render_listeners(chunk: string = '') {