|
|
|
@ -4,7 +4,6 @@ const regex_non_whitespace_characters = /[^ \r\n\f\v\t]/;
|
|
|
|
|
|
|
|
|
|
|
|
/** @extends Node */
|
|
|
|
/** @extends Node */
|
|
|
|
export default class AbstractBlock extends Node {
|
|
|
|
export default class AbstractBlock extends Node {
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('../../render_dom/Block.js').default} */
|
|
|
|
/** @type {import('../../render_dom/Block.js').default} */
|
|
|
|
block;
|
|
|
|
block;
|
|
|
|
|
|
|
|
|
|
|
|
@ -21,15 +20,10 @@ export default class AbstractBlock extends Node {
|
|
|
|
super(component, parent, scope, info);
|
|
|
|
super(component, parent, scope, info);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
warn_if_empty_block() {
|
|
|
|
warn_if_empty_block() {
|
|
|
|
if (!this.children || this.children.length > 1)
|
|
|
|
if (!this.children || this.children.length > 1) return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
const child = this.children[0];
|
|
|
|
const child = this.children[0];
|
|
|
|
if (!child || (child.type === 'Text' && !regex_non_whitespace_characters.test(child.data))) {
|
|
|
|
if (!child || (child.type === 'Text' && !regex_non_whitespace_characters.test(child.data))) {
|
|
|
|
this.component.warn(this, compiler_warnings.empty_block);
|
|
|
|
this.component.warn(this, compiler_warnings.empty_block);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|