|
|
|
@ -3,42 +3,39 @@ import Expression from './Expression.js';
|
|
|
|
|
|
|
|
|
|
|
|
/** @extends Node */
|
|
|
|
/** @extends Node */
|
|
|
|
export default class Tag extends Node {
|
|
|
|
export default class Tag extends Node {
|
|
|
|
|
|
|
|
/** @type {'MustacheTag' | 'RawMustacheTag'} */
|
|
|
|
/** @type {'MustacheTag' | 'RawMustacheTag'} */
|
|
|
|
type;
|
|
|
|
type;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {import('./Expression.js').default} */
|
|
|
|
/** @type {import('./Expression.js').default} */
|
|
|
|
expression;
|
|
|
|
expression;
|
|
|
|
|
|
|
|
|
|
|
|
/** @type {boolean} */
|
|
|
|
/** @type {boolean} */
|
|
|
|
should_cache;
|
|
|
|
should_cache;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param {any} component *
|
|
|
|
* @param {any} component *
|
|
|
|
* @param {any} parent *
|
|
|
|
* @param {any} parent *
|
|
|
|
* @param {any} scope *
|
|
|
|
* @param {any} scope *
|
|
|
|
* @param {any} info undefined
|
|
|
|
* @param {any} info undefined
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
constructor(component, parent, scope, info) {
|
|
|
|
constructor(component, parent, scope, info) {
|
|
|
|
super(component, parent, scope, info);
|
|
|
|
super(component, parent, scope, info);
|
|
|
|
component.tags.push(this);
|
|
|
|
component.tags.push(this);
|
|
|
|
this.cannot_use_innerhtml();
|
|
|
|
this.cannot_use_innerhtml();
|
|
|
|
this.expression = new Expression(component, this, scope, info.expression);
|
|
|
|
this.expression = new Expression(component, this, scope, info.expression);
|
|
|
|
this.should_cache =
|
|
|
|
this.should_cache =
|
|
|
|
info.expression.type !== 'Identifier' ||
|
|
|
|
info.expression.type !== 'Identifier' ||
|
|
|
|
(this.expression.dependencies.size && scope.names.has(info.expression.name));
|
|
|
|
(this.expression.dependencies.size && scope.names.has(info.expression.name));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
is_dependencies_static() {
|
|
|
|
is_dependencies_static() {
|
|
|
|
return (
|
|
|
|
return (this.expression.dynamic_contextual_dependencies().length === 0 &&
|
|
|
|
this.expression.dynamic_contextual_dependencies().length === 0 &&
|
|
|
|
this.expression.dynamic_dependencies().length === 0);
|
|
|
|
this.expression.dynamic_dependencies().length === 0
|
|
|
|
}
|
|
|
|
);
|
|
|
|
check_if_content_dynamic() {
|
|
|
|
}
|
|
|
|
if (!this.is_dependencies_static()) {
|
|
|
|
check_if_content_dynamic() {
|
|
|
|
this.not_static_content();
|
|
|
|
if (!this.is_dependencies_static()) {
|
|
|
|
}
|
|
|
|
this.not_static_content();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|