Skip to content

Commit 39076fe

Browse files
committed
add missing before_init
1 parent e1da295 commit 39076fe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/svelte/src/compiler/phases/3-transform/client/transform-client.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ export function client_component(source, analysis, options) {
4949
hoisted: [b.import_all('$', 'svelte/internal')],
5050
node: /** @type {any} */ (null), // populated by the root node
5151
// these should be set by create_block - if they're called outside, it's a bug
52+
get before_init() {
53+
/** @type {any[]} */
54+
const a = [];
55+
a.push = () => error(null, 'INTERNAL', 'before_init.push should not be called outside create_block');
56+
return a;
57+
},
5258
get init() {
5359
/** @type {any[]} */
5460
const a = [];

0 commit comments

Comments
 (0)