Lint and format src/compiler/compile/nodes/shared/AbstractBlock.js

pull/8569/head
Simon Holthausen 3 years ago
parent becf3cef2e
commit c6fd759ddf

@ -4,32 +4,26 @@ 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;
/** @type {import('../interfaces.js').INode[]} */
/** @type {import('../interfaces.js').INode[]} */ children;
children;
/**
/** * @param {import('../../Component.js').default} component
* @param {import('../../Component.js').default} component * @param {any} parent
* @param {any} parent * @param {any} scope
* @param {any} scope * @param {any} info
* @param {any} info */
*/ constructor(component, parent, scope, info) {
constructor(component, parent, scope, info) { 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) return;
if (!this.children || this.children.length > 1) const child = this.children[0];
return; if (!child || (child.type === 'Text' && !regex_non_whitespace_characters.test(child.data))) {
const child = this.children[0]; this.component.warn(this, compiler_warnings.empty_block);
if (!child || (child.type === 'Text' && !regex_non_whitespace_characters.test(child.data))) { }
this.component.warn(this, compiler_warnings.empty_block); }
}
}
} }

Loading…
Cancel
Save