simplify state

pull/15538/head
Rich Harris 4 months ago
parent 68de6b4337
commit d9237e25bc

@ -168,7 +168,6 @@ export function client_component(analysis, options) {
in_constructor: false, in_constructor: false,
instance_level_snippets: [], instance_level_snippets: [],
module_level_snippets: [], module_level_snippets: [],
is_functional_template_mode: options.templatingMode === 'functional',
// these are set inside the `Fragment` visitor, and cannot be used until then // these are set inside the `Fragment` visitor, and cannot be used until then
init: /** @type {any} */ (null), init: /** @type {any} */ (null),

@ -27,7 +27,7 @@ function get_template_function(namespace, state) {
: contains_script_tag : contains_script_tag
? '$.template_with_script' ? '$.template_with_script'
: '$.template' : '$.template'
).concat(state.is_functional_template_mode ? '_fn' : ''); ).concat(state.options.templatingMode === 'functional' ? '_fn' : '');
} }
/** /**
@ -75,7 +75,7 @@ export function transform_template(state, context, namespace, template_name, fla
/** @type {Expression[]} */ /** @type {Expression[]} */
const args = [ const args = [
state.is_functional_template_mode state.options.templatingMode === 'functional'
? template_to_functions(state.template) ? template_to_functions(state.template)
: b.template([b.quasi(template_to_string(state.template), true)], []) : b.template([b.quasi(template_to_string(state.template), true)], [])
]; ];

@ -100,7 +100,6 @@ export interface ComponentClientTransformState extends ClientTransformState {
}; };
}; };
readonly preserve_whitespace: boolean; readonly preserve_whitespace: boolean;
readonly is_functional_template_mode?: boolean;
/** The anchor node for the current context */ /** The anchor node for the current context */
readonly node: Identifier; readonly node: Identifier;

Loading…
Cancel
Save