MCPcopy
hub / github.com/sveltejs/svelte / SvelteElement

Function SvelteElement

packages/svelte/src/compiler/migrate/index.js:1115–1139  ·  view source on GitHub ↗
(node, { state, path, next })

Source from the content-addressed store, hash-verified

1113 next();
1114 },
1115 SvelteElement(node, { state, path, next }) {
1116 migrate_slot_usage(node, path, state);
1117 if (node.tag.type === 'Literal') {
1118 let is_static = true;
1119
1120 let a = /** @type {number} */ (node.tag.start);
1121 let b = /** @type {number} */ (node.tag.end);
1122 let quote_mark = state.str.original[a - 1];
1123
1124 while (state.str.original[--a] !== '=') {
1125 if (state.str.original[a] === '{') {
1126 is_static = false;
1127 break;
1128 }
1129 }
1130
1131 if (is_static && state.str.original[b] === quote_mark) {
1132 state.str.prependLeft(a + 1, '{');
1133 state.str.appendRight(/** @type {number} */ (node.tag.end) + 1, '}');
1134 }
1135 }
1136
1137 handle_events(node, state);
1138 next();
1139 },
1140 Component(node, { state, path, next }) {
1141 next();
1142 migrate_slot_usage(node, path, state);

Callers

nothing calls this directly

Calls 3

migrate_slot_usageFunction · 0.85
handle_eventsFunction · 0.85
nextFunction · 0.50

Tested by

no test coverage detected