Skip to content

Commit 14f588f

Browse files
committed
define the set locally, limit the blast radius
1 parent 01eabf8 commit 14f588f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

packages/svelte/src/compiler/phases/scope.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export function create_scopes(ast, root, allow_reactive_declarations, parent) {
331331
}
332332

333333
/**
334-
* @type {import('zimmerframe').Visitor<import('#compiler').UseOrTransitionOrAnimate, State, import('#compiler').SvelteNode>}
334+
* @type {import('zimmerframe').Visitor<import('#compiler').AnimateDirective | import('#compiler').TransitionDirective | import('#compiler').UseDirective, State, import('#compiler').SvelteNode>}
335335
*/
336336
const SvelteDirective = (node, { state, path, visit }) => {
337337
state.scope.reference(b.id(node.name), path);

packages/svelte/src/compiler/types/template.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,15 +254,15 @@ interface UseDirective extends BaseNode {
254254
expression: null | Expression;
255255
}
256256

257-
export type UseOrTransitionOrAnimate = UseDirective | TransitionDirective | AnimateDirective;
258-
259257
export type Directive =
260-
| UseOrTransitionOrAnimate
258+
| AnimateDirective
261259
| BindDirective
262260
| ClassDirective
263261
| LetDirective
264262
| OnDirective
265-
| StyleDirective;
263+
| StyleDirective
264+
| TransitionDirective
265+
| UseDirective;
266266

267267
interface BaseElement extends BaseNode {
268268
name: string;

packages/svelte/types/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,15 +1300,15 @@ declare module 'svelte/compiler' {
13001300
expression: null | Expression;
13011301
}
13021302

1303-
type UseOrTransitionOrAnimate = UseDirective | TransitionDirective | AnimateDirective;
1304-
13051303
type Directive =
1306-
| UseOrTransitionOrAnimate
1304+
| AnimateDirective
13071305
| BindDirective
13081306
| ClassDirective
13091307
| LetDirective
13101308
| OnDirective
1311-
| StyleDirective;
1309+
| StyleDirective
1310+
| TransitionDirective
1311+
| UseDirective;
13121312

13131313
interface BaseElement extends BaseNode {
13141314
name: string;

0 commit comments

Comments
 (0)