Skip to content

Commit 301c402

Browse files
committed
move code to where it is used
1 parent fefc4e9 commit 301c402

File tree

1 file changed

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

1 file changed

+14
-14
lines changed

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

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,20 @@ function apply_selector(relative_selectors, rule, element) {
187187
return true;
188188
}
189189

190+
/**
191+
* Mark both the compound selector and the node it selects as encapsulated,
192+
* for transformation in a later step
193+
* @param {Compiler.Css.RelativeSelector} relative_selector
194+
* @param {Compiler.AST.RegularElement | Compiler.AST.SvelteElement} node
195+
*/
196+
function mark(relative_selector, node) {
197+
if (!is_outer_global(relative_selector)) {
198+
relative_selector.metadata.scoped = true;
199+
}
200+
201+
node.metadata.scoped = true;
202+
}
203+
190204
/**
191205
*
192206
* @param {Compiler.Css.Combinator} combinator
@@ -262,20 +276,6 @@ function apply_combinator(combinator, relative_selector, parent_selectors, rule,
262276
}
263277
}
264278

265-
/**
266-
* Mark both the compound selector and the node it selects as encapsulated,
267-
* for transformation in a later step
268-
* @param {Compiler.Css.RelativeSelector} relative_selector
269-
* @param {Compiler.AST.RegularElement | Compiler.AST.SvelteElement} node
270-
*/
271-
function mark(relative_selector, node) {
272-
if (!is_outer_global(relative_selector)) {
273-
relative_selector.metadata.scoped = true;
274-
}
275-
276-
node.metadata.scoped = true;
277-
}
278-
279279
/**
280280
* Returns `true` if the relative selector is global, meaning
281281
* it's a `:global(...)` or unscopeable selector, or

0 commit comments

Comments
 (0)