|
|
@ -2,6 +2,7 @@ import CodeBuilder from '../utils/CodeBuilder';
|
|
|
|
import deindent from '../utils/deindent';
|
|
|
|
import deindent from '../utils/deindent';
|
|
|
|
import Renderer from './Renderer';
|
|
|
|
import Renderer from './Renderer';
|
|
|
|
import Wrapper from './wrappers/shared/Wrapper';
|
|
|
|
import Wrapper from './wrappers/shared/Wrapper';
|
|
|
|
|
|
|
|
import { escape } from '../utils/stringify';
|
|
|
|
|
|
|
|
|
|
|
|
export interface BlockOptions {
|
|
|
|
export interface BlockOptions {
|
|
|
|
parent?: Block;
|
|
|
|
parent?: Block;
|
|
|
@ -408,7 +409,7 @@ export default class Block {
|
|
|
|
const local_key = this.key && this.get_unique_name('key');
|
|
|
|
const local_key = this.key && this.get_unique_name('key');
|
|
|
|
|
|
|
|
|
|
|
|
return deindent`
|
|
|
|
return deindent`
|
|
|
|
${this.comment && `// ${this.comment}`}
|
|
|
|
${this.comment && `// ${escape(this.comment, { only_escape_at_symbol: true })}`}
|
|
|
|
function ${this.name}(${this.key ? `${local_key}, ` : ''}ctx) {
|
|
|
|
function ${this.name}(${this.key ? `${local_key}, ` : ''}ctx) {
|
|
|
|
${this.get_contents(local_key)}
|
|
|
|
${this.get_contents(local_key)}
|
|
|
|
}
|
|
|
|
}
|
|
|
|