File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/svelte/src/internal/client/dev Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 1
1
import { block , branch , destroy_effect } from '../reactivity/effects.js' ;
2
2
import { set_should_intro } from '../render.js' ;
3
3
import { get } from '../runtime.js' ;
4
+ import { check_target } from './legacy.js' ;
4
5
5
6
/**
6
7
* @template {(anchor: Comment, props: any) => any} Component
@@ -11,7 +12,7 @@ export function hmr(source) {
11
12
* @param {Comment } anchor
12
13
* @param {any } props
13
14
*/
14
- return ( anchor , props ) => {
15
+ return function ( anchor , props ) {
15
16
let instance = { } ;
16
17
17
18
/** @type {import("#client").Effect } */
@@ -20,6 +21,9 @@ export function hmr(source) {
20
21
block ( ( ) => {
21
22
const component = get ( source ) ;
22
23
24
+ // @ts -expect-error
25
+ check_target ( new . target && component ) ;
26
+
23
27
if ( effect ) {
24
28
// @ts -ignore
25
29
for ( var k in instance ) delete instance [ k ] ;
You can’t perform that action at this time.
0 commit comments