Skip to content

Commit fc61662

Browse files
committed
simplify
1 parent a77d0bd commit fc61662

File tree

1 file changed

+19
-30
lines changed

1 file changed

+19
-30
lines changed

packages/svelte/src/internal/client/runtime.js

Lines changed: 19 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -97,32 +97,6 @@ export function set_is_ssr(ssr) {
9797
is_ssr = ssr;
9898
}
9999

100-
/**
101-
* @param {Record<string, unknown>} props
102-
* @returns {import('./types.js').ComponentContext}
103-
*/
104-
export function create_component_context(props) {
105-
const parent = current_component_context;
106-
return {
107-
// accessors
108-
a: null,
109-
// context
110-
c: null,
111-
// effects
112-
e: null,
113-
// mounted
114-
m: false,
115-
// parent
116-
p: parent,
117-
// props
118-
s: props,
119-
// runes
120-
r: false,
121-
// update_callbacks
122-
u: null
123-
};
124-
}
125-
126100
/**
127101
* @param {null | import('./types.js').ComponentContext} context
128102
* @returns {boolean}
@@ -1749,14 +1723,29 @@ export function onDestroy(fn) {
17491723
}
17501724

17511725
/**
1752-
* @param {import('./types.js').MaybeSignal<Record<string, unknown>>} props
1726+
* @param {Record<string, unknown>} props
17531727
* @param {any} runes
17541728
* @returns {void}
17551729
*/
17561730
export function push(props, runes = false) {
1757-
const context_stack_item = create_component_context(props);
1758-
context_stack_item.r = runes;
1759-
current_component_context = context_stack_item;
1731+
current_component_context = {
1732+
// accessors
1733+
a: null,
1734+
// context
1735+
c: null,
1736+
// effects
1737+
e: null,
1738+
// mounted
1739+
m: false,
1740+
// parent
1741+
p: current_component_context,
1742+
// props
1743+
s: props,
1744+
// runes
1745+
r: runes,
1746+
// update_callbacks
1747+
u: null
1748+
};
17601749
}
17611750

17621751
/**

0 commit comments

Comments
 (0)