File tree Expand file tree Collapse file tree 2 files changed +9
-13
lines changed
packages/svelte/src/internal/client Expand file tree Collapse file tree 2 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -83,13 +83,11 @@ export function mark_module_end() {
83
83
let new_owner = null ;
84
84
85
85
/**
86
- * @param {import('../types.js').Signal } signal
86
+ * @param {import('../types.js').SignalDebug } signal
87
87
*/
88
88
export function set_owners ( signal ) {
89
- // @ts -expect-error
90
89
if ( current_owners && signal . owners ) {
91
90
for ( const owner of current_owners ) {
92
- // @ts -expect-error
93
91
signal . owners . add ( owner ) ;
94
92
}
95
93
}
@@ -109,31 +107,27 @@ export function add_owner(object, owner) {
109
107
}
110
108
111
109
/**
112
- * @param {import('../types.js').Signal } signal
110
+ * @param {import('../types.js').SignalDebug } signal
113
111
*/
114
112
export function add_owner_to_signal ( signal ) {
115
113
if (
116
114
new_owner &&
117
115
// @ts -expect-error
118
116
signal . owners ?. has ( current_component_context . function )
119
117
) {
120
- // @ts -expect-error
121
118
signal . owners . add ( new_owner ) ;
122
119
}
123
120
}
124
121
125
122
/**
126
- * @param {import('../types.js').Signal } signal
123
+ * @param {import('../types.js').SignalDebug } signal
127
124
*/
128
125
export function check_ownership ( signal ) {
129
- // @ts -expect-error
130
126
if ( ! signal . owners ) return ;
131
127
132
128
const component = get_component ( ) ;
133
129
134
- // @ts -expect-error
135
130
if ( component && signal . owners . size > 0 && ! signal . owners . has ( component ) ) {
136
- // @ts -expect-error
137
131
let owner = [ ...signal . owners ] [ 0 ] ;
138
132
139
133
let message =
Original file line number Diff line number Diff line change @@ -951,11 +951,13 @@ export function unsubscribe_on_destroy(stores) {
951
951
*/
952
952
export function get ( signal ) {
953
953
if ( DEV ) {
954
- add_owner_to_signal ( signal ) ;
954
+ const debuggable = /** @type {import('./types.js').SignalDebug } */ ( signal ) ;
955
+
956
+ add_owner_to_signal ( debuggable ) ;
955
957
956
958
// @ts -expect-error
957
959
if ( signal . inspect && inspect_fn ) {
958
- /** @type { import('./types.js').SignalDebug } */ ( signal ) . inspect . add ( inspect_fn ) ;
960
+ debuggable . inspect . add ( inspect_fn ) ;
959
961
// @ts -expect-error
960
962
inspect_captured_signals . push ( signal ) ;
961
963
}
@@ -1025,7 +1027,7 @@ export function get(signal) {
1025
1027
*/
1026
1028
export function set ( signal , value ) {
1027
1029
if ( DEV ) {
1028
- check_ownership ( signal ) ;
1030
+ check_ownership ( /** @type { import('./types.js').SignalDebug } */ ( signal ) ) ;
1029
1031
}
1030
1032
1031
1033
set_signal_value ( signal , value ) ;
@@ -1344,7 +1346,7 @@ export function source(initial_value) {
1344
1346
*/
1345
1347
function bind_signal_to_component_context ( signal ) {
1346
1348
if ( DEV ) {
1347
- set_owners ( signal ) ;
1349
+ set_owners ( /** @type { import('./types.js').SignalDebug } */ ( signal ) ) ;
1348
1350
}
1349
1351
1350
1352
if ( current_component_context === null || ! current_component_context . r ) return ;
You can’t perform that action at this time.
0 commit comments