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, namespace,
context.state, context.state,
context.state.preserve_whitespace, context.state.preserve_whitespace,
context.state.options.preserveComments, context.state.options.preserveComments
context.state.is_functional_template_mode
); );
if (hoisted.length === 0 && trimmed.length === 0) { if (hoisted.length === 0 && trimmed.length === 0) {

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

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

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

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

Loading…
Cancel
Save