no longer need to pass `is_functional_template_mode` to `clean_nodes`

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

@ -36,8 +36,7 @@ export function Fragment(node, context) {
namespace,
context.state,
context.state.preserve_whitespace,
context.state.options.preserveComments,
context.state.is_functional_template_mode
context.state.options.preserveComments
);
if (hoisted.length === 0 && trimmed.length === 0) {

@ -373,8 +373,7 @@ export function RegularElement(node, context) {
state.metadata.namespace,
state,
node.name === 'script' || state.preserve_whitespace,
state.options.preserveComments,
state.is_functional_template_mode
state.options.preserveComments
);
/** @type {typeof state} */

@ -19,9 +19,7 @@ export function Fragment(node, context) {
namespace,
context.state,
context.state.preserve_whitespace,
context.state.options.preserveComments,
// templating mode doesn't affect server builds
false
context.state.options.preserveComments
);
/** @type {ComponentServerTransformState} */

@ -47,9 +47,7 @@ export function RegularElement(node, context) {
scope: /** @type {Scope} */ (state.scopes.get(node.fragment))
},
state.preserve_whitespace,
state.options.preserveComments,
// templating mode doesn't affect server builds
false
state.options.preserveComments
);
for (const node of hoisted) {

@ -141,7 +141,6 @@ function sort_const_tags(nodes, state) {
* @param {TransformState & { options: ValidatedCompileOptions }} state
* @param {boolean} preserve_whitespace
* @param {boolean} preserve_comments
* @param {boolean} [is_functional_template_mode]
*/
export function clean_nodes(
parent,
@ -153,8 +152,7 @@ export function clean_nodes(
// first, we need to make `Component(Client|Server)TransformState` inherit from a new `ComponentTransformState`
// rather than from `ClientTransformState` and `ServerTransformState`
preserve_whitespace,
preserve_comments,
is_functional_template_mode
preserve_comments
) {
if (!state.analysis.runes) {
nodes = sort_const_tags(nodes, state);

Loading…
Cancel
Save