Skip to content

Commit e9ff665

Browse files
authored
chore: minor css-prune.js tweaks (#14457)
1 parent 19d80ad commit e9ff665

File tree

1 file changed

+9
-13
lines changed
  • packages/svelte/src/compiler/phases/2-analyze/css

1 file changed

+9
-13
lines changed

packages/svelte/src/compiler/phases/2-analyze/css/css-prune.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -141,16 +141,12 @@ function get_relative_selectors(node) {
141141

142142
// nesting could be inside pseudo classes like :is, :has or :where
143143
for (let selector of selectors) {
144-
walk(
145-
selector,
146-
{},
147-
{
148-
// @ts-ignore
149-
NestingSelector() {
150-
has_explicit_nesting_selector = true;
151-
}
144+
walk(selector, null, {
145+
// @ts-ignore
146+
NestingSelector() {
147+
has_explicit_nesting_selector = true;
152148
}
153-
);
149+
});
154150
// if we found one we can break from the others
155151
if (has_explicit_nesting_selector) break;
156152
}
@@ -881,17 +877,17 @@ function get_element_parent(node) {
881877
}
882878

883879
/**
884-
* @param {Compiler.AST.RegularElement | Compiler.AST.SvelteElement} element
880+
* @param {Compiler.AST.RegularElement | Compiler.AST.SvelteElement} node
885881
* @param {boolean} adjacent_only
886882
* @returns {Map<Compiler.AST.RegularElement | Compiler.AST.SvelteElement | Compiler.AST.SlotElement | Compiler.AST.RenderTag, NodeExistsValue>}
887883
*/
888-
function get_possible_element_siblings(element, adjacent_only) {
884+
function get_possible_element_siblings(node, adjacent_only) {
889885
/** @type {Map<Compiler.AST.RegularElement | Compiler.AST.SvelteElement | Compiler.AST.SlotElement | Compiler.AST.RenderTag, NodeExistsValue>} */
890886
const result = new Map();
891-
const path = element.metadata.path;
887+
const path = node.metadata.path;
892888

893889
/** @type {Compiler.SvelteNode} */
894-
let current = element;
890+
let current = node;
895891

896892
let i = path.length;
897893

0 commit comments

Comments
 (0)